1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7197],{44(t,i,e){e.d(i,{A:()=>o});var n=e(5683);class o extends n.A{constructor(t,i="before"){super(t,i),this._isValidElement()||console.warn(`[ButtonLoadingIndicatorUtil] Parent element is not of type <button> or <a>. Given element: ${this.parent}`)}create(){if(!this._isValidElement()){console.warn(`[ButtonLoadingIndicatorUtil] Unable to create loading indicator. Parent element is not of type <button> or <a>. Given element: ${this.parent}`);return}if("inner"===this.position){let t=this.parent.getBoundingClientRect().width;this.parent.style.width=`${t}px`}super.create(),this.parent.classList.add(`is-loading-indicator-${this.position}`),this._isButtonElement()?this.parent.disabled=!0:this._isAnchorElement()&&this.parent.classList.add("disabled")}remove(){if(!this.exists()){console.warn(`[ButtonLoadingIndicatorUtil] Unable to remove loading indicator. No indicator present on given element: ${this.parent}`);return}"inner"===this.position&&(this.parent.style.width="auto"),super.remove(),this.parent.classList.remove(`is-loading-indicator-${this.position}`),this._isButtonElement()?this.parent.disabled=!1:this._isAnchorElement()&&this.parent.classList.remove("disabled")}_isValidElement(){return this._isButtonElement()||this._isAnchorElement()}_isButtonElement(){return this.parent?.tagName.toLowerCase()==="button"}_isAnchorElement(){return this.parent?.tagName.toLowerCase()==="a"}}},5683(t,i,e){e.d(i,{A:()=>s,c:()=>o});let n="loader",o={BEFORE:"before",AFTER:"after",INNER:"inner"};class s{constructor(t,i=o.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=i}create(){if(!this.exists()){if(this.position===o.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=s.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),s.getTemplate())}}remove(){if(this.position===o.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${n}`).forEach(t=>t.remove())}exists(){return this.parent.querySelectorAll(`.${n}`).length>0}_getPosition(){return this.position===o.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${n}" role="status"> 2 <span class="visually-hidden">Loading...</span> 3 </div>`}static SELECTOR_CLASS(){return n}}},7197(t,i,e){e.r(i),e.d(i,{default:()=>r});var n=e(4335),o=e(4059),s=e(44);class r extends n.A{static #t=this.options={validation:!0,validateOnSubmit:!0,focusInvalidField:!0,debounceTime:"200",formFieldSelector:"input, textarea, select",loadingIndicator:!0,loadingIndicatorPosition:"inner"};init(){if(!1===this._isFormElement(this.el)){console.error("[FormHandler]: Element is not of type <form>",this.el);return}this.form=this.el,this.submitButtons=this._getSubmitButtons(),this.submittButtonLoaders=[],!0===this.options.validation&&this._initFormValidation(),this._initFormEvents()}set formFields(t){this._formFields=t}get formFields(){return this.options.formFieldSelector?this.form.querySelectorAll(this.options.formFieldSelector):[...this.form.elements]}_initFormEvents(){this.form.addEventListener("submit",this._onFormSubmit.bind(this)),this.form.addEventListener("removeLoader",this.removeLoadingIndicator.bind(this))}_initFormValidation(){window.formValidation.setNoValidate(this.form),this.form.checkValidity=this._checkValidity.bind(this),this._initFieldValidationEvents()}_initFieldValidationEvents(){this.formFields.forEach(t=>{this._initFieldValidation(t)})}_initFieldValidation(t){let i=t.tagName.toLowerCase();t.addEventListener("select"===i?"change":"input",o.A.debounce(window.formValidation.validateField.bind(window.formValidation,t),this.options.debounceTime))}_onFormSubmit(t){if(this.$emitter.publish("beforeSubmit"),!0===this.options.validateOnSubmit){let i=window.formValidation.validateForm(this.form,this.formFields);if(i.length>0){t.preventDefault(),this.$emitter.publish("validationFailed",{invalidFields:i}),!0===this.options.focusInvalidField&&(i[0].scrollIntoView({behavior:"smooth",block:"center"}),i[0].focus());return}}this.$emitter.publish("validSubmit"),!0===this.options.loadingIndicator&&this.addLoadingIndicator()}addLoadingIndicator(){this.submitButtons.forEach(t=>{let i=new s.A(t,this.options.loadingIndicatorPosition);this.submittButtonLoaders.push(i),i.create()})}
3removeLoadingIndicator(){this.submittButtonLoaders.forEach(t=>{t.remove()})}_checkValidity(){return 0===window.formValidation.validateForm(this.form,this.formFields).length}_getSubmitButtons(){let t=Array.from(this.form.querySelectorAll("button[type=submit]")),i=this.form.id;if(i){let e=Array.from(document.querySelectorAll(`button[type=submit][form="${i}"]`));t.push(...e)}return t}_isFormElement(t){return"form"===t.tagName.toLowerCase()}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.