ccs-digitalmarketplace-govuk-frontend
Version:
Digital Marketplace GOV.UK Frontend contains the code you need to start building a user interface for Digital Marketplace.
1 lines • 87.4 kB
JavaScript
class t{constructor(t){this.$input=t.find(".dm-list__item-input"),this.$label=t.find(".govuk-label"),this.$labelCounter=this.$label.find(".dm-list__item-label-counter"),this.$prefixText=t.find(".govuk-input__prefix")}getValue(){return this.$input.val()}clearValue(){this.$input.val(""),this.$input.attr("value","")}updateIndex(t){const e=`input-${this.$input.attr("name")}-${t}`;this.$label.attr("for",e),this.$labelCounter.text(t+1),this.$prefixText.text(`${t+1}.`),this.$input.attr("id",e)}}class e{constructor(t,e){this.answerListRow=t,this.$button=e.find(".dm-list__item-remove"),this.$removeButtonCounter=this.$button.find(".dm-list__item-remove-counter")}init(){this.toggleVisibility(!0),this.$button.on("click",(()=>{this.answerListRow.removeRow()}))}toggleVisibility(t){this.$button.toggleClass("govuk-visually-hidden",!t)}updateIndex(t){this.$removeButtonCounter.text(t+1)}}class n{constructor(n,o,i){this.$row=i,this.answerList=n,this.index=o,this.answerListRowInput=new t(i),this.answerListRowRemoveButton=new e(this,i)}init(){this.answerListRowRemoveButton.init()}updateIndex(t){this.index=t,this.answerListRowInput.updateIndex(t),this.answerListRowRemoveButton.updateIndex(t)}removeRow(){this.answerList.removeRow(this.index),this.deleteRow()}deleteRow(){this.$row.remove()}toggleRemoveButtonVisibility(t){this.answerListRowRemoveButton.toggleVisibility(t)}inputValue(){return this.answerListRowInput.getValue()}}class o{constructor(t,e){this.answerList=t,this.$button=e,this.$buttonCounter=e.find(".dm-list__item-add-counter")}init(t){this.$button.on("click",(()=>{this.answerList.addRow()})),this.updateButtonText(10-t)}updateButtonText(t){this.$buttonCounter.text(t)}toggleVisibility(t){this.$button.toggleClass("govuk-visually-hidden",!t)}}class i{constructor(t){this.$answerList=$(t),this.$answerListItems=this.$answerList.find(".dm-list__items"),this.answerListRows=this.$answerList.find(".dm-list__item").get().map(((t,e)=>new n(this,e,$(t)))),this.answerListAddButton=new o(this,this.$answerList.find(".dm-list__item-add"))}init(){const t=this.answerListRows.map((t=>t.inputValue()));let e;e=t.every((t=>!t))?2:t.indexOf(""),e>=0&&(this.answerListRows.slice(e).forEach((t=>t.deleteRow())),this.answerListRows.splice(e)),this.answerListAddButton.init(this.answerListRows.length),this.answerListRows.forEach((t=>t.init())),this.updateIfMinRows(),this.updateAnswerButton()}removeRow(t){this.answerListRows.splice(t,1),this.answerListRows.slice(t).forEach(((e,n)=>{e.updateIndex(t+n)})),this.updateIfMinRows(),this.updateAnswerButton(),this.focusOnRow(t)}addRow(){const t=this.answerListRows.length;if(t<10){const e=this.answerListRows[0].$row.clone(),o=new n(this,t,e);o.updateIndex(t),o.answerListRowInput.clearValue(),this.answerListRows.push(o),this.$answerListItems.append(e),this.answerListRows[t].init(),this.updateIfMinRows(),this.updateAnswerButton(),this.focusOnRow(t)}}updateIfMinRows(){1===this.answerListRows.length?this.answerListRows[0].toggleRemoveButtonVisibility(!1):this.answerListRows[0].toggleRemoveButtonVisibility(!0)}updateAnswerButton(){10===this.answerListRows.length?this.answerListAddButton.toggleVisibility(!1):(this.answerListAddButton.toggleVisibility(!0),this.answerListAddButton.updateButtonText(10-this.answerListRows.length))}focusOnRow(t){const e=this.answerListRows.length;let n=t;t>=e&&(n=e-1),this.answerListRows[n].answerListRowInput.$input.focus()}}class r{constructor(t){this.$totalSelected=t.find(".dm-checkbox-tree__summary-total-selected"),this.$totalSelectedText=t.find(".dm-checkbox-tree__summary-total-selected-text")}updateSelectedCount(t){this.$totalSelected.text(t),1===t?this.$totalSelectedText.text("category selected."):this.$totalSelectedText.text("categories selected.")}}class s{constructor(t,e){this.checkboxTree=t,this.$section=e,this.$accordionButton=this.$section.find("button.govuk-accordion__section-button"),this.checkboxes=this.$section.find(".govuk-checkboxes__input").get().map((t=>$(t))),this.$summary=this.$section.find(".dm-checkbox-tree__options-number-selected")}init(){this._openSectionIfSelected(),this.checkboxes.forEach((t=>{t.on("click",(()=>{this.checkboxTree.updateTotals(t.val(),t.is(":checked"))}))}))}_selectedItems(){return this.checkboxes.filter((t=>t.is(":checked")))}_countSelected(){return this._selectedItems().length}_openSectionIfSelected(){this.$accordionButton.length&&this._countSelected()>0&&"false"===this.$accordionButton.attr("aria-expanded")&&this.$accordionButton.trigger("click")}slectedItemValues(){return this._selectedItems().map((t=>t.val()))}updateSelectedCount(){if(this.$summary.length){const t=this._countSelected();t>0?this.$summary.text(`, ${t} selected`):this.$summary.text("")}}toggleCheckbox(t,e){this.checkboxes.forEach((n=>{n.val()===t&&n.prop("checked",e)}))}}class a{constructor(t){this.$checkboxTree=$(t),this.checkboxTreeSummary=new r(this.$checkboxTree.find(".dm-checkbox-tree__summary"));const e=this.$checkboxTree.find(".govuk-accordion__section").get().map((t=>new s(this,$(t))));e.length?this.checkboxTreeSections=e:this.checkboxTreeSections=[new s(this,$(".dm-checkbox-tree__options"))]}init(){this.checkboxTreeSections.forEach((t=>t.init())),this._updateCheckboxTreeSummaryCount(),this._updateCheckboxTreeSectionSelectedCounts()}_countSelected(){return new Set(this.checkboxTreeSections.map((t=>t.slectedItemValues())).flat()).size}_updateCheckboxTreeSummaryCount(){this.checkboxTreeSummary.updateSelectedCount(this._countSelected())}_updateCheckboxTreeSectionSelectedCounts(){this.checkboxTreeSections.forEach((t=>t.updateSelectedCount()))}updateTotals(t,e){this.checkboxTreeSections.forEach((n=>n.toggleCheckbox(t,e))),this._updateCheckboxTreeSummaryCount(),this._updateCheckboxTreeSectionSelectedCounts()}}class u{constructor(t,e){const n=t.find(`.govuk-grid-column-one-half:nth-of-type(${e})`);this.$input=n.find("input"),this.$label=n.find(".govuk-label"),this.$hint=n.find(".govuk-hint")}updateIndex(t){const e=this.$input.attr("name").replace(/\d+/,t),n=`input-${e}`;this.$label.attr("for",n),this.$hint.attr("id",`${n}-hint`),this.$input.attr("id",n),this.$input.attr("name",e),this.$input.attr("aria-describedby",`${n}-hint`)}makeInteractable(){this.$input.removeAttr("tabindex")}}class c{constructor(t){this.$requiredSection=t.find(".dm-compliance-communication__attachments-item-required"),this.$input=this.$requiredSection.find(".govuk-checkboxes__item > input"),this.$label=this.$requiredSection.find(".govuk-checkboxes__item > .govuk-label")}isChecked(){return this.$input.is(":checked")}updateIndex(t){const e=this.$input.attr("name").replace(/\d+/,t),n=`input-${e}`;this.$label.attr("for",n),this.$input.attr("id",n),this.$input.attr("name",e)}checkRow(){this.$requiredSection.toggleClass("govuk-visually-hidden",!0),this.$input.prop("checked",!0),this.$input.attr("tabindex",-1),this.$input.attr("tabindex",-1)}}class l{constructor(t,e){this.attachmentListRow=t,this.$button=e.find(".dm-compliance-communication__attachments-item-remove"),this.$removeButtonCounter=this.$button.find(".dm-compliance-communication__attachments-item-remove-counter")}init(){this.toggleVisibility(!0),this.$button.on("click",(()=>{this.attachmentListRow.removeRow()}))}toggleVisibility(t){this.$button.toggleClass("govuk-visually-hidden",!t),t?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}updateIndex(t){this.$removeButtonCounter.text(t+1)}}class h{constructor(t,e,n){this.$row=n,this.attachmentList=t,this.index=e,this.$legendCounter=this.$row.find(".dm-compliance-communication__attachments-item-legend-counter"),this.attachmentListRowFileInput=new u(n,1),this.attachmentListRowRequiredInput=new c(n,"dm-compliance-communication__attachments-item-required"),this.attachmentListRowRemoveButton=new l(this,n)}init(){this.attachmentListRowRemoveButton.init(),this.attachmentListRowFileInput.makeInteractable(),this.attachmentListRowRequiredInput.checkRow()}updateIndex(t){this.index=t,this.attachmentListRowFileInput.updateIndex(t),this.attachmentListRowRequiredInput.updateIndex(t),this.attachmentListRowRemoveButton.updateIndex(t),this.$legendCounter.text(t+1)}removeRow(){this.attachmentList.removeRow(this.index),this.deleteRow()}deleteRow(){this.$row.remove()}toggleRemoveButtonVisibility(t){this.attachmentListRowRemoveButton.toggleVisibility(t)}isRowChecked(){return this.attachmentListRowRequiredInput.isChecked()}}class p{constructor(t,e){this.attachmentList=t,this.$button=e,this.$buttonCounter=e.find(".dm-compliance-communication__attachments__js-remaining-counter")}init(t){this.$button.on("click",(()=>{this.attachmentList.addRow()})),this.updateButtonText(3-t)}updateButtonText(t){this.$buttonCounter.text(t)}toggleVisibility(t){this.$button.toggleClass("govuk-visually-hidden",!t),t?this.$button.removeAttr("tabindex"):this.$button.attr("tabindex",-1)}}class d{constructor(t){this.$attachmentList=$(t),this.$attachmentListItems=this.$attachmentList.find(".dm-compliance-communication__attachments-items"),this.attachmentListRows=this.$attachmentListItems.find(".dm-compliance-communication__attachments-item").get().map(((t,e)=>new h(this,e,$(t)))),this.attachmentListTemplateRow=new h(this,99,this.$attachmentList.find(".dm-compliance-communication__attachments-item-template > .dm-compliance-communication__attachments-item")),this.attachmentListAddButton=new p(this,this.$attachmentList.find(".dm-compliance-communication__attachments-add"))}init(){const t=this.attachmentListRows.map((t=>t.isRowChecked()));let e;e=t.every((t=>!t))?0:t.indexOf(!1),e>=0&&(this.attachmentListRows.slice(e).forEach((t=>t.deleteRow())),this.attachmentListRows.splice(e)),this.attachmentListAddButton.init(this.attachmentListRows.length),this.attachmentListRows.forEach((t=>t.init())),this.updateIfMinRows(),this.updateAttachmentButton()}removeRow(t){this.attachmentListRows.splice(t,1),this.attachmentListRows.slice(t).forEach(((e,n)=>{e.updateIndex(t+n)})),this.updateIfMinRows(),this.updateAttachmentButton(),t>0?this.focusOnRow(t):this.attachmentListAddButton.$button.focus()}addRow(){const t=this.attachmentListRows.length;if(t<3){const e=this.attachmentListTemplateRow.$row.clone(),n=new h(this,t,e);n.updateIndex(t),this.attachmentListRows.push(n),this.$attachmentListItems.append(e),this.attachmentListRows[t].init(),this.updateIfMinRows(),this.updateAttachmentButton(),this.focusOnRow(t)}}updateIfMinRows(){0!==this.attachmentListRows.length&&this.attachmentListRows[0].toggleRemoveButtonVisibility(!0)}updateAttachmentButton(){3===this.attachmentListRows.length?this.attachmentListAddButton.toggleVisibility(!1):(this.attachmentListAddButton.toggleVisibility(!0),this.attachmentListAddButton.updateButtonText(3-this.attachmentListRows.length))}focusOnRow(t){const e=this.attachmentListRows.length;let n=t;t>=e&&(n=e-1),this.attachmentListRows[n].attachmentListRowFileInput.$input.focus()}}/*! js-cookie v3.0.5 | MIT */function f(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)t[o]=n[o]}return t}var m=function t(e,n){function o(t,o,i){if("undefined"!=typeof document){"number"==typeof(i=f({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var s in i)i[s]&&(r+="; "+s,!0!==i[s]&&(r+="="+i[s].split(";")[0]));return document.cookie=t+"="+e.write(o,t)+r}}return Object.create({set:o,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var r=n[i].split("="),s=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(o[a]=e.read(s,a),t===a)break}catch(t){}}return t?o[t]:o}},remove:function(t,e){o(t,"",f({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,f({},this.attributes,e))},withConverter:function(e){return t(f({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const v={analytics:!1},g={_ga:"analytics",_gid:"analytics",_gat_govuk_shared:"analytics"},y=[".digitalmarketplace.service.gov.uk","www.applytosupply.digitalmarketplace.service.gov.uk"],b=m.withAttributes({path:"/"}),w="dm_cookies_policy";function x(){const t=b.get(w);let e;if(!t)return null;try{e=JSON.parse(t)}catch(t){return null}return"object"!=typeof e&&null!==e&&(e=JSON.parse(e)),e}function C(t){let e=x();e||(e=JSON.parse(JSON.stringify(v)));for(const n in t)if(e[n]=t[n],!t[n]){const t=[];Object.entries(g).forEach((([e,o])=>{o===n&&t.push(e)}));const e=Object.keys(b.get()).filter((e=>t.some((t=>e.startsWith(t)))));for(const t of e)y.forEach((e=>b.remove(t,{domain:e}))),b.remove(t,{domain:window.location.hostname.replace(/^www\./,".")})}!function(t,e,n){{const o={};if(void 0===n&&(n={}),n.days){const t=new Date;t.setTime(t.getTime()+24*n.days*60*60*1e3),o.expires=t}"https:"===document.location.protocol&&(o.secure=!0),b.set(t,e,o)}}(w,JSON.stringify(e),{days:365})}const k=/[^\s=/?&]+(?:@|%40|%2540)[^\s=/?&]+/g,_=function(t){this.value=t};function S(t){return"string"==typeof t?t.replace(k,"[email]"):"[object Array]"===Object.prototype.toString.call(t)||"[object Arguments]"===Object.prototype.toString.call(t)?function(t){for(let e=0,n=t.length;e<n;e++){const n=t[e];t[e]=S(n)}return t}(t):"object"==typeof t?function(t){if(t){if(t instanceof _)return t.value;for(const e in t){const n=t[e];t[e]=S(n)}return t}}(t):t}function I(t){window.ga("create",t.trackingId,t.cookieDomain,{cookieExpires:24*t.expires*60*60}),window.ga("set","anonymizeIp",t.anonymizeIp),window.ga("set","displayFeaturesTask",t.displayFeaturesTask),window.ga("set","transport",t.transport)}window.DMGOVUKFrontend=window.DMGOVUKFrontend||{};const L="UA-47046847-24";function O(){if(!("analytics"in window.DMGOVUKFrontend)){window[`ga-disable-${L}`]=!1;const s="www.digitalmarketplace.service.gov.uk"===document.domain?".digitalmarketplace.service.gov.uk":document.domain;t=window,e=document,n="script",o="ga",t.GoogleAnalyticsObject=o,t[o]=t[o]||function(){(t[o].q=t[o].q||[]).push(arguments)},t[o].l=1*new Date,i=e.createElement(n),r=e.getElementsByTagName(n)[0],i.async=1,i.src="//www.google-analytics.com/analytics.js",r.parentNode.insertBefore(i,r),window.DMGOVUKFrontend.analytics=new I({trackingId:L,cookieDomain:s,anonymizeIp:!0,displayFeaturesTask:null,transport:"beacon",expires:365}),function(t,e,n){window.ga("create",t,"auto",{name:e}),window.ga("require","linker"),window.ga(e+".require","linker"),window.ga("linker:autoLink",n),window.ga(e+".linker:autoLink",n),window.ga(e+".set","anonymizeIp",!0),window.ga(e+".set","location",S(window.location.href)),window.ga(e+".send","pageview")}("UA-145652997-1","govuk_shared",["www.gov.uk"]),function(t,e,n){const o=window.location.pathname+window.location.search;window.ga("send","pageview",S(o))}(),function(t){!function(t,e,n,o,i){t[o]=t[o]||[],t[o].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var r=e.getElementsByTagName(n)[0],s=e.createElement(n);s.async=!0,s.src="https://www.googletagmanager.com/gtm.js?id="+i,r.parentNode.insertBefore(s,r)}(window,document,"script","dataLayer",t)}("GTM-TGNCCR7")}var t,e,n,o,i,r}window[`ga-disable-${L}`]=!0;const R=function(t){this.$module=t.get(0)};function E(t){this.$module=t.get(0)}R.prototype.init=function(){this.$module.hideCookieMessage=this.hideCookieMessage.bind(this),this.$module.showConfirmationMessage=this.showConfirmationMessage.bind(this),this.$module.setCookieConsent=this.setCookieConsent.bind(this),this.$module.cookieBanner=document.querySelector(".dm-cookie-banner"),this.$module.cookieBannerConfirmationMessage=this.$module.querySelector(".dm-cookie-banner--selection-made"),this.setupCookieMessage()},R.prototype.setupCookieMessage=function(){this.$hideLink=this.$module.querySelector("button[data-hide-cookie-banner]"),this.$hideLink&&this.$hideLink.addEventListener("click",this.$module.hideCookieMessage),this.$acceptCookiesLink=this.$module.querySelector("button[data-accept-cookies=true]"),this.$acceptCookiesLink&&this.$acceptCookiesLink.addEventListener("click",(()=>this.$module.setCookieConsent(!0))),this.$rejectCookiesLink=this.$module.querySelector("button[data-accept-cookies=false]"),this.$rejectCookiesLink&&this.$rejectCookiesLink.addEventListener("click",(()=>this.$module.setCookieConsent(!1))),this.showCookieMessage()},R.prototype.showCookieMessage=function(){const t=x();this.$module&&!t&&(this.$module.style.display="block")},R.prototype.hideCookieMessage=function(t){this.$module&&(this.$module.style.display="none"),t.target&&t.preventDefault()},R.prototype.setCookieConsent=function(t){C({analytics:t}),this.$module.showConfirmationMessage(t),this.$module.cookieBannerConfirmationMessage.focus(),t&&O()},R.prototype.showConfirmationMessage=function(t){const e=t?"You’ve accepted analytics cookies.":"You told us not to use analytics cookies.";this.$cookieBannerMainContent=document.querySelector(".dm-cookie-banner__button--main"),this.$cookieBannerConfirmationMessage=document.querySelector(".dm-cookie-banner__confirmation-message"),this.$cookieBannerConfirmationMessage.insertAdjacentText("afterbegin",e),this.$cookieBannerMainContent.setAttribute("hidden","hidden"),this.$module.cookieBannerConfirmationMessage.removeAttribute("hidden")},E.prototype.init=function(){this.$module.submitSettingsForm=this.submitSettingsForm.bind(this),this.$module.addEventListener("submit",this.$module.submitSettingsForm),this.hideCookieBanner(),this.setInitialFormValues()},E.prototype.setInitialFormValues=function(){const t=x();if(!t)return;let e;this.hideWarningMessage(),e=t.analytics?this.$module.querySelector("input[name=cookies-analytics][value=On]"):this.$module.querySelector("input[name=cookies-analytics][value=Off]"),e.checked=!0},E.prototype.submitSettingsForm=function(t){t.preventDefault();const e=t.target.querySelectorAll("input[name=cookies-analytics]"),n={};for(let t=0;t<e.length;t++){const o=e[t];if(o.checked){const t="On"===o.value;n.analytics=t;break}}return void 0===n.analytics?(this.showError(),!1):(C(n),n.analytics&&!window.DMGOVUKFrontend.analytics&&O(),this.hideWarningMessage(),this.hideError(),this.showConfirmationMessage(),!1)},E.prototype.showConfirmationMessage=function(){const t=document.querySelector("#dm-cookie-settings-confirmation"),e=document.querySelector(".dm-cookie-settings__prev-page"),n=E.prototype.getReferrerLink();document.body.scrollTop=document.documentElement.scrollTop=0,n&&n!==document.location.pathname?(e.href=n,e.style.display="block"):e.style.display="none",t.style.display="block"},E.prototype.showError=function(){const t=document.querySelector("#dm-cookie-settings-error");null!==t&&(t.style.display="block",document.body.scrollTop=document.documentElement.scrollTop=0),this.showErrorMessage()},E.prototype.hideError=function(){const t=document.querySelector("#dm-cookie-settings-error");null!==t&&(t.style.display="none"),this.hideErrorMessage()},E.prototype.hideWarningMessage=function(){const t=document.querySelector("#dm-cookie-settings-warning");null!==t&&(t.style.display="none")},E.prototype.hideErrorMessage=function(){const t=document.querySelector("#dm-cookie-settings-error-message");null!==t&&(t.style.display="none");const e=document.querySelector(".govuk-form-group--error");e&&e.classList.remove("govuk-form-group--error")},E.prototype.showErrorMessage=function(){const t=document.querySelector("#dm-cookie-settings .govuk-form-group");t&&t.classList.add("govuk-form-group--error");const e=document.createElement("span");e.setAttribute("id","dm-cookie-settings-error-message"),e.className="govuk-error-message",e.innerHTML='<span class="govuk-visually-hidden">Error:</span> Select yes to accept analytics cookies';const n=document.querySelector("#cookie-settings-1, .govuk-radios--inline");n.parentElement.insertBefore(e,n)},E.prototype.hideCookieBanner=function(){const t=document.querySelector(".dm-cookie-banner");null!==t&&(t.style.display="none")},E.prototype.getReferrerLink=function(){return!!document.referrer&&new URL(document.referrer).pathname};const T=function(t,e,n){let o="next"===t?e.nextElementSibling:e.previousElementSibling;if(!n)return o;for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);o;){if(o.matches(n))return o;o="next"===t?o.nextElementSibling:o=o.previousElementSibling}};function A(t){this.$module=t.get(0),this.$allVisibleItems=this.$module.querySelectorAll(".dm-list-input__item--visible"),this.$addAnotherButton=this.$module.querySelector(".dm-list-input__item-add"),this.$allItems=this.$module.querySelectorAll(".dm-list-input__item"),this.visibleItems=0,this.itemContainerClass="dm-list-input__item-container",this.hiddenItemClass="dm-list-input__item--hidden",this.visibleItemClass="dm-list-input__item--visible",this.itemInputClass="dm-list-input__item-input",this.itemErrorClass="dm-list-input__item--error",this.itemErrorMsgClass="dm-list-input-error-message",this.itemCounterClass="dm-list-input__counter",this.inputErrorClass="govuk-input--error",this.removeButtonClass="dm-list-input__item-remove",this.hiddenRemoveButtonClass="dm-list-input__item-remove--hidden",this.formGroupErrorClass="govuk-form-group--error",this.hiddenAddButtonClass="dm-list-input__item-add--hidden",this.addButtonRemainingClass="dm-list-input__js-remaining-counter"}function B(t){this.$optionSelect=t.get(0),this.$options=this.$optionSelect.querySelectorAll("input[type='checkbox']"),this.$optionsContainer=this.$optionSelect.querySelector(".js-options-container"),this.$optionList=this.$optionsContainer.querySelector(".js-auto-height-inner"),this.$allCheckboxes=this.$optionsContainer.querySelectorAll(".govuk-checkboxes__item"),this.checkedCheckboxes=[]}A.prototype.init=function(){this.$module&&(this.hideEmptyItems(),this.updateAllCounters(),this.bindRemoveClickEvent(),this.toggleAddAnotherButton(),this.bindAddClickEvent())},A.prototype.hideEmptyItems=function(){let t=0,e=0;this.$allItems.forEach((function(n){const o=n.querySelector("."+this.itemInputClass),i=n.querySelector("."+this.removeButtonClass);""===o.value?(0===t||1===t&&0===e?i.classList.remove(this.hiddenRemoveButtonClass):(n.classList.add(this.hiddenItemClass),n.classList.remove(this.visibleItemClass),i.classList.add(this.hiddenRemoveButtonClass),o.setAttribute("disabled","true")),t+=1):(n.classList.remove(this.hiddenItemClass),n.classList.add(this.visibleItemClass),i.classList.remove(this.hiddenRemoveButtonClass),e+=1)}),this),this.$allVisibleItems=this.$module.querySelectorAll("."+this.visibleItemClass)},A.prototype.bindRemoveClickEvent=function(){this.$module.addEventListener("click",function(t){const e=t.target;if("BUTTON"===e.tagName&&e.classList.contains(this.removeButtonClass)){const t=e.parentNode.parentNode,n=t.querySelector("."+this.itemInputClass);if(n.value="",n.removeAttribute("value"),n.setAttribute("disabled","true"),e.classList.add(this.hiddenRemoveButtonClass),t.classList.add(this.hiddenItemClass),t.classList.remove(this.visibleItemClass),this.$allVisibleItems=this.$module.querySelectorAll("."+this.visibleItemClass),t.classList.contains(this.itemErrorClass)){t.classList.remove(this.itemErrorClass);const e=t.querySelector("."+this.formGroupErrorClass);e.classList.remove(this.formGroupErrorClass),e.querySelector("."+this.itemErrorMsgClass).remove();const n=e.querySelector("."+this.inputErrorClass),o=n.getAttribute("id"),i=n.getAttribute("aria-describedby");n.setAttribute("aria-describedby",i.replace(o+"-error","")),n.classList.remove(this.inputErrorClass)}if(1===this.$allVisibleItems.length){this.$module.querySelectorAll("."+this.removeButtonClass).forEach((function(t){t.classList.add(this.hiddenRemoveButtonClass)}),this),this.$allVisibleItems[0].querySelector("input").focus()}else{const e=T("next",t,"."+this.visibleItemClass);if(e)e.querySelector("input").focus();else{T("previous",t,"."+this.visibleItemClass).querySelector("input").focus()}}this.updateAllCounters(),this.toggleAddAnotherButton()}}.bind(this))},A.prototype.updateCounters=function(){const t=this.$allVisibleItems;let e=1;t.forEach((function(t){t.querySelectorAll("."+this.itemCounterClass).forEach((function(t){t.innerHTML=e})),e+=1}),this)},A.prototype.updateRemainingCounter=function(){const t=this.$allVisibleItems,e=this.$allItems.length;this.$module.querySelector("."+this.addButtonRemainingClass).innerHTML=e-t.length},A.prototype.bindAddClickEvent=function(){this.$addAnotherButton.addEventListener("click",function(){const t=this.$module.querySelector("."+this.hiddenItemClass),e=t.querySelector("."+this.itemInputClass);if(t&&(e.removeAttribute("disabled"),this.$module.querySelector("."+this.itemContainerClass).appendChild(t),t.classList.remove(this.hiddenItemClass),t.classList.add(this.visibleItemClass),this.$allVisibleItems=this.$module.querySelectorAll("."+this.visibleItemClass),this.updateAllCounters(),t.querySelector("."+this.removeButtonClass).classList.remove(this.hiddenRemoveButtonClass),e.focus(),this.toggleAddAnotherButton(),this.$allVisibleItems.length>1)){this.$module.querySelectorAll("."+this.removeButtonClass).forEach((function(t){t.classList.remove(this.hiddenRemoveButtonClass)}),this)}}.bind(this))},A.prototype.toggleAddAnotherButton=function(){this.$module.querySelector("."+this.hiddenItemClass)?this.$addAnotherButton.classList.remove(this.hiddenAddButtonClass):this.$addAnotherButton.classList.add(this.hiddenAddButtonClass)},A.prototype.updateAllCounters=function(){this.updateCounters(),this.updateRemainingCounter()},B.prototype.init=function(){this.$optionSelect.addEventListener("change",function(t){const e=t.target;"INPUT"===e.tagName&&"checkbox"===e.type&&this.updateCheckedCount()}.bind(this)),this.replaceHeadingSpanWithButton(),this.$optionSelect.classList.add("js-collapsible"),this.$optionSelect.querySelector(".js-container-button").addEventListener("click",this.toggleOptionSelect.bind(this)),"true"===this.$optionSelect.dataset.closedOnLoad?this.close():this.setupHeight();const t=this.checkedString();t&&this.attachCheckedCounter(t)},B.prototype.getAllCheckedCheckboxes=function(){this.checkedCheckboxes=[];const t=this;this.$allCheckboxes.forEach((function(e){e.querySelector("input[type=checkbox]").checked&&t.checkedCheckboxes.push(e)}),this)},B.prototype.replaceHeadingSpanWithButton=function(){const t=this.$optionSelect.querySelector(".js-container-button"),e=t.innerHTML,n=document.createElement("button");n.classList.add("js-container-button","dm-option-select__title","dm-option-select__button"),n.setAttribute("type","button"),n.setAttribute("aria-expanded",!0),n.setAttribute("id",t.id),n.setAttribute("aria-controls",this.$optionsContainer.id),n.innerHTML=e,t.insertAdjacentHTML("afterend",n.outerHTML),t.parentNode.removeChild(t)},B.prototype.attachCheckedCounter=function(t){this.$optionSelect.querySelector(".js-container-button").insertAdjacentHTML("afterend",'<div class="dm-option-select__selected-counter js-selected-counter">'+t+"</div>")},B.prototype.updateCheckedCount=function(){const t=this.checkedString(),e=this.$optionSelect.querySelector(".js-selected-counter");t?e?e.textContent=t:this.attachCheckedCounter(t):e.parentNode.removeChild(e)},B.prototype.checkedString=function(){this.getAllCheckedCheckboxes();const t=this.checkedCheckboxes.length;let e=!1;return t>0&&(e=t+" selected"),e},B.prototype.toggleOptionSelect=function(t){this.isClosed()?this.open():this.close(),t.preventDefault()},B.prototype.open=function(){this.isClosed()&&(this.$optionSelect.querySelector(".js-container-button").setAttribute("aria-expanded",!0),this.$optionSelect.classList.remove("js-closed"),this.$optionSelect.classList.add("js-opened"),this.$optionsContainer.style.height||this.setupHeight())},B.prototype.close=function(){this.$optionSelect.classList.remove("js-opened"),this.$optionSelect.classList.add("js-closed"),this.$optionSelect.querySelector(".js-container-button").setAttribute("aria-expanded",!1)},B.prototype.isClosed=function(){return this.$optionSelect.classList.contains("js-closed")},B.prototype.setContainerHeight=function(t){this.$optionsContainer.style.height=t+"px"},B.prototype.isCheckboxVisible=function(t){const e=this.$optionsContainer.clientHeight,n=this.$optionList.getBoundingClientRect().top+document.body.scrollTop;return t.getBoundingClientRect().top+document.body.scrollTop-n<e},B.prototype.getVisibleCheckboxes=function(){const t=[].slice.call(this.$options).filter(this.isCheckboxVisible.bind(this));return t.length<this.$options&&t.push(this.$options[t.length]),t},B.prototype.setupHeight=function(){let t=this.$optionsContainer.clientHeight,e=this.$optionList.offsetHeight;if(null===this.$optionsContainer.offsetParent&&(t=200,e=200),e<t+50)return void this.setContainerHeight(e+1);const n=this.getVisibleCheckboxes(),o=n[n.length-1],i=o.parentNode.offsetTop;this.setContainerHeight(i+parseFloat(window.getComputedStyle(o,null).height.replace("px",""))/1.5)};const j=0,q=1,M=2;class N{constructor(t,e){this.question=t,this.$input=e;const n=this.$input.attr("data-target");this.targets=n?n.split(" "):[]}setEventListener(){this.$input.on("click",(()=>{this.question.updateTargetQuestionsVisibility()}))}isChecked(){return this.$input.is(":checked")}}class V{constructor(t,e,n){this.questionWatcher=t,this.$question=e,this.id=this.$question.attr("id"),this.questionType=n,this.questionType===j?this.enableControllerQuestionMethods():this.enableTargetQuestionMethods()}enableControllerQuestionMethods(){this.questionInputs=this.$question.find("input").get().map((t=>new N(this,$(t)))),this.possibleTargetIds=new Set(this.questionInputs.map((t=>t.targets)).flat())}enableTargetQuestionMethods(){this.targetOf=[]}isVisible(){return!this.$question.hasClass("govuk-visually-hidden")}currentTargetIds(){let t;return t=this.isVisible()&&this.questionInputs?this.questionInputs.filter((t=>t.isChecked())).map((t=>t.targets)).flat():[],new Set(t)}updateTargetQuestionsVisibility(){this.questionWatcher.updateTargetQuestionsVisibility(this.possibleTargetIds)}appendTargetOf(t){this.targetOf.push(t)}toggleVisibility(t){this.$question.toggleClass("govuk-visually-hidden",!t),this.$question.attr("aria-hidden",(!t).toString())}}class F{constructor(){this.questions={},$('[data-module="dm-question-with-follow-up"]').each(((t,e)=>{this.push(new V(this,$(e),j))}));for(const[t,e]of Object.entries(this.questions))for(const n of e.possibleTargetIds)n in this.questions?this.questions[n].questionType===j&&(this.questions[n].questionType=q,this.questions[n].enableTargetQuestionMethods()):this.push(new V(this,$(`#${n}`),M)),this.questions[n].appendTargetOf(t)}init(){for(const t of Object.values(this.questions))if(t.questionType<M){for(const e of t.questionInputs)e.setEventListener();t.questionType===j&&this.updateTargetQuestionsVisibility(t.possibleTargetIds)}}push(t){this.questions[t.id]=t}updateTargetQuestionsVisibility(t,e){for(const n of t){const t=this.questions[n];let o;if(void 0===e){const e=t.targetOf.map((t=>this.questions[t]));o=new Set(e.map((t=>Array.from(t.currentTargetIds()))).flat()).has(n)}else o=e;t.toggleVisibility(o),t.questionType===q&&(o?this.updateTargetQuestionsVisibility(t.possibleTargetIds):this.updateTargetQuestionsVisibility(t.possibleTargetIds,!1))}}}function P(t){this.$module=t.get(0),this.toggleTarget=this.$module.querySelector(".js-class-toggle")}P.prototype.init=function(){this.$module&&(this.$module.addFocusClass=this.addFocusClass.bind(this),this.$module.removeFocusClassFromEmptyInput=this.removeFocusClassFromEmptyInput.bind(this),this.inputIsEmpty()||this.addFocusClass(),this.toggleTarget.addEventListener("focus",this.$module.addFocusClass),this.toggleTarget.addEventListener("blur",this.$module.removeFocusClassFromEmptyInput))},P.prototype.inputIsEmpty=function(){return""===this.toggleTarget.value},P.prototype.addFocusClass=function(){this.toggleTarget.classList.add("focus")},P.prototype.removeFocusClassFromEmptyInput=function(){this.inputIsEmpty()&&this.toggleTarget.classList.remove("focus")};var D={exports:{}};self;var U=D.exports=function(){var t={8952:function(t,e,n){var o=n(4328),i=n(36),r=TypeError;t.exports=function(t){if(o(t))return t;throw new r(i(t)+" is not a function")}},2096:function(t,e,n){var o=n(2424),i=String,r=TypeError;t.exports=function(t){if(o(t))return t;throw new r("Can't set "+i(t)+" as a prototype")}},4764:function(t,e,n){var o=n(9764).charAt;t.exports=function(t,e,n){return e+(n?o(t,e).length:1)}},6100:function(t,e,n){var o=n(7e3),i=TypeError;t.exports=function(t,e){if(o(e,t))return t;throw new i("Incorrect invocation")}},3951:function(t,e,n){var o=n(1632),i=String,r=TypeError;t.exports=function(t){if(o(t))return t;throw new r(i(t)+" is not an object")}},2504:function(t,e,n){var o=n(4096),i=n(2495),r=n(3556),s=function(t){return function(e,n,s){var a=o(e),u=r(a);if(0===u)return!t&&-1;var c,l=i(s,u);if(t&&n!=n){for(;u>l;)if((c=a[l++])!=c)return!0}else for(;u>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},3364:function(t,e,n){var o=n(8992),i=n(1664),r=n(5712),s=n(4356),a=n(3556),u=n(2568),c=i([].push),l=function(t){var e=1===t,n=2===t,i=3===t,l=4===t,h=6===t,p=7===t,d=5===t||h;return function(f,m,v,g){for(var y,b,w=s(f),x=r(w),C=a(x),k=o(m,v),_=0,S=g||u,$=e?S(f,C):n||p?S(f,0):void 0;C>_;_++)if((d||_ in x)&&(b=k(y=x[_],_,w),t))if(e)$[_]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return _;case 2:c($,y)}else switch(t){case 4:return!1;case 7:c($,y)}return h?-1:i||l?l:$}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},953:function(t,e,n){var o=n(9957),i=n(9972),r=n(8504),s=i("species");t.exports=function(t){return r>=51||!o((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},1496:function(t,e,n){var o=n(9957);t.exports=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){return 1},1)}))}},6728:function(t,e,n){var o=n(3476),i=n(1432),r=TypeError,s=Object.getOwnPropertyDescriptor,a=o&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(i(t)&&!s(t,"length").writable)throw new r("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},6736:function(t,e,n){var o=n(1432),i=n(6072),r=n(1632),s=n(9972)("species"),a=Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===a||o(e.prototype))||r(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},2568:function(t,e,n){var o=n(6736);t.exports=function(t,e){return new(o(t))(0===e?0:e)}},8696:function(t,e,n){var o=n(3951),i=n(3112);t.exports=function(t,e,n,r){try{return r?e(o(n)[0],n[1]):e(n)}catch(e){i(t,"throw",e)}}},1888:function(t,e,n){var o=n(1664),i=o({}.toString),r=o("".slice);t.exports=function(t){return r(i(t),8,-1)}},4427:function(t,e,n){var o=n(16),i=n(4328),r=n(1888),s=n(9972)("toStringTag"),a=Object,u="Arguments"===r(function(){return arguments}());t.exports=o?r:function(t){var e,n,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:u?r(e):"Object"===(o=r(e))&&i(e.callee)?"Arguments":o}},9968:function(t,e,n){var o=n(5152),i=n(9252),r=n(9444),s=n(8352);t.exports=function(t,e,n){for(var a=i(e),u=s.f,c=r.f,l=0;l<a.length;l++){var h=a[l];o(t,h)||n&&o(n,h)||u(t,h,c(e,h))}}},2272:function(t,e,n){var o=n(9957);t.exports=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3336:function(t){t.exports=function(t,e){return{value:t,done:e}}},3440:function(t,e,n){var o=n(3476),i=n(8352),r=n(9728);t.exports=o?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},9728:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},92:function(t,e,n){var o=n(3476),i=n(8352),r=n(9728);t.exports=function(t,e,n){o?i.f(t,e,r(0,n)):t[e]=n}},2544:function(t,e,n){var o=n(5312),i=n(8352);t.exports=function(t,e,n){return n.get&&o(n.get,e,{getter:!0}),n.set&&o(n.set,e,{setter:!0}),i.f(t,e,n)}},6076:function(t,e,n){var o=n(4328),i=n(8352),r=n(5312),s=n(4636);t.exports=function(t,e,n,a){a||(a={});var u=a.enumerable,c=void 0!==a.name?a.name:e;if(o(n)&&r(n,c,a),a.global)u?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},4036:function(t,e,n){var o=n(6076);t.exports=function(t,e,n){for(var i in e)o(t,i,e[i],n);return t}},4636:function(t,e,n){var o=n(6420),i=Object.defineProperty;t.exports=function(t,e){try{i(o,t,{value:e,configurable:!0,writable:!0})}catch(n){o[t]=e}return e}},3476:function(t,e,n){var o=n(9957);t.exports=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8168:function(t,e,n){var o=n(6420),i=n(1632),r=o.document,s=i(r)&&i(r.createElement);t.exports=function(t){return s?r.createElement(t):{}}},4316:function(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},6064:function(t){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:function(t,e,n){var o,i,r=n(6420),s=n(6064),a=r.process,u=r.Deno,c=a&&a.versions||u&&u.version,l=c&&c.v8;l&&(i=(o=l.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!i&&s&&(!(o=s.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=s.match(/Chrome\/(\d+)/))&&(i=+o[1]),t.exports=i},8256:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6520:function(t,e,n){var o=n(1664),i=Error,r=o("".replace),s=String(new i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,u=a.test(s);t.exports=function(t,e){if(u&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=r(t,a,"");return t}},3696:function(t,e,n){var o=n(3440),i=n(6520),r=n(9184),s=Error.captureStackTrace;t.exports=function(t,e,n,a){r&&(s?s(t,e):o(t,"stack",i(n,a)))}},9184:function(t,e,n){var o=n(9957),i=n(9728);t.exports=!o((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",i(1,7)),7!==t.stack)}))},9160:function(t,e,n){var o=n(6420),i=n(9444).f,r=n(3440),s=n(6076),a=n(4636),u=n(9968),c=n(6704);t.exports=function(t,e){var n,l,h,p,d,f=t.target,m=t.global,v=t.stat;if(n=m?o:v?o[f]||a(f,{}):o[f]&&o[f].prototype)for(l in e){if(p=e[l],h=t.dontCallGetSet?(d=i(n,l))&&d.value:n[l],!c(m?l:f+(v?".":"#")+l,t.forced)&&void 0!==h){if(typeof p==typeof h)continue;u(p,h)}(t.sham||h&&h.sham)&&r(p,"sham",!0),s(n,l,p,t)}}},9957:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7176:function(t,e,n){n(880);var o=n(8448),i=n(6076),r=n(7680),s=n(9957),a=n(9972),u=n(3440),c=a("species"),l=RegExp.prototype;t.exports=function(t,e,n,h){var p=a(t),d=!s((function(){var e={};return e[p]=function(){return 7},7!==""[t](e)})),f=d&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!d||!f||n){var m=/./[p],v=e(p,""[t],(function(t,e,n,i,s){var a=e.exec;return a===r||a===l.exec?d&&!s?{done:!0,value:o(m,e,n,i)}:{done:!0,value:o(t,n,e,i)}:{done:!1}}));i(String.prototype,t,v[0]),i(l,p,v[1])}h&&u(l[p],"sham",!0)}},908:function(t,e,n){var o=n(7332),i=Function.prototype,r=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(o?s.bind(r):function(){return s.apply(r,arguments)})},8992:function(t,e,n){var o=n(3180),i=n(8952),r=n(7332),s=o(o.bind);t.exports=function(t,e){return i(t),void 0===e?t:r?s(t,e):function(){return t.apply(e,arguments)}}},7332:function(t,e,n){var o=n(9957);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},8448:function(t,e,n){var o=n(7332),i=Function.prototype.call;t.exports=o?i.bind(i):function(){return i.apply(i,arguments)}},6208:function(t,e,n){var o=n(3476),i=n(5152),r=Function.prototype,s=o&&Object.getOwnPropertyDescriptor,a=i(r,"name"),u=a&&"something"===function(){}.name,c=a&&(!o||o&&s(r,"name").configurable);t.exports={EXISTS:a,PROPER:u,CONFIGURABLE:c}},5288:function(t,e,n){var o=n(1664),i=n(8952);t.exports=function(t,e,n){try{return o(i(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},3180:function(t,e,n){var o=n(1888),i=n(1664);t.exports=function(t){if("Function"===o(t))return i(t)}},1664:function(t,e,n){var o=n(7332),i=Function.prototype,r=i.call,s=o&&i.bind.bind(r,r);t.exports=o?s:function(t){return function(){return r.apply(t,arguments)}}},5232:function(t,e,n){var o=n(6420),i=n(4328);t.exports=function(t,e){return arguments.length<2?(n=o[t],i(n)?n:void 0):o[t]&&o[t][e];var n}},6752:function(t){t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},4504:function(t,e,n){var o=n(8952),i=n(9760);t.exports=function(t,e){var n=t[e];return i(n)?void 0:o(n)}},6420:function(t,e,n){var o=function(t){return t&&t.Math===Math&&t};t.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n.g&&n.g)||o("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5152:function(t,e,n){var o=n(1664),i=n(4356),r=o({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return r(i(t),e)}},2560:function(t){t.exports={}},4168:function(t,e,n){var o=n(5232);t.exports=o("document","documentElement")},9888:function(t,e,n){var o=n(3476),i=n(9957),r=n(8168);t.exports=!o&&!i((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},5712:function(t,e,n){var o=n(1664),i=n(9957),r=n(1888),s=Object,a=o("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?a(t,""):s(t)}:s},7512:function(t,e,n){var o=n(4328),i=n(1632),r=n(4024);t.exports=function(t,e,n){var s,a;return r&&o(s=e.constructor)&&s!==n&&i(a=s.prototype)&&a!==n.prototype&&r(t,a),t}},9112:function(t,e,n){var o=n(1664),i=n(4328),r=n(3976),s=o(Function.toString);i(r.inspectSource)||(r.inspectSource=function(t){return s(t)}),t.exports=r.inspectSource},3480:function(t,e,n){var o=n(1632),i=n(3440);t.exports=function(t,e){o(e)&&"cause"in e&&i(t,"cause",e.cause)}},9104:function(t,e,n){var o,i,r,s=n(4288),a=n(6420),u=n(1632),c=n(3440),l=n(5152),h=n(3976),p=n(6504),d=n(2560),f="Object already initialized",m=a.TypeError,v=a.WeakMap;if(s||h.state){var g=h.state||(h.state=new v);g.get=g.get,g.has=g.has,g.set=g.set,o=function(t,e){if(g.has(t))throw new m(f);return e.facade=t,g.set(t,e),e},i=function(t){return g.get(t)||{}},r=function(t){return g.has(t)}}else{var y=p("state");d[y]=!0,o=function(t,e){if(l(t,y))throw new m(f);return e.facade=t,c(t,y,e),e},i=function(t){return l(t,y)?t[y]:{}},r=function(t){return l(t,y)}}t.exports={set:o,get:i,has:r,enforce:function(t){return r(t)?i(t):o(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw new m("Incompatible receiver, "+t+" required");return n}}}},1432:function(t,e,n){var o=n(1888);t.exports=Array.isArray||function(t){return"Array"===o(t)}},4328:function(t){var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},6072:function(t,e,n){var o=n(1664),i=n(9957),r=n(4328),s=n(4427),a=n(5232),u=n(9112),c=function(){},l=a("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=o(h.exec),d=!h.test(c),f=function(t){if(!r(t))return!1;try{return l(c,[],t),!0}catch(t){return!1}},m=function(t){if(!r(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(h,u(t))}catch(t){return!0}};m.sham=!0,t.exports=!l||i((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?m:f},6704:function(t,e,n){var o=n(9957),i=n(4328),r=/#|\.prototype\./,s=function(t,e){var n=u[a(t)];return n===l||n!==c&&(i(e)?o(e):!!e)},a=s.normalize=function(t){return String(t).replace(r,".").toLowerCase()},u=s.data={},c=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},9760:function(t){t.exports=function(t){return null==t}},1632:function(t,e,n){var o=n(4328);t.exports=function(t){return"object"==typeof t?null!==t:o(t)}},2424:function(t,e,n){var o=n(1632);t.exports=function(t){return o(t)||null===t}},7048:function(t){t.exports=!1},7728:function(t,e,n){var o=n(5232),i=n(4328),r=n(7e3),s=n(6536),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&r(e.prototype,a(t))}},3112:function(t,e,n){var o=n(8448),i=n(3951),r=n(4504);t.exports=function(t,e,n){var s,a;i(t);try{if(!(s=r(t,"return"))){if("throw"===e)throw n;return n}s=o(s,t)}catch(t){a=!0,s=t}if("throw"===e)throw n;if(a)throw s;return i(s),n}},9724:function(t,e,n){var o=n(8448),i=n(9368),r=n(3440),s=n(4036),a=n(9972),u=n(9104),c=n(4504),l=n(336).IteratorPrototype,h=n(3336),p=n(3112),d=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",v=u.set,g=function(t){var e=u.getterFor(t?m:f);return s(i(l),{next:function(){var n=e(this);if(t)return n.nextHandler();try{var o=n.done?void 0:n.nextHandler();return h(o,n.done)}catch(t){throw n.done=!0,t}},return:function(){var n=e(this),i=n.iterator;if(n.done=!0,t){var r=c(i,"return");return r?o(r,i):h(void 0,!0)}if(n.inner)try{p(n.inner.iterator,"normal")}catch(t){return p(i,"throw",t)}return p(i,"normal"),h(void 0,!0)}})},y=g(!0),b=g(!1);r(b,d,"Iterator Helper"),t.exports=function(t,e){var n=function(n,o){o?(o.iterator=n.iterator,o.next=n.next):o=n,o.type=e?m:f,o.nextHandler=t,o.counter=0,o.done=!1,v(this,o)};return n.prototype=e?y:b,n}},5792:function(t,e,n){var o=n(8448),i=n(8952),r=n(3951),s=n(6752),a=n(9724),u=n(8696),c=a((function(){var t=this.iterator,e=r(o(this.next,t));if(!(this.done=!!e.done))return u(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return r(this),i(t),new c(s(this),{mapper:t})}},336:function(t,e,n){var o,i,r,s=n(9957),a=n(4328),u=n(1632),c=n(9368),l=n(7796),h=n(6076),p=n(9972),d=n(7048),f=p("iterator"),m=!1;[].keys&&("next"in(r=[].keys())?(i=l(l(r)))!==Object.prototype&&(o=i):m=!0),!u(o)||s((function(){var t={};return o[f].call(t)!==t}))?o={}:d&&(o=c(o)),a(o[f])||h(o,f,(function(){return this})),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:m}},3556:function(t,e,n){var o=n(7584);t.exports=function(t){return o(t.length)}},5312:function(t,e,n){var o=n(1664),i=n(9957),r=n(4328),s=n(5152),a=n(3476),u=n(6208).CONFIGURABLE,c=n(9112),l=n(9104),h=l.enforce,p=l.get,d=String,f=Object.defineProperty,m=o("".slice),v=o("".replace),g=o([].join),y=a&&!i((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=t.exports=function(t,e,n){"Symbol("===m(d(e),0,7)&&(e="["+v(d(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!s(t,"name")||u&&t.name!==e)&&(a?f(t,"name",{value:e,configurable:!0}):t.name=e),y&&n&&s(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&s(n,"constructor")&&n.constructor?a&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var o=h(t);return s(o,"source")||(o.source=g(b,"string"==typeof e?e:"")),t};Function.prototype.toString=w((function(){return r(this)&&p(this).source||c(this)}),"toString")},1748:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var o=+t;return(o>0?n:e)(o)}},8948:function(t,e,n){var o=n(5016);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:o(t)}},9292:function(t,e,n){var o=n(3476),i=n(1664),r=n(8448),s=n(9957),a=n(1531),u=n(9392),c=n(8912),l=n(4356),h=n(5712),p=Object.assign,d=Object.defineProperty,f=i([].concat);t.exports=!p||s((function(){if(o&&1!==p({b:1},p(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!==p({},t)[n]||a(p({},e)).join("")!==i}))?function(t,e){for(var n=l(t),i=arguments.length,s=1,p=u.f,d=c.f;i>s;)for(var m,v=h(arguments[s++]),g=p?f(a(v),p(v)):a(v),y=g.length,b=0;y>b;)m=g[b++],o&&!r(d,v,m)||(n[m]=v[m]);return n}:p},9368:function(t,e,n){var o,i=n(3951),r=n(2056),s=n(8256),a=n(2560),u=n(4168),c=n(8168),l=n(6504),h="prototype",p="script",d=l("IE_PROTO"),f=function(){},m=function(t){return"<"+p+">"+t+"</"+p+">"},v=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){try{o=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;g="undefined"!=typeof document?document.domain&&o?v(o):(e=c("iframe"),n="java"+p+":",e.style.display="none",u.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):v(o);for(var i=s.length;i--;)delete g[h][s[i]];return g()};a[d]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f[h]=i(t),n=new f,f[h]=null,n[d]=t):n=g(),void 0===e?n:r.f(n,e)}},2056:function(t,e,n){var o=n(3476),i=n(1576),r=n(8352),s=n(3951),a=n(4096),u=n(1531);e.f=o&&!i?Object.defineProperties:function(t,e){s(t);for(var n,o=a(e),i=u(e),c=i.length,l=0;c>l;)r.f(t,n=i[l++],o[n]);return t}},8352:function(t,e,n){var o=n(3476),i=n(9888),r=n(1576),s=n(3951),a=n(88),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",p="configurable",d="writable";e.f=o?r?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&d in n&&!n[d]){var o=l(t,e);o&&o[d]&&(t[e]=n.value,n={configurable:p in n?n[p]:o[p],enumerable:h in n?n[h]:o[h],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},9444:function(t,e,n){var o=n(3476),i=n(8448),r=n(8912),s=n(9728),a=n(4096),u=n(88),c=n(5152),l=n(9888),h=Object.getOwnPropertyDescriptor;e.f=o?h:function(t,e){if(t=a(t),e=u(e),l)try{return h(t,e)}catch(t){}if(c(t,e))return s(!i(r.f,t,e),t[e])}},5048:function(t,e,n){var o=n(9008),i=n(8256).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,i)}},9392:function(t,e){e.f=Object.getOwnPropertySymbols},7796:function(t,e,n){var o=n(5152),i=n(4328),r=n(4356),s=n(6504),a=n(2272),u=s("IE_PROTO"),c=Object,l=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=r(t);if(o(e,u))return e[u];var n=e.constructor;return i(n)&&e instanceof n?n.prototype:e instanceof c?l:null}},7e3:function(t,e,n){var o=n(1664);t.exports=o({}.isPrototypeOf)},9008:function(t,e,n){var o=n(1664),i=n(5152),r=n(4096),s=n(2504).indexOf,a=n(2560),u=o([].push);t.exports=function(t,e){var n,o=r(t),c=0,l=[];for(n in o)!i(a,n)&&i(o,n)&&u(l,n);for(;e.length>c;)i(o,n=e[c++])&&(~s(l,n)||u(l,n));return l}},1531:function(t,e,n){var o=n(9008),i=n(8256);t.exports=Object.keys||function(t){return o(t,i)}},8912:function(t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},4024:function(t,e,n){var o=n(5288),i=n(3951),r=n(2096);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=o(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return i(n),r(o),e?t(n,o):n.__proto__=o,n}}():void 0)},7032:function(t,e,n){var o=n(16),i=n(4427);t.exports=o?{}.toString:function(){return"[object "+i(this)+"]"}},2104:function(t,e,n){var o=n(8448),i=n(4328),r=n(1632),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!r(a=o(n,t)))return a;if(i(n=t.valueOf)&&!r(a=o(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!r(a=o(n,t)))return a;throw new s("Can't convert object to primitive value")}},9252:function(t,e,n){var o=n(5232),i=n(1664),r=n(5048),s=n(9392),a=n(3951),u=i([].concat);t.exports=o("Reflect","ownKeys")||function(t){var e=r.f(a(t)),n=s.f;return n?u(e,n(t)):e}},584:function(t,e,n){var o=n(8352).f;t.exports=function(t,e,n){n in t||o(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},9092:function(t,e,n){var o=n(8448),i=n(3951),r=n(4328),s=n(1888),a=n(7680),u=TypeError;t.exports=function(t,e){var n=t.exec;if(r(n)){var c=o(n,t,e);return null!==c&&i(c),c}if("RegExp"===s(t))return o(a,t,e);throw new u("RegExp#exec called on incompatible receiver")}},7680:function(t,e,n){var o,i,r=n(8448),s=n(1664),a=n(5016),u=n(8872),c=n(3548),l=n(4696),h=n(9368),p=n(9104).get,d=n(8e3),f=n(9124),m=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,y=s("".charAt),b=s("".indexOf),w=s("".replace),x=s("".slice),C=(i=/b*/g,r(v,o=/a/,"a"),r(v,i,"a"),0!==o.lastIndex||0!==i.lastIndex),k=c.BROKEN_CARET,_=void 0!==/()??/.exec("")[1];(C||_||k||d||f)&&(g=function(t){var e,n,o,i,s,c,l,d=this,f=p(d),S=a(t),$=f.raw;if($)return $.lastIndex=d.lastIndex,e=r(g,$,S),d.lastIndex=$.lastIndex,e;var I=f.groups,L=k&&d.sticky,O=r(u,d),R=d.source,E=0,T=S;if(L&&(O=w(O,"y",""),-1===b(O,"g")&&(O+="g"),T=x(S,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==y(S,d.lastIndex-1))&&(R="(?: "+R+")",T=" "+T,E++),n=new RegExp("^(?:"+R+")",O)),_&&(n=new RegExp("^"+R+"$(?!\\s)",O)),C&&(o=d.lastIndex),i=r(v,L?n:d,T),L?i?(i.input=x(i.input,E),i[0]=x(i[0],E),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:C&&i&&(d.lastIndex=d.global?i.index+i[0].length:o),_&&i&&i.length>1&&r(m,i[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i&&I)for(i.groups=c=h(null),s=0;s<I.length;s++)c[(l=I[s])[0]]=i[l[1]];return i}),t.exports=g},8872:function(t,e,n){var o=n(3951);t.exports=function(){var t=o(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},3548:function(t,e,n){var o=n(9957),i=n(6420).RegExp,r=o((function(){var t=i("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),s=r||o((function(){return!i("a","y").sticky})),a=r||o((function(){var t=i("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:r}},8e3:function(t,e,n){var o=n(9957),i=n(6420).RegExp;t.exports=o((function(){var t=i(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},9124:function(t,e,n){var o=n(9957),i=n(6420).RegExp;t.exports=o((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},5436:function(t,e,n){var o=n(9760),i=TypeError;t.exports=function(t){if(o(t))throw new i("Can't call method on "+t);return t}},6504:function(t,e,n){var o=n(4696),i=n(7776),r=o("keys");t.exports=function(t){return r[t]||(r[t]=i(t))}},3976:function(t,e,n){var o=n(7048),i=n(6420),r=n(4636),s="__core-js_shared__",a=t.exports=i[s]||r(s,{});(a.versions||(a.versions=[])).push({version:"3.36.0",mode:o?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4696:function(t,e,n){var o=n(3976);t.exports=function(t,e){return o[t]||(o[t]=e||{})}},9764:function(t,e,n){var o=n(1664),i=n(6180),r=n(5016),s=n(5436),a=o("".charAt),u=o("".charCodeAt),c=o("".slice),l=function(t){return function(e,n){var o,l,h=r(s(e)),p=i(n),d=h.length;return p<0||p>=d?t?"":void 0:(o=u(h,p))<55296||o>56319||p+1===d||(l=u(h,p+1))<56320||l>57343?t?a(h,p):o:t?c(h,p,p+2):l-56320+(o-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},772:function(t,e,n){var o=n(8504),i=n(9957),r=n(6420).String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!r(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},2495:function(t,e,n){var o=n(6180),i=Math.max,r=Math.min;t.exports=function(t,e){var n=o(t);return n<0?i(n+e,0):r(n,e)}},4096:function(t,e,n){var o=n(5712),i=n(5436);t.exports=function(t){return o(i(t))}},6180:function(t,e,n){var o=n(1748);t.exports=function(t){var e=+t;return e!=e||0===e?0:o(e)}},7584:function(t,e,n){var o=n(6180),i=Math.min;t.exports=function(t){var e=o(t);return e>0?i(e,9007199254740991):0}},4356:function(t,e,n){var o=n(5436),i=Object;t.exports=function(t){return i(o(t))}},7024:function(t,e,n){var o=n(8448),i=n(1632),r=n(7728),s=n(4504),a=n(2104),u=n(9972),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!i(t)||r(t))return t;var n,u=s(t,l);if(u){if(void 0===e&&(e="default"),n=o(u,t,e),!i(n)||r(n))return n;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},88:function(t,e,n){var o=n(7024),i=n(7728);t.exports=function(t){var e=o(t,"string");return i(e)?e:e+""}},16:function(t,e,n){var o={};o[n(9972)("toStringTag")]="z",t.exports="[object z]"===String(o)},5016:function(t,e,n){var o=n(4427),i=String;t.exports=function(t){if("Symbol"===o(t))throw new TypeError("Cannot convert a Symbol value to a string");return i(t)}},36:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},7776:function(t,e,n){var o=n(1664),i=0,r=Math.random(),s=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+r,36)}},6536:function(t,e,n){var o=n(772);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:function(t,e,n){var o=n(3476),i=n(9957);t.exports=o&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4288:function(t,e,n){var o=n(6420),i=n(4328),r=o.WeakMap;t.exports=i(r)&&/native code/.test(String(r))},9972:function(t,e,n){var o=n(6420),i=n(4696),r=n(5152),s=n(7776),a=n(772),u=n(6536),c=o.Symbol,l=i("wks"),h=u?c.for||c:c&&c.withoutSetter||s;t.exports=function(t){return r(l,t)||(l[t]=a&&r(c,t)?c[t]:h("Symbol."+t)),l[t]}},6488:function(t,e,n){var o=n(5232),i=n(5152),r=n(3440),s=n(7e3),a=n(4024),u=n(9968),c=n(584),l=n(7512),h=n(8948),p=n(3480),d=n(3696),f=n(3476),m=n(7048);t.exports=function(t,e,n,v){var g="stackTraceLimit",y=v?2:1,b=t.split("."),w=b[b.length-1],x=o.apply(null,b);if(x){var C=x.prototype;if(!m&&i(C,"cause")&&delete C.cause,!n)return x;var k=o("Error"),_=e((function(t,e){var n=h(v?e:t,void 0),o=v?new x(t):new x;return void 0!==n&&r(o,"message",n),d(o,_,o.stack,2),this&&s(C,this)&&l(o,this,_),arguments.length>y&&p(o,arguments[y]),o}));if(_.prototype=C,"Error"!==w?a?a(_,k):u(_,k,{name:!0}):f&&g in x&&(c(_,x,g),c(_,x,"prepareStackTrace")),u(_,x),!m)try{C.name!==w&&r(C,"name",w),C.constructor=_}catch(t){}return _}}},7476:function(t,e,n){var o=n(9160),i=n(9957),r=n(1432),s=n(1632),a=n(4356),u=n(3556),c=n(4316),l=n(92),h=n(2568),p=n(953),d=n(9972),f=n(8504),m=d("isConcatSpreadable"),v=f>=51||!i((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),g=function(t){if(!s(t))return!1;var e=t[m];return void 0!==e?!!e:r(t)};o({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(t){var e,n,o,i,r,s=a(this),p=h(s,0),d=0;for(e=-1,o=arguments.length;e<o;e++)if(g(r=-1===e?s:arguments[e]))for(i=u(r),c(d+i),n=0;n<i;n++,d++)n in r&&l(p,d,r[n]);else c(d+1),l(p,d++,r);return p.length=d,p}})},6932:function(t,e,n){var o=n(9160),i=n(3364).filter;o({target:"Array",proto:!0,forced:!n(953)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},700:function(t,e,n){var o=n(9160),i=n(1664),r=n(5712),s=n(4096),a=n(1496),u=i([].join);o({target:"Array",proto:!0,forced:r!==Object||!a("join",",")},{join:function(t){return u(s(this),void 0===t?",":t)}})},4456:function(t,e,n){var o=n(9160),i=n(3364).map;o({target:"Array",proto:!0,forced:!n(953)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},4728:function(t,e,n){var o=n(9160),i=n(4356),r=n(3556),s=n(6728),a=n(4316);o({target:"Array",proto:!0,arity:1,forced:n(9957)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=i(this),n=r(e),o=arguments.length;a(n+o);for(var u=0;u<o;u++)e[n]=arguments[u],n++;return s(e,n),n}})},8752:function(t,e,n){var o=n(9160),i=n(6420),r=n(908),s=n(6488),a="WebAssembly",u=i[a],c=7!==new Error("e",{cause:7}).cause,l=function(t,e){var n={};n[t]=s(t,e,c),o({global:!0,constructor:!0,arity:1,forced:c},n)},h=function(t,e){if(u&&u[t]){var n={};n[t]=s(a+"."+t,e,c),o({target:a,stat:!0,constructor:!0,arity:1,forced:c},n)}};l("Error",(function(t){return function(e){return r(t,this,arguments)}})),l("EvalError",(function(t){return function(e){return r(t,this,arguments)}})),l("RangeError",(function(t){return function(e){return r(t,this,arguments)}})),l("ReferenceError",(function(t){return function(e){return r(t,this,arguments)}})),l("SyntaxError",(function(t){return function(e){return r(t,this,arguments)}})),l("TypeError",(function(t){return function(e){return r(t,this,arguments)}})),l("URIError",(function(t){return function(e){return r(t,this,arguments)}})),h("CompileError",(function(t){return function(e){return r(t,this,arguments)}})),h("LinkError",(function(t){return function(e){return r(t,this,arguments)}})),h("RuntimeError",(function(t){return function(e){return r(t,this,arguments)}}))},508:function(t,e,n){var o=n(3476),i=n(6208).EXISTS,r=n(1664),s=n(2544),a=Function.prototype,u=r(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=r(c.exec);o&&!i&&s(a,"name",{configurable:!0,get:function(){try{return l(c,u(this))[1]}catch(t){return""}}})},232:function(t,e,n){var o=n(9160),i=n(9292);o({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},5443:function(t,e,n){var o=n(16),i=n(6076),r=n(7032);o||i(Object.prototype,"toString",r,{unsafe:!0})},880:function(t,e,n){var o=n(9160),i=n(7680);o({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9836:function(t,e,n){var o=n(8448),i=n(7176),r=n(3951),s=n(9760),a=n(7584),u=n(5016),c=n(5436),l=n(4504),h=n(4764),p=n(9092);i("match",(function(t,e,n){return[function(e){var n=c(this),i=s(e)?void 0:l(e,t);return i?o(i,e,n):new RegExp(e)[t](u(n))},function(t){var o=r(this),i=u(t),s=n(e,o,i);if(s.done)return s.value;if(!o.global)return p(o,i);var c=o.unicode;o.lastIndex=0;for(var l,d=[],f=0;null!==(l=p(o,i));){var m=u(l[0]);d[f]=m,""===m&&(o.lastIndex=h(i,a(o.lastIndex),c)),f++}return 0===f?null:d}]}))},3536:function(t,e,n){var o=n(9160),i=n(6420),r=n(6100),s=n(3951),a=n(4328),u=n(7796),c=n(2544),l=n(92),h=n(9957),p=n(5152),d=n(9972),f=n(336).IteratorPrototype,m=n(3476),v=n(7048),g="constructor",y="Iterator",b=d("toStringTag"),w=TypeError,x=i[y],C=v||!a(x)||x.prototype!==f||!h((function(){x({})})),k=function(){if(r(this,f),u(this)===f)throw new w("Abstract class Iterator not directly constructable")},_=function(t,e){m?c(f,t,{configurable:!0,get:function(){return e},set:function(e){if(s(this),this===f)throw new w("You can't redefine this property");p(this,t)?this[t]=e:l(this,t,e)}}):f[t]=e};p(f,b)||_(b,y),!C&&p(f,g)&&f[g]!==Object||_(g,k),k.prototype=f,o({global:!0,constructor:!0,forced:C},{Iterator:k})},2144:function(t,e,n){var o=n(9160),i=n(8448),r=n(8952),s=n(3951),a=n(6752),u=n(9724),c=n(8696),l=n(7048),h=u((function(){for(var t,e,n=this.iterator,o=this.predicate,r=this.next;;){if(t=s(i(r,n)),this.done=!!t.done)return;if(e=t.value,c(n,o,[e,this.counter++],!0))return e}}));o({target:"Iterator",proto:!0,real:!0,forced:l},{filter:function(t){return s(this),r(t),new h(a(this),{predicate:t})}})},9080:function(t,e,n){var o=n(9160),i=n(5792);o({target:"Iterator",proto:!0,real:!0,forced:n(7048)},{map:i})}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};return function(){n.d(o,{default:function(){return G}}),n(8752),n(6932),n(4456),n(508),n(232),n(5443),n(3536),n(2144),n(9080);var t=function(){},e={},i=[],r=[];function s(n,o){var s,a,u,c,l=r;for(c=arguments.length;c-- >2;)i.push(arguments[c]);for(o&&null!=o.children&&(i.length||i.push(o.children),delete o.children);i.length;)if((a=i.pop())&&void 0!==a.pop)for(c=a.length;c--;)i.push(a[c]);else"boolean"==typeof a&&(a=null),(u="function"!=typeof n)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(u=!1)),u&&s?l[l.length-1]+=a:l===r?l=[a]:l.push(a),s=u;var h=new t;return h.nodeName=n,h.children=l,h.attributes=null==o?void 0:o,h.key=null==o?void 0:o.key,void 0!==e.vnode&&e.vnode(h),h}function a(t,e){for(var n in e)t[n]=e[n];return t}function u(t,e){t&&("function"==typeof t?t(e):t.current=e)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,l=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function p(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(e.debounceRendering||c)(d)}function d(){for(var t;t=h.pop();)t._dirty&&A(t)}function f(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&m(t,e.nodeName):n||t._componentConstructor===e.nodeName}function m(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function v(t){var e=a({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===e[o]&&(e[o]=n[o]);return e}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,n,o,i){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)u(n,null),u(o,t);else if("class"!==e||i)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof n||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var r in n)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===l.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?n||t.addEventListener(e,b,s):t.removeEventListener(e,b,s),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!i&&e in t){try{t[e]=null==o?"":o}catch(t){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var a=i&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function b(t){return this._listeners[t.type](e.event&&e.event(t)||t)}var w=[],x=0,C=!1,k=!1;function _(){for(var t;t=w.shift();)e.afterMount&&e.afterMount(t),t.componentDidMount&&t.componentDidMount()}function S(t,e,n,o,i,r){x++||(C=null!=i&&void 0!==i.ownerSVGElement,k=null!=t&&!("__preactattr_"in t));var s=$(t,e,n,o,r);return i&&s.parentNode!==i&&i.appendChild(s),--x||(k=!1,r||_()),s}function $(t,e,n,o,i){var r=t,s=C;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||i)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),I(t,!0))),r.__preactattr_=!0,r;var a,u,c=e.nodeName;if("function"==typeof c)return function(t,e,n,o){for(var i=t&&t._component,r=i,s=t,a=i&&t._componentConstructor===e.nodeName,u=a,c=v(e);i&&!u&&(i=i._parentComponent);)u=i.constructor===e.nodeName;return i&&u&&(!o||i._component)?(T(i,c,3,n,o),t=i.base):(r&&!a&&(B(r),t=s=null),i=R(e.nodeName,c,n),t&&!i.nextBase&&(i.nextBase=t,s=null),T(i,c,1,n,o),t=i.base,s&&t!==s&&(s._component=null,I(s,!1))),t}(t,e,n,o);if(C="svg"===c||"foreignObject"!==c&&C,c=String(c),(!t||!m(t,c))&&(a=c,(u=C?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,r=u,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),I(t,!0)}var l=r.firstChild,h=r.__preactattr_,p=e.children;if(null==h){h=r.__preactattr_={};for(var d=r.attributes,b=d.length;b--;)h[d[b].name]=d[b].value}return!k&&p&&1===p.length&&"string"==typeof p[0]&&null!=l&&void 0!==l.splitText&&null==l.nextSibling?l.nodeValue!=p[0]&&(l.nodeValue=p[0]):(p&&p.length||null!=l)&&function(t,e,n,o,i){var r,s,a,u,c,l=t.childNodes,h=[],p={},d=0,m=0,v=l.length,y=0,b=e?e.length:0;if(0!==v)for(var w=0;w<v;w++){var x=l[w],C=x.__preactattr_;null!=(k=b&&C?x._component?x._component.__key:C.key:null)?(d++,p[k]=x):(C||(void 0!==x.splitText?!i||x.nodeValue.trim():i))&&(h[y++]=x)}if(0!==b)for(w=0;w<b;w++){var k;if(c=null,null!=(k=(u=e[w]).key))d&&void 0!==p[k]&&(c=p[k],p[k]=void 0,d--);else if(m<y)for(r=m;r<y;r++)if(void 0!==h[r]&&f(s=h[r],u,i)){c=s,h[r]=void 0,r===y-1&&y--,r===m&&m++;break}c=$(c,u,n,o),a=l[w],c&&c!==t&&c!==a&&(null==a?t.appendChild(c):c===a.nextSibling?g(a):t.insertBefore(c,a))}if(d)for(var w in p)void 0!==p[w]&&I(p[w],!1);for(;m<=y;)void 0!==(c=h[y--])&&I(c,!1)}(r,p,n,o,k||null!=h.dangerouslySetInnerHTML),function(t,e,n){var o;for(o in n)e&&null!=e[o]||null==n[o]||y(t,o,n[o],n[o]=void 0,C);for(o in e)"children"===o||"innerHTML"===o||o in n&&e[o]===("value"===o||"checked"===o?t[o]:n[o])||y(t,o,n[o],n[o]=e[o],C)}(r,e.attributes,h),C=s,r}function I(t,e){var n=t._component;n?B(n):(null!=t.__preactattr_&&u(t.__preactattr_.ref,null),!1!==e&&null!=t.__preactattr_||g(t),L(t))}function L(t){for(t=t.lastChild;t;){var e=t.previousSibling;I(t,!0),t=e}}var O=[];function R(t,e,n){var o,i=O.length;for(t.prototype&&t.prototype.render?(o=new t(e,n),j.call(o,e,n)):((o=new j(e,n)).constructor=t,o.render=E);i--;)if(O[i].constructor===t)return o.nextBase=O[i].nextBase,O.splice(i,1),o;return o}function E(t,e,n){return this.constructor(t,n)}function T(t,n,o,i,r){t._disable||(t._disable=!0,t.__ref=n.ref,t.__key=n.key,delete n.ref,delete n.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i)),i&&i!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=i),t.prevProps||(t.prevProps=t.props),t.props=n,t._disable=!1,0!==o&&(1!==o&&!1===e.syncComponentUpdates&&t.base?p(t):A(t,1,r)),u(t.__ref,t))}function A(t,n,o,i){if(!t._disable){var r,s,u,c=t.props,l=t.state,h=t.context,p=t.prevProps||c,d=t.prevState||l,f=t.prevContext||h,m=t.base,g=t.nextBase,y=m||g,b=t._component,C=!1,k=f;if(t.constructor.getDerivedStateFromProps&&(l=a(a({},l),t.constructor.getDerivedStateFromProps(c,l)),t.state=l),m&&(t.props=p,t.state=d,t.context=f,2!==n&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(c,l,h)?C=!0:t.componentWillUpdate&&t.componentWillUpdate(c,l,h),t.props=c,t.state=l,t.context=h),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!C){r=t.render(c,l,h),t.getChildContext&&(h=a(a({},h),t.getChildContext())),m&&t.getSnapshotBeforeUpdate&&(k=t.getSnapshotBeforeUpdate(p,d));var $,L,O=r&&r.nodeName;if("function"==typeof O){var E=v(r);(s=b)&&s.constructor===O&&E.key==s.__key?T(s,E,1,h,!1):($=s,t._component=s=R(O,E,h),s.nextBase=s.nextBase||g,s._parentComponent=t,T(s,E,0,h,!1),A(s,1,o,!0)),L=s.base}else u=y,($=b)&&(u=t._component=null),(y||1===n)&&(u&&(u._component=null),L=S(u,r,h,o||!m,y&&y.parentNode,!0));if(y&&L!==y&&s!==b){var j=y.parentNode;j&&L!==j&&(j.replaceChild(L,y),$||(y._component=null,I(y,!1)))}if($&&B($),t.base=L,L&&!i){for(var q=t,M=t;M=M._parentComponent;)(q=M).base=L;L._component=q,L._componentConstructor=q.constructor}}for(!m||o?w.push(t):C||(t.componentDidUpdate&&t.componentDidUpdate(p,d,k),e.afterUpdate&&e.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||i||_()}}function B(t){e.beforeUnmount&&e.beforeUnmount(t);var n=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var o=t._component;o?B(o):n&&(null!=n.__preactattr_&&u(n.__preactattr_.ref,null),t.nextBase=n,g(n),O.push(t),L(n)),u(t.__ref,null)}function j(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function q(t,e,n){return S(n,t,{},!1,e,!1)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},M(t,e)}a(j.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=a(a({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),p(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),A(this,2)},render:function(){}}),n(700),n(4728),n(880),n(9836),n(7476);var N=function(t){var e,n;function o(){for(var e,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,M(e,n);var i=o.prototype;return i.componentWillMount=function(){var t,e,n,o=this;this.debounceStatusUpdate=(t=function(){if(!o.state.debounced){var t=!o.props.isInFocus||o.props.validChoiceMade;o.setState((function(e){return{bump:!e.bump,debounced:!0,silenced:t}}))}},e=1400,function(){var o=this,i=arguments;clearTimeout(n),n=setTimeout((function(){n=null,t.apply(o,i)}),e)})},i.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},i.render=function(){var t=this.props,e=t.id,n=t.length,o=t.queryLength,i=t.minQueryLength,r=t.selectedOption,a=t.selectedOptionIndex,u=t.tQueryTooShort,c=t.tNoResults,l=t.tSelectedOption,h=t.tResults,p=t.className,d=this.state,f=d.bump,m=d.debounced,v=d.silenced,g=o<i,y=0===n,b=r?l(r,n,a):"",w=null;return w=g?u(i):y?c():h(n,b),this.debounceStatusUpdate(),s("div",{className:p,style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},s("div",{id:e+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!v&&m&&f?w:""),s("div",{id:e+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},v||!m||f?"":w))},o}(j);N.defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,n){return t+" "+(n+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}};var V=function(t){return s("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:t.className,focusable:"false"},s("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},s("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},F.apply(this,arguments)}function P(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}var U={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function H(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var W=function(t){var e,n;function o(e){var n;return(n=t.call(this,e)||this).elementReferences={},n.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},n.handleComponentBlur=n.handleComponentBlur.bind(P(n)),n.handleKeyDown=n.handleKeyDown.bind(P(n)),n.handleUpArrow=n.handleUpArrow.bind(P(n)),n.handleDownArrow=n.handleDownArrow.bind(P(n)),n.handleEnter=n.handleEnter.bind(P(n)),n.handlePrintableKey=n.handlePrintableKey.bind(P(n)),n.handleListMouseLeave=n.handleListMouseLeave.bind(P(n)),n.handleOptionBlur=n.handleOptionBlur.bind(P(n)),n.handleOptionClick=n.handleOptionClick.bind(P(n)),n.handleOptionFocus=n.handleOptionFocus.bind(P(n)),n.handleOptionMouseDown=n.handleOptionMouseDown.bind(P(n)),n.handleOptionMouseEnter=n.handleOptionMouseEnter.bind(P(n)),n.handleInputBlur=n.handleInputBlur.bind(P(n)),n.handleInputChange=n.handleInputChange.bind(P(n)),n.handleInputClick=n.handleInputClick.bind(P(n)),n.handleInputFocus=n.handleInputFocus.bind(P(n)),n.pollInputElement=n.pollInputElement.bind(P(n)),n.getDirectInputChanges=n.getDirectInputChanges.bind(P(n)),n}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,D(e,n);var i=o.prototype;return i.isQueryAnOption=function(t,e){var n=this;return-1!==e.map((function(t){return n.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},i.componentDidMount=function(){this.pollInputElement()},i.componentWillUnmount=function(){clearTimeout(this.$pollInput)},i.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},i.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},i.componentDidUpdate=function(t,e){var n=this.state.focused,o=null===n,i=e.focused!==n;i&&!o&&this.elementReferences[n].focus();var r=-1===n,s=i&&null===e.focused;if(r&&s){var a=this.elementReferences[n];a.setSelectionRange(0,a.value.length)}},i.hasAutoselect=function(){return!H()&&this.props.autoselect},i.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},i.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},i.handleComponentBlur=function(t){var e,n=this.state,o=n.options,i=n.query,r=n.selected;this.props.confirmOnBlur?(e=t.query||i,this.props.onConfirm(o[r])):e=i,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},i.handleListMouseLeave=function(t){this.setState({hovered:null})},i.handleOptionBlur=function(t,e){var n=this.state,o=n.focused,i=n.menuOpen,r=n.options,s=n.selected,a=null===t.relatedTarget,u=t.relatedTarget===this.elementReferences[-1],c=o!==e&&-1!==o;if(!c&&a||!c&&!u){var l=i&&H();this.handleComponentBlur({menuOpen:l,query:this.templateInputValue(r[s])})}},i.handleInputBlur=function(t){var e=this.state,n=e.focused,o=e.menuOpen,i=e.options,r=e.query,s=e.selected;if(-1===n){var a=o&&H(),u=H()?r:this.templateInputValue(i[s]);this.handleComponentBlur({menuOpen:a,query:u})}},i.handleInputChange=function(t){var e=this,n=this.props,o=n.minLength,i=n.source,r=n.showAllValues,s=this.hasAutoselect(),a=t.target.value,u=0===a.length,c=this.state.query!==a,l=a.length>=o;this.setState({query:a,ariaHint:u}),r||!u&&c&&l?i(a,(function(t){var n=t.length>0;e.setState({menuOpen:n,options:t,selected:s&&n?0:-1,validChoiceMade:!1})})):!u&&l||this.setState({menuOpen:!1,options:[]})},i.handleInputClick=function(t){this.handleInputChange(t)},i.handleInputFocus=function(t){var e=this.state,n=e.query,o=e.validChoiceMade,i=e.options,r=this.props.minLength,s=!o&&n.length>=r&&i.length>0;s?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:s||e,selected:-1}})):this.setState({focused:-1})},i.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},i.handleOptionMouseEnter=function(t,e){H()||this.setState({hovered:e})},i.handleOptionClick=function(t,e){var n=this.state.options[e],o=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},i.handleOptionMouseDown=function(t){t.preventDefault()},i.handleUpArrow=function(t){t.preventDefault();var e=this.state,n=e.menuOpen,o=e.selected;-1!==o&&n&&this.handleOptionFocus(o-1)},i.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var n=this.state,o=n.menuOpen,i=n.options,r=n.selected;r!==i.length-1&&o&&this.handleOptionFocus(r+1)}},i.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},i.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),this.state.selected>=0&&this.handleOptionClick(t,this.state.selected))},i.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},i.handleKeyDown=function(t){switch(U[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:((e=t.keyCode)>47&&e<58||32===e||8===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223)&&this.handlePrintableKey(t)}var e},i.render=function(){var t,e=this,n=this.props,o=n.cssNamespace,i=n.displayMenu,r=n.id,a=n.minLength,u=n.name,c=n.placeholder,l=n.required,h=n.showAllValues,p=n.tNoResults,d=n.tStatusQueryTooShort,f=n.tStatusNoResults,m=n.tStatusSelectedOption,v=n.tStatusResults,g=n.tAssistiveHint,y=n.dropdownArrow,b=n.menuAttributes,w=n.inputClasses,x=n.hintClasses,C=n.menuClasses,k=this.state,_=k.focused,S=k.hovered,$=k.menuOpen,I=k.options,L=k.query,O=k.selected,R=k.ariaHint,E=k.validChoiceMade,T=this.hasAutoselect(),A=-1===_,B=0===I.length,j=0!==L.length,q=L.length>=a,M=this.props.showNoOptionsFound&&A&&B&&j&&q,V=o+"__wrapper",P=o+"__status",D=o+"__dropdown-arrow-down",U=-1!==_&&null!==_,W=o+"__option",z=o+"__hint",Q=this.templateInputValue(I[O]),G=Q&&0===Q.toLowerCase().indexOf(L.toLowerCase())&&T?L+Q.substr(L.length):"",K=r+"__assistiveHint",Y={"aria-describedby":R?K:null,"aria-expanded":$?"true":"false","aria-activedescendant":U?r+"__option--"+_:null,"aria-owns":r+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"};h&&"string"==typeof(t=y({className:D}))&&(t=s("div",{className:o+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}}));var J=o+"__input",X=[J,this.props.showAllValues?J+"--show-all-values":J+"--default"];null!==_&&X.push(J+"--focused"),w&&X.push(w);var Z=o+"__menu",tt=[Z,Z+"--"+i,Z+"--"+($||M?"visible":"hidden")];C&&tt.push(C),(null!=b&&b.class||null!=b&&b.className)&&tt.push((null==b?void 0:b.class)||(null==b?void 0:b.className));var et=Object.assign({},b,{id:r+"__listbox",role:"listbox",className:tt.join(" "),onMouseLeave:this.handleListMouseLeave});return delete et.class,s("div",{className:V,onKeyDown:this.handleKeyDown},s(N,{id:r,length:I.length,queryLength:L.length,minQueryLength:a,selectedOption:this.templateInputValue(I[O]),selectedOptionIndex:O,validChoiceMade:E,isInFocus:null!==this.state.focused,tQueryTooShort:d,tNoResults:f,tSelectedOption:m,tResults:v,className:P}),G&&s("span",null,s("input",{className:[z,null===x?w:x].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:G})),s("input",F({},Y,{autoComplete:"off",className:X.join(" "),id:r,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:u,placeholder:c,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:l,value:L})),t,s("ul",et,I.map((function(t,n){var o=(-1===_?O===n:_===n)&&null===S?" "+W+"--focused":"",i=n%2?" "+W+"--odd":"",a=H()?"<span id="+r+"__option-suffix--"+n+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(n+1)+" of "+I.length+"</span>":"";return s("li",{"aria-selected":_===n?"true":"false",className:""+W+o+i,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:r+"__option--"+n,key:n,onBlur:function(t){return e.handleOptionBlur(t,n)},onClick:function(t){return e.handleOptionClick(t,n)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,n)},ref:function(t){e.elementReferences[n]=t},role:"option",tabIndex:"-1","aria-posinset":n+1,"aria-setsize":I.length})})),M&&s("li",{className:W+" "+W+"--no-results"},p())),s("span",{id:K,style:{display:"none"}},g()))},o}(j);function z(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=Q(t.source)),q(s(W,t),t.element)}W.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:V,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};var Q=function(t){return function(e,n){n(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};z.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var n=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];n&&(n.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var n=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=n.textContent||n.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),z(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var G=z}(),o.default}();class H{constructor(t){this.$input=t}init(){U.enhanceSelectElement({selectElement:this.$input.get(0)})}}const W=()=>{[[i,"dm-list"],[a,"dm-checkbox-tree"],[d,"dm-compliance-communication__attachments"],[R,"dm-cookie-banner"],[E,"dm-cookie-settings"],[A,"dm-list-input"],[B,"dm-option-select"],[F,"dm-question-with-follow-up"],[P,"dm-search-box"],[H,"dm-select-country"]].forEach((([t,e])=>{$(`[data-module="${e}"]`).each(((e,n)=>{new t($(n)).init()}))}));const t=x();t&&t.analytics&&O()};export{W as initAll};