var LanguageModel=function(e){this.enterKey="Enter",this.shiftKey="Shift",this.ok="OK",this.continue="Continue",this.skip="Skip",this.pressEnter="Press :enterKey",this.multipleChoiceHelpText="Choose as many as you like",this.multipleChoiceHelpTextSingle="Choose only one answer",this.otherPrompt="Other",this.placeholder="Type your answer here...",this.submitText="Submit",this.longTextHelpText=":shiftKey + :enterKey to make a line break.",this.prev="Prev",this.next="Next",this.percentCompleted=":percent% completed",this.invalidPrompt="Please fill out the field correctly",this.thankYouText="Thank you!",this.successText="Your submission has been sent.",this.ariaOk="Press to continue",this.ariaRequired="This step is required",this.ariaPrev="Previous step",this.ariaNext="Next step",this.ariaSubmitText="Press to submit",this.ariaMultipleChoice="Press :letter to select",this.ariaTypeAnswer="Type your answer here",Object.assign(this,e||{})};LanguageModel.prototype.formatString=function(e){var t=this;return e.replace(/:(\w+)/g,function(e,i){return t[i]?''+t[i]+"":e})};var QuestionType=Object.freeze({Date:"FlowFormDateType",Dropdown:"FlowFormDropdownType",Email:"FlowFormEmailType",LongText:"FlowFormLongTextType",MultipleChoice:"FlowFormMultipleChoiceType",Number:"FlowFormNumberType",Password:"FlowFormPasswordType",Phone:"FlowFormPhoneType",SectionBreak:"FlowFormSectionBreakType",Text:"FlowFormTextType",Url:"FlowFormUrlType"}),DropdownOptionBlank=Object.freeze({label:"",value:"",disabled:!0}),MaskPresets=Object.freeze({Date:"##/##/####",DateIso:"####-##-##",PhoneUs:"(###) ###-####"}),ChoiceOption=function(e){this.label="",this.value=null,this.selected=!1,Object.assign(this,e)};ChoiceOption.prototype.choiceLabel=function(){return this.label||this.value},ChoiceOption.prototype.choiceValue=function(){return null!==this.value?this.value:this.label},ChoiceOption.prototype.toggle=function(){this.selected=!this.selected};var LinkOption=function(e){this.url="",this.text="",this.target="_blank",Object.assign(this,e)},QuestionModel=function(e){this.id=null,this.answer=null,this.answered=!1,this.index=0,this.options=[],this.description="",this.className="",this.type=null,this.html=null,this.required=!1,this.jump=null,this.placeholder=null,this.mask="",this.multiple=!1,this.allowOther=!1,this.other=null,this.language=null,this.tagline=null,this.title=null,this.subtitle=null,this.content=null,this.inline=!1,this.helpText=null,this.helpTextShow=!0,this.descriptionLink=[],this.min=null,this.max=null,this.nextStepOnAnswer=!1,Object.assign(this,e),this.type===QuestionType.Phone&&(this.mask||(this.mask=MaskPresets.Phone),this.placeholder||(this.placeholder=this.mask)),this.type===QuestionType.Url&&(this.mask=null),this.type!==QuestionType.Date||this.placeholder||(this.placeholder="yyyy-mm-dd"),this.multiple&&(this.answer=[])};QuestionModel.prototype.setAnswer=function(e){this.type!==QuestionType.Number||""===e||isNaN(+e)||(e=+e),this.answer=e},QuestionModel.prototype.getJumpId=function(){var e=null;return"function"==typeof this.jump?e=this.jump.call(this):this.jump[this.answer]?e=this.jump[this.answer]:this.jump._other&&(e=this.jump._other),e},QuestionModel.prototype.setIndex=function(e){this.id||(this.id="q_"+e),this.index=e};var isIos=!1,isMobile=!1;"undefined"!=typeof navigator&&"undefined"!=typeof document&&(isIos=navigator.userAgent.match(/iphone|ipad|ipod/i)||-1!==navigator.userAgent.indexOf("Mac")&&"ontouchend"in document,isMobile=isIos||navigator.userAgent.match(/android/i));var IsMobile={data:function(){return{isIos:isIos,isMobile:isMobile}}},script={name:"FlowFormBaseType",props:{language:LanguageModel,question:QuestionModel,active:Boolean,value:[String,Array,Boolean,Number,Object]},mixins:[IsMobile],data:function(){return{dirty:!1,dataValue:null,answer:null,enterPressed:!1,allowedChars:null,alwaysAllowedKeys:["ArrowLeft","ArrowRight","Delete","Backspace"],focused:!1,canReceiveFocus:!1}},mounted:function(){this.question.answer?this.dataValue=this.question.answer:this.question.multiple&&(this.dataValue=[])},methods:{fixAnswer:function(e){return e},getElement:function(){for(var e=this.$refs.input;e&&e.$el;)e=e.$el;return e},setFocus:function(){this.focused=!0},unsetFocus:function(e){this.focused=!1},focus:function(){if(!this.focused){var e=this.getElement();e&&e.focus()}},blur:function(){var e=this.getElement();e&&e.blur()},onKeyDown:function(e){this.enterPressed=!1,clearTimeout(this.timeoutId),e&&("Enter"!==e.key||e.shiftKey||this.unsetFocus(),null!==this.allowedChars&&-1===this.alwaysAllowedKeys.indexOf(e.key)&&-1===this.allowedChars.indexOf(e.key)&&e.preventDefault())},onChange:function(e){this.dirty=!0,this.dataValue=e.target.value,this.onKeyDown(),this.setAnswer(this.dataValue)},onEnter:function(){this._onEnter()},_onEnter:function(){this.enterPressed=!0,this.dataValue=this.fixAnswer(this.dataValue),this.setAnswer(this.dataValue),this.isValid()?this.blur():this.focus()},setAnswer:function(e){this.question.setAnswer(e),this.answer=this.question.answer,this.question.answered=this.isValid(),this.$emit("input",this.answer)},showInvalid:function(){return this.dirty&&this.enterPressed&&!this.isValid()},isValid:function(){return!(this.question.required||this.hasValue||!this.dirty)||!!this.validate()},validate:function(){return!this.question.required||this.hasValue}},computed:{placeholder:function(){return this.question.placeholder||this.language.placeholder},hasValue:function(){if(null!==this.dataValue){var e=this.dataValue;return e.trim?e.trim().length>0:!Array.isArray(e)||e.length>0}return!1}}};function normalizeComponent(e,t,i,n,s,o,_,r,a,u){"boolean"!=typeof _&&(a=r,r=_,_=!1);var l,c="function"==typeof i?i.options:i;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),n&&(c._scopeId=n),o?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=l):t&&(l=_?function(e){t.call(this,u(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),l)if(c.functional){var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return i}var __vue_script__=script,__vue_inject_styles__=void 0,__vue_scope_id__=void 0,__vue_module_identifier__=void 0,__vue_is_functional_template__=void 0,__vue_component__=normalizeComponent({},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,!1,void 0,void 0,void 0),script$1={extends:__vue_component__,name:QuestionType.Dropdown,computed:{answerLabel:function(){for(var e=0;er.length))return e(n,r,o,i)}return""}}function masker(e,t,i,n){return void 0===i&&(i=!0),Array.isArray(t)?dynamicMask(maskit,t,n)(e,t,i,n):maskit(e,t,i,n)}var tokens={"#":{pattern:/\d/},X:{pattern:/[0-9a-zA-Z]/},S:{pattern:/[a-zA-Z]/},A:{pattern:/[a-zA-Z]/,transform:function(e){return e.toLocaleUpperCase()}},a:{pattern:/[a-zA-Z]/,transform:function(e){return e.toLocaleLowerCase()}},"!":{escape:!0}};function event(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function mask(e,t){var i=t.value;if((Array.isArray(i)||"string"==typeof i)&&(i={mask:i,tokens:tokens}),"INPUT"!==e.tagName.toLocaleUpperCase()){var n=e.getElementsByTagName("input");if(1!==n.length)throw new Error("v-mask directive requires 1 input, found "+n.length);e=n[0]}e.oninput=function(t){if(t.isTrusted){var n=e.selectionEnd,s=e.value[n-1];for(e.value=masker(e.value,i.mask,!0,i.tokens);ne.maxHeight?(i=e.maxHeight,e.maxHeightScroll=!0):e.maxHeightScroll=!1);var n=i+"px";e.height=n+(t?" !important":"")}),this}},created:function(){this.val=this.value},mounted:function(){this.resize()}},__vue_script__$5=script$5,__vue_render__$3=function(){var e=this,t=e.$createElement;return(e._self._c||t)("textarea",{directives:[{name:"model",rawName:"v-model",value:e.val,expression:"val"}],style:e.computedStyles,domProps:{value:e.val},on:{focus:e.resize,input:function(t){t.target.composing||(e.val=t.target.value)}}})},__vue_staticRenderFns__$3=[];__vue_render__$3._withStripped=!0;var __vue_inject_styles__$5=void 0,__vue_scope_id__$5=void 0,__vue_module_identifier__$5=void 0,__vue_is_functional_template__$5=!1,__vue_component__$5=normalizeComponent({render:__vue_render__$3,staticRenderFns:__vue_staticRenderFns__$3},__vue_inject_styles__$5,__vue_script__$5,__vue_scope_id__$5,__vue_is_functional_template__$5,__vue_module_identifier__$5,!1,void 0,void 0,void 0),script$6={extends:__vue_component__,name:QuestionType.LongText,components:{TextareaAutosize:__vue_component__$5},data:function(){return{canReceiveFocus:!0}},mounted:function(){window.addEventListener("resize",this.onResizeListener)},beforeDestroy:function(){window.removeEventListener("resize",this.onResizeListener)},methods:{onResizeListener:function(){this.$refs.input.resize()},unsetFocus:function(e){!e&&this.isMobile||(this.focused=!1)},onEnterDown:function(e){this.isMobile||e.preventDefault()},onEnter:function(){this.isMobile||this._onEnter()}}},__vue_script__$6=script$6,__vue_render__$4=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",[i("textarea-autosize",{ref:"input",attrs:{rows:"1",value:e.value,required:e.question.required,placeholder:e.placeholder},nativeOn:{keydown:[function(t){return e.onKeyDown(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.onEnterDown(t)}],keyup:[function(t){return e.onChange(t)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(t.preventDefault(),e.onEnter(t))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.preventDefault(),e.onEnter(t))}],focus:function(t){return e.setFocus(t)},blur:function(t){return e.unsetFocus(t)}}})],1)},__vue_staticRenderFns__$4=[];__vue_render__$4._withStripped=!0;var __vue_inject_styles__$6=void 0,__vue_scope_id__$6=void 0,__vue_module_identifier__$6=void 0,__vue_is_functional_template__$6=!1,__vue_component__$6=normalizeComponent({render:__vue_render__$4,staticRenderFns:__vue_staticRenderFns__$4},__vue_inject_styles__$6,__vue_script__$6,__vue_scope_id__$6,__vue_is_functional_template__$6,__vue_module_identifier__$6,!1,void 0,void 0,void 0),script$7={extends:__vue_component__,name:QuestionType.MultipleChoice,data:function(){return{editingOther:!1}},mounted:function(){this.question.multiple&&(this.dataValue=[]),this.addKeyListener()},beforeDestroy:function(){this.removeKeyListener()},watch:{active:function(e){e?(this.addKeyListener(),this.question.multiple&&this.question.answered&&(this.enterPressed=!1)):this.removeKeyListener()}},methods:{addKeyListener:function(){this.removeKeyListener(),document.addEventListener("keyup",this.onKeyListener)},removeKeyListener:function(){document.removeEventListener("keyup",this.onKeyListener)},onKeyListener:function(e){if(this.active&&!this.editingOther&&e.key&&1===e.key.length){var t=e.key.toUpperCase().charCodeAt(0);if(t>=65&&t<=90){var i=t-65;if(i>-1){var n=this.question.options[i];n?this.toggleAnswer(n):this.question.allowOther&&i===this.question.options.length&&this.startEditOther()}}}},getLabel:function(e){return this.language.ariaMultipleChoice.replace(":letter",this.getToggleKey(e))},getToggleKey:function(e){var t=65+e;return t<=90?String.fromCharCode(t):""},toggleAnswer:function(e){if(!this.question.multiple){this.question.allowOther&&(this.question.other=this.dataValue=null,this.setAnswer(this.dataValue));for(var t=0;t0)}}},__vue_script__$7=script$7,__vue_render__$5=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"f-radios-wrap"},[i("ul",{staticClass:"f-radios",class:{"f-multiple":e.question.multiple},attrs:{role:"listbox"}},[e._l(e.question.options,function(t,n){return i("li",{key:"m"+n,class:{"f-selected":t.selected},attrs:{"aria-label":e.getLabel(n),role:"option"},on:{click:function(i){return i.preventDefault(),e.toggleAnswer(t)}}},[i("span",{staticClass:"f-key"},[e._v(e._s(e.getToggleKey(n)))]),e._v(" "),i("span",{staticClass:"f-label"},[e._v(e._s(t.choiceLabel()))])])}),e._v(" "),e.question.allowOther?i("li",{staticClass:"f-other",class:{"f-selected":e.question.other,"f-focus":e.editingOther},attrs:{"aria-label":e.language.ariaTypeAnswer,role:"option"},on:{click:function(t){return t.preventDefault(),e.startEditOther(t)}}},[e.editingOther?e._e():i("span",{staticClass:"f-key"},[e._v(e._s(e.getToggleKey(e.question.options.length)))]),e._v(" "),e.editingOther?i("input",{directives:[{name:"model",rawName:"v-model",value:e.question.other,expression:"question.other"}],ref:"otherInput",attrs:{type:"text",maxlength:"256"},domProps:{value:e.question.other},on:{blur:e.stopEditOther,keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.stopEditOther(t))},e.onChangeOther],change:e.onChangeOther,input:function(t){t.target.composing||e.$set(e.question,"other",t.target.value)}}}):e.question.other?i("span",{staticClass:"f-selected"},[i("span",{staticClass:"f-label"},[e._v(e._s(e.question.other))])]):i("span",{staticClass:"f-label"},[e._v(e._s(e.language.otherPrompt))])]):e._e()],2)])},__vue_staticRenderFns__$5=[];__vue_render__$5._withStripped=!0;var __vue_inject_styles__$7=void 0,__vue_scope_id__$7=void 0,__vue_module_identifier__$7=void 0,__vue_is_functional_template__$7=!1,__vue_component__$7=normalizeComponent({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},__vue_inject_styles__$7,__vue_script__$7,__vue_scope_id__$7,__vue_is_functional_template__$7,__vue_module_identifier__$7,!1,void 0,void 0,void 0),script$8={extends:__vue_component__$3,name:QuestionType.Number,data:function(){return{inputType:"tel",allowedChars:"-0123456789."}},methods:{validate:function(){return this.hasValue?!isNaN(+this.dataValue):!this.question.required||this.hasValue}}},__vue_script__$8=script$8,__vue_inject_styles__$8=void 0,__vue_scope_id__$8=void 0,__vue_module_identifier__$8=void 0,__vue_is_functional_template__$8=void 0,__vue_component__$8=normalizeComponent({},__vue_inject_styles__$8,__vue_script__$8,__vue_scope_id__$8,__vue_is_functional_template__$8,__vue_module_identifier__$8,!1,void 0,void 0,void 0),script$9={extends:__vue_component__$3,name:QuestionType.Password,data:function(){return{inputType:"password"}}},__vue_script__$9=script$9,__vue_inject_styles__$9=void 0,__vue_scope_id__$9=void 0,__vue_module_identifier__$9=void 0,__vue_is_functional_template__$9=void 0,__vue_component__$9=normalizeComponent({},__vue_inject_styles__$9,__vue_script__$9,__vue_scope_id__$9,__vue_is_functional_template__$9,__vue_module_identifier__$9,!1,void 0,void 0,void 0),script$a={extends:__vue_component__$3,name:QuestionType.Phone,data:function(){return{inputType:"tel",canReceiveFocus:!0}}},__vue_script__$a=script$a,__vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=void 0,__vue_component__$a=normalizeComponent({},__vue_inject_styles__$a,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,!1,void 0,void 0,void 0),script$b={extends:__vue_component__,name:QuestionType.SectionBreak,methods:{onEnter:function(){this.dirty=!0,this._onEnter()},isValid:function(){return!0}}},__vue_script__$b=script$b,__vue_render__$6=function(){var e=this.$createElement,t=this._self._c||e;return this.question.content?t("div",{staticClass:"f-content"},[t("span",{staticClass:"f-section-text"},[this._v(this._s(this.question.content))])]):this._e()},__vue_staticRenderFns__$6=[];__vue_render__$6._withStripped=!0;var __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1,__vue_component__$b=normalizeComponent({render:__vue_render__$6,staticRenderFns:__vue_staticRenderFns__$6},__vue_inject_styles__$b,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,!1,void 0,void 0,void 0),script$c={extends:__vue_component__$3,name:QuestionType.Url,data:function(){return{inputType:"url"}},methods:{fixAnswer:function(e){return e&&-1===e.indexOf("://")&&(e="https://"+e),e},validate:function(){if(this.hasValue)try{new URL(this.fixAnswer(this.dataValue));return!0}catch(e){return!1}return!this.question.required}}},__vue_script__$c=script$c,__vue_inject_styles__$c=void 0,__vue_scope_id__$c=void 0,__vue_module_identifier__$c=void 0,__vue_is_functional_template__$c=void 0,__vue_component__$c=normalizeComponent({},__vue_inject_styles__$c,__vue_script__$c,__vue_scope_id__$c,__vue_is_functional_template__$c,__vue_module_identifier__$c,!1,void 0,void 0,void 0),script$d={extends:__vue_component__$3,name:QuestionType.Date,data:function(){return{inputType:"date"}},methods:{validate:function(){return!(this.question.min&&this.dataValuethis.question.max)&&(!this.question.required||this.hasValue))}}},__vue_script__$d=script$d,__vue_inject_styles__$d=void 0,__vue_scope_id__$d=void 0,__vue_module_identifier__$d=void 0,__vue_is_functional_template__$d=void 0,__vue_component__$d=normalizeComponent({},__vue_inject_styles__$d,__vue_script__$d,__vue_scope_id__$d,__vue_is_functional_template__$d,__vue_module_identifier__$d,!1,void 0,void 0,void 0),script$e={name:"FlowFormQuestion",components:{FlowFormDateType:__vue_component__$d,FlowFormDropdownType:__vue_component__$1,FlowFormEmailType:__vue_component__$4,FlowFormLongTextType:__vue_component__$6,FlowFormMultipleChoiceType:__vue_component__$7,FlowFormNumberType:__vue_component__$8,FlowFormPasswordType:__vue_component__$9,FlowFormPhoneType:__vue_component__$a,FlowFormSectionBreakType:__vue_component__$b,FlowFormTextType:__vue_component__$3,FlowFormUrlType:__vue_component__$c},props:{question:QuestionModel,language:LanguageModel,value:[String,Array,Boolean,Number,Object],active:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1}},mixins:[IsMobile],data:function(){return{QuestionType:QuestionType,dataValue:null,debounced:!1}},mounted:function(){this.focusField(),this.dataValue=this.question.answer,this.$refs.qanimate.addEventListener("animationend",this.onAnimationEnd)},beforeDestroy:function(){this.$refs.qanimate.removeEventListener("animationend",this.onAnimationEnd)},methods:{focusField:function(){var e=this.$refs.questionComponent;e&&e.focus()},onAnimationEnd:function(){this.focusField()},shouldFocus:function(){var e=this.$refs.questionComponent;return e&&e.canReceiveFocus&&!e.focused},returnFocus:function(){this.$refs.questionComponent;this.shouldFocus()&&this.focusField()},onEnter:function(e){this.checkAnswer(this.emitAnswer)},onTab:function(e){this.checkAnswer(this.emitAnswerTab)},checkAnswer:function(e){var t=this.$refs.questionComponent;t.isValid()&&this.question.nextStepOnAnswer&&!this.question.multiple?this.debounce(function(){return e(t)},350):e(t)},emitAnswer:function(e){e&&(e.focused||this.$emit("answer",e),e.onEnter())},emitAnswerTab:function(e){e&&this.question.type!==QuestionType.Date&&(this.returnFocus(),this.$emit("answer",e),e.onEnter())},debounce:function(e,t){var i;return this.debounced=!0,clearTimeout(i),void(i=setTimeout(e,t))},showOkButton:function(){var e=this.$refs.questionComponent;return this.question.type===QuestionType.SectionBreak?this.active:!this.question.required||(!(!this.question.allowOther||!this.question.other)||!(QuestionType.MultipleChoice&&!this.question.multiple&&this.question.nextStepOnAnswer)&&(!(!e||null===this.dataValue)&&(e.hasValue&&e.isValid())))},showSkip:function(){var e=this.$refs.questionComponent;return!(this.question.required||e&&e.hasValue)},showInvalid:function(){var e=this.$refs.questionComponent;return!(!e||null===this.dataValue)&&e.showInvalid()}},computed:{mainClasses:{cache:!1,get:function(){var e={"q-is-active":this.active,"q-is-inactive":!this.active,"f-fade-in-down":this.reverse,"f-fade-in-up":!this.reverse,"f-focused":this.$refs.questionComponent&&this.$refs.questionComponent.focused,"f-has-value":this.$refs.questionComponent&&this.$refs.questionComponent.hasValue};return e["field-"+this.question.type.toLowerCase().substring(8)]=!0,e}},showHelperText:function(){return!!this.question.subtitle||(this.question.type===QuestionType.LongText||this.question.type===QuestionType.MultipleChoice)&&this.question.helpTextShow}}},__vue_script__$e=script$e,__vue_render__$7=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"qanimate",staticClass:"vff-animate q-form",class:e.mainClasses},[i("div",{staticClass:"q-inner"},[i("div",{class:{"f-section-wrap":e.question.type===e.QuestionType.SectionBreak}},[i("div",{class:{fh2:e.question.type!==e.QuestionType.SectionBreak}},[e.question.tagline?i("span",{staticClass:"f-tagline"},[e._v(e._s(e.question.tagline))]):e._e(),e._v(" "),e.question.title?[e.question.type===e.QuestionType.SectionBreak?i("span",{staticClass:"fh2"},[e._v(e._s(e.question.title))]):i("span",{staticClass:"f-text"},[e._v("\n "+e._s(e.question.title)+" \n "),e._v(" "),e.question.required?i("span",{staticClass:"f-required",attrs:{"aria-label":e.language.ariaRequired,role:"note"}},[i("span",{attrs:{"aria-hidden":"true"}},[e._v("*")])]):e._e(),e._v(" "),e.question.inline?i("span",{staticClass:"f-answer"},[i(e.question.type,{ref:"questionComponent",tag:"component",attrs:{question:e.question,language:e.language,active:e.active},on:{next:e.onEnter},model:{value:e.dataValue,callback:function(t){e.dataValue=t},expression:"dataValue"}})],1):e._e()])]:e._e(),e._v(" "),e.showHelperText?i("span",{staticClass:"f-sub"},[e.question.subtitle?i("span",[e._v(e._s(e.question.subtitle))]):e._e(),e._v(" "),e.question.type!==e.QuestionType.LongText||e.isMobile?e._e():i("span",{staticClass:"f-help",domProps:{innerHTML:e._s(e.question.helpText||e.language.formatString(e.language.longTextHelpText))}}),e._v(" "),e.question.type===e.QuestionType.MultipleChoice&&e.question.multiple?i("span",{staticClass:"f-help"},[e._v(e._s(e.question.helpText||e.language.multipleChoiceHelpText))]):e.question.type===e.QuestionType.MultipleChoice?i("span",{staticClass:"f-help"},[e._v(e._s(e.question.helpText||e.language.multipleChoiceHelpTextSingle))]):e._e()]):e._e(),e._v(" "),e.question.inline?e._e():i("div",{staticClass:"f-answer f-full-width"},[i(e.question.type,{ref:"questionComponent",tag:"component",attrs:{question:e.question,language:e.language,active:e.active},on:{next:e.onEnter},model:{value:e.dataValue,callback:function(t){e.dataValue=t},expression:"dataValue"}})],1)],2),e._v(" "),e.question.description||0!==e.question.descriptionLink.length?i("p",{staticClass:"f-description"},[e.question.description?i("span",[e._v(e._s(e.question.description))]):e._e(),e._v(" "),e._l(e.question.descriptionLink,function(t,n){return i("a",{key:"m"+n,staticClass:"f-link",attrs:{href:t.url,target:t.target}},[e._v(e._s(t.text||t.url))])})],2):e._e()]),e._v(" "),e.showOkButton()?i("div",{staticClass:"vff-animate f-fade-in f-enter"},[i("button",{ref:"button",staticClass:"o-btn-action",attrs:{type:"button",href:"#","aria-label":e.language.ariaOk},on:{click:function(t){return t.preventDefault(),e.onEnter(t)}}},[e.question.type===e.QuestionType.SectionBreak?i("span",[e._v(e._s(e.language.continue))]):e.showSkip()?i("span",[e._v(e._s(e.language.skip))]):i("span",[e._v(e._s(e.language.ok))])]),e._v(" "),e.question.type===e.QuestionType.LongText&&e.isMobile?e._e():i("a",{staticClass:"f-enter-desc",attrs:{href:"#"},domProps:{innerHTML:e._s(e.language.formatString(e.language.pressEnter))},on:{click:function(t){return t.preventDefault(),e.onEnter(t)}}})]):e._e(),e._v(" "),e.showInvalid()?i("div",{staticClass:"f-invalid",attrs:{role:"alert","aria-live":"assertive"}},[e._v(e._s(e.language.invalidPrompt))]):e._e()])])},__vue_staticRenderFns__$7=[];__vue_render__$7._withStripped=!0;var __vue_inject_styles__$e=void 0,__vue_scope_id__$e=void 0,__vue_module_identifier__$e=void 0,__vue_is_functional_template__$e=!1,__vue_component__$e=normalizeComponent({render:__vue_render__$7,staticRenderFns:__vue_staticRenderFns__$7},__vue_inject_styles__$e,__vue_script__$e,__vue_scope_id__$e,__vue_is_functional_template__$e,__vue_module_identifier__$e,!1,void 0,void 0,void 0),script$f={name:"FlowForm",components:{FlowFormQuestion:__vue_component__$e},props:{questions:{type:Array,validator:function(e){return e.every(function(e){return e instanceof QuestionModel})}},language:{type:LanguageModel,default:function(){return new LanguageModel}},progressbar:{type:Boolean,default:!0},standalone:{type:Boolean,default:!0},navigation:{type:Boolean,default:!0},timer:{type:Boolean,default:!1},timerStartStep:[String,Number],timerStopStep:[String,Number]},mixins:[IsMobile],data:function(){return{completed:!1,submitted:!1,activeQuestionIndex:0,questionList:[],questionListActivePath:[],reverse:!1,timerOn:!1,timerInterval:null,time:0}},mounted:function(){document.addEventListener("keydown",this.onKeyDownListener),document.addEventListener("keyup",this.onKeyUpListener,!0),window.addEventListener("beforeunload",this.onBeforeUnload),this.setQuestions(),this.checkTimer()},beforeDestroy:function(){document.removeEventListener("keydown",this.onKeyDownListener),document.removeEventListener("keyup",this.onKeyUpListener,!0),window.removeEventListener("beforeunload",this.onBeforeUnload),this.stopTimer()},computed:{numActiveQuestions:function(){return this.questionListActivePath.length},activeQuestion:function(){return this.questionListActivePath[this.activeQuestionIndex]},activeQuestionId:function(){var e=this.questions[this.activeQuestionIndex];return this.isOnLastStep?"_submit":e&&e.id?e.id:null},numCompletedQuestions:function(){var e=0;return this.questionListActivePath.forEach(function(t){t.answered&&++e}),e},percentCompleted:function(){return this.numActiveQuestions?Math.floor(this.numCompletedQuestions/this.numActiveQuestions*100):0},isOnLastStep:function(){return this.numActiveQuestions>0&&this.activeQuestionIndex===this.questionListActivePath.length},isOnTimerStartStep:function(){return this.activeQuestionId===this.timerStartStep||!this.timerOn&&!this.timerStartStep&&0===this.activeQuestionIndex},isOnTimerStopStep:function(){return!!this.submitted||this.activeQuestionId===this.timerStopStep}},methods:{activeQuestionComponent:function(){return this.$refs.questions?this.$refs.questions[this.activeQuestionIndex]:null},setQuestions:function(){this.setQuestionListActivePath(),this.setQuestionList()},setQuestionListActivePath:function(){var e=[];if(this.questions.length){var t,i=0,n=0;do{var s=this.questions[i];if(s.setIndex(n),s.language=this.language,e.push(s),s.jump)if(s.answered)if(t=s.getJumpId()){if("_submit"===t)i=this.questions.length;else for(var o=0;o0&&!this.submitted&&(e.preventDefault(),e.returnValue="")},onKeyDownListener:function(e){if("Tab"===e.key&&!this.submitted)if(e.shiftKey)e.stopPropagation(),e.preventDefault(),this.navigation&&this.goToPreviousQuestion();else{var t=this.activeQuestionComponent();t.shouldFocus()?(e.preventDefault(),t.focusField()):(e.stopPropagation(),this.emitTab(),this.reverse=!1)}},onKeyUpListener:function(e){if(!e.shiftKey&&-1!==["Tab","Enter"].indexOf(e.key)&&!this.submitted){var t=this.activeQuestionComponent();"Tab"===e.key&&t.shouldFocus()?t.focusField():("Enter"===e.key&&this.emitEnter(),e.stopPropagation(),this.reverse=!1)}},emitEnter:function(){var e=this.activeQuestionComponent();e?e.onEnter():this.completed&&this.isOnLastStep&&this.submit()},emitTab:function(){var e=this.activeQuestionComponent();e?e.onTab():this.emitEnter()},submit:function(){this.emitSubmit(),this.submitted=!0},emitComplete:function(){this.$emit("complete",this.completed,this.questionList)},emitSubmit:function(){this.$emit("submit",this.questionList)},isNextQuestionAvailable:function(){if(this.submitted)return!1;var e=this.activeQuestion;return!(!e||e.required)||(!(!this.completed||this.isOnLastStep)||this.activeQuestionIndex0&&!this.submitted&&(this.isOnTimerStopStep&&this.startTimer(),--this.activeQuestionIndex,this.reverse=!0,this.checkTimer())},goToNextQuestion:function(){this.blurFocus(),this.isNextQuestionAvailable()&&this.emitEnter(),this.reverse=!1},blurFocus:function(){document.activeElement&&document.activeElement.blur&&document.activeElement.blur()},checkTimer:function(){this.timer&&(this.isOnTimerStartStep?this.startTimer():this.isOnTimerStopStep&&this.stopTimer())},startTimer:function(){this.timer&&!this.timerOn&&(this.timerInterval=setInterval(this.incrementTime,1e3),this.timerOn=!0)},stopTimer:function(){this.timerOn&&clearInterval(this.timerInterval),this.timerOn=!1},incrementTime:function(){++this.time,this.$emit("timer",this.time,this.formatTime(this.time))},formatTime:function(e){var t=14,i=5;return e>=3600&&(t=11,i=8),new Date(1e3*e).toISOString().substr(t,i)}},watch:{completed:function(){this.emitComplete()},submitted:function(){this.stopTimer()}}},__vue_script__$f=script$f,__vue_render__$8=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"vff",class:{"vff-not-standalone":!e.standalone,"vff-is-mobile":e.isMobile,"vff-is-ios":e.isIos}},[i("div",{staticClass:"f-container"},[i("div",{staticClass:"f-form-wrap"},[e._l(e.questionList,function(t,n){return i("flow-form-question",{key:"q"+n,ref:"questions",refInFor:!0,attrs:{question:t,language:e.language,active:t.index===e.activeQuestionIndex,reverse:e.reverse},on:{answer:e.onQuestionAnswered},model:{value:t.answer,callback:function(i){e.$set(t,"answer",i)},expression:"q.answer"}})}),e._v(" "),e.isOnLastStep?i("div",{staticClass:"vff-animate f-fade-in-up field-submittype"},[e._t("complete",[i("div",{staticClass:"f-section-wrap"},[i("p",[i("span",{staticClass:"fh2"},[e._v(e._s(e.language.thankYouText))])])])]),e._v(" "),e._t("completeButton",[e.submitted?e._e():i("button",{ref:"button",staticClass:"o-btn-action",attrs:{type:"button",href:"#","aria-label":e.language.ariaSubmitText},on:{click:function(t){return t.preventDefault(),e.submit()}}},[i("span",[e._v(e._s(e.language.submitText))])]),e._v(" "),e.submitted?e._e():i("a",{staticClass:"f-enter-desc",attrs:{href:"#"},domProps:{innerHTML:e._s(e.language.formatString(e.language.pressEnter))},on:{click:function(t){return t.preventDefault(),e.submit()}}}),e._v(" "),e.submitted?i("p",{staticClass:"text-success"},[e._v(e._s(e.language.successText))]):e._e()])],2):e._e()],2)]),e._v(" "),i("div",{staticClass:"vff-footer"},[i("div",{staticClass:"footer-inner-wrap"},[e.progressbar?i("div",{staticClass:"f-progress",class:{"not-started":0===e.percentCompleted,completed:100===e.percentCompleted}},[i("div",{staticClass:"f-progress-bar"},[i("div",{staticClass:"f-progress-bar-inner",style:"width: "+e.percentCompleted+"%;"})]),e._v("\n "+e._s(e.language.percentCompleted.replace(":percent",e.percentCompleted))+"\n ")]):e._e(),e._v(" "),e.navigation?i("div",{staticClass:"f-nav"},[i("a",{staticClass:"f-prev",class:{"f-disabled":0===e.activeQuestionIndex||e.submitted},attrs:{href:"#",role:"button","aria-label":e.language.ariaPrev},on:{click:function(t){return t.preventDefault(),e.goToPreviousQuestion()}}},[i("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"42.333px",height:"28.334px",viewBox:"78.833 5.5 42.333 28.334","aria-hidden":"true"}},[i("path",{attrs:{d:"M82.039,31.971L100,11.442l17.959,20.529L120,30.187L101.02,8.492c-0.258-0.295-0.629-0.463-1.02-0.463c-0.39,0-0.764,0.168-1.02,0.463L80,30.187L82.039,31.971z"}})]),e._v(" "),i("span",{staticClass:"f-nav-text",attrs:{"aria-hidden":"true"}},[e._v(e._s(e.language.prev))])]),e._v(" "),i("a",{staticClass:"f-next",class:{"f-disabled":!e.isNextQuestionAvailable()},attrs:{href:"#",role:"button","aria-label":e.language.ariaNext},on:{click:function(t){return t.preventDefault(),e.goToNextQuestion()}}},[i("svg",{attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"42.333px",height:"28.334px",viewBox:"78.833 5.5 42.333 28.334","aria-hidden":"true"}},[i("path",{attrs:{d:"M117.963,8.031l-17.961,20.529L82.042,8.031l-2.041,1.784l18.98,21.695c0.258,0.295,0.629,0.463,1.02,0.463c0.39,0,0.764-0.168,1.02-0.463l18.98-21.695L117.963,8.031z"}})]),e._v(" "),i("span",{staticClass:"f-nav-text",attrs:{"aria-hidden":"true"}},[e._v(e._s(e.language.next))])])]):e._e(),e._v(" "),e.timer?i("div",{staticClass:"f-timer"},[i("span",[e._v(e._s(e.formatTime(e.time)))])]):e._e()])])])},__vue_staticRenderFns__$8=[];__vue_render__$8._withStripped=!0;var __vue_inject_styles__$f=void 0,__vue_scope_id__$f=void 0,__vue_module_identifier__$f=void 0,__vue_is_functional_template__$f=!1,__vue_component__$f=normalizeComponent({render:__vue_render__$8,staticRenderFns:__vue_staticRenderFns__$8},__vue_inject_styles__$f,__vue_script__$f,__vue_scope_id__$f,__vue_is_functional_template__$f,__vue_module_identifier__$f,!1,void 0,void 0,void 0);function assign(e,t){var i=arguments;if(null==e)throw new TypeError("Cannot convert first argument to object");for(var n=Object(e),s=1;s