1(self.webpackChunkyit_uid_framework=self.webpackChunkyit_uid_framework||[]).push([[132],{4294:(e,t,i)=>{"use strict";i.d(t,{default:()=>a});var n=i(8341);const a=()=>{new n.Ay({className:"Form"})}},5224:(e,t,i)=>{"use strict";i.d(t,{A:()=>p});var n=i(1669),a=i.n(n),r=i(680),o=i.n(r);const s=function(e,t){if(t&&e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).filter(i=>i[t]===e)[0]||!1}return!1},l=e=>{const t=e.split(".");let i=self;for(let n=0;n!==t.length;n++){if(!(t[n]in i)){i=void 0;break}i=i[t[n]]}return i};const d=class{constructor(e){this.validateFields=l(`epi.EPiServer.Forms.${e}.ValidationInfo`)||[]}add(e){return this.validateFields.push(e)-1}find(e){return s(e,"targetElementName",this.validateFields)}delete(e){const t=this.validateFields.indexOf(e);return t>-1&&this.validateFields.splice(t,1),this}};const m=class{constructor(e){const{parent:t,separator:i="|"}=e;this.parent=t,this.form=a()(this.parent).closest("form").get(0),this.epiValidators=new d(this.form.id),this.separator=this.parent.dataset.separator||i,this.fields=[],"$$epiforms"in self&&self.$$epiforms(this.form).on("formsStepValidating",e=>{e.isValid&&this.collectData()})}add(e){const{fElementName:t}=e.dataset,i=this.findByName(t)||this.create(t),n=i.items.push({el:e});return this.rename(i,n-1),this}create(e){const t=this.epiValidators.find(e),i=!!t&&Object.assign({},t),n=this.createHidden(e),a=this.fields.push({name:e,validators:i,hidden:n,items:[]});return this.epiValidators.delete(t),this.fields[a-1]}createHidden(e){const t=document.createElement("input");return t.classList.add("Form__Element"),t.classList.add("FormHidden"),t.setAttribute("type","hidden"),t.setAttribute("name",e),t.setAttribute("data-f-type","hidden"),this.parent.appendChild(t),t}collectData(){this.fields.forEach(e=>{const t=[];e.items.forEach(e=>{let i=this.getElementValue(e.el);null!=i&&(i.constructor==Array?i=i.map(e=>(("string"==typeof e||e instanceof String)&&(e=e.replace(new RegExp(o()(this.separator),"g"),`\\${this.separator}`)),e)):("string"==typeof i||i instanceof String)&&(i=i.replace(new RegExp(o()(this.separator),"g"),`\\${this.separator}`)),t.push(i))});const i=0==t.length?"---":t.join(`${this.separator}`);e.hidden.setAttribute("value",i)})}findByName(e){return s(e,"name",this.fields)}getElementValue(e){return l("epi.EPiServer.Forms.Utils.getElementValue")(a()(e))}rename(e,t){const{name:i,items:n,validators:a}=e,r=n[t],{el:o}=r,s=`_${t}`,l=i+s,d=(o.id||i)+s,m=o.querySelectorAll(`[name="${i}"]`),u=o.querySelector(`[data-f-linked-name="${i}"]`);if(r.name=l,a){const e=Object.assign({},a,{targetElementName:l,targetElementId:d});this.epiValidators.add(e)}o.setAttribute("data-f-element-name",l),o.setAttribute("id",d),u&&u.setAttribute("data-f-linked-name",l),m.forEach(e=>{const t=e.getAttribute("id"),i=e.querySelector(`[for="${t}"]`),n=t+s;i&&i.setAttribute("for",n),e.setAttribute("id",n),e.setAttribute("name",l)})}removeLast(){this.fields.forEach(e=>{const{items:t}=e;if(t.length>0){const e=t.pop(),i=this.epiValidators.find(e.name);this.epiValidators.delete(i)}})}},u="FieldsRow",c="FieldsRow__Btn";const p=class{constructor(e){this.el=e,this.rows=[],this.addGroupButton=this.el.dataset.newbutton,this.allowEmpty=void 0!==this.el.dataset.allow0,this.maxRows=this.el.dataset.maxrows,this.fields=new m({parent:e}),this.initial=this.el.cloneNode(!0),this.addLabel=this.el.dataset.add?this.el.dataset.add:"Add",this.removeLabel=this.el.dataset.remove?this.el.dataset.remove:"Remove",this.init()}init(){this.add(this.el.children,!1),this.btnAdd=this.createButton({classNames:`${c} ${c}--add`,value:this.addLabel}),1==this.maxRows&&this.btnAdd.classList.add("hidden"),this.btnRemove=this.createButton({classNames:`${c} ${c}--remove`,value:this.removeLabel}),this.btnAdd.addEventListener("click",this.addListener.bind(this)),this.btnRemove.addEventListener("click",this.removeListener.bind(this)),this.el.classList.add(u),this.allowEmpty&&(this.addGroupButton&&(this.btnNew=this.createButton({classNames:`${c} ${c}--new`,value:this.addGroupButton}),this.btnNew.addEventListener("click",this.addListener.bind(this))),this.removeListener(),this.el.style.display="block"),(0==this.rows.length||1==this.rows.length&&!this.allowEmpty)&&this.btnRemove.classList.add("disabled")}add(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=document.createElement("div");return i.classList.add(`${u}
1__Row`),Array.from(e).forEach(e=>{const n=t?e.cloneNode(!0):e;n.classList.contains("Form__Element")&&this.fields.add(n),i.appendChild(n)}),this.el.appendChild(i),this.rows.push(i),1==this.rows.length&&1==t&&this.toggleButtons(!0),this.btnRemove&&this.btnRemove.classList.remove("disabled"),this.btnAdd&&this.maxRows>0&&this.rows.length==this.maxRows&&this.btnAdd.classList.add("hidden"),this}addListener(e){e.preventDefault(),this.add(this.initial.children)}removeListener(e){if(e&&e.preventDefault(),this.rows.length-1>0||this.rows.length>0&&this.allowEmpty){const e=this.rows.pop();this.fields.removeLast(),e.parentElement.removeChild(e),0==this.rows.length&&this.toggleButtons(!1),(0==this.rows.length||1==this.rows.length&&!this.allowEmpty)&&this.btnRemove.classList.add("disabled"),this.btnAdd.classList.remove("hidden")}}createButton(e){if(!this.btnContainer){const e=document.createElement("div");e.classList.add(`${u}__Btns`),this.btnContainer=this.el.appendChild(e)}const{classNames:t="",value:i=""}=e,n=document.createElement("a");return n.href="#",n.title=i,n.text=i,t.split(" ").forEach(e=>n.classList.add(e)),this.btnContainer.appendChild(n)}toggleButtons(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.addGroupButton&&(e?this.btnContainer.classList.remove("FieldsRow__Btns--center"):this.btnContainer.classList.add("FieldsRow__Btns--center"))}}},5751:()=>{"undefined"!=typeof $$epiforms&&function(e){if("undefined"!=typeof epi&&void 0!==epi.EPiServer&&void 0!==epi.EPiServer.Forms&&void 0!==e){var t=function(e,t){this.workingFormInfo=t.workingFormInfo,this.dependantInfo=e,this.$domElement=n.getFormElementBlock(e.fieldName,this.workingFormInfo.$workingForm),this.onDependencyStateChanged=t.onDependencyStateChanged,this.dependency=new epi.EPiServer.Forms.Dependency.Dependant(e,t.workingFormInfo),this._registerEventListener(this.dependency),this.isSatisfied=this.dependency.isSatisfied,"function"==typeof this.onDependencyStateChanged&&this.onDependencyStateChanged(this.$domElement,this.dependantInfo,this.isSatisfied),this.check()};t.prototype={_registerEventListener:function(t){var i=this;e(t).on("change",function(e,t){i.onDependencyChangeHandler.call(i,t)})},onDependencyChangeHandler:function(t){this.isSatisfied!==t.isSatisfied&&(this.isSatisfied=t.isSatisfied,this._executeAction(),"function"==typeof this.onDependencyStateChanged&&this.onDependencyStateChanged(this.$domElement,this.dependantInfo,this.isSatisfied),e(this.$domElement).trigger("formsDependencyStateChanged"))},check:function(){this.dependency.runCheck()},_executeAction:function(){if(this.dependantInfo.action){var e=epi.EPiServer.Forms.Dependency.Actions,t=this.dependantInfo.action.clientsideAction;e[t]&&"function"==typeof e[t]&&e[t](this)}}};var i=function(e,t){this.workingFormInfo=t,this.conditions=e.conditions,this.conditionCombination=e.conditionCombination,this.isSatisfied=null,this._registerEventListener()};i.prototype={_registerEventListener:function(){if(this.conditions&&!(this.conditions.length<=0))for(var t=this,i=[],a=0;a<this.conditions.length;a++){var r=this.conditions[a];if(-1===i.indexOf(r.fieldName)){var o=n.getFormElementBlock(r.fieldName,this.workingFormInfo.$workingForm),s=e("[data-f-datainput]",o),d=l._getTriggerEventsForDependeeElement(o);d&&d.length>0&&e.each(d,function(e,i){"change"!==i?s[i](n.debounce(function(e){e.stopPropagation(),t._handleValueChange()},epi.EPiServer.Forms.ThrottleTimeout,t)):s[i](function(){t._handleValueChange.apply(t)})}),e(o).on("formsDependencyStateChanged",function(e,i){t._handleValueChange.apply(t)}),i.push(r.fieldName)}}},runCheck:function(){this._handleValueChange()},_handleValueChange:function(){var t=this.isSatisfied;this.isSatisfied=this._checkSatisfaction(),this.isSatisfied!==t&&e(this).trigger("change",{isSatisfied:this.isSatisfied})},_checkSatisfaction:function(){if(!this.conditions||this.conditions.length<=0)return!0;for(var e=0;e<this.conditions.length;e++){var t=this.conditions[e],i=this._getFieldState(t.fieldName),n=epi.EPiServer.Forms.DependConditions[t.operator];if("function"==typeof n){var a=n(i.value,t.fieldValue);if(a&&this.conditionCombination===epi.EPiServer.Forms.Dependency.ConditionCombinations.Any)return!0;
1if(!a&&this.conditionCombination!==epi.EPiServer.Forms.Dependency.ConditionCombinations.Any)return!1}}return!(this.conditionCombination===epi.EPiServer.Forms.Dependency.ConditionCombinations.Any)},_getFieldState:function(e){var t=n.getFormElementBlock(e,this.workingFormInfo.$workingForm);return t?{value:epi.EPiServer.Forms.Dependency._getValueOfDependeeElement(t,this.workingFormInfo)}:null}};var n=epi.EPiServer.Forms.Utils,a=epi.EPiServer.Forms.Data,r=epi.EPiServer.Forms.Extension,o=epi.EPiServer.Forms.Validation,s=epi.EPiServer.Forms.Navigation,l=epi.EPiServer.Forms.Dependency;epi.EPiServer.Forms.__DebounceTimer=null,epi.EPiServer.Forms.__Initialized=!(void 0===epi.EPiServer.Forms.__Initialized),e.extend(!0,epi.EPiServer.Forms,{Utils:{debounce:function(e,t,i){return function(){!function(e,i,n,a){clearTimeout(a.__DebounceTimer),a.__DebounceTimer=setTimeout(function(){i.apply(e,n)},t)}(this,e,arguments,i||epi.EPiServer.Forms)}},isInactiveField:function(e,t){return l._isInactiveElement(t,e)},loadExternalScriptOnDemand:function(e,t,i){var a=document.getElementsByTagName("body")[0],r=0,o=e.length,s=null,l=null;for(n.LoadedScripts=n.LoadedScripts||[];r<o;r++)s=e[r],n.LoadedScripts.indexOf(s)>=0||((l=document.createElement("script")).type="text/javascript",l.async=i||!1,l.defer=i||!1,l.src=s,a.appendChild(l),n.LoadedScripts.push(s));l?n._setupCallback(l,t):t()},loadExternalCssOnDemand:function(e,t){for(var i=document.getElementsByTagName("head")[0],a=0,r=e.length,o=null;a<r;a++){o=e[a];var s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("href",o),i.appendChild(s),a===r-1&&n._setupCallback(s,t)}},_setupCallback:function(e,t){"function"==typeof t&&(e.onload=t,e.onreadystatechange=function(){"complete"===this.readyState&&t()})},stringFormat:function(e,t){for(var i=e,n=t.length;n--;)i=i.replace(new RegExp("\\{"+n+"\\}","gm"),t[n]||"");return i},getConcatString:function(e,t){return e instanceof Array?e.join(t):e},htmlEncodeEntities:function(t){return e("<div></div>").text(t).html()},htmlDecodeEntities:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value},isMatchedReg:function(e,t){try{var i=new RegExp(t).exec(e);return null!=i&&i.length>0}catch(n){return!1}},raiseFormsEvent:function(t,i){var n=e.extend(!0,{type:"forms",workingFormInfo:t},i);if(t)t.$workingForm.triggerHandler(n);else{var a=e('.EPiServerForms:eq(0), [data-f-type="form"]:first');(!a||a.length<1)&&(a=e("body")),a.triggerHandler(n)}},injectVisitorData:function(t){var i=e(".FormHidden[data-epiforms-visitordatasources], [data-f-visitordatasources]",t.$workingForm);if(i&&0!==i.length){var n=null;i.each(function(){if((n=e(this))&&n.length>0){var t=null,i=n.data("epiforms-visitordatasources")||n.data("f-visitordatasources");e(i.split(",")).each(function(e,i){"function"==typeof(t=epi.EPiServer.Forms.VisitorData[i])&&t(n)})}})}},isElementType:function(e,t){return e.data("f-type")===t},getElementName:function(e){return e.attr("name")||e.data("epiforms-element-name")||e.data("f-element-name")},getElementValue:function(t){return t.hasClass("FormFileUpload")||n.isElementType(t,"fileupload")?n.getPreviousPostedFiles(t):t.hasClass("FormChoice")||n.isElementType(t,"choice")?t.find(".FormChoice__Input:checked, [data-f-datainput]:checked").map(function(t,i){return e(i).val()}).get():t.hasClass("FormSelection")||n.isElementType(t,"selection")?[].concat(t.find("select").val()):t.hasClass("FormCaptcha")||t.hasClass("FormTextbox")||t.hasClass("FormTextbox--Textarea")||n.isElementType(t,"captcha")||n.isElementType(t,"textbox")?e(".FormTextbox__Input, [data-f-datainput]",t).val().trim():t.hasClass("FormRange")||n.isElementType(t,"range")?e(".FormRange__Input, [data-f-datainput]",t).val().trim():t.hasClass("Form__CustomElement")||n.isElementType(t,"custom")?epi.EPiServer.Forms.Extension.getCustomElementValue(t):n.getNonSpecificElementValue(t)},getFormStepBlock:function(e,t){return n.getFormElementBlock(e,t)},getFormElementBlock:function(t,i){if(!t)return[];var n=e(".Form__Element [data-epiforms-element-name='"+t+"']",i);return n&&0!==n.length||(n=e("[data-f-element-name='"+t+"']",i)),n},getWorkingFormFromInnerElement:function(t){return e(t).parents(".EPiServerForms:first, [data-f-type='form']:first")},getFormIdentifier:function(e){return e.prop("id")},getPreviousPostedFiles:function(t){var i=t.find(".FormFileUpload__Input, [data-f-datainput]"),a=n.getElementName(i),r=n.getWorkingFormFromInnerElement(i),o=epi.EPiServer.Forms.Utils.getFormIdentifier(r),s=epi.EPiServer.Forms.Data.loadFormDataFromStorage(o),l=i[0].files;return e.each(s,function(e,t){if(e.indexOf("__TempData")>-1&&e.replace("__TempData","")==a&&0===l.length)return l=t,!1}),l},getNonSpecificElementValue:function(t){if(!t.attr("data-f-element-name"))return t.val().trim();var i=t.find(":input");if(0===i.length)return t.val().trim();if("input"!=i[0].tagName.toLowerCase())return e(i[0]).val().trim();var n=i[0].type.toLowerCase();return"checkbox"==n||"radio"==n?i.filter(":checked").map(function(t,i){return e(i).val()}).get():e(i[0]).val().trim()},getCurrentStepIndex:function(t){var i=e("input[name=__FormCurrentStepIndex]",t.$workingForm).val();return void 0===i||""===i.trim()||isNaN(+i)||+i>t.StepsInfo.Steps.length-1?t.StepsInfo.AllStepsAreNotLinked?i=0:e.each(t.StepsInfo.Steps,function(e,n){if(n.attachedContentLink==epi.EPiServer.CurrentPageLink&&r.isStepSatisfyDependentCondition(n,t))return i=e,!1}):i=+i,i},setCurrentStepIndex:function(t,i){return e("input[name=__FormCurrentStepIndex]",t.$workingForm).val(i),i},validateRegularExpressionValidator:function(e,t,i){return i&&i.model&&i.model.jsPattern&&""!==t?n.isMatchedReg(t,i.model.jsPattern)?{isValid:!0}:{isValid:!1,message:n.stringFormat(i.model.message,[i.model.jsPattern,i.description])}:{isValid:!0}}
1,showNextStepOnEnterKeyDown:function(t){var i=n.getWorkingFormFromInnerElement(t.target),a=t.keyCode,r=e(".Form__NavigationBar .Form__NavigationBar__Action.btnNext, [data-f-type='navigationbar'] [data-f-navigation-next]",i),o=e(".Form__Element.FormSubmitButton, [data-f-type='submitbutton']",i).parent(".FormStep, [data-f-type='step']").filter(function(t){return!e(this).hasClass("hide")});return 13!==a||0!==o.length||null==r||!r.length||(t.preventDefault(),t.stopPropagation(),r.trigger("click"),!0)},scrollToTheTopOfForm:function(t){null!=t&&"fixed"!==t.css("position").toLowerCase()&&e(document).scrollTop()>0&&window.scrollTo(0,t.offset().top)}},Extension:{getSummarizedText:function(t,i,a){var r=a?"<br/>":"\n",o=a?t.ConfirmMessage:n.htmlDecodeEntities(t.ConfirmMessage),s=t.ElementsInfo,l=[],d=[],m=["__FormGuid","__FormLanguage","__FormCurrentStepIndex","__FormSubmissionId"],u=t.ConfirmMessage?o+r+r:"",c=null,p=null;for(var f in i)if(!(l.indexOf(f.replace("__TempData",""))>-1||n.isInactiveField(t,f))){var h=f.indexOf("__TempData")>-1?s[f.replace("__TempData","")]:s[f];c=h&&h.friendlyName?h.friendlyName:"",(null==(p=h&&1==h.customBinding?epi.EPiServer.Forms.CustomBindingElements[h.type](h,i[f]):i[f])||p instanceof Array&&0===p.length||e.isEmptyObject(p))&&(p=""),p instanceof Array?p=e.map(p,function(e,t){return e?"string"==typeof e?e:"object"==typeof e?e.name:void 0:null}).join(", "):p instanceof FileList&&0===p.length?p="":(p=p.toString().substr(0,46).trim()).length>=45&&(p+=" ..."),e("[name="+f+"]",t.$workingForm).hasClass("FormHideInSummarized")&&d.push(f),""==c||null==c||""==p||null==p||m.indexOf(f)>=0||d.indexOf(f)>=0||(l.push(f),u+=a?n.stringFormat("{0}: {1}"+r,[n.htmlEncodeEntities(c),n.htmlEncodeEntities(p)]):n.stringFormat("{0}: {1}"+r,[n.htmlDecodeEntities(c),p]))}return u},onBeforeSubmit:function(){var t=e.Deferred();return t.resolve(),t.promise()},showSummarizedText:function(t,i,n,a){var r=e.Deferred(),o=this.getSummarizedText(i,t,!1);return o&&""!==o.trim()?(setTimeout(function(){var e=confirm(o);r.resolve(e)},100),r.promise()):(r.resolve(!0),r.promise())},getCustomElementValue:function(e){return e.val()||e.find("[data-f-datainput]").val()},bindCustomElementValue:function(e,t){e.find(".Form__CustomInput, [data-f-datainput]").val(t)},resetCustomElementValue:function(e){e.find(".Form__CustomInput, [data-f-datainput]").val("")},getAllDataElements:function(t){return e(".Form__Element, .Form__CustomElement, [data-f-type]",t).not(".FormStep,.FormSubmitButton,.Form__Element--NonData,[data-f-type='step'],[data-f-type='form'],[data-f-type='resetbutton'],[data-f-type='submitbutton'],[data-f-element-nondata]")},isStepSatisfyDependentCondition:function(e,t){if(!e)return!1;var i=e.dependField,n=a.loadFormDataFromStorage(t.Id),r=epi.EPiServer.Forms.DependConditions[e.dependCondition];return!(i&&r&&n)||(l._isInactiveElement(i,t)?r(null,e.dependValue):r(n[i],e.dependValue))},getAntiForgeryToken:function(t){return{antiForgeryToken:e('input[name="__RequestVerificationToken"]',t.$workingForm).val()}},buildSubmitRequestHeader:function(t){var i={},n=this.getAntiForgeryToken(t);return e.extend(i,n),i}},Data:{loadCurrentFormDataFromStorage:function(e){var t=epi.EPiServer.Forms.Utils.getFormIdentifier(e);return this.loadFormDataFromStorage(t)},loadFormDataFromStorage:function(e){var t=this.getStorage()[e];return t&&(t=JSON.parse(t))||{}},saveCurrentFormDataToStorage:function(e,t){var i=epi.EPiServer.Forms.Utils.getFormIdentifier(e);return this.saveFormDataToStorage(i,t)},saveFormDataToStorage:function(e,t){var i=this.getStorage();try{i.setItem(e,JSON.stringify(t))}catch(n){}return t},clearFormDataInStorage:function(e){removeFormDataInStorage(epi.EPiServer.Forms.Utils.getFormIdentifier(e))},removeFormDataInStorage:function(e){this.getStorage().removeItem(e)},getStorage:function(){return sessionStorage}},Validation:{getValidatorByValidatorType:function(e,t){if(e instanceof Array&&0!==e.length&&t)for(var i=0,n=null,a=e.length;i<a;i++)if((n=e[i])&&n.type===t)return n},getElementValidators:function(e,t){if(e instanceof Array&&0!==e.length&&t)for(var i=0,n=e.length,a=null;i<n;i++)if((a=e[i])&&(a.targetElementId===t||a.targetElementName===t))return a.validators},validateFormValue:function(t,i,n){var a=[];return e(n).each(function(n,r){var o=epi.EPiServer.Forms.Validators[r.type],s=null;if("function"==typeof o?s=o:"function"==typeof o.validate&&(s=o.validate),s){var l=s(t,i,r);e.extend(l,{fieldName:t,fieldValue:i}),a.push(l)}}),a}},Dependency:{ConditionCombinations:{All:"All",Any:"Any"},Actions:{Config:{ShowDuration:10,HideDuration:10},show:function(e){if(e.isSatisfied){this._showElement(e);var t=e.workingFormInfo.DependencyInactiveElements&&e.workingFormInfo.DependencyInactiveElements.indexOf(e.depen
1dantInfo.fieldName);t>=0&&e.workingFormInfo.DependencyInactiveElements.splice(t,1)}else this._hideElement(e),e.workingFormInfo.DependencyInactiveElements.push(e.dependantInfo.fieldName)},hide:function(e){if(e.isSatisfied)this._hideElement(e),e.workingFormInfo.DependencyInactiveElements.push(e.dependantInfo.fieldName);else{this._showElement(e);var t=e.workingFormInfo.DependencyInactiveElements&&e.workingFormInfo.DependencyInactiveElements.indexOf(e.dependantInfo.fieldName);t>=0&&e.workingFormInfo.DependencyInactiveElements.splice(t,1)}},_hideElement:function(e){e.$domElement.hide(this.Config.HideDuration),e.$domElement.addClass("hide")},_showElement:function(e){e.$domElement.show(this.Config.ShowDuration),e.$domElement.removeClass("hide")}},DependantController:t,Dependant:i,_initDependencyInfos:function(e){var t=e.DependenciesInfo;if(t&&!(t.length<=0)){e.DependantControllers=[];for(var i=0;i<t.length;i++){var a=t[i],r={onDependencyStateChanged:function(t,i,a){n.raiseFormsEvent(e,{type:"formsDependencyStateChanged",targetElement:t,dependencyInfo:i,isConditionSatisfied:a})},workingFormInfo:e},o=new epi.EPiServer.Forms.Dependency.DependantController(a,r);e.DependantControllers.push(o)}}},_getValueOfDependeeElement:function(t,i){if(i&&t){var a=n.getElementName(t);if(!(i.DependencyInactiveElements.indexOf(a)>=0)){var r=n.getCurrentStepIndex(i),o=e(i.$steps[r]);return e(t,o).length>0?n.getElementValue(t):epi.EPiServer.Forms.Data.loadCurrentFormDataFromStorage(i.$workingForm)[a]}}},_getTriggerEventForDependeeElement:function(e){return n.isElementType(e,"textbox")?"keyup":"change"},_getTriggerEventsForDependeeElement:function(e){return n.isElementType(e,"textbox")?"number"===e.attr("data-f-modifier")?["keyup","change"]:["keyup"]:["change"]},_isElementOfInactiveSteps:function(t,i){var n=i.StepsInfo.Steps.filter(function(e){return!1===e.isActive});if(0===n.length)return!1;for(var a=0;a<n.length;a++){var r=n[a].index;if(!0!==(r===i.StepsInfo.Steps.length-1)){var o=e(i.$steps[r]).find("[data-f-datainput]"),s=e.map(o,function(t){return epi.EPiServer.Forms.Utils.getElementName(e(t))});if(s&&s.indexOf(t)>-1)return!0}}return!1},_isInactiveElement:function(e,t){return t.DependencyInactiveElements.indexOf(e)>-1||this._isElementOfInactiveSteps(e,t)}},Navigation:{findNextStep:function(e,t){var i=null,n=e+1,a=t.StepsInfo.Steps[n];if(a){var r=epi.EPiServer.Forms.Extension.isStepSatisfyDependentCondition(a,t);a.isActive=r,i=r?a:this.findNextStep(n,t)}return i},findPreviousStep:function(e,t){var i=null,n=e-1,a=t.StepsInfo.Steps[n];return a&&(i=epi.EPiServer.Forms.Extension.isStepSatisfyDependentCondition(a,t)?a:this.findPreviousStep(n,t)),i}}});var d={VisitorData:{"EPiServer.Forms.Implementation.VisitorData.GeoVisitorDataSource":function(t){var i=n.getWorkingFormFromInnerElement(t),a=epi.EPiServer.Forms[n.getFormIdentifier(i)].DataSubmitController;e.get(a+"/GetGeoData").done(function(e){if(!t.val()){var i=t.data("epiforms-visitordataproperty")||t.data("f-visitordataproperty");null!=e&&e[i]&&t.val(e[i])}})}}},m={Validators:{"EPiServer.Forms.Implementation.Validation.RequiredValidator":function(e,t,i){return i&&(""==t||t&&!t.length)?{isValid:!1,message:i.model.message}:{isValid:!0}},"EPiServer.Forms.Implementation.Validation.RegularExpressionValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.EmailValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.UrlValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.DateDDMMYYYYValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.DateMMDDYYYYValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.DateYYYYMMDDValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.IntegerValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.PositiveIntegerValidator":n.validateRegularExpressionValidator,"EPiServer.Forms.Implementation.Validation.AllowedExtensionsValidator":function(e,t,i){function n(e,t,i){var n=function(e){return e.substr((~-e.lastIndexOf(".")>>>0)+2)}(e);return!(n.length<1)&&(n=n.toLowerCase(),!(t.indexOf(n)>=0)&&(i.length<1||i.indexOf(n)>-1))}if(!t||t instanceof Array&&0===t.length)return{isValid:!0};var a=t,r=i.model.accept,o=epi.EPiServer.Forms.UploadExtensionBlackList.split(","),s=null==r||r.length<1?[]:r.split(","),l=0,d=0,m=s.length,u=a.length;if(m>0)for(;l<m;l++)s[l]=s[l].substr(1);for(;d<u;d++)if(!n(a[d].name,o,s))return{isValid:!1,message:epi.EPiServer.Forms.Utils.stringFormat(i.model.message,[r])};return{isValid:!0}},"EPiServer.Forms.Implementation.Validation.MaxFileSizeValidator":function(e,t,i){for(var n=t,a=0,r=n.length,o=i.model.sizeInBytes;a<r;a++)if(n[a].size>o)return{isValid:!1,message:epi.EPiServer.Forms.Utils.stringFormat(i.model.message,[o/1048576])};return{isValid:!0}},"EPiServer.Forms.Implementation.Validation.NumericValidator":function(e,t,i){var n;return t&&(n=t,isNaN(parseFloat(n))||!isFinite(n))?{isValid:!1,message:i.model.message}:{isValid:!0}},"EPiServer.Forms.Implementation.Validation.CaptchaValidator":{initialize:function(t){var i=this;
1t.parents(".FormCaptcha, [data-f-type='captcha']").find(".FormCaptcha__Refresh, [data-f-captcha-refresh]").on("click",function(t){i._refreshCaptcha(e(this)),t.preventDefault()})},validate:function(e,t,i){var n=t.trim();return{isValid:null!=n&&""!==n,message:i.model.message}},onServerValidateFailed:function(e,t){this._refreshCaptcha(e),e.focus()},_refreshCaptcha:function(e){var t=e.hasClass("FormCaptcha")||n.isElementType(e,"captcha")?e:e.parents(".FormCaptcha, [data-f-type='captcha']"),i=t.find(".FormCaptcha__Image, [data-f-captcha-image]"),a=t.find(".FormTextbox__Input, [data-f-datainput]");i.attr("src",i.attr("src")+"&d="+Math.random()),a.val("")}}}},u={DependConditions:{Equals:function(e,t){return(e=e?epi.EPiServer.Forms.Utils.getConcatString(e,",").toUpperCase():"")===(t=t?t.toUpperCase():"")},NotEquals:function(e,t){return(e=e?epi.EPiServer.Forms.Utils.getConcatString(e,",").toUpperCase():"")!==(t=t?t.toUpperCase():"")},Contains:function(e,t){return e=e?epi.EPiServer.Forms.Utils.getConcatString(e,",").toUpperCase():"",t=t?t.toUpperCase():"",e.indexOf(t)>=0},NotContains:function(e,t){return!(e=e?epi.EPiServer.Forms.Utils.getConcatString(e,","):"")&&t||e&&!t||e&&t&&e.toUpperCase().indexOf(t.toUpperCase())<0},MatchRegularExpression:function(e,t){var i=new RegExp(t,"igm");return i.ignoreCase=i.global=i.multiline=!0,!t||t&&i.test(e)}}};e.extend(!0,epi.EPiServer.Forms,d),e.extend(!0,epi.EPiServer.Forms,m),e.extend(!0,epi.EPiServer.Forms,u),e.extend(!0,epi.EPiServer.Forms,{CustomBindingElements:{}}),epi.EPiServer.Forms.init=function(t){void 0===t&&(t='.EPiServerForms, [data-f-type="form"]'),epi.EPiServer.Forms.__Initialized||(epi.EPiServer.Forms.__Initialized=!0,e(document).ready(function(){function i(t){t.preventDefault(),t.stopPropagation();var i=n.getWorkingFormFromInnerElement(t.target),s=h(i);if(!1===s.SubmittableStatus.submittable)return c(s,s.SubmittableStatus.message),!1;e.when(r.onBeforeSubmit(i)).then(function(){var d=b(s);if(!v(d,s))return E(d),_(d),!1;var m=function(t){var i=h(t),n=g(t),r=a.loadFormDataFromStorage(i.Id);return e.extend(r,n)}(i);e.when(function(t,i){var n=e.Deferred();if(!t.ShowSummarizedData)return n.resolve(!0),n.promise();var a=[],o=["__FormGuid","__FormLanguage","__FormCurrentStepIndex","__FormSubmissionId"];return r.showSummarizedText(i,t,o,a)}(s,m)).then(function(a){if(!a)return!1;var r=[];for(var d in m)if(!(d.indexOf("__TempData")>-1||l._isInactiveElement(d,s)||n.getFormElementBlock(d,i).parents(".FormStep:first, [data-f-type='step']:first").hasClass("hide"))){var p=o.getElementValidators(s.ValidationInfo,d);r=r.concat(o.validateFormValue(d,m[d],p))}var f=e.grep(r,function(e){return 0==e.isValid});if(f.length>0){var h=e.map(f,function(e){return e.message});return c(s,h.join(" ")),!1}var g=i.get(0).querySelector(".Form__Element--recaptcha");window.grecaptcha&&window.recaptchaSiteKey&&g?(e(t.srcElement||t.currentTarget).closest("[data-f-type='submitbutton']").prop("disabled",!0),grecaptcha.ready(function(){grecaptcha.execute(window.recaptchaSiteKey,{action:"submit"}).then(function(e){g.value=e,u(t)})})):u(t)})})}function d(e){e.preventDefault(),e.stopPropagation();var t=n.getWorkingFormFromInnerElement(e.target),i=h(t);n.raiseFormsEvent(i,{type:"formsReset",sourceEvent:e}),m(t,i),S(i.StepsInfo.Steps[0],i)}function m(t,i){if(t.get(0).reset?t.get(0).reset():function(t){for(var i=e(".Form__MainBody, [data-f-mainbody]",t).get(0).querySelectorAll("[data-f-datainput]"),n=0;n<i.length;n++)"hidden"!==i[n].type&&(i[n].value="")}(t.get(0)),i.SubmittableStatus&&!1===i.SubmittableStatus.submittable?c(i,i.SubmittableStatus.message):c(i,""),a.removeFormDataInStorage(i.Id),e("[aria-invalid=true]",t).attr("aria-invalid","false"),r.getAllDataElements(t).each(function(t,i){var a=e(i);F(a).text(""),a.removeClass("ValidationFail ValidationSuccess"),a.hasClass("FormChoice")||n.isElementType(a,"choice")?a.find("input[type=checkbox], input[type=radio]").each(function(t,i){var n=e(i);n.prop("checked",!(!n.data("epiforms-default-value")&&!n.data("f-default-value")))}):a.hasClass("FormSelection")||n.isElementType(a,"selection")?(a.find("option[disabled]:eq(0)").prop("selected",!0),a.find("option").each(function(t,i){var n=e(i);!1===n.prop("disabled")&&n.prop("selected",!(!n.data("epiforms-default-value")&&!n.data("f-default-value")))})):a.hasClass("FormFileUpload")||n.isElementType(a,"fileupload")?(p(a).text(""),C(a.find(".FormFileUpload__Input, [data-f-datainput]"))):(a.hasClass("Form__CustomElement")||n.isElementType(a,"custom"))&&r.resetCustomElementValue(a)}),i.DependantControllers&&i.DependantControllers.length)for(var o=0;o<i.DependantControllers.length;o++)i.DependantControllers[o].check()}function u(t){var i=n.getWorkingFormFromInnerElement(t.target),l=epi.EPiServer.Forms.Utils.getFormIdentifier(i),d=h(i),u=b(d),p=n.getCurrentStepIndex(d),g=d.StepsInfo.Steps.length,v=p===g-1,_=e(t.currentTarget);if(_.is(":hidden")){var I=u.find("[data-f-type=submitbutton]:visible")[0];I?_=e(I):g>1&&!v&&(_=e(".Form__NavigationBar .Form__NavigationBar__Action.btnNext, [data-f-type='navigationbar'] [data-f-navigation-next]",i))}if("submitbutton"===_.data("f-type")){var w=_.attr("data-f-element-name");if(n.isInactiveField(d,w))return}var x,D=a.saveFormDataToStorage(d.Id,f(i)),V=new FormData,k=s.findNextStep(p,d),P=!k&&v,N=!!_.data("epiforms-is-progressive-submit")||!!_.data("f-is-progressive-submit");for(var T in k||v||(k=d.StepsInfo.Steps[g-1]),P=P||!!_.data("epiforms-is-finalized")||!!_.data("f-is-finalized"),D[_.prop("name")]=_.val(),V.append("__FormGuid",l),V.append("__FormHostedPage",epi.EPiServer.CurrentPageLink),V.append("__FormLanguage",epi.EPiServer.CurrentFormLanguage),V.append("__FormCurrentStepIndex",p),V.append("__FormWithJavaScriptSupport","true"),D)if(D.hasOwnProperty(T))if(n.isInactiveField(d,T))V.append(T,"");else if(x=D[T],Array.isArray(x)&&x.length>0&&null!==x[0]&&"object"==typeof x[0]){for(var A,L=x,$="",B=0;B<L.length;B++)x[0].file&&Object.getPrototypeOf(x[0].file)===File.prototype&&(A=L[B].file,V.append(T+"_file_"+B,A)),$+=L[B].name+"|";V.append(T,$)}else V.append(T,x);n.raiseFormsEvent(d,{type:"formsStartSubmitting",formData:V}),_.prop("disabled",!0),c(d,"");var R=i.prop("method")?i.prop("method"):i.attr("method"),U=e.ajax({url:d.DataSubmitController+"/Submit",headers:r.buildSubmitRequestHeader(d),data:V,cache:!1,type:R,processData:!1,contentType:!1,async:epi.EPiServer.Forms.AsyncSubmit||i.data("epiforms-async-submit")||i.data("f-async-submit")||!1}),O="";U.done(function(r){if(t.preventDefault(),e(".Form__Element__ValidationError, [data-f-validationerror]").text(""),!0===r.IsSuccess){var s=b(d);if(e(".FormFileUpload .FormFileUpload__Input, [data-f-type='fileupload'] [data-f-datainput]",s).each(function(t,i){e(this).val(""),C(e(this))}),0==P&&0==N){n.raiseFormsEvent(d,{type:"formsNavigationNextStep",targetStep:k});var l=a.loadFormDataFromStorage(d.Id),u=e.extend(l,{__FormSubmissionId:r.Data.SubmissionId});return a.saveFormDataToStorage(d.Id,u),n.raiseFormsEvent(d,{type:"formsSubmitted",formData:V,isFinalizedSubmission:!1,isSuccess:r.IsSuccess,returnedResult:r}),S(k,d),!1}1==P&&m(i,d),n.raiseFormsEvent(d,{type:"formsSubmitted",formData:V,isFinalizedSubmission:P,isSuccess:r.IsSuccess,returnedResult:r});var f=d.StepsInfo.Steps.length;if(r.RedirectUrl)return O=r.RedirectUrl,window.location.href=r.RedirectUrl,!1;0==N&&!k&&p<f-1?S(d.StepsInfo.Steps[f-1],d):(e(".Form__MainBody, [data-f-mainbody]",d.$workingForm).hide(),c(d,r.Message,!0))}else y(d),n.raiseFormsEvent(d,{type:"formsSubmitted",formData:V,isSuccess:r.IsSuccess,returnedResult:r}),r.Message&&c(d,r.Message),r.Data&&r.Data.ValidationInfo&&r.Data.ValidationInfo.length>0&&function(t,i){for(var n=null,a=0;a<i.length;a++)if(i[a]&&i[a].InvalidElement){var r=F(n=e("#"+i[a].InvalidElement,t.$workingForm)),s=o.getElementValidators(t.ValidationInfo,i[a].InvalidElement),l=o.getValidatorByValidatorType(s,i[a].Validator);if(l){var d=epi.EPiServer.Forms.Validators[l.type],m=d.onServerValidateFailed;m&&"function"==typeof m&&m.apply(d,[n,l])}r.text(i[a].ValidationMessage||epi.EPiServer.Forms.Messages.viewMode.commonValidationFail).show()}n&&E(n.parents(".FormStep:first, [data-f-type='step']:first"))}(d,r.Data.ValidationInfo)}),U.fail(function(e,i,a){t.preventDefault(),n.raiseFormsEvent(d,{type:"formsSubmittedError",formData:V,isSuccess:!1,xhr:e,typeOfFailure:i,status:a}),c(d,i+" "+e.status+": "+a)}
1),U.always(function(){O||_.prop("disabled",!1),y(d)})}function c(t,i,n){if(t){var a=e(".Form__Status__Message, [data-f-form-statusmessage]",t.$workingForm);a.removeClass("Form__Warning__Message").removeClass("Form__Success__Message"),1==n&&i?a.removeClass("hide").addClass("Form__Success__Message").html(i):i?a.removeClass("hide").addClass("Form__Warning__Message").html(i):a.addClass("hide").html("")}}function p(e){return e.find(".FormFileUpload__PostedFile, [data-f-postedFile]")}function f(t,i){var n=h(t),r=g(b(n),i),o=a.loadFormDataFromStorage(n.Id);return e.extend(o,r)}function h(e){var t=n.getFormIdentifier(e),i=epi.EPiServer.Forms[t];return i.$workingForm=e,i}function g(t,i){var a={};return r.getAllDataElements(t).each(function(t,r){var o=e(r);if(!("function"==typeof i&&i(o)||o.parents(".FormStep:first, [data-f-type='step']:first").hasClass("hide"))){var s=n.getElementName(o);if(s)if(o.hasClass("FormFileUpload")||n.isElementType(o,"fileupload")){var l=e(".FormFileUpload__Input, [data-f-datainput]",o)[0],d=s+"__TempData";if(a[s]=[],a[d]=[],l&&0!==l.files.length)for(var m=0;m<l.files.length;m++){var u=l.files[m];a[s].push({name:u.name,file:u}),a[d].push({name:u.name})}else{var c=n.getPreviousPostedFiles(o);a[s]=c,a[d]=c}}else a[s]=n.getElementValue(o)}}),a}function v(t,i){if(!t)return!0;var a=!0;return r.getAllDataElements(t).each(function(t,r){a=function(t,i){var a=e(t),r=F(a),s=n.getElementName(a),l=a.attr("id")||s,d=o.getElementValidators(i.ValidationInfo,l),m=!0;a.removeClass("ValidationFail ValidationSuccess"),r.hide();var u=n.getElementValue(a);if(i.DependencyInactiveElements.indexOf(s)<0&&d instanceof Array&&d.length>0){var c=o.validateFormValue(s,u,d),p=e.grep(c,function(e){return!1===e.isValid}),f=e.grep(i.ValidationInfo,function(e){return e.targetElementId===l||e.targetElementName===l})[0],h=e("#"+f.targetElementId);if(p&&p.length>0){var g=e.map(p,function(e){return e.message});h.attr("aria-invalid","true"),a.addClass("ValidationFail"),r.text(g.join(" ")).show(),m=!1}else a.addClass("ValidationSuccess"),h.attr("aria-invalid","false"),m=!0}return n.raiseFormsEvent(i,{type:"elementValidated",isValid:m,elementName:s,elementValue:u,elementIdentifier:l,element:t,$messageContainer:r}),m}(r,i)&&a}),n.raiseFormsEvent(i,{type:"formsStepValidating",isValid:a}),i.$workingForm.toggleClass("ValidationSuccess",a),i.$workingForm.toggleClass("ValidationFail",!a),a}function F(t){var i=n.getElementName(t),a=n.stringFormat("{0}[data-epiforms-linked-name='{1}'], {0}[data-epiforms-linked-name='{2}']",[".Form__Element__ValidationError",i,t.attr("id")]),r=n.stringFormat("{0}[data-f-linked-name='{1}'], {0}[data-f-linked-name='{2}']",["[data-f-validationerror]",i,t.attr("id")]);return e(a).add(r)}function S(t,i){if(t)if(n.raiseFormsEvent(i,{type:"formsNavigateToStep",targetStep:t}),function(t,i){e.each(t,function(t,a){var o=-1!==t.indexOf("__TempData")?t.replace("__TempData",""):t,s=e('[data-epiforms-element-name="'+o+'"], [data-f-element-name="'+o+'"]',i);if(0!==s.length&&!s.hasClass("FormExcludeDataRebind")&&!s.data("f-excludedatarebind")){var l=s.find(".FormChoice__Input--Checkbox, [data-f-datainput]:checkbox");if(l.length>0)e.each(l,function(){var t=e(this).val();e(this).attr("checked",a.indexOf(t)>-1)});else if((l=s.find(".FormChoice__Input--Radio, [data-f-datainput]:radio")).length>0){var d=Array.isArray(a)?a[0]:a;e.each(l,function(){var t=e(this).val();e(this).attr("checked",d==t)})}else if(s.hasClass("FormSelection")||n.isElementType(s,"selection"))e("option:enabled",s).each(function(t,i){e(i).attr("selected",a.indexOf(e(i).val())>-1)});else if(!s.hasClass("FormCaptcha")&&!n.isElementType(s,"captcha"))if((l=s.find(".FormFileUpload__Input, [data-f-datainput]:file")).length>0){var m="";if(a instanceof Array&&a.length>0){var u=a.map(function(e){return e.name}).join(", ");m=m.concat(u)}if(""!==m){var c=n.stringFormat(epi.EPiServer.Forms.Messages.fileUpload.postedFile,[m]);p(s).text(c).show()}}else s.hasClass("Form__CustomElement")||n.isElementType(s,"custom")?r.bindCustomElementValue(s,a):s.find("[data-f-datainput]:first").val(a)}})}(a.loadFormDataFromStorage(i.Id),i.$workingForm),i.StepsInfo.AllStepsAreNotLinked||t.attachedContentLink==epi.EPiServer.CurrentPageLink)i.$steps.addClass("hide"),i.$steps.each(function(a,r){if(a===t.index)return e(r).removeClass("hide"),n.setCurrentStepIndex(i,t.index),!1}),n.scrollToTheTopOfForm(i.$workingForm);else{if(t.attachedUrl&&t.attachedUrl.length)return void window.location.replace(t.attachedUrl);i.StepsInfo.AllStepsAreNotLinked||c(i,epi.EPiServer.Forms.Messages.viewMode.malformStepConfiguration)}else i.$steps.hide();y(i)}function E(t){epi.EPiServer.Forms.Validators["EPiServer.Forms.Implementation.Validation.CaptchaValidator"]._refreshCaptcha(e(".Form__Element.FormCaptcha, [data-f-type='captcha']",t))}function _(t){if(t){var i=e(".Form__Element.ValidationFail",t)[0];if(i){i.scrollIntoView();var n=e("[data-f-datainput]",i);n&&n.length>0&&n[0].focus()}}}function y(t){var i=n.getCurrentStepIndex(t),a=e(".Form__NavigationBar, [data-f-type='navigationbar']",t.$workingForm);if(i<0)a.hide();else{var r=e(".Form__NavigationBar__Action.btnPrev, [data-f-navigation-previous]",a).prop("disabled",!1),o=e(".Form__NavigationBar__Action.btnNext, [data-f-navigation-next]",a).prop("disabled",!1);0!==i&&!1!==t.SubmittableStatus.submittable||r.prop("disabled",!0),i!==t.StepsInfo.Steps.length-1&&!1!==t.SubmittableStatus.submittable||o.prop("disabled",!0);var s=i+1,l=t.StepsInfo.Steps.length;e(".Form__NavigationBar, [data-f-type='navigationbar']",t.$workingForm).toggle(t.ShowNavigationBar),e(".Form__NavigationBar__ProgressBar__CurrentStep, [data-f-navigation-currentStep]",a).text(s),e(".Form__NavigationBar__ProgressBar__StepsCount, [data-f-navigation-stepcount]",a).text(l),e(".Form__NavigationBar__ProgressBar--Progress, [data-f-navigation-progress]",a).css({width:100*s/l+"%"})}}function b(t){var i=n.getCurrentStepIndex(t);return e(t.$steps[i])}function C(e){/MSIE/.test(navigator.userAgent)&&e.replaceWith(e=e.clone(!0))}a.getStorage()?(e(t).each(function(t,o){var l=e(o),m=h(l);m.SubmittableStatus&&!1===m.SubmittableStatus.submittable&&c(m,m.SubmittableStatus.message),function(t){if(!t||!t.StepsInfo||!t.StepsInfo.Steps)return;if(t.$steps=e(".FormStep, [data-f-type='step']",t.$workingForm),t.StepsInfo.Steps.length<2)return;var i=t.StepsInfo.Steps[n.getCurrentStepIndex(t)];S(i,t),e(".Form__NavigationBar__Action.btnNext, [data-f-navigation-next]",t.$workingForm).on("click",function(i){i.preventDefault(),e.when(r.onBeforeSubmit(t.$workingForm)).then(function(){var e=b(t);if(!v(e,t))return E(e),_(e),!1;u(i)})}),e(".Form__NavigationBar__Action.btnPrev, [data-f-navigation-previous]",t.$workingForm).on("click",function(i){i.preventDefault();var r=f(t.$workingForm,function(e){return e.hasClass("FormFileUpload")||n.isElementType(e,"fileupload")});a.saveFormDataToStorage(t.Id,r);var o=s.findPreviousStep(n.getCurrentStepIndex(t),t);S(o,t),E(e("section[data-epiforms-stepindex="+o.index+"], section[data-f-stepindex="+o.index+"]",t.$workingForm)),n.raiseFormsEvent(t,{type:"formsNavigationPrevStep",targetStep:o})})}(m);for(var p=1;p<m.StepsInfo.Steps.length-1;p++){var g=m.StepsInfo.Steps[p];g.isActive=epi.EPiServer.Forms.Extension.isStepSatisfyDependentCondition(g,m)}epi.EPiServer.Forms.Dependency._initDependencyInfos(m),e(m.ValidationInfo).each(function(t,i){e(i.validators).each(function(t,n){var a=epi.EPiServer.Forms.Validators[n.type];a&&"function"==typeof a.initialize&&a.initialize(e("#"+i.targetElementId))})}),n.injectVisitorData(m),e(".Form__Element.FormSubmitButton, [data-f-type='submitbutton']",l).off("
1click",i).on("click",i),e(".Form__Element.FormResetButton, [data-f-type='resetbutton']",l).off("click",d).on("click",d),n.raiseFormsEvent(m,{type:"formsSetupCompleted"})}),e(".EPiServerForms .FormTextbox--Number .FormTextbox__Input, [data-f-type='form'][data-f-type='textbox'][data-f-modifier='number'] [data-f-datainput]").on("keydown",function(e){var t=e.which||e.keyCode;if(!e.shiftKey&&!e.altKey&&!e.ctrlKey&&t>=65&&t<=90||32===t)return!1;if(!e.shiftKey&&!e.altKey&&!e.ctrlKey&&t>=48&&t<=57||t>=96&&t<=105||65===e.keyCode&&!0===e.ctrlKey||67===t&&!0===e.ctrlKey||88===t&&!0===e.ctrlKey||t>=35&&t<=39||8===t||9===t||13===t||46===t||45===t)return!0;var i=this.value;return(109!==t&&189!==t||"-"!==i[0])&&(!((!(e.shiftKey||e.altKey||e.ctrlKey||190!==t)||188===t||110===t)&&/[\.,]/.test(i))&&void 0)}).on("keyup",function(e){var t=this.value;isNaN(t)&&t&&(t=(t=("-"===t[0]?"-":"")+t.replace(/[^0-9\.]/g,"")).replace(/\.(?=(.*)\.)+/g,""),this.value=t)}),e('.EPiServerForms input.FormTextbox__Input,.FormChoice__Input.FormChoice__Input--Checkbox,.FormRange__Input,.FormTextbox__Input.FormUrl__Input,.FormChoice__Input.FormChoice__Input--Radio,.FormTextbox__Input.FormCaptcha__Input.FormHideInSummarized,[data-f-type="form"] [data-f-datainput]:not(textarea)').on("keydown",function(e){return n.showNextStepOnEnterKeyD
1own(e)})):e('.EPiServerForms .Form__Status__Message, [data-f-type="form"] [data-f-form-statusmessage]').text(epi.EPiServer.Forms.ErrorMessages.cantnotworkwithoutstorage)}))}}}($$epiforms||$)},8341:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>u,lV:()=>m});var n=i(7725),a=i(6511),r=i(8221),o=i.n(r),s=i(1669),l=i.n(s),d=i(5224);i(5751);class m extends n.A{constructor(e,t){super(),this.form=e,this.className=t.className,this.initialize()}getScrollableContainer(e){let t=e.parentElement;for(;t&&0===t.scrollTop;)t=t.parentElement;return t}initialize(){if(this.method=this.form.getAttribute("method")||"post",this.action=this.form.getAttribute("action"),this.response=this.form.getElementsByClassName(`${this.className}__response`)[0],l()(this.form).data("init"))return;if(l()(this.form).data("init",!0),this.hasClass(this.form,"EPiServerForms")||this.hasClass(this.form,"SimpleForm")||this.form.addEventListener("submit",e=>{this.submit(e)}),this.hasClass(this.form,"SimpleForm")){const e=this.form.querySelector("[data-email]");e&&(e.type="email"),this.form.addEventListener("submit",e=>{this.submitSimpleForm(e)})}const e=this.form.querySelectorAll(".FormFileUpload__Input");if(this.fileUploadStyle(e),"epi"in window&&"EPiServer"in window.epi&&"Forms"in window.epi.EPiServer){l().extend(!0,window.epi.EPiServer.Forms,{Validators:{"YIT.Interface.Web.Models.Forms.Validation.AddressValidator":function(e,t,i){let n=!0;const a=l()(`input[name="${e}"]`).parents("form").find(".Form__Element--Address input[type=text]"),r=a.length;let o=0;return a.each((e,t)=>{""==l().trim(l()(t).val())&&o++}),n=0==o||o==r||""!=l().trim(t),n?{isValid:!0}:{isValid:!1,message:i.model.message}},"YIT.Interface.Web.Models.Forms.Validation.AdvancedNumericValidator":function(e,t,i){return t&&1!=l().isNumeric(t)?{isValid:!1,message:i.model.message}:{isValid:!0}}}});let e={};l()(this.form).on("formsSubmitted",o()(t=>{const i=l()(t.currentTarget);let n=t.currentTarget.getElementsByClassName("Form__Status")[0];if(i.removeClass("submitting"),i.find('[data-spinner="true"]').length){const e=i.parents(".overlay").length?"":" open";l()(".overlay").removeClass(`is-loading is-formsubmit${e}`)}if(t.isSuccess){var r;let n={event:"formSubmissionSuccess",formId:"contactForm"};const a=i.find("[data-gtm-settings]");if(a.length){n=a.data("gtm-onsubmit");const e=a.data("gtm-variables");e&&e.forEach(e=>{e.variable.split(".").reduce((i,n,a,r)=>i[n]=i[n]||(a==r.length-1?"field"in e?t.formData.get(e.field):e.value:{}),n)})}window.dataLayer=window.dataLayer||[],window.dataLayer.push(n),null!==(r=window.formIdsOptimizely)&&void 0!==r&&r.includes(t.currentTarget.id)&&(window.optimizely=window.optimizely||[],window.optimizely.push({type:"event",eventName:"formSubmit"}));const o=i.find('[data-lead-type="Reservation"]');if(o.length&&(setTimeout(()=>{const e=i.get(0),t=e.querySelector(".Form__Success__Message"),n=e.querySelector(".Form__CurrentItemInfo"),a=n?n.outerHTML:"";t&&n&&(t.innerHTML=t.innerHTML.replace("[ReservedApartment]",a))},10),l()(document).trigger({type:"reservationFormSent",productId:o.attr("data-product-id")})),window.d365FormId){const t=document.querySelector(`div[data-form-block-id="${window.d365FormId}"] form`);if(t){const{firstName:i,lastName:n,email:a,phone:r}=e;if(i&&n&&a&&r){const e=t.querySelectorAll('input[type="text"],input[type="email"],input[type="tel"]'),o=t.querySelector('button[type="submit"]');if(e.length>=3)if(e[0].value=i,e[1].value=n,e[2].value=a,e[3].value=r,"function"==typeof t.requestSubmit)t.requestSubmit(o);else{const e=new Event("submit",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}}}}}else{i.find(".Form__Element__ValidationError:visible").first().text().length&&(n=t.currentTarget.getElementsByClassName("FormCaptcha")[0])}new a.A({element:n,offset:100,container:this.getScrollableContainer(t.currentTarget)})},25)),l()(this.form).on("formsStepValidating",e=>{if(!e.isValid){const t=e.currentTarget.getElementsByClassName("ValidationFail")[0];t&&new a.A({element:t,offset:100,container:this.getScrollableContainer(e.currentTarget)})}}),l()(this.form).on("formsStartSubmitting",t=>{const i=l()(t.currentTarget);if(i.addClass("submitting"),i.find('[data-spinner="true"]').length&&setTimeout(()=>{i.hasClass("submitting")&&l()(".overlay").addClass("is-loading is-formsubmit open")},1e3),window.d365FormId){var n,a,r,o;const t=i.get(0);e={firstName:null===(n=t.querySelector("input[data-firstname]"))||void 0===n?void 0:n.value,lastName:null===(a=t.querySelector("input[data-lastname]"))||void 0===a?void 0:a.value,email:null===(r=t.querySelector("input[data-email]"))||void 0===r?void 0:r.value,phone:null===(o=t.querySelector("input[data-phone]"))||void 0===o?void 0:o.value}}})}l()(".dropdown",this.form).dropdown({autoWidth:!1});const t=this.form.querySelector(".FormChoice--promo");if(t){const e=t.querySelector(".FormChoice__Input--Checkbox"),i=t.querySelectorAll(".FormChoice__Input--Radio");if(e&&i){e.addEventListener("change",function(){if(this.checked)for(let e=0;e<i.length;++e)i[e].checked=!1}
1);for(let t=0;t<i.length;++t)i[t].addEventListener("change",function(){e.checked=!1})}}}getValues(){const e=this.form.querySelectorAll("input, select, textarea"),t={};for(const i in e){const n=e[i];if(n.tagName){if(("checkbox"===n.type||"radio"===n.type)&&!1===n.checked)continue;t[n.name]=t[n.name]?[].concat(t[n.name],n.value):n.value}}return t}serialize(e){const t={};return Object.keys(e).map(i=>{Array.isArray(e[i])?t[i]=e[i].join():t[i]=e[i]}),t}fileUploadStyle(e){Array.prototype.forEach.call(e,e=>{const t=e.previousElementSibling,i=e.getAttribute("data-label");t.innerHTML=i,this.addRemoveFileButton(e),e.addEventListener("change",e=>{const n=[],a=e.currentTarget;if(a.files)for(let t=0;t<a.files.length;t++)n.push(a.files[t].name.split("\\").pop());const r=e.currentTarget.parentElement.querySelector(".FormFileUpload__RemoveButton");n.length?(t.innerHTML=n.join(", "),r.classList.add("active")):(t.innerHTML=i,r.classList.remove("active"))})})}addRemoveFileButton(e){let t=e.parentElement.querySelector(".FormFileUpload__RemoveButton");t||(t=document.createElement("a"),t.className="FormFileUpload__RemoveButton",t.href="#",t.addEventListener("click",e=>{e.preventDefault();const t=e.currentTarget.parentElement.querySelector("input");this.resetFile(t)}),e.parentElement.appendChild(t))}resetFile(e){const t=e,i=document.createElement("input"),n=e.parentElement.querySelector(".FormFileUpload__RemoveButton");i.type="file",i.id=t.id,i.name=t.name,i.className=t.className,t.multiple&&(i.multiple=t.multiple),i.style.cssText=t.style.cssText,i.setAttribute("data-label",t.getAttribute("data-label")),t.parentNode.replaceChild(i,t),this.fileUploadStyle([i]),n.classList.remove("active")}submit(e){e.preventDefault();const t=this.serialize(this.getValues());"subscribe"!=e.target.id||t.CustomCategory||(t.CustomCategory="All"),fetch(this.action,{method:this.method,mode:"same-origin",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),body:JSON.stringify(t)}).then(e=>{if(e.ok)return e.text()}).then(e=>{this.handleResponse(e)}).catch(e=>{})}handleResponse(e){this.response.className=this.response.className.replace("is-success","").replace("is-error","").trim(),'"OK"'===e?(this.response.className+=" is-success",this.form.reset()):this.response.className+=" is-error"}submitSimpleForm(e){e.preventDefault();const t=this.getValues(),i=new FormData;for(const n in t)i.append(n,t[n]);fetch(this.action,{method:this.method,mode:"same-origin",credentials:"same-origin",body:i}).then(e=>{if(e.ok)return e.json()}).then(e=>{this.handleSimpleFormResponse(e,i)}).catch(e=>{})}handleSimpleFormResponse(e,t){if(e.Success){const e=this.form.querySelector(".Form__Status__Message"),n=this.form.querySelector(".Form__MainBody");e&&n&&(e.classList.remove("hide"),n.classList.add("hide"));try{const e=this.form.querySelector("[data-gtm-settings]");if(e){const i=JSON.parse(e.dataset.gtmOnsubmit),n=JSON.parse(e.dataset.gtmVariables);n&&n.forEach(e=>{e.variable.split(".").reduce((i,n,a,r)=>i[n]=i[n]||(a==r.length-1?"field"in e?t.get(e.field):e.value:{}),i)});let a="";this.form.closest(".megamenu__menu")?a="topmenu":this.form.closest(".footer")?a="footer":this.form.closest(".overlay")?a="popup":this.form.closest(".block")&&(a="inline"),i.formName+=`_${a}`,window.dataLayer=window.dataLayer||[],window.dataLayer.push(i)}}catch(i){}}else{const t=this.form.querySelector("[data-email]");t&&(t.parentNode.classList.add("ValidationFail"),t.nextElementSibling.innerHTML=e.Message,t.nextElementSibling.style.display="block")}}}class u{constructor(e){this.className=e.className||"form",this.elements=document.querySelectorAll(`.${this.className}`),this.options=e,this.initialize()}initialize(){"epi"in window&&"EPiServer"in window.epi&&"Forms"in window.epi.EPiServer&&!window.epi.EPiServer.Forms.__Initialized&&(l()(".FieldsRow, #section-__field_49178-panel").each(function(){new d.A(this)}),window.epi.EPiServer.Forms.init()),Array.prototype.slice.call(this.elements).map(e=>{new m(e,this.options)})}}}}]);
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.