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AC5FL,mBAAoBH,kD,kCCTrB,MASaS,EAA8F,CAG1GN,mBAAoBH,yD,yDCDTU,E,mDAAZ,SAAYA,GAEX,2BAEA,wBAEA,CAND,CAAYA,IAAAA,EAA0C,KActD,MAAMV,EAAe,sBAeRW,EAA4E,CAExFC,wBAAyBZ,EAAe,kBACxCa,uBAAwBb,EAAe,iBACvCc,qBAAsBd,EAAe,qBACrCe,mBAAoBf,EAAe,kBACnCgB,8BAA+BhB,EAAe,6BAC9CiB,6BAA8BjB,EAAe,4BAC7ChC,0BAA2BgC,EAAe,wBAC1CkB,+BAAgClB,EAAe,8BAoBnCmB,EAA6E,CACzF,oCAAqC,IAAmChB,mBACxE,6BAA8B,IAA4BA,mBAC1D,6BAA8B,IAA4BA,mBAC1D,0BAA2B,IAA0BA,mBACrD,yBAA0B,IAAyBA,mB","sources":["webpack://@dgtls-pub/wolf-sb-integration/./src/global/js/DomServices.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/global/js/InputsServices.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/global/js/ControllerBase.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-form/m-form.controller.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-form/m-form.events.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-formstep-select-icon/m-formstep-select-icon.events.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-formstep-select-image/m-formstep-select-image.events.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-formstep-warranty-step-2/m-formstep-warranty-step-2.events.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-formstep-warranty-step-3/m-formstep-warranty-step-3.events.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/molecules/m-formstep-warranty-wolf-products/m-formstep-warranty-wolf-products.events.ts","webpack://@dgtls-pub/wolf-sb-integration/./src/wolf/components/organisms/o-form-stepper/o-form-stepper.events.ts"],"sourcesContent":["import { IDomServices } from 'global/interfaces/controller.interface';\nimport { Subject } from 'rxjs';\n\nexport class DomServices<T> implements IDomServices<T> {\n\tprotected $element: HTMLElement;\n\tprotected $references: Record<keyof T, HTMLElement>;\n\tonDomElementChanged: Subject<string> = new Subject();\n\n\tconstructor(element: HTMLElement, references: Record<keyof T, HTMLElement>) {\n\t\tthis.$references = references;\n\t\tthis.$element = element;\n\t}\n\n\tstatic collectReferences<T>(\n\t\telement: HTMLElement,\n\t\tignoredReferences: string[],\n\t\tincludedReferences: string[],\n\t): Partial<Record<keyof T, HTMLElement>> {\n\t\tconst refs: Partial<Record<keyof T, HTMLElement>> = {};\n\n\t\tArray.from(element.querySelectorAll('[data-ref]')).forEach((el: HTMLElement) => {\n\t\t\tlet referenceName: string = '';\n\t\t\tif (el.dataset.ref) {\n\t\t\t\treferenceName = el.dataset.ref;\n\t\t\t}\n\n\t\t\t// skip ignored references\n\t\t\tif (ignoredReferences.includes(referenceName)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (referenceName) {\n\t\t\t\t// if the included list has items, only include these references, otherwise consider all\n\t\t\t\tif (includedReferences.length > 0) {\n\t\t\t\t\tif (includedReferences.includes(referenceName)) {\n\t\t\t\t\t\trefs[referenceName] = el;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(refs, referenceName)) {\n\t\t\t\t\t\tif (window.location.hostname === 'localhost') {\n\t\t\t\t\t\t\tconsole.warn(`A reference called '${referenceName}' has already been registered in ${this.constructor.name}!\\n Element:`, element);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefs[referenceName] = el;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn refs;\n\t}\n\n\tgetRef<T extends HTMLElement = HTMLElement>(ref: string): T | undefined {\n\t\tif (this.$references) {\n\t\t\treturn Object.prototype.hasOwnProperty.call(this.$references, ref) ? (this.$references[ref] as T) : undefined;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tparseStringToHtml = (htmlAsString: string): void | ChildNode => {\n\t\tconst parsedNode = new DOMParser().parseFromString(htmlAsString, 'text/html').body.firstChild;\n\t\tif (parsedNode) return parsedNode;\n\t};\n\n\trenderDomElement = (ref: string, html: string, renderOnParent: boolean = false): void => {\n\t\tconst refExists = this.$references ? Object.prototype.hasOwnProperty.call(this.$references, ref) : undefined;\n\t\tif (renderOnParent) {\n\t\t\tthis.$element.innerHTML = html;\n\t\t\tthis.domElementChanged(ref);\n\t\t} else if (this.$references && refExists) {\n\t\t\t(this.$references as any)[ref].innerHTML = html;\n\t\t\tthis.domElementChanged(ref);\n\t\t} else {\n\t\t\tconsole.warn('DOM ref does not exist!', ref);\n\t\t}\n\t};\n\n\tappendRawHtmlToDomElement = (\n\t\tnode: HTMLElement,\n\t\thtmlAsString: string,\n\t\tposition: 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' = 'afterend',\n\t): void | ChildNode => {\n\t\tconst htmlNode = this.parseStringToHtml(htmlAsString);\n\t\tnode.insertAdjacentElement(position, htmlNode as Element);\n\t\tif (htmlNode) {\n\t\t\treturn htmlNode;\n\t\t}\n\t};\n\n\treplaceLastChildElementWithRawHtml = (ref: string, htmlAsString: string): void | ChildNode => {\n\t\tconst refExists = this.$references ? Object.prototype.hasOwnProperty.call(this.$references, ref) : undefined;\n\t\tif (refExists) {\n\t\t\tconst htmlNode = this.parseStringToHtml(htmlAsString);\n\t\t\tconst lastNode = this.$references[ref].childNodes[this.$references[ref].childNodes.length - 1];\n\t\t\t(this.$references as any)[ref].replaceChild(htmlNode, lastNode);\n\t\t\tthis.domElementChanged(ref);\n\t\t\tif (htmlNode) {\n\t\t\t\treturn htmlNode;\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.warn('DOM ref does not exist!', ref);\n\t\t}\n\t};\n\n\ttoggleElementState(control: HTMLElement, newState: Array<'enable' | 'disable' | 'show' | 'hide' | 'check' | 'uncheck'>): void {\n\t\tif (!control) return;\n\t\tnewState &&\n\t\t\tnewState.forEach((state) => {\n\t\t\t\tswitch (state) {\n\t\t\t\t\tcase 'enable': {\n\t\t\t\t\t\tcontrol.removeAttribute('disabled');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'disable': {\n\t\t\t\t\t\tcontrol.setAttribute('disabled', 'true');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'show': {\n\t\t\t\t\t\tcontrol.removeAttribute('hidden');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'hide': {\n\t\t\t\t\t\tcontrol.setAttribute('hidden', 'true');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'uncheck': {\n\t\t\t\t\t\tcontrol.removeAttribute('checked');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'check': {\n\t\t\t\t\t\tcontrol.setAttribute('checked', 'true');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tdomElementChanged = (reference: string): void => {\n\t\tthis.onDomElementChanged.next(reference);\n\t};\n\n\tparseDOMScriptTag = <TJSON>(elementId: string): TJSON => {\n\t\tconst data = document.getElementById(elementId) as HTMLScriptElement;\n\t\ttry {\n\t\t\tconst out = JSON.parse(data.innerText);\n\t\t\treturn out as TJSON;\n\t\t} catch (error) {\n\t\t\tconsole.warn('Cannot parse component form config', error);\n\t\t}\n\t\treturn {} as TJSON;\n\t};\n\n\trenderDomElementInHTMLElement(element: HTMLElement, html: string): void {\n\t\telement.innerHTML = html;\n\t}\n}\n","import { IInputServicesBase } from 'global/interfaces/controller.interface';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nexport enum InputClasses {\n\terrorClass = 'uk-form-danger',\n\thiddenClass = 'uk-hidden',\n}\nexport class InputServices implements IInputServicesBase {\n\tprivate observedInputs: Record<string, Subscription> = {};\n\n\taddFocusToInput({ element, inputName }: { element: HTMLElement; inputName: string }): void {\n\t\tconst input = element?.querySelector(`input[name='${inputName}']`);\n\t\tif (input) (input as HTMLInputElement).focus();\n\t}\n\n\tobserveElementEvents(\n\t\telement: HTMLInputElement | HTMLSelectElement | HTMLButtonElement,\n\t\tinputEvent: 'input' | 'change' | 'click',\n\t\tonChange: (value: string, event: InputEvent) => any,\n\t): void {\n\t\tconst inputToObserve$ = fromEvent(element, inputEvent);\n\n\t\tthis.observedInputs[element.name] = inputToObserve$.pipe(map(this.mapInputEvent)).subscribe(({ value, event }) =>\n\t\t\tthis.subscribeInputWithErrorRemovalOnInputChange({\n\t\t\t\tvalue,\n\t\t\t\tevent,\n\t\t\t\tonChange,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * This method is in charge of adding error classes to the correct element within an input group on a defined element\n\t * @param {HTMLElement | null} element - The element to update\n\t * @param {Record<string, string>} errors - The errors to manage\n\t */\n\taddErrorsToFieldset({\n\t\telement,\n\t\terrors,\n\t\tonErrorsUpdated,\n\t}: {\n\t\telement: HTMLElement | null;\n\t\terrors: Record<string, string>;\n\t\tonErrorsUpdated?: () => void;\n\t}): void {\n\t\tif (element) {\n\t\t\tObject.keys(errors).forEach((inputName) => {\n\t\t\t\tconst input = element?.querySelector(`input[name='${inputName}']`) as HTMLElement;\n\n\t\t\t\tif (input) {\n\t\t\t\t\tconst errorMessage = errors[inputName] || '';\n\t\t\t\t\tthis.addOrRemoveFormValidationError('SHOW_VALIDATION_ERROR', input, errorMessage);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (onErrorsUpdated) onErrorsUpdated();\n\t\t\tif (errors) {\n\t\t\t\tconst inputNameToFocus = Object.keys(errors)[0];\n\t\t\t\tconst firstErrorElement = element?.querySelector(`input[name='${inputNameToFocus}']`);\n\t\t\t\tif (firstErrorElement) firstErrorElement.scrollIntoView();\n\t\t\t\tif (inputNameToFocus) this.addFocusToInput({ element, inputName: inputNameToFocus });\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(`ADD ERRORS TO FIELDSET: Looks like the element you want to update doesn't exist`);\n\t\t}\n\t}\n\n\taddOrRemoveFormValidationError(showOrHide: 'SHOW_VALIDATION_ERROR' | 'HIDE_VALIDATION_ERROR', input: HTMLElement, errorMessage: string = ''): void {\n\t\tif (!input) return;\n\n\t\tconst label = input.previousElementSibling;\n\t\tconst errorMessageContainer = input.nextElementSibling;\n\n\t\tif (showOrHide === 'SHOW_VALIDATION_ERROR') {\n\t\t\t// add error class to label\n\t\t\tif (label && label.classList) label.classList.add(InputClasses.errorClass);\n\t\t\t// add error class to input\n\t\t\tinput.classList.add(InputClasses.errorClass);\n\t\t\t// if there's an error message, inject it, show the div and add an error class\n\t\t\tif (errorMessageContainer) {\n\t\t\t\terrorMessageContainer.classList.add(InputClasses.errorClass);\n\t\t\t\terrorMessageContainer.classList.remove(InputClasses.hiddenClass);\n\t\t\t\terrorMessageContainer.innerHTML = errorMessage;\n\t\t\t}\n\t\t} else if (showOrHide === 'HIDE_VALIDATION_ERROR') {\n\t\t\t// remove error class from label\n\t\t\tif (label && label.classList) label.classList.remove(InputClasses.errorClass);\n\t\t\t// remove error class from input\n\t\t\tinput.classList.remove(InputClasses.errorClass);\n\t\t\t// remove error message and class\n\t\t\tif (errorMessageContainer) {\n\t\t\t\terrorMessageContainer.classList.remove(InputClasses.errorClass);\n\t\t\t\terrorMessageContainer.classList.add(InputClasses.hiddenClass);\n\t\t\t\terrorMessageContainer.innerHTML = '';\n\t\t\t}\n\t\t}\n\t}\n\n\tsubscribeInputWithErrorRemovalOnInputChange = ({\n\t\tvalue,\n\t\tevent,\n\t\tonChange,\n\t}: {\n\t\tvalue: string;\n\t\tevent: InputEvent;\n\t\tonChange?: (value: string, event: InputEvent) => void;\n\t}): void => {\n\t\tconst castEvent = event.target as HTMLElement;\n\n\t\tconst label = castEvent && castEvent.previousElementSibling;\n\t\tif (label && label.classList.contains(InputClasses.errorClass)) label.classList.remove(InputClasses.errorClass);\n\n\t\tconst input = event.target as HTMLElement;\n\t\tif (input && input.classList.contains(InputClasses.errorClass)) input.classList.remove(InputClasses.errorClass);\n\n\t\tconst errorMessage = castEvent && castEvent.nextElementSibling;\n\t\tif (errorMessage) {\n\t\t\terrorMessage.classList.remove(InputClasses.errorClass);\n\t\t\terrorMessage.classList.add('uk-hidden');\n\t\t}\n\n\t\tif (onChange) onChange(value, event);\n\t};\n\n\tmapInputEvent = (event: InputEvent): { value: string; event: InputEvent } => {\n\t\treturn { value: (event.target as HTMLInputElement | HTMLSelectElement).value, event };\n\t};\n}\n","import { IControllerBase, IDomServices } from 'global/interfaces/controller.interface';\nimport { DomServices } from './DomServices';\nimport { InputServices } from './InputsServices';\nexport default class ControllerBase<T extends Record<keyof T, string> = Record<string, string>> implements IControllerBase<T> {\n\treadonly $element: HTMLElement;\n\treadonly $references: Record<keyof T, HTMLElement>;\n\treadonly ignoredReferences: string[];\n\treadonly includedReferences: string[];\n\treadonly disableReferenceCollection: boolean;\n\t/** See {@link DomServices} */\n\treadonly domUtils: IDomServices<T>;\n\t/** See {@link InputServices} */\n\treadonly inputUtils: InputServices;\n\n\tconstructor(element: HTMLElement, ignoredReferences?: string[], includedReferences?: string[], disableReferenceCollection?: boolean) {\n\t\tthis.$element = element;\n\t\tthis.ignoredReferences = ignoredReferences || [];\n\t\tthis.includedReferences = includedReferences || [];\n\t\tthis.disableReferenceCollection = disableReferenceCollection || false;\n\n\t\tif (!this.disableReferenceCollection) {\n\t\t\tconst references = DomServices.collectReferences<T>(this.$element, this.ignoredReferences, this.includedReferences);\n\t\t\tif (references && Object.keys(references).length > 0) {\n\t\t\t\tthis.$references = references as Record<keyof T, HTMLElement>;\n\t\t\t} else {\n\t\t\t\tthis.$references = {} as Record<keyof T, HTMLElement>;\n\t\t\t}\n\t\t}\n\n\t\tthis.domUtils = new DomServices(this.$element, this.$references);\n\t\tthis.inputUtils = new InputServices();\n\t}\n\n\tdispatchCustomEvent<T>(\n\t\tname: string,\n\t\tdetail: T,\n\t\tbubbles: boolean = false,\n\t\tdispatchOnWindow: boolean = false,\n\t\tdispatchOnSpecificElement?: HTMLElement,\n\t): void {\n\t\tconst customEvent = new CustomEvent(name, { detail: detail, bubbles: bubbles });\n\t\tif (true === dispatchOnWindow) {\n\t\t\twindow.dispatchEvent(customEvent);\n\t\t} else if (dispatchOnSpecificElement) {\n\t\t\tdispatchOnSpecificElement.dispatchEvent(customEvent);\n\t\t} else {\n\t\t\tthis.$element.dispatchEvent(customEvent);\n\t\t}\n\t}\n}\n","import ControllerBase from '../../../../global/js/ControllerBase';\nimport { MoleculeFormProps } from './m-form.data';\nimport { MoleculeFormEvents, MoleculeFormEventTypes } from './m-form.events';\nimport { OrganismFormStepperEvents } from '../../organisms/o-form-stepper/o-form-stepper.events';\n\ninterface ComponentRefs {}\n\ntype HTMLInputTypes = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n\nexport default class ControllerControlledForm extends ControllerBase<ComponentRefs> {\n\tprivate static readonly componentRefs: ComponentRefs = {};\n\n\tprivate inputs: Record<string, HTMLInputTypes> = {};\n\t/** Initialize form validity state */\n\tprivate formValidity = true;\n\t/** A list of translations for the component */\n\tprivate readonly translations: MoleculeFormProps['translations'];\n\tprivate readonly lastControlKeyUp: boolean;\n\tprivate currentElementWithKeyupListener: HTMLInputTypes | undefined;\n\tprivate currentTimer: NodeJS.Timeout;\n\n\tconstructor(element: HTMLElement) {\n\t\tsuper(element, [], Object.values(ControllerControlledForm.componentRefs));\n\t\ttry {\n\t\t\tthis.translations = this.$element.dataset.translations && JSON.parse(this.$element.dataset.translations);\n\t\t\tthis.lastControlKeyUp = this.$element.dataset.lastcontrolinvalidevent === 'keyup' ? true : false;\n\t\t} catch (error) {\n\t\t\tconsole.warn(error, 'Missing translations for m-form');\n\t\t}\n\n\t\tthis.init().validateFields().listenForChanges().observeValidationUpdateRequests().observeFormValidationErrors();\n\t}\n\n\tprivate init(): ControllerControlledForm {\n\t\t// collect a list of inputs, selects, textareas\n\t\tthis.getFields().forEach((input: HTMLInputTypes) => {\n\t\t\tif (input && input.name) {\n\t\t\t\t// check for non-unique names!\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(this.inputs, input.name)) {\n\t\t\t\t\tconsole.warn('Form input name is not unique: ', input.name);\n\t\t\t\t}\n\t\t\t\tthis.inputs[input.name] = input;\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tprivate getFields(): Array<HTMLInputTypes> {\n\t\treturn Array.from<HTMLInputTypes>(this.$element.querySelectorAll('input, textarea, select'));\n\t}\n\n\t/**\n\t * Runs form validation and optionally emits the validity event\n\t * @url https://developer.mozilla.org/en-US/docs/Learn/Forms/Form_validation\n\t * @param  {HTMLInputTypes|null} currentFormElement\n\t * @param  {boolean=true} emitOnlyOnChanged\n\t * @returns ControllerControlledForm\n\t */\n\tprivate validateFields(currentFormElement: HTMLInputTypes | null = null, emitOnlyOnChanged: boolean = true): ControllerControlledForm {\n\t\tthis.dispatchCustomEvent(OrganismFormStepperEvents.FORM_DATA_CHANGED_BY_STEP, 0, false, true);\n\n\t\t// remove old error message from the form element if it exists\n\t\tcurrentFormElement && this.clearValidationErrors(currentFormElement);\n\t\t// if field is required and value empty, add a required error message\n\t\tcurrentFormElement && this.showHTML5ValidationErrors(currentFormElement);\n\n\t\tconst validity = this.runValidation();\n\t\tthis.formValidity = validity.currentValidState;\n\n\t\t// dispatch the form's validity state to the $element. Listening parent components can listen using a reference\n\t\tif (emitOnlyOnChanged && validity.validStateChanged) {\n\t\t\tthis.dispatchCustomEvent(MoleculeFormEvents.VALIDATION_RAN, this.formValidity, false, false);\n\t\t} else {\n\t\t\tthis.dispatchCustomEvent(MoleculeFormEvents.VALIDATION_RAN, this.formValidity, false, false);\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Perform HTML5 validation on collected form fields and report changes to the validation state\n\t * @returns CustomValidity\n\t */\n\tprivate runValidation(): CustomValidity {\n\t\tlet valid: boolean = true;\n\t\tconst currentValidity = this.formValidity;\n\t\tconst invalidInputs: HTMLInputTypes[] = [];\n\n\t\tfor (const key in this.inputs) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(this.inputs, key)) {\n\t\t\t\tconst element = this.inputs[key];\n\t\t\t\tif (element.validity.valid === false) {\n\t\t\t\t\tif (this.lastControlKeyUp) {\n\t\t\t\t\t\t// remember that the input was invalid\n\t\t\t\t\t\tinvalidInputs.push(element);\n\t\t\t\t\t}\n\n\t\t\t\t\t// test inputs to find at least one that is not valid\n\t\t\t\t\tif (valid === true) {\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// set up keyup events for the last invalid input\n\t\tif (invalidInputs.length === 1) {\n\t\t\tconst elInv = invalidInputs[0];\n\t\t\tif (elInv.tagName.toUpperCase() === 'INPUT') {\n\t\t\t\telInv.addEventListener('keyup', (e) => this.onKeyup(e, elInv));\n\t\t\t\tthis.currentElementWithKeyupListener = elInv;\n\t\t\t}\n\t\t} else if (this.currentElementWithKeyupListener) {\n\t\t\t// reset keyup event listeners\n\t\t\tthis.currentElementWithKeyupListener.removeEventListener('keyup', (e) =>\n\t\t\t\tthis.onKeyup(e, this.currentElementWithKeyupListener as HTMLInputTypes),\n\t\t\t);\n\t\t\tclearTimeout(this.currentTimer);\n\t\t\tthis.currentElementWithKeyupListener = undefined;\n\t\t}\n\n\t\tconst validity: CustomValidity = {\n\t\t\tpreviousValidState: currentValidity,\n\t\t\tcurrentValidState: valid,\n\t\t\tvalidStateChanged: currentValidity !== valid,\n\t\t};\n\t\treturn validity;\n\t}\n\n\tprivate onKeyup(e: Event, elInv: HTMLInputTypes) {\n\t\tif (this.currentTimer) {\n\t\t\tclearTimeout(this.currentTimer);\n\t\t}\n\t\tthis.currentTimer = setTimeout(() => {\n\t\t\tthis.validateFields(elInv);\n\t\t}, 500);\n\t}\n\n\tprivate listenForChanges(): ControllerControlledForm {\n\t\tfor (const key in this.inputs) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(this.inputs, key)) {\n\t\t\t\tconst elem = this.inputs[key];\n\t\t\t\tswitch (elem.tagName.toUpperCase()) {\n\t\t\t\t\tcase 'INPUT': {\n\t\t\t\t\t\telem.addEventListener('blur', (e) => {\n\t\t\t\t\t\t\tthis.validateFields(elem);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'RADIO': // todo\n\t\t\t\t\tcase 'TEXTAREA':\n\t\t\t\t\tcase 'SELECT': {\n\t\t\t\t\t\telem.addEventListener('change', (e) => this.validateFields(elem));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Support for re-running validation from parent component\n\t * @returns ControllerControlledForm\n\t */\n\tprivate observeValidationUpdateRequests(): ControllerControlledForm {\n\t\tthis.$element.addEventListener(MoleculeFormEvents.RERUN_VALIDATION, (event: CustomEvent<MoleculeFormEventTypes['RERUN_VALIDATION']>) => {\n\t\t\tif (event.detail) {\n\t\t\t\tthis.validateFields(null, false);\n\t\t\t}\n\t\t});\n\t\treturn this;\n\t}\n\n\tprivate observeFormValidationErrors(): ControllerControlledForm {\n\t\twindow.addEventListener(\n\t\t\tMoleculeFormEvents.DISPLAY_VALIDATION_ERRORS,\n\t\t\t(event: CustomEvent<MoleculeFormEventTypes['DISPLAY_VALIDATION_ERRORS']>) => {\n\t\t\t\tif (event.detail) {\n\t\t\t\t\tthis.updateValidationErrors(event.detail);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t\treturn this;\n\t}\n\n\tprivate updateValidationErrors(errors: MoleculeFormEventTypes['DISPLAY_VALIDATION_ERRORS']): void {\n\t\tif (!errors) return;\n\t\tthis.inputUtils.addErrorsToFieldset({ element: this.$element, errors });\n\t}\n\n\tprivate clearValidationErrors(formElement: HTMLInputTypes): ControllerControlledForm {\n\t\tthis.inputUtils.addOrRemoveFormValidationError('HIDE_VALIDATION_ERROR', formElement);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Show additional client-side validation errors, such as when a field is 'touched' by the user, show a required validation error if the field in required and invalid\n\t * @param  {HTMLInputTypes} formElement\n\t * @returns ControllerControlledForm\n\t */\n\tprivate showHTML5ValidationErrors(formElement: HTMLInputTypes): ControllerControlledForm {\n\t\tif (formElement.required && formElement.validity.valid === false) {\n\t\t\tthis.inputUtils.addOrRemoveFormValidationError(\n\t\t\t\t'SHOW_VALIDATION_ERROR',\n\t\t\t\tformElement,\n\t\t\t\tthis.translations.fieldIsRequired || 'This field is required.',\n\t\t\t);\n\t\t}\n\t\t// ...more support for patterns and general invalid fields, min length etc...?\n\t\treturn this;\n\t}\n}\n\ninterface CustomValidity {\n\t/** The previous HTML5 validation state of the form elements */\n\tpreviousValidState: boolean;\n\t/** The current or new HTML5 validation state of the form elements after checking validation */\n\tcurrentValidState: boolean;\n\t/** True if the state changed since last check */\n\tvalidStateChanged: boolean;\n}\n","import { FormFieldErrors } from 'global/interfaces/http.interface';\nimport { ComponentEvents } from '../../../../global/interfaces/component.interface';\n\nconst EVENT_PREFIX = 'MoleculeFormEvents__';\n\n/** The type of custom events emitted in event.detail */\nexport type MoleculeFormEventTypes = {\n\tVALIDATION_RAN: boolean;\n\tRERUN_VALIDATION: boolean;\n\t/** This will be like { firstname: 'Please provide your name', address1: 'Invalid address' } */\n\tDISPLAY_VALIDATION_ERRORS: FormFieldErrors;\n};\n\n/** The event names for the above events */\nexport const MoleculeFormEvents: ComponentEvents<MoleculeFormEventTypes> = {\n\t/** Event emitted everytime the HTML5 validation is run */\n\tVALIDATION_RAN: EVENT_PREFIX + 'VALIDATION_RAN',\n\tRERUN_VALIDATION: EVENT_PREFIX + 'RERUN_VALIDATION',\n\t/** Event listener for external controllers to tell the m-form to show a list of validation errors */\n\tDISPLAY_VALIDATION_ERRORS: EVENT_PREFIX + 'DISPLAY_VALIDATION_ERRORS',\n};\n","import { ComponentEvents } from '../../../../global/interfaces/component.interface';\n\nconst EVENT_PREFIX = 'FormstepSelectIconEvents__';\n\n/** The type of custom events emitted */\nexport type FormstepSelectIconEventTypes = {\n\tREQUEST_VALIDATION: string;\n};\n\n/** The event names for the above events */\nexport const FormstepSelectIconEvents: ComponentEvents<FormstepSelectIconEventTypes> = {\n\tREQUEST_VALIDATION: EVENT_PREFIX + 'REQUEST_VALIDATION',\n};\n","import { ComponentEvents } from '../../../../global/interfaces/component.interface';\n\nconst EVENT_PREFIX = 'FormstepSelectImageEvents__';\n\nexport interface MoleculeSelectImageOptionChangedEvent {\n\tselectedOptions: any[];\n}\n\nexport interface MoleculeSelectImageEvent {\n\tcurrentStep: number;\n\tselectedValue: string;\n\tisSelected: boolean;\n}\n\n/** The type of custom events emitted */\nexport type FormstepSelectImageEventTypes = {\n\tREQUEST_VALIDATION: string;\n\tSELECT_OPTION_CHANGED: MoleculeSelectImageOptionChangedEvent;\n\tSELECT_IMAGE: MoleculeSelectImageEvent;\n};\n\n/** The event names for the above events */\nexport const FormstepSelectImageEvents: ComponentEvents<FormstepSelectImageEventTypes> = {\n\tREQUEST_VALIDATION: EVENT_PREFIX + 'REQUEST_VALIDATION',\n\tSELECT_OPTION_CHANGED: EVENT_PREFIX + 'SELECT_OPTION_CHANGED',\n\tSELECT_IMAGE: EVENT_PREFIX + 'SELECT_IMAGE',\n};\n","import { ComponentEvents } from '../../../../global/interfaces/component.interface';\n\nconst EVENT_PREFIX = 'FormstepWarrantyStep2Events__';\n\n/** The type of custom events emitted */\nexport type FormstepWarrantyStep2EventTypes = {\n\tREQUEST_VALIDATION: string;\n};\n\n/** The event names for the above events */\nexport const FormstepWarrantyStep2Events: ComponentEvents<FormstepWarrantyStep2EventTypes> = {\n\tREQUEST_VALIDATION: EVENT_PREFIX + 'REQUEST_VALIDATION',\n};\n","import { ComponentEvents } from '../../../../global/interfaces/component.interface';\n\nconst EVENT_PREFIX = 'FormstepWarrantyStep3Events__';\n\n/** The type of custom events emitted */\nexport type FormstepWarrantyStep3EventTypes = {\n\tREQUEST_VALIDATION: string;\n};\n\n/** The event names for the above events */\nexport const FormstepWarrantyStep3Events: ComponentEvents<FormstepWarrantyStep3EventTypes> = {\n\tREQUEST_VALIDATION: EVENT_PREFIX + 'REQUEST_VALIDATION',\n};\n","import { ComponentEvents } from '../../../../global/interfaces/component.interface';\n\nconst EVENT_PREFIX = 'FormstepWarrantyWolfProductsEvents__';\n\n/** The type of custom events emitted */\nexport type FormstepWarrantyWolfProductsEventTypes = {\n\t// DISABLE_GO_TO_NEXT_STEP: string;\n\tREQUEST_VALIDATION: string;\n};\n\n/** The event names for the above events */\nexport const FormstepWarrantyWolfProductsEvents: ComponentEvents<FormstepWarrantyWolfProductsEventTypes> = {\n\t// DISABLE_GO_TO_NEXT_STEP: EVENT_PREFIX + 'DISABLE_GO_TO_NEXT_STEP',\n\n\tREQUEST_VALIDATION: EVENT_PREFIX + 'REQUEST_VALIDATION',\n};\n","import { MoleculeFormStepResumeSliceProps } from 'wolf/components/molecules/m-formstep-resume-slice/m-formstep-resume-slice.data';\nimport { FormstepWarrantyStep2Events } from 'wolf/components/molecules/m-formstep-warranty-step-2/m-formstep-warranty-step-2.events';\nimport { FormstepWarrantyStep3Events } from 'wolf/components/molecules/m-formstep-warranty-step-3/m-formstep-warranty-step-3.events';\nimport { FormstepWarrantyWolfProductsEvents } from 'wolf/components/molecules/m-formstep-warranty-wolf-products/m-formstep-warranty-wolf-products.events';\nimport { ComponentEvents } from '../../../../global/interfaces/component.interface';\nimport { FormstepSelectImageEvents } from '../../molecules/m-formstep-select-image/m-formstep-select-image.events';\nimport { FormstepSelectIconEvents } from '../../molecules/m-formstep-select-icon/m-formstep-select-icon.events';\n\n/**\n * Support for differentiating between the type of successful\n * validation events triggered by FE or BE validation events\n * Note: treat as bitwise flags so we can set them!\n */\nexport enum FormStepperValidationEventClientServerEnum {\n\t/** Events carried out on the client, in the frontend controllers */\n\tFrontend = 1,\n\t/** Events carried out on the backend API */\n\tBackend = 2,\n\t// Another = 4,\n}\n\nexport interface FormStepperValidationEvent {\n\tonValidationSuccess: (validationLocation?: FormStepperValidationEventClientServerEnum, resumeSlice?: MoleculeFormStepResumeSliceProps) => void;\n\tonValidationError: (validationLocation?: FormStepperValidationEventClientServerEnum) => void;\n\tcurrentStep: number;\n}\n\nconst EVENT_PREFIX = 'FormStepperEvents__';\n\n/** The type of custom events emitted in event.detail */\nexport type OrganismFormStepperEventTypes = {\n\tDISABLE_GO_TO_NEXT_STEP: boolean;\n\tENABLE_GO_TO_NEXT_STEP: boolean;\n\tRECEIVE_RESUME_SLICE: ResumeSliceSummary[];\n\tREQUEST_GO_TO_STEP: number;\n\tRECEIVE_CONTROLLED_FORM_SLICE: ControlledFormSlice;\n\tREMOVE_CONTROLLED_FORM_SLICE: ControlledFormSlice;\n\tFORM_DATA_CHANGED_BY_STEP: number;\n\tRESET_VALIDATION_SCORE_BY_STEP: number;\n};\n\n/** The event names for the above events */\nexport const OrganismFormStepperEvents: ComponentEvents<OrganismFormStepperEventTypes> = {\n\t/** If true, the 'next step' button is disabled */\n\tDISABLE_GO_TO_NEXT_STEP: EVENT_PREFIX + 'DisableNextStep',\n\tENABLE_GO_TO_NEXT_STEP: EVENT_PREFIX + 'EnableNextStep',\n\tRECEIVE_RESUME_SLICE: EVENT_PREFIX + 'ReceiveResumeSlice',\n\tREQUEST_GO_TO_STEP: EVENT_PREFIX + 'RequestGoToStep',\n\tRECEIVE_CONTROLLED_FORM_SLICE: EVENT_PREFIX + 'ReceiveControlledFormSlice',\n\tREMOVE_CONTROLLED_FORM_SLICE: EVENT_PREFIX + 'RemoveControlledFormSlice',\n\tFORM_DATA_CHANGED_BY_STEP: EVENT_PREFIX + 'FormDataChangedByStep',\n\tRESET_VALIDATION_SCORE_BY_STEP: EVENT_PREFIX + 'ResetValidationScoreByStep',\n};\n\nexport interface ResumeSliceSummary {\n\tstep: number;\n\tresumeSlices: MoleculeFormStepResumeSliceProps[];\n}\n\nexport interface ControlledFormSlice {\n\tstepId: string;\n\tformSlice: Record<string, string>;\n}\n\nexport type ValidationClientsideEventController =\n\t| 'm-formstep-warranty-wolf-products'\n\t| 'm-formstep-warranty-step-2'\n\t| 'm-formstep-warranty-step-3'\n\t| 'm-formstep-select-image'\n\t| 'm-formstep-select-icon';\n\nexport const ValidationEventMapper: Record<ValidationClientsideEventController, string> = {\n\t'm-formstep-warranty-wolf-products': FormstepWarrantyWolfProductsEvents.REQUEST_VALIDATION,\n\t'm-formstep-warranty-step-2': FormstepWarrantyStep2Events.REQUEST_VALIDATION,\n\t'm-formstep-warranty-step-3': FormstepWarrantyStep3Events.REQUEST_VALIDATION,\n\t'm-formstep-select-image': FormstepSelectImageEvents.REQUEST_VALIDATION,\n\t'm-formstep-select-icon': FormstepSelectIconEvents.REQUEST_VALIDATION,\n};\n"],"names":["DomServices","constructor","element","references","onDomElementChanged","Subject","parseStringToHtml","htmlAsString","parsedNode","DOMParser","parseFromString","body","firstChild","renderDomElement","ref","html","renderOnParent","refExists","this","$references","Object","prototype","hasOwnProperty","call","undefined","$element","innerHTML","domElementChanged","console","warn","appendRawHtmlToDomElement","node","position","htmlNode","insertAdjacentElement","replaceLastChildElementWithRawHtml","lastNode","childNodes","length","replaceChild","reference","next","parseDOMScriptTag","elementId","data","document","getElementById","JSON","parse","innerText","error","collectReferences","ignoredReferences","includedReferences","refs","Array","from","querySelectorAll","forEach","el","referenceName","dataset","includes","window","location","hostname","name","getRef","toggleElementState","control","newState","state","removeAttribute","setAttribute","renderDomElementInHTMLElement","InputClasses","InputServices","observedInputs","subscribeInputWithErrorRemovalOnInputChange","value","event","onChange","castEvent","target","label","previousElementSibling","classList","contains","errorClass","remove","input","errorMessage","nextElementSibling","add","mapInputEvent","addFocusToInput","inputName","querySelector","focus","observeElementEvents","inputEvent","inputToObserve$","fromEvent","pipe","map","subscribe","addErrorsToFieldset","errors","onErrorsUpdated","Error","keys","addOrRemoveFormValidationError","inputNameToFocus","firstErrorElement","scrollIntoView","showOrHide","errorMessageContainer","hiddenClass","ControllerBase","disableReferenceCollection","domUtils","inputUtils","dispatchCustomEvent","detail","bubbles","dispatchOnWindow","dispatchOnSpecificElement","customEvent","CustomEvent","dispatchEvent","ControllerControlledForm","super","values","componentRefs","inputs","formValidity","translations","lastControlKeyUp","lastcontrolinvalidevent","init","validateFields","listenForChanges","observeValidationUpdateRequests","observeFormValidationErrors","getFields","currentFormElement","emitOnlyOnChanged","FORM_DATA_CHANGED_BY_STEP","clearValidationErrors","showHTML5ValidationErrors","validity","runValidation","currentValidState","validStateChanged","VALIDATION_RAN","valid","currentValidity","invalidInputs","key","push","elInv","tagName","toUpperCase","addEventListener","e","onKeyup","currentElementWithKeyupListener","removeEventListener","clearTimeout","currentTimer","previousValidState","setTimeout","elem","RERUN_VALIDATION","DISPLAY_VALIDATION_ERRORS","updateValidationErrors","formElement","required","fieldIsRequired","EVENT_PREFIX","MoleculeFormEvents","FormstepSelectIconEvents","REQUEST_VALIDATION","FormstepSelectImageEvents","SELECT_OPTION_CHANGED","SELECT_IMAGE","FormstepWarrantyStep2Events","FormstepWarrantyStep3Events","FormstepWarrantyWolfProductsEvents","FormStepperValidationEventClientServerEnum","OrganismFormStepperEvents","DISABLE_GO_TO_NEXT_STEP","ENABLE_GO_TO_NEXT_STEP","RECEIVE_RESUME_SLICE","REQUEST_GO_TO_STEP","RECEIVE_CONTROLLED_FORM_SLICE","REMOVE_CONTROLLED_FORM_SLICE","RESET_VALIDATION_SCORE_BY_STEP","ValidationEventMapper"],"sourceRoot":""}