!function(T){if("undefined"!=typeof epi&&void 0!==epi.EPiServer&&void 0!==epi.EPiServer.Forms)if(void 0!==T){var e=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()};e.prototype={_registerEventListener:function(e){var n=this;T(e).on("change",function(e,t){n.onDependencyChangeHandler.call(n,t)})},onDependencyChangeHandler:function(e){this.isSatisfied!==e.isSatisfied&&(this.isSatisfied=e.isSatisfied,this._executeAction(),"function"==typeof this.onDependencyStateChanged&&this.onDependencyStateChanged(this.$domElement,this.dependantInfo,this.isSatisfied),T(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 t=function(e,t){this.workingFormInfo=t,this.conditions=e.conditions,this.conditionCombination=e.conditionCombination,this.isSatisfied=null,this._registerEventListener()};t.prototype={_registerEventListener:function(){if(this.conditions&&!(this.conditions.length<=0))for(var n=this,e=[],t=0;t").text(e).html()},htmlDecodeEntities:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value},isMatchedReg:function(e,t){try{var n=new RegExp(t).exec(e);return null!=n&&0n.StepsInfo.Steps.length-1?n.StepsInfo.AllStepsAreNotLinked?i=0:T.each(n.StepsInfo.Steps,function(e,t){if(t.attachedContentLink==epi.EPiServer.CurrentPageLink&&$.isStepSatisfyDependentCondition(t,n))return i=e,!1}):i=+i,i},setCurrentStepIndex:function(e,t){return T("input[name=__FormCurrentStepIndex]",e.$workingForm).val(t),t},validateRegularExpressionValidator:function(e,t,n){return n&&n.model&&n.model.jsPattern&&""!==t?N.isMatchedReg(t,n.model.jsPattern)?{isValid:!0}:{isValid:!1,message:N.stringFormat(n.model.message,[n.model.jsPattern,n.description])}:{isValid:!0}},showNextStepOnEnterKeyDown:function(e){var t=N.getWorkingFormFromInnerElement(e.target),n=e.keyCode,i=T(".Form__NavigationBar .Form__NavigationBar__Action.btnNext, [data-f-type='navigationbar'] [data-f-navigation-next]",t),r=T(".Form__Element.FormSubmitButton, [data-f-type='submitbutton']",t).parent(".FormStep, [data-f-type='step']").filter(function(e){return!T(this).hasClass("hide")});return 13==n&&0==r.length&&null!=i&&i.length&&(e.preventDefault(),e.stopPropagation(),i.trigger("click")),!0},scrollToTheTopOfForm:function(e){null!=e&&"fixed"!==e.css("position").toLowerCase()&&0":"\n",r=n?e.ConfirmMessage:N.htmlDecodeEntities(e.ConfirmMessage),a=e.ElementsInfo,o=[],s=[],l=["__FormGuid","__FormLanguage","__FormCurrentStepIndex","__FormSubmissionId"],m=e.ConfirmMessage?r+i+i:"",d=null,p=null;for(var u in t)if(-1==o.indexOf(u.replace("__TempData",""))&&!N.isInactiveField(e,u)){var f=-1!==u.indexOf("__TempData")?a[u.replace("__TempData","")]:a[u];d=f&&f.friendlyName?f.friendlyName:"",(null==(p=f&&1==f.customBinding?epi.EPiServer.Forms.CustomBindingElements[f.type](f,t[u]):t[u])||p instanceof Array&&0===p.length||T.isEmptyObject(p))&&(p=""),p instanceof Array?p=T.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="":45<=(p=p.toString().substr(0,46).trim()).length&&(p+=" ..."),T("[name="+u+"]",e.$workingForm).hasClass("FormHideInSummarized")&&s.push(u),""==d||null==d||""==p||null==p||0<=l.indexOf(u)||0<=s.indexOf(u)||(o.push(u),m+=n?N.stringFormat("{0}: {1}"+i,[N.htmlEncodeEntities(d),N.htmlEncodeEntities(p)]):N.stringFormat("{0}: {1}"+i,[N.htmlDecodeEntities(d),p]))}return m},showSummarizedText:function(e,t,n,i){var r=T.Deferred(),a=this.getSummarizedText(t,e,!1);return a&&""!==a.trim()?setTimeout(function(){var e=confirm(a);r.resolve(e)},100):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(e){return T(".Form__Element, .Form__CustomElement, [data-f-type]",e).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 n=e.dependField,i=A.loadFormDataFromStorage(t.Id),r=epi.EPiServer.Forms.DependConditions[e.dependCondition];return!(n&&r&&i)||(c._isInactiveElement(n,t)?r(null,e.dependValue):r(i[n],e.dependValue))},getAntiForgeryToken:function(e){return{antiForgeryToken:T('input[name="__RequestVerificationToken"]',e.$workingForm).val()}},buildSubmitRequestHeader:function(e){var t={},n=this.getAntiForgeryToken(e);return T.extend(t,n),t}},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=T.parseJSON(t))||{}},saveCurrentFormDataToStorage:function(e,t){var n=epi.EPiServer.Forms.Utils.getFormIdentifier(e);return this.saveFormDataToStorage(n,t)},saveFormDataToStorage:function(e,t){var n=this.getStorage();try{n.setItem(e,JSON.stringify(t))}catch(e){console.log("Local Storage not supported: "+e.message)}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 n=0,i=null,r=e.length;n>>0))).length<1||(s=s.toLowerCase(),0<=r.indexOf(s)||!(a.length<1||-1o)return{isValid:!1,message:epi.EPiServer.Forms.Utils.stringFormat(n.model.message,[o/1048576])};return{isValid:!0}},"EPiServer.Forms.Implementation.Validation.NumericValidator":function(e,t,n){return t&&1!=T.isNumeric(t)?{isValid:!1,message:n.model.message}:{isValid:!0}},"EPiServer.Forms.Implementation.Validation.CaptchaValidator":{initialize:function(e){var t=this;e.parents(".FormCaptcha, [data-f-type='captcha']").find(".FormCaptcha__Refresh, [data-f-captcha-refresh]").on("click",function(e){t._refreshCaptcha(T(this)),e.preventDefault()})},validate:function(e,t,n){var i=t.trim();return{isValid:null!=i&&""!=i,message:n.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']"),n=t.find(".FormCaptcha__Image, [data-f-captcha-image]"),i=t.find(".FormTextbox__Input, [data-f-datainput]");n.attr("src",n.attr("src")+"&d="+Math.random()),i.val("")}}}},a={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():"",0<=e.indexOf(t)},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 n=new RegExp(t,"igm");return n.ignoreCase=n.global=n.multiline=!0,!t||t&&n.test(e)}}};T.extend(!0,epi.EPiServer.Forms,i),T.extend(!0,epi.EPiServer.Forms,r),T.extend(!0,epi.EPiServer.Forms,a),T.extend(!0,epi.EPiServer.Forms,{CustomBindingElements:{}}),epi.EPiServer.Forms.init=function(){epi.EPiServer.Forms.__Initialized||(epi.EPiServer.Forms.__Initialized=!0,T(document).ready(function(){function o(o){o.preventDefault(),o.stopPropagation();var s=N.getWorkingFormFromInnerElement(o.target),l=x(s);if(!1===l.SubmittableStatus.submittable)return C(l,l.SubmittableStatus.message),!1;var e=k(l);if(!u(e,l))return P(e),f(e),!1;var t,n,i,r,m=(n=x(t=s),i=a(t),r=A.loadFormDataFromStorage(n.Id),T.extend(r,i));T.when(function(e,t){var n=T.Deferred();if(!e.ShowSummarizedData)return n.resolve(!0),n.promise();return $.showSummarizedText(t,e,["__FormGuid","__FormLanguage","__FormCurrentStepIndex","__FormSubmissionId"],[])}(l,m)).then(function(e){if(!e)return!1;var t=[];for(var n in m)if(-1==n.indexOf("__TempData")&&!c._isInactiveElement(n,l)&&!N.getFormElementBlock(n,s).parents(".FormStep:first, [data-f-type='step']:first").hasClass("hide")){var i=U.getElementValidators(l.ValidationInfo,n);t=t.concat(U.validateFormValue(n,m[n],i))}var r=T.grep(t,function(e){return 0==e.isValid});if(0