From 7ed887fb6988b94c93ee818e6a89e65d942584ce Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Sun, 11 Aug 2024 10:28:50 +1000 Subject: [PATCH] assets --- src/web/assets/frontend/dist/js/formie.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/web/assets/frontend/dist/js/formie.js b/src/web/assets/frontend/dist/js/formie.js index 1e2bfc5e..6b2790f3 100644 --- a/src/web/assets/frontend/dist/js/formie.js +++ b/src/web/assets/frontend/dist/js/formie.js @@ -1,5 +1 @@ -<<<<<<< HEAD -!function(){"use strict";var t,e={4920:function(){!function(){var t;function e(t){var e=0;return function(){return e>>0)+"_",s=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(i+(r||"")+"_"+s++,r)}})),n("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var i="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return window.FormieTranslations&&(t=window.FormieTranslations[t]||t),t.replace(/{([a-zA-Z0-9]+)}/g,((t,r)=>e[r]?e[r]:t))},r=function(t,e){t&&e&&("string"==typeof e&&(e=e.split(" ")),e.forEach((e=>{t.classList.add(e)})))},i=function(t,e){t&&e&&("string"==typeof e&&(e=e.split(" ")),e.forEach((e=>{t.classList.remove(e)})))},s=(t,e)=>{const r=t.closest("form");return!!r&&r.querySelector(`[data-field-handle="${e}"]`)};var n={rule:t=>{let{field:e,input:r,config:i,getRule:n}=t;const o=n("match");if(!o)return!0;const a=s(e,o);if(!a)return!0;const l=a.querySelector(i.fieldsSelector);if(!l)return!0;return l.value===r.value},message:t=>{let{field:e,label:r,t:i,getRule:n}=t;const o=n("match"),a=s(e,o);return i("{name} must match {value}.",{name:r,value:a?.querySelector("[data-field-label]")?.childNodes[0].textContent?.trim()??""})}};var o={rule:t=>{let{input:e,config:r}=t;const i=e.getAttribute("pattern"),s=i?new RegExp(`^(?:${i})$`):r.patterns[e.type];return!s||!e.value||e.value.length<1||!!e.value.match(s)},message:t=>{let{input:e,label:r,t:i}=t;const s={email:i("{attribute} is not a valid email address.",{attribute:r}),url:i("{attribute} is not a valid URL.",{attribute:r}),number:i("{attribute} is not a valid number.",{attribute:r}),default:i("{attribute} is not a valid format.",{attribute:r})};return e.getAttribute(`data-pattern-${e.type}-message`)??s[e.type]??s.default}};var a={rule:t=>{let{input:e}=t;if(!e.hasAttribute("required")||"hidden"===e.type)return!0;if("checkbox"===e.type||"radio"===e.type){const t=e.form.querySelectorAll(`[name="${e.name}"]:not([type="hidden"])`);if(t.length){return Array.prototype.filter.call(t,(t=>t.checked)).length}return e.checked}return""!==e.value.trim()},message:t=>{let{input:e,label:r,t:i}=t;return e.getAttribute("data-required-message")??i("{attribute} cannot be blank.",{attribute:r})}};var l={match:n,pattern:o,required:a,minmax:{rule:t=>{let{input:e,config:r}=t;if("number"!==e.type)return!0;const i=parseFloat(e.value),s=e.hasAttribute("min")?parseFloat(e.getAttribute("min")):null,n=e.hasAttribute("max")?parseFloat(e.getAttribute("max")):null;return!(null!==s&&in)},message:t=>{let{input:e,label:r,t:i}=t;const s=e.hasAttribute("min")?parseFloat(e.getAttribute("min")):null,n=e.hasAttribute("max")?parseFloat(e.getAttribute("max")):null;return null!==s&&null!==n?`${r} must be between ${s} and ${n}.`:null!==s?`${r} must be no less than ${s}.`:null!==n?`${r} must be no greater than ${n}.`:`${r} has an invalid value.`}}};function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function h(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c=class{constructor(t,e){this.form=t,this.errors=[],this.errorIds={},this.validators={},this.boundListeners=!1,this.config=function(t){for(var e=1;e{let[e,r]=t;this.addValidator(e,r.rule,r.message)})),this.init()}init(){this.form.setAttribute("novalidate",!0),this.config.live&&this.addEventListeners(),this.emitEvent(document,"formieValidatorInitialized")}inputs(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t instanceof HTMLElement&&t.getAttribute("type")?[t]:(t||(t=this.form),t.querySelectorAll(this.config.fieldsSelector))}validate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.errors=[],this.inputs(t).forEach((t=>{let e=!1;this.isVisible(t)&&(this.removeError(t),Object.entries(this.validators).forEach((r=>{let[i,s]=r;const n=this.getValidatorCallbackOptions(t),o=s.validate(n);if(!o){if(!e){const e=this.getErrorMessage(t,i,s);this.showError(t,i,e)}this.errors.push({input:t,validator:i,result:o}),e=!0}})))})),this.config.live||this.addEventListeners()}removeAllErrors(){this.inputs().forEach((t=>{this.removeError(t)}))}removeError(t){t.removeAttribute("aria-describedby"),t.removeAttribute("aria-invalid");const e=t.closest("[data-field-handle]");if(!e)return;const r=e.querySelector("[data-field-error-messages]");r&&r.remove(),i(e,this.config.fieldContainerErrorClass),i(t,this.config.inputErrorClass),this.emitEvent(t,"formieValidatorClearError")}showError(t,e,i){const s=t.closest("[data-field-handle]");if(!s)return;let n=s.querySelector("[data-field-error-messages]");n||(n=document.createElement("div"),n.setAttribute("data-field-error-messages",""),r(n,this.config.messagesClass),s.appendChild(n));if(!s.querySelector(`[data-field-error-message-${e}]`)){const o=document.createElement("div");o.setAttribute("data-field-error-message",""),o.setAttribute(`data-field-error-message-${e}`,""),r(o,this.config.messageClass),o.textContent=i,n.appendChild(o);const a=`error-${s.getAttribute("data-field-handle")}`;this.errorIds[a]||(this.errorIds[a]=`${a}-${Math.random().toString(20).substr(2,5)}`);const l=this.errorIds[a];t.setAttribute("aria-describedby",l),t.setAttribute("aria-invalid",!0),o.setAttribute("id",l),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic",!0)}r(s,this.config.fieldContainerErrorClass),r(t,this.config.inputErrorClass),this.emitEvent(t,"formieValidatorShowError",{validatorName:e,errorMessage:i})}getValidatorCallbackOptions(t){const r=t.closest("[data-field-handle]"),i=r?.querySelector("[data-field-label]")?.childNodes[0].textContent?.trim()??"";return{t:e,input:t,label:i,field:r,config:this.config,getRule:t=>this.getRule(r,t)}}getErrorMessage(t,r,i){const s=this.getValidatorCallbackOptions(t);return("function"==typeof i.errorMessage?i.errorMessage(s):i.errorMessage)??e("{attribute} is invalid.",{attribute:s.label})}getErrors(){return this.errors}getRule(t,e){if(t){const r=t.getAttribute("data-validation");if(r){const t=this.parseValidationRules(r);if(t[e])return t[e]}}return!1}parseValidationRules(t){const e={};return t.split("|").forEach((t=>{const[r,i]=t.split(":");e[r]=void 0===i||i})),e}destroy(){this.removeEventListeners(),this.form.removeAttribute("novalidate"),this.emitEvent(document,"formieValidatorDestroyed")}isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}blurHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||"file"!==t.target.type&&"checkbox"!==t.target.type&&"radio"!==t.target.type&&this.validate(t.target)}changeHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||"file"!==t.target.type&&"checkbox"!==t.target.type&&"radio"!==t.target.type||this.validate(t.target)}inputHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||this.config.inputErrorClass.length&&!t.target.classList.contains(this.config.inputErrorClass)||"checkbox"!==t.target.type&&"radio"!==t.target.type&&this.validate(t.target)}clickHandler(t){t instanceof CustomEvent||!t.target.form||!t.target.form.isSameNode(this.form)||this.config.inputErrorClass.length&&!t.target.classList.contains(this.config.inputErrorClass)||"checkbox"!==t.target.type&&"radio"!==t.target.type&&this.validate(t.target)}addEventListeners(){this.boundListeners||(this.form.addEventListener("blur",this.blurHandler.bind(this),!0),this.form.addEventListener("change",this.changeHandler.bind(this),!1),this.form.addEventListener("input",this.inputHandler.bind(this),!1),this.form.addEventListener("click",this.clickHandler.bind(this),!1),this.boundListeners=!0)}removeEventListeners(){this.form.removeEventListener("blur",this.blurHandler,!0),this.form.removeEventListener("change",this.changeHandler,!1),this.form.removeEventListener("input",this.inputHandler,!1),this.form.removeEventListener("click",this.clickHandler,!1)}emitEvent(t,e,r){const i=new CustomEvent(e,{bubbles:!0,detail:r||{}});t.dispatchEvent(i)}addValidator(t,e,r){this.validators[t]={validate:e,errorMessage:r}}};class d{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.$form=t,this.config=e,this.settings=e.settings,this.validationOnSubmit=!!this.settings.validationOnSubmit,this.validationOnFocus=!!this.settings.validationOnFocus,this.setCurrentPage(this.settings.currentPageId),this.$form&&(this.$form.formTheme=this,this.form=this.$form.form,this.loadingClass=this.form.getClasses("loading"),this.tabErrorClass=this.form.getClasses("tabError"),this.tabActiveClass=this.form.getClasses("tabActive"),this.tabCompleteClass=this.form.getClasses("tabComplete"),this.errorMessageClass=this.form.getClasses("errorMessage"),this.successMessageClass=this.form.getClasses("successMessage"),this.tabClass=this.form.getClasses("tab"),this.initValidator(),this.hideSuccess(),this.addSubmitEventListener(),this.updateFormHash(),this.settings.enableUnloadWarning&&this.addFormUnloadEventListener(),"ajax"===this.settings.submitMethod&&this.formTabEventListener(),this.$form.dispatchEvent(new CustomEvent("onFormieThemeReady",{bubbles:!0,detail:{theme:this,addValidator:this.addValidator.bind(this)}})))}initValidator(){const t={live:this.validationOnFocus,fieldContainerErrorClass:this.form.getClasses("fieldContainerError"),inputErrorClass:this.form.getClasses("fieldInputError"),messagesClass:this.form.getClasses("fieldErrors"),messageClass:this.form.getClasses("fieldError")};this.validator=new c(this.$form,t),this.form.triggerEvent("registerFormieValidation",{validator:this.validator})}addValidator(){this.form.registerEvent("registerFormieValidation",(t=>{t.validator.addValidator(...arguments)}))}addSubmitEventListener(){this.$form.querySelectorAll('[type="submit"]').forEach((t=>{this.form.addEventListener(t,"click",(t=>{this.$submitBtn=t.target,this.originalButtonText=this.$submitBtn.textContent.trim();const e=this.$submitBtn.getAttribute("data-submit-action")||"submit";this.updateSubmitAction(e)}))})),this.form.addEventListener(this.$form,"onBeforeFormieSubmit",this.onBeforeSubmit.bind(this)),this.form.addEventListener(this.$form,"onFormieValidate",this.onValidate.bind(this)),this.form.addEventListener(this.$form,"onFormieSubmit",this.onSubmit.bind(this)),this.form.addEventListener(this.$form,"onFormieSubmitError",this.onSubmitError.bind(this))}onBeforeSubmit(t){this.beforeSubmit(),this.submitHandler=t.detail.submitHandler}onValidate(t){this.validate()||(this.onFormError(),t.detail.invalid=!0,t.preventDefault())}onSubmit(t){t.preventDefault(),"ajax"===this.settings.submitMethod?this.ajaxSubmit():((this.settings.enableBackSubmission||"back"!==this.form.submitAction)&&this.updateFormHash(),"submit"===this.form.submitAction&&this.triggerJsEvents(),this.$form.submit())}onSubmitError(t){this.onFormError()}addFormUnloadEventListener(){this.form.addEventListener(window,"beforeunload",(t=>{if(this.savedFormHash!==this.hashForm())return t.preventDefault(),t.returnValue=e("Are you sure you want to leave?")}))}formTabEventListener(){this.$form.querySelectorAll("[data-fui-page-tab-anchor]").forEach((t=>{this.form.addEventListener(t,"click",(t=>{t.preventDefault();const e=t.target.getAttribute("data-fui-page-index"),r=t.target.getAttribute("data-fui-page-id");this.togglePage({nextPageIndex:e,nextPageId:r,totalPages:this.settings.pages.length});const i=new XMLHttpRequest;i.open("GET",t.target.getAttribute("href"),!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Accept","application/json"),i.setRequestHeader("Cache-Control","no-cache"),i.send()}))}))}hashForm(){const t={},e=new FormData(this.$form),r=["g-recaptcha-response","h-captcha-response","CRAFT_CSRF_TOKEN","__JSCHK","__DUP","beesknees","cf-turnstile-response","frc-captcha-solution","submitAction"];for(const i of e.entries()){r.filter((t=>i[0].startsWith(t))).length||(t[i[0]]=i[1])}return JSON.stringify(t)}updateFormHash(){this.savedFormHash=this.hashForm()}validate(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.validationOnSubmit)return!0;if("submit"!==this.form.submitAction)return!0;let e=this.$form;this.$currentPage&&(e=this.$currentPage),this.validator.validate(e);const r=this.validator.getErrors();return r.length>0&&t&&r[0].input.focus(),0===r.length&&this.removeFormAlert(),!r.length}hideSuccess(){const t=this.$form.parentNode.querySelector("[data-fui-alert-success]");if(t&&this.settings.submitActionMessageTimeout){const e=1e3*parseInt(this.settings.submitActionMessageTimeout,10);setTimeout((()=>{t.remove()}),e)}}addLoading(){this.$submitBtn&&(this.$submitBtn.setAttribute("disabled",!0),"spinner"===this.settings.loadingIndicator&&r(this.$submitBtn,this.loadingClass),"text"===this.settings.loadingIndicator&&(this.$submitBtn.textContent=this.settings.loadingIndicatorText))}removeLoading(){this.$submitBtn&&(this.$submitBtn.removeAttribute("disabled"),"spinner"===this.settings.loadingIndicator&&i(this.$submitBtn,this.loadingClass),"text"===this.settings.loadingIndicator&&(this.$submitBtn.textContent=this.originalButtonText))}onFormError(t){t?this.showFormAlert(t,"error"):this.showFormAlert(this.settings.errorMessage,"error"),this.removeLoading()}showFormAlert(t,e){let r=this.$form.parentNode.querySelector("[data-fui-alert]");r?r.innerHTML!==this.decodeHtml(t)&&(r.innerHTML=`${r.innerHTML}
${t}`):(r=document.createElement("div"),r.innerHTML=t,this.form.applyThemeConfig(r,"alert"),"error"==e?(this.form.applyThemeConfig(r,"alertError"),"bottom-form"==this.settings.errorMessagePosition?this.$submitBtn.parentNode.parentNode.insertBefore(r,this.$submitBtn.parentNode):"top-form"==this.settings.errorMessagePosition&&this.$form.parentNode.insertBefore(r,this.$form)):(this.form.applyThemeConfig(r,"alertSuccess"),"bottom-form"==this.settings.submitActionMessagePosition?this.settings.submitActionFormHide?this.$form.parentNode.insertBefore(r,this.$form):this.$submitBtn.parentNode?this.$submitBtn.parentNode.parentNode.insertBefore(r,this.$submitBtn.parentNode):this.$form.parentNode.insertBefore(r,this.$form.nextSibling):"top-form"==this.settings.submitActionMessagePosition&&this.$form.parentNode.insertBefore(r,this.$form)))}showTabErrors(t){Object.keys(t).forEach(((t,e)=>{const i=this.$form.parentNode.querySelector(`[data-fui-page-id="${t}"]`);i&&r(i.parentNode,this.tabErrorClass)}))}decodeHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}removeFormAlert(){const t=this.$form.parentNode.querySelector("[data-fui-alert]");t&&t.remove()}removeTabErrors(){this.$form.parentNode.querySelectorAll("[data-fui-page-tab]").forEach((t=>{i(t,this.tabErrorClass)}))}beforeSubmit(){this.validator?.removeAllErrors(),this.removeFormAlert(),this.removeTabErrors(),(this.settings.enableBackSubmission||"back"!==this.form.submitAction)&&this.addLoading()}ajaxSubmit(){const t=new FormData(this.$form),r=this.$form.getAttribute("method"),i=this.$form.getAttribute("action"),s=new XMLHttpRequest;s.open(r||"POST",i||window.location.href,!0),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Accept","application/json"),s.setRequestHeader("Cache-Control","no-cache"),s.timeout=1e3*(this.settings.ajaxTimeout||10),this.beforeSubmit(),s.ontimeout=()=>{this.onAjaxError(e("The request timed out."))},s.onerror=t=>{this.onAjaxError(e("The request encountered a network error. Please try again."))},s.onload=()=>{if(s.status>=200&&s.status<300)try{const t=JSON.parse(s.responseText);t.errors?this.onAjaxError(t.errorMessage,t):this.onAjaxSuccess(t)}catch(t){this.onAjaxError(e("Unable to parse response `{e}`.",{e:t}))}else this.onAjaxError(`${s.status}: ${s.statusText}`)},s.send(t)}afterAjaxSubmit(t){this.updateSubmitAction("submit"),this.updateSubmissionInput(t),t.events&&Array.isArray(t.events)&&t.events.length&&(this.removeFormAlert(),t.events.forEach((t=>{this.$form.dispatchEvent(new CustomEvent(t.event,{bubbles:!0,detail:{data:t.data}}))})))}onAjaxError(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.errors||{},i=e.pageFieldErrors||{};this.onFormError(t),this.showTabErrors(i),this.submitHandler.formSubmitError(e),this.afterAjaxSubmit(e),Object.keys(r).forEach(((t,e)=>{const[i]=r[t];let s=t.split(".");s=s.join("][");let n=this.$form.querySelector(`[name="fields[${s}]"]`);if(n||(n=this.$form.querySelector(`[name="fields[${s}][]"]`)),!n&&t.includes("[")){const e=t.match(/\[(.*?)\]/)[1]||null;let r=`fields[${t.replace(/\./g,"][").replace("]]","]").replace(/\[.*?\]/,"][rows][.*][fields]")}]`;r=r.replace(/\[/g,"\\[").replace(/\]/g,"\\]");const i=this.querySelectorAllRegex(new RegExp(r),"name");i.length&&i[e]&&(n=i[e])}n&&(i&&this.validator?.showError(n,"server",i),0===e&&n.focus())})),this.togglePage(e,!1)}onAjaxSuccess(t){if(this.submitHandler.formAfterSubmit(t),this.afterAjaxSubmit(t),this.updateFormHash(),"submit"===this.form.submitAction&&this.triggerJsEvents(),t.nextPageId)return this.removeLoading(),void this.togglePage(t);if(t.redirectCallback)t.redirectCallback();else if(t.redirectUrl)"new-tab"===this.settings.submitActionTab?(this.resetForm(),t.redirectTarget.open(t.redirectUrl,"_blank")):t.redirectTarget.location.href=t.redirectUrl;else{if(this.removeLoading(),t.totalPages>1)if("top-form"==this.settings.submitActionMessagePosition)this.togglePage({nextPageIndex:0,nextPageId:this.settings.pages[0].id,totalPages:this.settings.pages.length});else{this.$submitBtn&&this.$submitBtn.remove();this.$form.querySelectorAll('[data-submit-action="back"]').forEach((t=>{t.remove()}))}if("message"===this.settings.submitAction){const e=t.submitActionMessage||this.settings.submitActionMessage;this.showFormAlert(e,"success"),this.hideSuccess(),this.settings.submitActionFormHide&&(this.$form.style.display="none"),this.settings.scrollToTop&&this.scrollToForm()}this.resetForm(),this.removeHiddenInput("submissionId"),this.updateFormHash()}}updateSubmitAction(t){t||(t="submit"),this.form.submitAction=t,this.updateOrCreateHiddenInput("submitAction",t)}updateSubmissionInput(t){t.submissionId&&t.nextPageId&&this.updateOrCreateHiddenInput("submissionId",t.submissionId)}updateOrCreateHiddenInput(t,e){let r=this.$form.querySelector(`[name="${t}"][type="hidden"]`);r||(r=document.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",t),this.$form.appendChild(r)),r.setAttribute("value",e)}resetForm(){this.$form.reset(),this.$form.querySelectorAll('[type="checkbox"]').forEach((t=>{t.removeAttribute("checked")}))}removeHiddenInput(t){const e=this.$form.querySelector(`[name="${t}"][type="hidden"]`);e&&e.parentNode.removeChild(e)}togglePage(t){this.$form.dispatchEvent(new CustomEvent("onFormiePageToggle",{bubbles:!0,detail:{data:t}}));const e=this.$form.querySelectorAll("[data-fui-page]");t.nextPageId&&e.forEach((e=>{e.id===`${this.getPageId(t.nextPageId)}`?e.removeAttribute("data-fui-page-hidden"):e.setAttribute("data-fui-page-hidden",!0)}));const s=this.$form.querySelector("[data-fui-progress-bar]");if(s&&t.nextPageIndex>=0){const e=parseInt(t.nextPageIndex,10)+1,r=Math.round(e/t.totalPages*100);s.style.width=`${r}%`,s.setAttribute("aria-valuenow",r),s.textContent=`${r}%`}const n=this.$form.querySelectorAll("[data-fui-page-tab]");if(t.nextPageId){n.forEach((e=>{e.id===`${this.tabClass}-${t.nextPageId}`?r(e,this.tabActiveClass):i(e,this.tabActiveClass)}));let e=!0;n.forEach((t=>{t.classList.contains(this.tabActiveClass)&&(e=!1),e?r(t,this.tabCompleteClass):i(t,this.tabCompleteClass)})),this.setCurrentPage(t.nextPageId)}this.settings.scrollToTop&&this.scrollToForm()}setCurrentPage(t){this.settings.currentPageId=t,this.$currentPage=this.$form.querySelector(`#${this.getPageId(t)}`)}getCurrentPage(){return this.settings.pages.find((t=>t.id==this.settings.currentPageId))}getCurrentPageIndex(){const t=this.getCurrentPage();return t?this.settings.pages.indexOf(t):0}getPageId(t){return`${this.config.formHashId}-p-${t}`}scrollToForm(){const t=parseInt(getComputedStyle(document.documentElement).scrollPaddingTop)||0,e=parseInt(getComputedStyle(document.documentElement).scrollMarginTop)||0;window.scrollTo({top:this.$form.parentNode.getBoundingClientRect().top+window.pageYOffset-100-t-e,behavior:"smooth"})}triggerJsEvents(){const t=this.getCurrentPage();if(t&&t.settings.enableJsEvents){const e={};t.settings.jsGtmEventOptions.forEach((t=>{e[t.label]=t.value})),window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)}}querySelectorAllRegex(t,e){const r=[];for(const i of this.$form.querySelectorAll(`[${e}]`))t.test(i.getAttribute(e))&&r.push(i);return r}}class f{constructor(){this.listeners=new Map,this.dispatchedEvents=new Map}addEventListener(t,e){if(this.listeners.has(t)||this.listeners.set(t,[]),this.listeners.get(t).push(e),this.dispatchedEvents.has(t)){e(this.dispatchedEvents.get(t))}}removeEventListener(t,e){if(!this.listeners.has(t))return;const r=this.listeners.get(t).indexOf(e);-1!==r&&this.listeners.get(t).splice(r,1)}dispatchEvent(t,e){if(!this.listeners.has(t))return void this.dispatchedEvents.set(t,e);this.listeners.get(t).forEach((t=>{t(e)}))}}class m{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.$form=t,this.config=e,this.settings=e.settings,this.listeners={},this.eventDispatcher=new f,this.$form&&(this.$form.form=this,this.settings.outputJsTheme&&(this.formTheme=new d(this.$form,this.config)),this.registerFieldEvents(this.$form),this.$form.dispatchEvent(new CustomEvent("onFormieReady",{bubbles:!0,detail:{form:this}})),this.addEventListener(this.$form,"submit",(t=>{t.preventDefault();const e=this.eventObject("onBeforeFormieSubmit",{submitHandler:this});this.$form.dispatchEvent(e)&&setTimeout((()=>{this.validate()&&this.afterValidate()&&this.validateCaptchas()&&this.validatePayment()&&this.submitForm()}),300)}),!1))}validate(){const t=this.eventObject("onFormieValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}afterValidate(){const t=this.eventObject("onAfterFormieValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}validateCaptchas(){const t=this.eventObject("onFormieCaptchaValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}validatePayment(){const t=this.eventObject("onFormiePaymentValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}submitForm(){const t=this.eventObject("onFormieSubmit",{submitHandler:this});this.$form.dispatchEvent(t)&&("ajax"===this.settings.submitMethod?this.formAfterSubmit():this.$form.submit())}formAfterSubmit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.redirectTarget=t.redirectTarget||window,this.$form.dispatchEvent(new CustomEvent("onAfterFormieSubmit",{bubbles:!0,detail:t})),t.nextPageId||this.config.Formie.refreshFormTokens(this)}formSubmitError(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieSubmitError",{bubbles:!0,detail:t}))}formDestroy(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieDestroy",{bubbles:!0,detail:t}))}registerFieldEvents(t){t.querySelectorAll("[data-field-type]").forEach((t=>{const e=t.querySelector("input, select");e&&(this.addEventListener(e,"input",(e=>{t.dispatchEvent(new CustomEvent("input",{bubbles:!1,detail:{input:e.target}}))})),this.addEventListener(e,"focus",(e=>{t.dispatchEvent(new CustomEvent("focus",{bubbles:!1,detail:{input:e.target}}))})),this.addEventListener(e,"blur",(e=>{t.dispatchEvent(new CustomEvent("blur",{bubbles:!1,detail:{input:e.target}}))})),t.dispatchEvent(new CustomEvent("init",{bubbles:!1,detail:{input:e}})))}))}addEventListener(t,e,r){if(!this.destroyed){this.listeners[e]={element:t,func:r};const i=e.split(".")[0];t.addEventListener(i,this.listeners[e].func)}}removeEventListener(t){const e=this.listeners[t]||{};if(e&&e.element&&e.func){const r=t.split(".")[0];e.element.removeEventListener(r,e.func),delete this.listeners[t]}}eventObject(t,e){return new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e})}getThemeConfigAttributes(t){return(this.settings.themeConfig||{})[t]||{}}getClasses(t){return this.getThemeConfigAttributes(t).class||[]}applyThemeConfig(t,e){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=this.getThemeConfigAttributes(e);i&&Object.entries(i).forEach((e=>{let[i,s]=e;("class"!==i||r)&&(!0===s?t.setAttribute(i,""):t.setAttribute(i,s))}))}registerEvent(t,e){this.eventDispatcher.addEventListener(t,e)}triggerEvent(t,e){this.eventDispatcher.dispatchEvent(t,e)}}function g(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function p(t){for(var e=1;e0&&void 0!==arguments[0])||arguments[0];this.$forms=document.querySelectorAll("form[data-fui-form]")||[],this.$forms.length||(this.$forms=document.querySelectorAll("div[data-fui-form]")||[]),this.$forms.forEach((e=>{if(t){const t=new IntersectionObserver((r=>{0!==r[0].intersectionRatio&&(this.initForm(e),t.disconnect())}));t.observe(e)}else this.initForm(e)})),document.dispatchEvent(new CustomEvent("onFormieLoaded",{bubbles:!0,detail:{formie:this}}))}async initForm(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(r)&&(r=JSON.parse(e.getAttribute("data-fui-form"))),t(r))return void console.error("Unable to parse `data-fui-form` form attribute for config. Ensure this attribute exists on your form and contains valid JSON.");const i=this.getFormByHashId(r.formHashId);i&&await this.destroyForm(i);const s=r.registeredJs||[];r.Formie=this;const n=new m(e,r);if(this.forms.push(n),n.fieldConfigs=this.parseFieldConfig(e,e),s.length){if(document.querySelector(`[data-fui-scripts="${r.formHashId}"]`))return void console.warn(`Formie scripts already loaded for form #${r.formHashId}.`);n.$registeredJs=document.createElement("div"),n.$registeredJs.setAttribute("data-fui-scripts",r.formHashId),document.body.appendChild(n.$registeredJs),s.forEach((t=>{const r=document.createElement("script");t.src&&(r.src=t.src,r.defer=!0,r.onload=()=>{if(t.module){const r=n.fieldConfigs[t.module];r&&Array.isArray(r)&&r.length&&r.forEach((e=>{this.initJsClass(t.module,e)})),t.settings&&this.initJsClass(t.module,p({$form:e},t.settings)),"FormieConditions"===t.module&&this.initJsClass(t.module,{$form:e})}}),n.$registeredJs.appendChild(r)}))}document.dispatchEvent(new CustomEvent("onFormieInit",{bubbles:!0,detail:{formie:this,form:n,$form:e,formId:n.config.formHashId}}))}initJsClass(t,e){const r=window[t];r&&new r(e)}parseFieldConfig(t,e){const r={};return t.querySelectorAll("[data-field-config]").forEach((t=>{let i=JSON.parse(t.getAttribute("data-field-config"));Array.isArray(i)||(i=[i]),i.forEach((i=>{r[i.module]||(r[i.module]=[]),r[i.module].push(p({$form:e,$field:t},i))}))})),r}getForm(t){return this.forms.find((e=>e.$form==t))}getFormById(t){return this.forms.find((e=>{if(e.config)return e.config.formId==t}))}getFormByHashId(t){return this.forms.find((e=>{if(e.config)return e.config.formHashId==t}))}getFormByHandle(t){return this.forms.find((e=>{if(e.config)return e.config.formHandle==t}))}async destroyForm(e){let r;if(e instanceof m?r=e.$form:(r=e,e=this.getForm(r)),!e||!r)return;const i=this.forms.indexOf(e);-1!==i&&(e.destroyed=!0,e.$registeredJs&&e.$registeredJs.parentNode&&e.$registeredJs.parentNode.removeChild(e.$registeredJs),e.formDestroy({form:e}),t(e.listeners)||Object.keys(e.listeners).forEach((t=>{e.removeEventListener(t)})),e.formTheme&&e.formTheme.validator&&e.formTheme.validator.destroy(),this.forms.splice(i,1))}refreshForCache(t,e){const r=this.getFormByHashId(t);r?this.refreshFormTokens(r,e):console.error(`Unable to find form "${t}".`)}refreshFormTokens(t,e){const{formHashId:r,formHandle:i}=t.config;fetch(`/actions/formie/forms/refresh-tokens?form=${i}`).then((t=>t.json())).then((i=>{const{$form:s}=t;if(i.csrf.param){const t=s.querySelector(`input[name="${i.csrf.param}"]`);t?(t.value=i.csrf.token,console.log(`${r}: Refreshed CSRF input %o.`,i.csrf)):console.error(`${r}: Unable to locate CSRF input for "${i.csrf.param}".`)}else console.error(`${r}: Missing CSRF token information in cache-refresh response.`);i.captchas&&Object.entries(i.captchas).forEach((t=>{let[e,i]=t;var n,o;(n=`input[name="${i.sessionKey}"]`,o=s,o=o||document,new Promise((t=>{if(o.querySelector(n))return t(o.querySelector(n));const e=new MutationObserver((r=>{o.querySelector(n)&&(e.disconnect(),t(o.querySelector(n)))}));e.observe(o,{childList:!0,subtree:!0})}))).then((t=>{i.value&&(t.value=i.value,console.log(`${r}: Refreshed "${e}" captcha input %o.`,i))})),setTimeout((()=>{s.querySelector(`input[name="${i.sessionKey}"]`)||console.error(`${r}: Unable to locate captcha input for "${e}".`)}),1e4)})),t.formTheme&&t.formTheme.updateFormHash(),e&&e(i)}))}}window.Formie=v,window.Formie=new v;const y=document.currentScript,E=!y?.hasAttribute("data-manual-init"),x=!y?.hasAttribute("data-bypass-observer");E&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(t=>{window.Formie.initForms(x)})):window.Formie.initForms(x))},207:function(){},6921:function(){},9303:function(){},5745:function(){},1425:function(){},8910:function(){},880:function(){}},r={};function i(t){var s=r[t];if(void 0!==s)return s.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,i),n.exports}i.m=e,t=[],i.O=function(e,r,s,n){if(!r){var o=1/0;for(h=0;h=n)&&Object.keys(i.O).every((function(t){return i.O[t](r[l])}))?r.splice(l--,1):(a=!1,n0&&t[h-1][2]>n;h--)t[h]=t[h-1];t[h]=[r,s,n]},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){var t={31:0,119:0,815:0,555:0,644:0,907:0,997:0,634:0};i.O.j=function(e){return 0===t[e]};var e=function(e,r){var s,n,o=r[0],a=r[1],l=r[2],u=0;if(o.some((function(e){return 0!==t[e]}))){for(s in a)i.o(a,s)&&(i.m[s]=a[s]);if(l)var h=l(i)}for(e&&e(r);u>>0)+"_",o=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+o++,r)}})),i("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return window.FormieTranslations&&(t=window.FormieTranslations[t]||t),t.replace(/{([a-zA-Z0-9]+)}/g,(function(t,r){return e[r]?e[r]:t}))},u=(r(7807),r(200),r(217),r(284),r(6025),r(9470),r(1237),r(222),function(t,e){var r,n={fieldClass:"error",errorClass:"error-message",fieldPrefix:"bouncer-field_",errorPrefix:"bouncer-error_",patterns:{email:/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$/,url:/^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*(?:\.(?:[a-zA-Z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,number:/^(?:[-+]?[0-9]*[.,]?[0-9]+)$/,color:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,date:/(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/,time:/^(?:(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]))$/,month:/^(?:(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])))$/},customValidations:{},messageAfterField:!0,messageCustom:"data-bouncer-message",messageTarget:"data-bouncer-target",disableSubmit:!1,validateOnBlur:!0,validateOnSubmit:!0,emitEvents:!0},o=function(t,e){Array.prototype.forEach.call(t,e)},i=function t(){var e={};return o(arguments,(function(r){for(var n in r){if(!r.hasOwnProperty(n))return;"[object Object]"===Object.prototype.toString.call(r[n])?e[n]=t(e[n],r[n]):e[n]=r[n]}})),e},a=function(t,e,r){if("function"==typeof window.CustomEvent){var n=new CustomEvent(e,{bubbles:!0,detail:r||{}});t.dispatchEvent(n)}},u=function(t){if(!t.hasAttribute("required"))return!1;if("checkbox"===t.type){var e=t.form.querySelectorAll('[name="'+d(t.name)+'"]:not([type="hidden"])');return e.length?!Array.prototype.filter.call(e,(function(t){return t.checked})).length:!t.checked}if("hidden"===t.type)return!1;var r=t.value.length;return"radio"===t.type&&(r=Array.prototype.filter.call(t.form.querySelectorAll('[name="'+d(t.name)+'"]'),(function(t){return t.checked})).length),r<1},s=function(t,e){var r=t.getAttribute("pattern");return!(!(r=r?new RegExp("^(?:"+r+")$"):e.patterns[t.type])||!t.value||t.value.length<1)&&!t.value.match(r)},c=function(t){if(!t.value||t.value.length<1)return!1;var e=t.getAttribute("max"),r=t.getAttribute("min"),n=parseFloat(t.value);return e&&n>e?"over":!!(r&&ne?"over":!!(r&&n=1&&e<=31||127==e||0===o&&e>=48&&e<=57||1===o&&e>=48&&e<=57&&45===a?i+="\\"+e.toString(16)+" ":i+=e>=128||45===e||95===e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?r.charAt(o):"\\"+r.charAt(o)}return i},v=function(t,e,r){var n=t.name?t.name:t.id;return!n&&r&&(n=e.fieldPrefix+Math.floor(999*Math.random()),t.id=n),n},p=function(t,e){var r=document.createElement("div");r.className=e.errorClass,r.setAttribute("data-error-message",""),r.id=e.errorPrefix+v(t,e,!0),r.setAttribute("aria-live","polite"),r.setAttribute("aria-atomic",!0);var n=function(t){if("radio"===t.type&&t.name){var e=t.form.querySelectorAll('[name="'+d(t.name)+'"]');t=e[e.length-1]}return"checkbox"!==t.type&&"radio"!==t.type||(t=t.closest("[data-field-handle]").firstChild),t}(t),o=function(t,e,r){var n=t.getAttribute(r.messageTarget);if(n){var o=t.form.querySelector(n);if(o)return o.firstChild||o.appendChild(document.createTextNode(""))}return r.messageAfterField?(e||(e=t),e.nextSibling||e.parentNode.appendChild(document.createTextNode("")),e.nextSibling):e}(t,n,e);return o.parentNode.insertBefore(r,o),r},m=function(t,e,r){t.classList.add(r.fieldClass),t.setAttribute("aria-describedby",e.id),t.setAttribute("aria-invalid",!0);var n=t.closest("[data-field-handle]");n&&n.classList.add(r.fieldClass)},g=function(t,e,r){var n=t.form.querySelector("#"+d(r.errorPrefix+v(t,r)))||p(t,r),o=function(t,e,r){var n=r.messages;if(e.missingValue)return n.missingValue[t.type]||n.missingValue.default;if(e.outOfRange)return n.outOfRange[e.outOfRange].replace("{max}",t.getAttribute("max")).replace("{min}",t.getAttribute("min")).replace("{length}",t.value.length);if(e.wrongLength)return n.wrongLength[e.wrongLength].replace("{maxLength}",t.getAttribute("maxlength")).replace("{minLength}",t.getAttribute("minlength")).replace("{length}",t.value.length);if(e.patternMismatch){return t.getAttribute(r.messageCustom)||n.patternMismatch[t.type]||n.patternMismatch.default}for(var o in r.customValidations)if(r.customValidations.hasOwnProperty(o)&&e[o]&&n[o])return n[o];return e.customMessage?e.customMessage:n.fallback}(t,e,r);n.textContent="function"==typeof o?o(t,r):o,function(t,e,r){"radio"===t.type&&t.name&&Array.prototype.forEach.call(document.querySelectorAll('[name="'+t.name+'"]'),(function(t){m(t,e,r)})),m(t,e,r)}(t,n,r),r.emitEvents&&a(t,"bouncerShowError",{errors:e})},y=function(t,e){t.classList.remove(e.fieldClass),t.removeAttribute("aria-describedby"),t.removeAttribute("aria-invalid");var r=t.closest("[data-field-handle]");r&&r.classList.remove(e.fieldClass)},b=function(t,e){var r=t.form.querySelector("#"+d(e.errorPrefix+v(t,e)));r&&(r.parentNode.removeChild(r),function(t,e){"radio"===t.type&&t.name?Array.prototype.forEach.call(document.querySelectorAll('[name="'+t.name+'"]'),(function(t){y(t,e)})):y(t,e)}(t,e),e.emitEvents&&a(t,"bouncerRemoveError"))},x={};x.showError=function(t,e,n){var o=i(r,n||{});return g(t,e,o)},x.removeError=function(t,e){var n=i(r,e||{});return b(t,n)},x.validate=function(t,e){if(!t.disabled&&!t.readOnly&&"reset"!==t.type&&"submit"!==t.type&&"button"!==t.type){var n=i(r,e||{}),o=h(t,n);if(!o.valid)return g(t,o.errors,n),o;b(t,n)}},x.validateAll=function(t){return Array.prototype.filter.call(t.querySelectorAll("input, select, textarea"),(function(t){var e=x.validate(t);return e&&!e.valid}))};var w=function(e){e.target.form&&e.target.form.isSameNode(t)&&"file"!==e.target.type&&"checkbox"!==e.target.type&&"radio"!==e.target.type&&x.validate(e.target)},S=function(e){e.target.form&&e.target.form.isSameNode(t)&&("file"!==e.target.type&&"checkbox"!==e.target.type&&"radio"!==e.target.type||x.validate(e.target))},E=function(e){e.target.form&&e.target.form.isSameNode(t)&&e.target.classList.contains(r.fieldClass)&&"checkbox"!==e.target.type&&"radio"!==e.target.type&&x.validate(e.target)},A=function(e){e.target.form&&e.target.form.isSameNode(t)&&e.target.classList.contains(r.fieldClass)&&"checkbox"!==e.target.type&&"radio"!==e.target.type&&x.validate(e.target)},O=function(e){if(e.target.isSameNode(t)){e.preventDefault();var n=x.validateAll(e.target);if(n.length>0)return n[0].focus(),void a(e.target,"bouncerFormInvalid",{errors:n});r.disableSubmit||e.target.submit(),r.emitEvents&&a(e.target,"bouncerFormValid")}};x.destroy=function(){r.validateOnBlur&&(document.removeEventListener("blur",w,!0),document.removeEventListener("input",E,!1),document.removeEventListener("change",S,!1),document.removeEventListener("click",A,!1)),r.validateOnSubmit&&document.removeEventListener("submit",O,!1),function(t,e){o(t.querySelectorAll("input, select, textarea"),(function(t){b(t,e)}))}(t,r),t.removeAttribute("novalidate"),r.emitEvents&&a(document,"bouncerDestroyed",{settings:r}),r=null};return r=i(n,e||{}),t.setAttribute("novalidate",!0),r.validateOnBlur&&(document.addEventListener("blur",w,!0),document.addEventListener("input",E,!1),document.addEventListener("change",S,!1),document.addEventListener("click",A,!1)),r.validateOnSubmit&&document.addEventListener("submit",O,!1),r.emitEvents&&a(document,"bouncerInitialized",{settings:r}),x});function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(t,e)||f(t,e)||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.")}()}function c(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function f(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};h(this,t),this.$form=e,this.config=r,this.settings=r.settings,this.validationOnSubmit=!!this.settings.validationOnSubmit,this.validationOnFocus=!!this.settings.validationOnFocus,this.setCurrentPage(this.settings.currentPageId),this.$form&&(this.$form.formTheme=this,this.form=this.$form.form,this.loadingClass=this.form.getClasses("loading"),this.tabErrorClass=this.form.getClasses("tabError"),this.tabActiveClass=this.form.getClasses("tabActive"),this.tabCompleteClass=this.form.getClasses("tabComplete"),this.errorMessageClass=this.form.getClasses("errorMessage"),this.successMessageClass=this.form.getClasses("successMessage"),this.alertClass=this.form.getClasses("alert"),this.alertErrorClass=this.form.getClasses("alertError"),this.alertSuccessClass=this.form.getClasses("alertSuccess"),this.tabClass=this.form.getClasses("tab"),this.initValidator(),this.hideSuccess(),this.addSubmitEventListener(),this.updateFormHash(),this.settings.enableUnloadWarning&&this.addFormUnloadEventListener(),"ajax"===this.settings.submitMethod&&this.formTabEventListener())}var e,r,n;return e=t,r=[{key:"initValidator",value:function(){var t=this,e={fieldClass:"fui-error",errorClass:this.form.getClasses("fieldError"),fieldPrefix:"fui-field-",errorPrefix:"fui-error-",messageAfterField:!0,messageCustom:"data-fui-message",messageTarget:"data-fui-target",validateOnBlur:this.validationOnFocus,validateOnSubmit:!1,disableSubmit:!1,customValidations:{},messages:{missingValue:{checkbox:a("This field is required."),radio:a("Please select a value."),select:a("Please select a value."),"select-multiple":a("Please select at least one value."),default:a("Please fill out this field.")},patternMismatch:{email:a("Please enter a valid email address."),url:a("Please enter a URL."),number:a("Please enter a number"),color:a("Please match the following format: #rrggbb"),date:a("Please use the YYYY-MM-DD format"),time:a("Please use the 24-hour time format. Ex. 23:00"),month:a("Please use the YYYY-MM format"),default:a("Please match the requested format.")},outOfRange:{over:a("Please select a value that is no more than {max}."),under:a("Please select a value that is no less than {min}.")},wrongLength:{over:a("Please shorten this text to no more than {maxLength} characters. You are currently using {length} characters."),under:a("Please lengthen this text to {minLength} characters or more. You are currently using {length} characters.")},fallback:a("There was an error with this field.")}},r=new CustomEvent("registerFormieValidation",{bubbles:!0,detail:{validatorSettings:e}});setTimeout((function(){t.$form.dispatchEvent(r),t.validator=new u(t.$form,r.detail.validatorSettings)}),500),this.form.addEventListener(this.$form,"bouncerRemoveError",(function(e){t.submitDebounce||t.validationOnFocus||t.validate(!1)})),this.form.addEventListener(this.$form,"bouncerShowError",(function(t){var e=null,r=t.target,n=r.closest("[data-field-type]"),o=r.parentNode.querySelector("[data-error-message]");if(o&&o.parentNode.parentNode&&o.parentNode.parentNode.appendChild(o),t.detail&&t.detail.errors&&(t.detail.errors.missingValue||t.detail.errors.serverMessage)){var i=r.parentNode.querySelector("[data-fui-message]");if(i&&(e=i.getAttribute("data-fui-message")),t.detail.errors.serverMessage&&(e=t.detail.errors.serverMessage),n){var a=n.querySelector("[data-error-message]");a&&e&&(a.textContent=e)}}}),!1)}},{key:"addSubmitEventListener",value:function(){var t=this;this.$form.querySelectorAll('[type="submit"]').forEach((function(e){t.form.addEventListener(e,"click",(function(e){t.$submitBtn=e.target,t.originalButtonText=t.$submitBtn.textContent.trim();var r=t.$submitBtn.getAttribute("data-submit-action")||"submit";t.updateSubmitAction(r)}))})),this.form.addEventListener(this.$form,"onBeforeFormieSubmit",this.onBeforeSubmit.bind(this)),this.form.addEventListener(this.$form,"onFormieValidate",this.onValidate.bind(this)),this.form.addEventListener(this.$form,"onFormieSubmit",this.onSubmit.bind(this)),this.form.addEventListener(this.$form,"onFormieSubmitError",this.onSubmitError.bind(this))}},{key:"onBeforeSubmit",value:function(t){this.beforeSubmit(),this.submitHandler=t.detail.submitHandler}},{key:"onValidate",value:function(t){this.validate()||(this.onFormError(),t.detail.invalid=!0,t.preventDefault())}},{key:"onSubmit",value:function(t){t.preventDefault(),"ajax"===this.settings.submitMethod?this.ajaxSubmit():((this.settings.enableBackSubmission||"back"!==this.form.submitAction)&&this.updateFormHash(),"submit"===this.form.submitAction&&this.triggerJsEvents(),this.$form.submit())}},{key:"onSubmitError",value:function(t){this.onFormError()}},{key:"addFormUnloadEventListener",value:function(){var t=this;this.form.addEventListener(window,"beforeunload",(function(e){if(t.savedFormHash!==t.hashForm())return e.preventDefault(),e.returnValue=a("Are you sure you want to leave?")}))}},{key:"formTabEventListener",value:function(){var t=this;this.$form.querySelectorAll("[data-fui-page-tab-anchor]").forEach((function(e){t.form.addEventListener(e,"click",(function(e){e.preventDefault();var r=e.target.getAttribute("data-fui-page-index"),n=e.target.getAttribute("data-fui-page-id");t.togglePage({nextPageIndex:r,nextPageId:n,totalPages:t.settings.pages.length});var o=new XMLHttpRequest;o.open("GET",e.target.getAttribute("href"),!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Cache-Control","no-cache"),o.send()}))}))}},{key:"hashForm",value:function(){var t,e={},r=new FormData(this.$form),n=["g-recaptcha-response","h-captcha-response","CRAFT_CSRF_TOKEN","__JSCHK","__DUP","beesknees","cf-turnstile-response","frc-captcha-solution","submitAction"],o=c(r.entries());try{var i=function(){var r=t.value;n.filter((function(t){return r[0].startsWith(t)})).length||(e[r[0]]=r[1])};for(o.s();!(t=o.n()).done;)i()}catch(t){o.e(t)}finally{o.f()}return JSON.stringify(e)}},{key:"updateFormHash",value:function(){this.savedFormHash=this.hashForm()}},{key:"validate",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.validationOnSubmit)return!0;if("submit"!==this.form.submitAction)return!0;var r=this.$form;this.$currentPage&&(r=this.$currentPage);var n=this.validator.validateAll(r);return n.length>0&&e&&n[0].focus(),0===n.length&&this.removeFormAlert(),this.submitDebounce=!0,setTimeout((function(){t.submitDebounce=!1}),500),!n.length}},{key:"hideSuccess",value:function(){var t=this.$form.parentNode.querySelector(".".concat(this.successMessageClass));if(t&&this.settings.submitActionMessageTimeout){var e=1e3*parseInt(this.settings.submitActionMessageTimeout,10);setTimeout((function(){t.remove()}),e)}}},{key:"addLoading",value:function(){this.$submitBtn&&(this.$submitBtn.setAttribute("disabled",!0),"spinner"===this.settings.loadingIndicator&&this.$submitBtn.classList.add(this.loadingClass),"text"===this.settings.loadingIndicator&&(this.$submitBtn.textContent=this.settings.loadingIndicatorText))}},{key:"removeLoading",value:function(){this.$submitBtn&&(this.$submitBtn.removeAttribute("disabled"),"spinner"===this.settings.loadingIndicator&&this.$submitBtn.classList.remove(this.loadingClass),"text"===this.settings.loadingIndicator&&(this.$submitBtn.textContent=this.originalButtonText))}},{key:"onFormError",value:function(t){t?this.showFormAlert(t,"error"):this.showFormAlert(this.settings.errorMessage,"error"),this.removeLoading()}},{key:"showFormAlert",value:function(t,e){var r=this.$form.parentNode.querySelector("[data-fui-alert]");r?r.innerHTML!==this.decodeHtml(t)&&(r.innerHTML="".concat(r.innerHTML,"
").concat(t)):((r=document.createElement("div")).className=this.alertClass,r.setAttribute("role","alert"),r.setAttribute("data-fui-alert","true"),r.innerHTML=t,this.form.applyThemeConfig(r,"alert",!1),"error"==e?(this.form.applyThemeConfig(r,"alertError",!1),r.className+=" ".concat(this.alertErrorClass," ").concat(this.alertClass,"-").concat(this.settings.errorMessagePosition),"bottom-form"==this.settings.errorMessagePosition?this.$submitBtn.parentNode.parentNode.insertBefore(r,this.$submitBtn.parentNode):"top-form"==this.settings.errorMessagePosition&&this.$form.parentNode.insertBefore(r,this.$form)):(this.form.applyThemeConfig(r,"alertSuccess",!1),r.className+=" ".concat(this.alertSuccessClass," ").concat(this.alertClass,"-").concat(this.settings.submitActionMessagePosition),"bottom-form"==this.settings.submitActionMessagePosition?this.settings.submitActionFormHide?this.$form.parentNode.insertBefore(r,this.$form):this.$submitBtn.parentNode?this.$submitBtn.parentNode.parentNode.insertBefore(r,this.$submitBtn.parentNode):this.$form.parentNode.insertBefore(r,this.$form.nextSibling):"top-form"==this.settings.submitActionMessagePosition&&this.$form.parentNode.insertBefore(r,this.$form)))}},{key:"showTabErrors",value:function(t){var e=this;Object.keys(t).forEach((function(t,r){var n=e.$form.parentNode.querySelector('[data-fui-page-id="'.concat(t,'"]'));n&&n.parentNode.classList.add(e.tabErrorClass)}))}},{key:"decodeHtml",value:function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.value}},{key:"removeFormAlert",value:function(){var t=this.$form.parentNode.querySelector(".".concat(this.alertClass));t&&t.remove()}},{key:"removeTabErrors",value:function(){var t=this;this.$form.parentNode.querySelectorAll("[data-fui-page-tab]").forEach((function(e){e.classList.remove(t.tabErrorClass)}))}},{key:"beforeSubmit",value:function(){var t=this;Array.prototype.filter.call(this.$form.querySelectorAll("input, select, textarea"),(function(e){t.validator.removeError(e)})),this.removeFormAlert(),this.removeTabErrors(),(this.settings.enableBackSubmission||"back"!==this.form.submitAction)&&this.addLoading()}},{key:"ajaxSubmit",value:function(){var t=this,e=new FormData(this.$form),r=this.$form.getAttribute("method"),n=this.$form.getAttribute("action"),o=new XMLHttpRequest;o.open(r||"POST",n||window.location.href,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Cache-Control","no-cache"),o.timeout=1e3*(this.settings.ajaxTimeout||10),this.beforeSubmit(),o.ontimeout=function(){t.onAjaxError(a("The request timed out."))},o.onerror=function(e){t.onAjaxError(a("The request encountered a network error. Please try again."))},o.onload=function(){if(o.status>=200&&o.status<300)try{var e=JSON.parse(o.responseText);e.errors?t.onAjaxError(e.errorMessage,e):t.onAjaxSuccess(e)}catch(e){t.onAjaxError(a("Unable to parse response `{e}`.",{e:e}))}else t.onAjaxError("".concat(o.status,": ").concat(o.statusText))},o.send(e)}},{key:"afterAjaxSubmit",value:function(t){var e=this;this.updateSubmitAction("submit"),this.updateSubmissionInput(t),t.events&&Array.isArray(t.events)&&t.events.length&&(this.removeFormAlert(),t.events.forEach((function(t){e.$form.dispatchEvent(new CustomEvent(t.event,{bubbles:!0,detail:{data:t.data}}))})))}},{key:"onAjaxError",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.errors||{},o=r.pageFieldErrors||{};this.onFormError(t),this.showTabErrors(o),this.submitHandler.formSubmitError(r),this.afterAjaxSubmit(r),Object.keys(n).forEach((function(t,r){var o=s(n[t],1)[0],i=t.split(".");i=i.join("][");var a=e.$form.querySelector('[name="fields['.concat(i,']"]'));if(a||(a=e.$form.querySelector('[name="fields['.concat(i,'][]"]'))),!a&&t.includes("[")){var u=t.match(/\[(.*?)\]/)[1]||null,c="fields[".concat(t.replace(/\./g,"][").replace("]]","]").replace(/\[.*?\]/,"][rows][.*][fields]"),"]");c=c.replace(/\[/g,"\\[").replace(/\]/g,"\\]");var f=e.querySelectorAllRegex(new RegExp(c),"name");f.length&&f[u]&&(a=f[u])}a&&(e.validator.showError(a,{serverMessage:o}),0===r&&a.focus())})),this.togglePage(r,!1)}},{key:"onAjaxSuccess",value:function(t){if(this.submitHandler.formAfterSubmit(t),this.afterAjaxSubmit(t),this.updateFormHash(),"submit"===this.form.submitAction&&this.triggerJsEvents(),t.nextPageId)return this.removeLoading(),void this.togglePage(t);if(t.redirectCallback)t.redirectCallback();else if(t.redirectUrl)"new-tab"===this.settings.submitActionTab?(this.resetForm(),t.redirectTarget.open(t.redirectUrl,"_blank")):t.redirectTarget.location.href=t.redirectUrl;else{if(this.removeLoading(),t.totalPages>1&&("top-form"==this.settings.submitActionMessagePosition?this.togglePage({nextPageIndex:0,nextPageId:this.settings.pages[0].id,totalPages:this.settings.pages.length}):(this.$submitBtn&&this.$submitBtn.remove(),this.$form.querySelectorAll('[data-submit-action="back"]').forEach((function(t){t.remove()})))),"message"===this.settings.submitAction){var e=t.submitActionMessage||this.settings.submitActionMessage;this.showFormAlert(e,"success"),this.hideSuccess(),this.settings.submitActionFormHide&&(this.$form.style.display="none"),this.settings.scrollToTop&&this.scrollToForm()}this.resetForm(),this.removeHiddenInput("submissionId"),this.updateFormHash()}}},{key:"updateSubmitAction",value:function(t){t||(t="submit"),this.form.submitAction=t,this.updateOrCreateHiddenInput("submitAction",t)}},{key:"updateSubmissionInput",value:function(t){t.submissionId&&t.nextPageId&&this.updateOrCreateHiddenInput("submissionId",t.submissionId)}},{key:"updateOrCreateHiddenInput",value:function(t,e){var r=this.$form.querySelector('[name="'.concat(t,'"][type="hidden"]'));r||((r=document.createElement("input")).setAttribute("type","hidden"),r.setAttribute("name",t),this.$form.appendChild(r)),r.setAttribute("value",e)}},{key:"resetForm",value:function(){this.$form.reset(),this.$form.querySelectorAll('[type="checkbox"]').forEach((function(t){t.removeAttribute("checked")}))}},{key:"removeHiddenInput",value:function(t){var e=this.$form.querySelector('[name="'.concat(t,'"][type="hidden"]'));e&&e.parentNode.removeChild(e)}},{key:"togglePage",value:function(t){var e=this;this.$form.dispatchEvent(new CustomEvent("onFormiePageToggle",{bubbles:!0,detail:{data:t}}));var r=this.$form.querySelectorAll("[data-fui-page]");t.nextPageId&&r.forEach((function(r){r.id==="".concat(e.getPageId(t.nextPageId))?r.removeAttribute("data-fui-page-hidden"):r.setAttribute("data-fui-page-hidden",!0)}));var n=this.$form.querySelector("[data-fui-progress-bar]");if(n&&t.nextPageIndex>=0){var o=parseInt(t.nextPageIndex,10)+1,i=Math.round(o/t.totalPages*100);n.style.width="".concat(i,"%"),n.setAttribute("aria-valuenow",i),n.textContent="".concat(i,"%")}var a=this.$form.querySelectorAll("[data-fui-page-tab]");if(t.nextPageId){a.forEach((function(r){r.id==="".concat(e.tabClass,"-").concat(t.nextPageId)?r.classList.add(e.tabActiveClass):r.classList.remove(e.tabActiveClass)}));var u=!0;a.forEach((function(t){t.classList.contains(e.tabActiveClass)&&(u=!1),u?t.classList.add(e.tabCompleteClass):t.classList.remove(e.tabCompleteClass)})),this.setCurrentPage(t.nextPageId)}this.settings.scrollToTop&&this.scrollToForm()}},{key:"setCurrentPage",value:function(t){this.settings.currentPageId=t,this.$currentPage=this.$form.querySelector("#".concat(this.getPageId(t)))}},{key:"getCurrentPage",value:function(){var t=this;return this.settings.pages.find((function(e){return e.id==t.settings.currentPageId}))}},{key:"getCurrentPageIndex",value:function(){var t=this.getCurrentPage();return t?this.settings.pages.indexOf(t):0}},{key:"getPageId",value:function(t){return"".concat(this.config.formHashId,"-p-").concat(t)}},{key:"scrollToForm",value:function(){var t=parseInt(getComputedStyle(document.documentElement).scrollPaddingTop)||0,e=parseInt(getComputedStyle(document.documentElement).scrollMarginTop)||0;window.scrollTo({top:this.$form.parentNode.getBoundingClientRect().top+window.pageYOffset-100-t-e,behavior:"smooth"})}},{key:"triggerJsEvents",value:function(){var t=this.getCurrentPage();if(t&&t.settings.enableJsEvents){var e={};t.settings.jsGtmEventOptions.forEach((function(t){e[t.label]=t.value})),window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)}}},{key:"querySelectorAllRegex",value:function(t,e){var r,n=[],o=c(this.$form.querySelectorAll("[".concat(e,"]")));try{for(o.s();!(r=o.n()).done;){var i=r.value;t.test(i.getAttribute(e))&&n.push(i)}}catch(t){o.e(t)}finally{o.f()}return n}}],r&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,e)}(t,e)||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.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};g(this,t),this.$form=e,this.config=n,this.settings=n.settings,this.listeners={},this.$form&&(this.$form.form=this,this.settings.outputJsTheme&&(this.formTheme=new v(this.$form,this.config)),this.registerFieldEvents(this.$form),this.addEventListener(this.$form,"submit",(function(t){t.preventDefault();var e=r.eventObject("onBeforeFormieSubmit",{submitHandler:r});r.$form.dispatchEvent(e)&&r.processSubmit()}),!1))}var e,r,n;return e=t,r=[{key:"processSubmit",value:function(){var t=this;setTimeout((function(){t.validate()&&t.afterValidate()&&t.validateCaptchas()&&t.validatePayment()&&t.submitForm()}),300)}},{key:"validate",value:function(){var t=this.eventObject("onFormieValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}},{key:"afterValidate",value:function(){var t=this.eventObject("onAfterFormieValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}},{key:"validateCaptchas",value:function(){var t=this.eventObject("onFormieCaptchaValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}},{key:"validatePayment",value:function(){var t=this.eventObject("onFormiePaymentValidate",{submitHandler:this});return this.$form.dispatchEvent(t)}},{key:"submitForm",value:function(){var t=this.eventObject("onFormieSubmit",{submitHandler:this});this.$form.dispatchEvent(t)&&("ajax"===this.settings.submitMethod?this.formAfterSubmit():this.$form.submit())}},{key:"formAfterSubmit",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.redirectTarget=t.redirectTarget||window,this.$form.dispatchEvent(new CustomEvent("onAfterFormieSubmit",{bubbles:!0,detail:t})),t.nextPageId||this.config.Formie.refreshFormTokens(this)}},{key:"formSubmitError",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieSubmitError",{bubbles:!0,detail:t}))}},{key:"formDestroy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$form.dispatchEvent(new CustomEvent("onFormieDestroy",{bubbles:!0,detail:t}))}},{key:"registerFieldEvents",value:function(t){var e=this;t.querySelectorAll("[data-field-type]").forEach((function(t){var r=t.querySelector("input, select");r&&(e.addEventListener(r,"input",(function(e){t.dispatchEvent(new CustomEvent("input",{bubbles:!1,detail:{input:e.target}}))})),e.addEventListener(r,"focus",(function(e){t.dispatchEvent(new CustomEvent("focus",{bubbles:!1,detail:{input:e.target}}))})),e.addEventListener(r,"blur",(function(e){t.dispatchEvent(new CustomEvent("blur",{bubbles:!1,detail:{input:e.target}}))})),t.dispatchEvent(new CustomEvent("init",{bubbles:!1,detail:{input:r}})))}))}},{key:"addEventListener",value:function(t,e,r){if(!this.destroyed){this.listeners[e]={element:t,func:r};var n=e.split(".")[0];t.addEventListener(n,this.listeners[e].func)}}},{key:"removeEventListener",value:function(t){var e=this.listeners[t]||{};if(e&&e.element&&e.func){var r=t.split(".")[0];e.element.removeEventListener(r,e.func),delete this.listeners[t]}}},{key:"eventObject",value:function(t,e){return new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e})}},{key:"getThemeConfigAttributes",value:function(t){return(this.settings.themeConfig||{})[t]||{}}},{key:"getClasses",value:function(t){return this.getThemeConfigAttributes(t).class||[]}},{key:"applyThemeConfig",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getThemeConfigAttributes(e);n&&Object.entries(n).forEach((function(e){var n=p(e,2),o=n[0],i=n[1];("class"!==o||r)&&t.setAttribute(o,i)}))}}],r&&y(e.prototype,r),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(t,e)}(t,e)||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.")}()}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==c[1]?c[1]:{},i(r)&&(r=JSON.parse(e.getAttribute("data-fui-form"))),!i(r)){t.next=5;break}return console.error("Unable to parse `data-fui-form` form attribute for config. Ensure this attribute exists on your form and contains valid JSON."),t.abrupt("return");case 5:if(!(n=this.getFormByHashId(r.formHashId))){t.next=9;break}return t.next=9,this.destroyForm(n);case 9:if(a=r.registeredJs||[],r.Formie=this,u=new b(e,r),this.forms.push(u),u.fieldConfigs=this.parseFieldConfig(e,e),!a.length){t.next=22;break}if(!document.querySelector('[data-fui-scripts="'.concat(r.formHashId,'"]'))){t.next=18;break}return console.warn("Formie scripts already loaded for form #".concat(r.formHashId,".")),t.abrupt("return");case 18:u.$registeredJs=document.createElement("div"),u.$registeredJs.setAttribute("data-fui-scripts",r.formHashId),document.body.appendChild(u.$registeredJs),a.forEach((function(t){var r=document.createElement("script");t.src&&(r.src=t.src,r.defer=!0,r.onload=function(){if(t.module){var r=u.fieldConfigs[t.module];r&&Array.isArray(r)&&r.length&&r.forEach((function(e){s.initJsClass(t.module,e)})),t.settings&&s.initJsClass(t.module,E({$form:e},t.settings)),"FormieConditions"===t.module&&s.initJsClass(t.module,{$form:e})}}),u.$registeredJs.appendChild(r)}));case 22:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"initJsClass",value:function(t,e){var r=window[t];r&&new r(e)}},{key:"parseFieldConfig",value:function(t,e){var r={};return t.querySelectorAll("[data-field-config]").forEach((function(t){var n=JSON.parse(t.getAttribute("data-field-config"));Array.isArray(n)||(n=[n]),n.forEach((function(n){r[n.module]||(r[n.module]=[]),r[n.module].push(E({$form:e,$field:t},n))}))})),r}},{key:"getForm",value:function(t){return this.forms.find((function(e){return e.$form==t}))}},{key:"getFormById",value:function(t){return this.forms.find((function(e){if(e.config)return e.config.formId==t}))}},{key:"getFormByHashId",value:function(t){return this.forms.find((function(e){if(e.config)return e.config.formHashId==t}))}},{key:"getFormByHandle",value:function(t){return this.forms.find((function(e){if(e.config)return e.config.formHandle==t}))}},{key:"destroyForm",value:(a=j(o().mark((function t(e){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof b?r=e.$form:(r=e,e=this.getForm(r)),e&&r){t.next=3;break}return t.abrupt("return");case 3:if(-1!==(n=this.forms.indexOf(e))){t.next=6;break}return t.abrupt("return");case 6:e.destroyed=!0,e.$registeredJs&&e.$registeredJs.parentNode&&e.$registeredJs.parentNode.removeChild(e.$registeredJs),e.formDestroy({form:e}),i(e.listeners)||Object.keys(e.listeners).forEach((function(t){e.removeEventListener(t)})),e.formTheme&&e.formTheme.validator&&e.formTheme.validator.destroy(),this.forms.splice(n,1);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"refreshForCache",value:function(t,e){var r=this.getFormByHashId(t);r?this.refreshFormTokens(r,e):console.error('Unable to find form "'.concat(t,'".'))}},{key:"refreshFormTokens",value:function(t,e){var r=t.config,n=r.formHashId,o=r.formHandle,i="".concat(t.settings.baseActionUrl,"/formie/forms/refresh-tokens?form=").concat(o);fetch(i).then((function(t){return t.json()})).then((function(r){var o=t.$form;if(r.csrf.param){var i=o.querySelector('input[name="'.concat(r.csrf.param,'"]'));i?(i.value=r.csrf.token,console.log("".concat(n,": Refreshed CSRF input %o."),r.csrf)):console.error("".concat(n,': Unable to locate CSRF input for "').concat(r.csrf.param,'".'))}else console.error("".concat(n,": Missing CSRF token information in cache-refresh response."));r.captchas&&Object.entries(r.captchas).forEach((function(t){var e,r,i=x(t,2),a=i[0],u=i[1];(e='input[name="'.concat(u.sessionKey,'"]'),r=o,r=r||document,new Promise((function(t){if(r.querySelector(e))return t(r.querySelector(e));var n=new MutationObserver((function(o){r.querySelector(e)&&(n.disconnect(),t(r.querySelector(e)))}));n.observe(r,{childList:!0,subtree:!0})}))).then((function(t){u.value&&(t.value=u.value,console.log("".concat(n,': Refreshed "').concat(a,'" captcha input %o.'),u))})),setTimeout((function(){o.querySelector('input[name="'.concat(u.sessionKey,'"]'))||console.error("".concat(n,': Unable to locate captcha input for "').concat(a,'".'))}),1e4)})),t.formTheme&&t.formTheme.updateFormHash(),e&&e(r)}))}}],r&&C(e.prototype,r),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();window.Formie=P,window.Formie=new P;var T=!0;document.currentScript&&document.currentScript.hasAttribute("data-manual-init")&&(T=!1),T&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(t){window.Formie.initForms()})):window.Formie.initForms())},3200:function(t,e,r){var n=r(7230),o=r(933),i=r(321),a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},4831:function(t,e,r){var n=r(7230),o=r(3538),i=r(321),a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a constructor")}},8563:function(t,e,r){var n=r(7230),o=r(933),i=n.String,a=n.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw a("Can't set "+i(t)+" as a prototype")}},186:function(t,e,r){var n=r(7952),o=r(6997),i=r(7108),a=n("unscopables"),u=Array.prototype;null==u[a]&&i.f(u,a,{configurable:!0,value:o(null)}),t.exports=function(t){u[a][t]=!0}},3264:function(t,e,r){"use strict";var n=r(2370).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},5209:function(t,e,r){var n=r(7230),o=r(2346),i=n.TypeError;t.exports=function(t,e){if(o(e,t))return t;throw i("Incorrect invocation")}},3536:function(t,e,r){var n=r(7230),o=r(6913),i=n.String,a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},866:function(t,e,r){"use strict";var n=r(1569).forEach,o=r(2245)("forEach");t.exports=o?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},8897:function(t,e,r){"use strict";var n=r(7230),o=r(1248),i=r(4225),a=r(987),u=r(6996),s=r(1855),c=r(3538),f=r(1646),l=r(3859),h=r(9853),d=r(6418),v=n.Array;t.exports=function(t){var e=a(t),r=c(this),n=arguments.length,p=n>1?arguments[1]:void 0,m=void 0!==p;m&&(p=o(p,n>2?arguments[2]:void 0));var g,y,b,x,w,S,E=d(e),A=0;if(!E||this==v&&s(E))for(g=f(e),y=r?new this(g):v(g);g>A;A++)S=m?p(e[A],A):e[A],l(y,A,S);else for(w=(x=h(e,E)).next,y=r?new this:[];!(b=i(w,x)).done;A++)S=m?u(x,p,[b.value,A],!0):b.value,l(y,A,S);return y.length=A,y}},7945:function(t,e,r){var n=r(9164),o=r(2966),i=r(1646),a=function(t){return function(e,r,a){var u,s=n(e),c=i(s),f=o(a,c);if(t&&r!=r){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},1569:function(t,e,r){var n=r(1248),o=r(1916),i=r(6801),a=r(987),u=r(1646),s=r(1204),c=o([].push),f=function(t){var e=1==t,r=2==t,o=3==t,f=4==t,l=6==t,h=7==t,d=5==t||l;return function(v,p,m,g){for(var y,b,x=a(v),w=i(x),S=n(p,m),E=u(w),A=0,O=g||s,j=e?O(v,E):r||h?O(v,0):void 0;E>A;A++)if((d||A in w)&&(b=S(y=w[A],A,x),t))if(e)j[A]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return A;case 2:c(j,y)}else switch(t){case 4:return!1;case 7:c(j,y)}return l?-1:o||f?f:j}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},9321:function(t,e,r){var n=r(3694),o=r(7952),i=r(7806),a=o("species");t.exports=function(t){return i>=51||!n((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},2245:function(t,e,r){"use strict";var n=r(3694);t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){return 1},1)}))}},696:function(t,e,r){var n=r(7230),o=r(2966),i=r(1646),a=r(3859),u=n.Array,s=Math.max;t.exports=function(t,e,r){for(var n=i(t),c=o(e,n),f=o(void 0===r?n:r,n),l=u(s(f-c,0)),h=0;c0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},9799:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},5302:function(t,e,r){var n=r(7230),o=r(5027).f,i=r(5399),a=r(6272),u=r(746),s=r(1831),c=r(4545);t.exports=function(t,e){var r,f,l,h,d,v=t.target,p=t.global,m=t.stat;if(r=p?n:m?n[v]||u(v,{}):(n[v]||{}).prototype)for(f in e){if(h=e[f],l=t.noTargetGet?(d=o(r,f))&&d.value:r[f],!c(p?f:v+(m?".":"#")+f,t.forced)&&void 0!==l){if(typeof h==typeof l)continue;s(h,l)}(t.sham||l&&l.sham)&&i(h,"sham",!0),a(r,f,h,t)}}},3694:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},4430:function(t,e,r){"use strict";r(5098);var n=r(1916),o=r(6272),i=r(9735),a=r(3694),u=r(7952),s=r(5399),c=u("species"),f=RegExp.prototype;t.exports=function(t,e,r,l){var h=u(t),d=!a((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),v=d&&!a((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return e=!0,null},r[h](""),!e}));if(!d||!v||r){var p=n(/./[h]),m=e(h,""[t],(function(t,e,r,o,a){var u=n(t),s=e.exec;return s===i||s===f.exec?d&&!a?{done:!0,value:p(e,r,o)}:{done:!0,value:u(r,e,o)}:{done:!1}}));o(String.prototype,t,m[0]),o(f,h,m[1])}l&&s(f[h],"sham",!0)}},251:function(t,e,r){var n=r(592),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},1248:function(t,e,r){var n=r(1916),o=r(3200),i=r(592),a=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},592:function(t,e,r){var n=r(3694);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},4225:function(t,e,r){var n=r(592),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},567:function(t,e,r){var n=r(6079),o=r(3225),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,u=o(i,"name"),s=u&&"something"===function(){}.name,c=u&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:s,CONFIGURABLE:c}},1916:function(t,e,r){var n=r(592),o=Function.prototype,i=o.bind,a=o.call,u=n&&i.bind(a,a);t.exports=n?function(t){return t&&u(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},1223:function(t,e,r){var n=r(7230),o=r(933),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t]):n[t]&&n[t][e]}},6418:function(t,e,r){var n=r(996),o=r(5048),i=r(3019),a=r(7952)("iterator");t.exports=function(t){if(null!=t)return o(t,a)||o(t,"@@iterator")||i[n(t)]}},9853:function(t,e,r){var n=r(7230),o=r(4225),i=r(3200),a=r(3536),u=r(321),s=r(6418),c=n.TypeError;t.exports=function(t,e){var r=arguments.length<2?s(t):e;if(i(r))return a(o(r,t));throw c(u(t)+" is not iterable")}},5048:function(t,e,r){var n=r(3200);t.exports=function(t,e){var r=t[e];return null==r?void 0:n(r)}},6968:function(t,e,r){var n=r(1916),o=r(987),i=Math.floor,a=n("".charAt),u=n("".replace),s=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,f=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,n,l,h){var d=r+t.length,v=n.length,p=f;return void 0!==l&&(l=o(l),p=c),u(h,p,(function(o,u){var c;switch(a(u,0)){case"$":return"$";case"&":return t;case"`":return s(e,0,r);case"'":return s(e,d);case"<":c=l[s(u,1,-1)];break;default:var f=+u;if(0===f)return o;if(f>v){var h=i(f/10);return 0===h?o:h<=v?void 0===n[h-1]?a(u,1):n[h-1]+a(u,1):o}c=n[f-1]}return void 0===c?"":c}))}},7230:function(t,e,r){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},3225:function(t,e,r){var n=r(1916),o=r(987),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},7076:function(t){t.exports={}},5812:function(t,e,r){var n=r(7230);t.exports=function(t,e){var r=n.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))}},6507:function(t,e,r){var n=r(1223);t.exports=n("document","documentElement")},4253:function(t,e,r){var n=r(6079),o=r(3694),i=r(2200);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},6801:function(t,e,r){var n=r(7230),o=r(1916),i=r(3694),a=r(2248),u=n.Object,s=o("".split);t.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?s(t,""):u(t)}:u},8089:function(t,e,r){var n=r(933),o=r(6913),i=r(1403);t.exports=function(t,e,r){var a,u;return i&&n(a=e.constructor)&&a!==r&&o(u=a.prototype)&&u!==r.prototype&&i(t,u),t}},4335:function(t,e,r){var n=r(1916),o=r(933),i=r(1393),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},21:function(t,e,r){var n,o,i,a=r(5506),u=r(7230),s=r(1916),c=r(6913),f=r(5399),l=r(3225),h=r(1393),d=r(375),v=r(7076),p="Object already initialized",m=u.TypeError,g=u.WeakMap;if(a||h.state){var y=h.state||(h.state=new g),b=s(y.get),x=s(y.has),w=s(y.set);n=function(t,e){if(x(y,t))throw new m(p);return e.facade=t,w(y,t,e),e},o=function(t){return b(y,t)||{}},i=function(t){return x(y,t)}}else{var S=d("state");v[S]=!0,n=function(t,e){if(l(t,S))throw new m(p);return e.facade=t,f(t,S,e),e},o=function(t){return l(t,S)?t[S]:{}},i=function(t){return l(t,S)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!c(e)||(r=o(e)).type!==t)throw m("Incompatible receiver, "+t+" required");return r}}}},1855:function(t,e,r){var n=r(7952),o=r(3019),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},4893:function(t,e,r){var n=r(2248);t.exports=Array.isArray||function(t){return"Array"==n(t)}},933:function(t){t.exports=function(t){return"function"==typeof t}},3538:function(t,e,r){var n=r(1916),o=r(3694),i=r(933),a=r(996),u=r(1223),s=r(4335),c=function(){},f=[],l=u("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=n(h.exec),v=!h.exec(c),p=function(t){if(!i(t))return!1;try{return l(c,f,t),!0}catch(t){return!1}},m=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!d(h,s(t))}catch(t){return!0}};m.sham=!0,t.exports=!l||o((function(){var t;return p(p.call)||!p(Object)||!p((function(){t=!0}))||t}))?m:p},4545:function(t,e,r){var n=r(3694),o=r(933),i=/#|\.prototype\./,a=function(t,e){var r=s[u(t)];return r==f||r!=c&&(o(e)?n(e):!!e)},u=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=a.data={},c=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},6913:function(t,e,r){var n=r(933);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},7442:function(t){t.exports=!1},385:function(t,e,r){var n=r(6913),o=r(2248),i=r(7952)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},7581:function(t,e,r){var n=r(7230),o=r(1223),i=r(933),a=r(2346),u=r(9264),s=n.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,s(t))}},5103:function(t,e,r){var n=r(7230),o=r(1248),i=r(4225),a=r(3536),u=r(321),s=r(1855),c=r(1646),f=r(2346),l=r(9853),h=r(6418),d=r(5635),v=n.TypeError,p=function(t,e){this.stopped=t,this.result=e},m=p.prototype;t.exports=function(t,e,r){var n,g,y,b,x,w,S,E=r&&r.that,A=!(!r||!r.AS_ENTRIES),O=!(!r||!r.IS_ITERATOR),j=!(!r||!r.INTERRUPTED),C=o(e,E),P=function(t){return n&&d(n,"normal",t),new p(!0,t)},T=function(t){return A?(a(t),j?C(t[0],t[1],P):C(t[0],t[1])):j?C(t,P):C(t)};if(O)n=t;else{if(!(g=h(t)))throw v(u(t)+" is not iterable");if(s(g)){for(y=0,b=c(t);b>y;y++)if((x=T(t[y]))&&f(m,x))return x;return new p(!1)}n=l(t,g)}for(w=n.next;!(S=i(w,n)).done;){try{x=T(S.value)}catch(t){d(n,"throw",t)}if("object"==typeof x&&x&&f(m,x))return x}return new p(!1)}},5635:function(t,e,r){var n=r(4225),o=r(3536),i=r(5048);t.exports=function(t,e,r){var a,u;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw r;return r}a=n(a,t)}catch(t){u=!0,a=t}if("throw"===e)throw r;if(u)throw a;return o(a),r}},7824:function(t,e,r){"use strict";var n,o,i,a=r(3694),u=r(933),s=r(6997),c=r(5024),f=r(6272),l=r(7952),h=r(7442),d=l("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(n=o):v=!0),null==n||a((function(){var t={};return n[d].call(t)!==t}))?n={}:h&&(n=s(n)),u(n[d])||f(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},3019:function(t){t.exports={}},1646:function(t,e,r){var n=r(6092);t.exports=function(t){return n(t.length)}},2484:function(t,e,r){var n=r(3694),o=r(933),i=r(3225),a=r(7108).f,u=r(567).CONFIGURABLE,s=r(4335),c=r(21),f=c.enforce,l=c.get,h=!n((function(){return 8!==a((function(){}),"length",{value:8}).length})),d=String(String).split("String"),v=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!i(t,"name")||u&&t.name!==e)&&a(t,"name",{value:e,configurable:!0}),h&&r&&i(r,"arity")&&t.length!==r.arity&&a(t,"length",{value:r.arity});var n=f(t);return i(n,"source")||(n.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return o(this)&&l(this).source||s(this)}),"toString")},3012:function(t,e,r){var n,o,i,a,u,s,c,f,l=r(7230),h=r(1248),d=r(5027).f,v=r(7823).set,p=r(4619),m=r(4370),g=r(2811),y=r(5009),b=l.MutationObserver||l.WebKitMutationObserver,x=l.document,w=l.process,S=l.Promise,E=d(l,"queueMicrotask"),A=E&&E.value;A||(n=function(){var t,e;for(y&&(t=w.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?a():i=void 0,t}}i=void 0,t&&t.enter()},p||y||g||!b||!x?!m&&S&&S.resolve?((c=S.resolve(void 0)).constructor=S,f=h(c.then,c),a=function(){f(n)}):y?a=function(){w.nextTick(n)}:(v=h(v,l),a=function(){v(n)}):(u=!0,s=x.createTextNode(""),new b(n).observe(s,{characterData:!0}),a=function(){s.data=u=!u})),t.exports=A||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},61:function(t,e,r){var n=r(8724);t.exports=n&&!!Symbol.for&&!!Symbol.keyFor},8724:function(t,e,r){var n=r(7806),o=r(3694);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},5506:function(t,e,r){var n=r(7230),o=r(933),i=r(4335),a=n.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},6935:function(t,e,r){"use strict";var n=r(3200),o=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new o(t)}},6487:function(t,e,r){var n=r(7230),o=r(385),i=n.TypeError;t.exports=function(t){if(o(t))throw i("The method doesn't accept regular expressions");return t}},6997:function(t,e,r){var n,o=r(3536),i=r(7673),a=r(9799),u=r(7076),s=r(6507),c=r(2200),f=r(375),l=f("IE_PROTO"),h=function(){},d=function(t){return"