{"version":3,"sources":["webpack:///./src/views/ListingMakeAnOffer.vue?4735","webpack:///./src/views/ListingMakeAnOffer.vue","webpack:///./src/views/ListingMakeAnOffer.vue?b4d9","webpack:///./src/views/ListingMakeAnOffer.vue?ba71","webpack:///./src/views/ListingMakeAnOffer.vue?d08e","webpack:///./src/components/Forms/SteppedForm.vue?214a","webpack:///./node_modules/client-website-ts-library/plugins/view/index.ts","webpack:///./src/components/Forms/SteppedForm.vue?67c9","webpack:///./src/components/Forms/SteppedForm.vue","webpack:///./src/components/Forms/SteppedForm.vue?14c6","webpack:///./src/components/Forms/SteppedForm.vue?cfde"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","style","backgroundImage","listing","Images","Preview","Url","Agents","PROLISTPhoto","_e","submitted","_v","formData","on","$event","staticRenderFns","Listings","Get","$route","params","id","then","ClientWebsiteId","Website","Id","Items","Type","Context","Listing","data","field","document","getElementById","FieldId","HTMLInputElement","value","console","log","HTMLSelectElement","fieldsHidden","getElementsByClassName","Array","from","forEach","hiddenField","classList","remove","add","components","SteppedForm","component","prolistAnalyticsService","ServiceManager","Analytics","headService","Require","Head","evt","obj","getAnalyticsEvent","call","getAnalyticsData","path","name","undefined","triggerAnalyticsEvent","event","GetAll","adapter","Record","result","head","bind","Promise","meta","Update","UpdateWithStatic","requestAnimationFrame","updateHead","updateAnalytics","$on","class","fullHeight","fieldBg","fieldColour","labelColour","labelFocusedColour","loading","errored","domProps","_s","definition","Options","SubmittedText","currentStep","_l","section","idx","key","SectionId","Title","Sections","length","validatingStep","ref","refInFor","errors","ctx","type","handleFieldInput","goBack","goForward","submitButtonClass","submitButtonColour","submitButtonBackgroundColour","submitForm","SubmitButtonText","context","submitPercent","recaptchaService","ReCaptcha","progress","total","Math","round","Forms","GetForm","def","catch","fieldDef","filter","err","Key","collectData","normalisedData","normaliseData","SubmitForm","Valid","Submitted","$emit","resetRecaptcha","ValidationState","Errors","includeRecaptcha","resolve","reject","sectionComponent","$refs","push","ex","getRecaptchaResponse","recaptchaResponse","Log","Debug","Value","Reset","GetResponse","ValidateSection","newValues","entry","i","default","Section","Loader"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,OAAO,CAAEJ,EAAW,QAAE,CAACI,EAAG,eAAe,CAACE,YAAY,oBAAoBC,MAAM,CAAC,KAAO,OAAO,OAAS,OAAO,MAAQ,mCAAmC,OAAS,WAAYP,EAAY,SAAEI,EAAG,aAAa,CAACG,MAAM,CAAC,WAAY,IAAO,CAACH,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,MAAM,CAACE,YAAY,aAAaE,MAAM,CAAGC,gBAAiB,OAAST,EAAIU,QAAQC,OAAO,GAAGC,QAAQC,IAAM,OAAUb,EAAIU,QAAQI,OAAO,GAAe,aAAEV,EAAG,MAAM,CAACE,YAAY,oBAAoBE,MAAM,CAAE,mBAAoB,OAASR,EAAIU,QAAQI,OAAO,GAAGC,aAAaH,QAAQC,IAAM,OAAQb,EAAIgB,KAAOhB,EAAIiB,UAAkSb,EAAG,MAAM,CAACE,YAAY,qBAAqB,CAACF,EAAG,MAAM,CAACG,MAAM,CAAC,IAAM,gCAAgC,IAAM,UAAUH,EAAG,IAAI,CAACJ,EAAIkB,GAAG,6DAA6Dd,EAAG,IAAI,CAACJ,EAAIkB,GAAG,gEAAgEd,EAAG,IAAI,CAACJ,EAAIkB,GAAG,kGAAkGd,EAAG,IAAI,CAACJ,EAAIkB,GAAG,yGAAyGd,EAAG,IAAI,CAACA,EAAG,aAAa,CAACG,MAAM,CAAC,KAAO,qBAAqB,CAACP,EAAIkB,GAAG,oBAAoBd,EAAG,aAAa,CAACG,MAAM,CAAC,KAAO,yBAAyB,CAACP,EAAIkB,GAAG,0BAA0B,KAAh8Bd,EAAG,cAAc,CAACE,YAAY,eAAeC,MAAM,CAAC,QAAUP,EAAImB,SAAS,K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","file":"js/chunk-8b3a45cc.992ebead.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Page',[(_vm.listing)?[_c('SiteMasthead',{staticClass:\"make_offer_header\",attrs:{\"mini\":\"true\",\"darken\":\"true\",\"image\":\"/assets/images/photos/survey.jpg\",\"height\":\"128px\"}}),(_vm.formData)?_c('ContentRow',{attrs:{\"noPadding\":true}},[_c('div',{staticClass:\"survey\"},[_c('div',{staticClass:\"survey__bg\",style:({ backgroundImage: 'url(' + _vm.listing.Images[0].Preview.Url + ')' })}),(_vm.listing.Agents[0].PROLISTPhoto)?_c('div',{staticClass:\"survey__agent-img\",style:({'background-image': 'url(' + _vm.listing.Agents[0].PROLISTPhoto.Preview.Url + ')'})}):_vm._e(),(!_vm.submitted)?_c('SteppedForm',{staticClass:\"survey__form\",attrs:{\"context\":_vm.formData,\"type\":\"Variations.InspireRealEstate.MakeAnOfferForm\",\"full-height\":\"true\",\"fieldColour\":\"#fff\",\"labelColour\":\"#fff\",\"labelFocusedColour\":\"#fff\"},on:{\"submitted\":function($event){_vm.submitted = true}}}):_c('div',{staticClass:\"survey__submitted\"},[_c('img',{attrs:{\"src\":\"/assets/images/brand/logo.svg\",\"alt\":\"Logo\"}}),_c('p',[_vm._v(\" Thank you for submitting your offer on this property. \")]),_c('p',[_vm._v(\" We have received your offer and will review it promptly. \")]),_c('p',[_vm._v(\" One of our agents will be in touch with you shortly to discuss the details and next steps. \")]),_c('p',[_vm._v(\" In the meantime, feel free to explore our other listings or contact us if you have any questions. \")]),_c('p',[_c('LinkButton',{attrs:{\"href\":\"/properties/sold\"}},[_vm._v(\"Recent Results\")]),_c('LinkButton',{attrs:{\"href\":\"/properties/for-sale\"}},[_vm._v(\"Properties for Sale\")])],1)])],1)]):_vm._e()]:_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { AsyncView } from 'client-website-ts-library/plugins';\r\nimport { API, Config } from 'client-website-ts-library/services';\r\nimport { Listing } from 'client-website-ts-library/types';\r\nimport { Component, Mixins } from 'vue-property-decorator';\r\n\r\nimport { FormConstructorData, FormField } from 'client-website-ts-library/types/Forms';\r\nimport { ContextItemType } from 'client-website-ts-library/types/Context';\r\nimport SteppedForm from '../components/Forms/SteppedForm.vue';\r\n\r\n@Component({\r\n components: {\r\n SteppedForm,\r\n },\r\n})\r\nexport default class ListingMakeAnOffer extends Mixins(AsyncView) {\r\n private listing: Listing | null = null;\r\n\r\n private formData: FormConstructorData | null = null;\r\n\r\n private submitted = false;\r\n\r\n mounted() {\r\n API.Listings.Get(this.$route.params.id).then((listing) => {\r\n this.listing = listing;\r\n\r\n this.formData = {\r\n ClientWebsiteId: Config.Website.Id,\r\n Items: [\r\n {\r\n Type: ContextItemType.Listing,\r\n Id: listing.Id,\r\n },\r\n ],\r\n };\r\n });\r\n }\r\n\r\n handleFieldInput(data: FormField) {\r\n const field = document.getElementById(`field_${data.FieldId}`);\r\n\r\n if (field) {\r\n if (field instanceof HTMLInputElement) {\r\n const value = field.value;\r\n console.log(field.value);\r\n } else if (field instanceof HTMLSelectElement) {\r\n if (field.value === 'Yes, there are other offers') {\r\n // Get all elements with the class \"hidden\"\r\n const fieldsHidden = document.getElementsByClassName('hidden-offers');\r\n\r\n // Use forEach to remove the \"hidden\" class from each element\r\n Array.from(fieldsHidden).forEach((hiddenField) => {\r\n hiddenField.classList.remove('hidden-offers');\r\n hiddenField.classList.add('show-offers');\r\n });\r\n } else if (field.value === 'No, there are no other offers') {\r\n // Get all elements with the class \"hidden\"\r\n const fieldsHidden = document.getElementsByClassName('show-offers');\r\n\r\n // Use forEach to remove the \"hidden\" class from each element\r\n Array.from(fieldsHidden).forEach((hiddenField) => {\r\n hiddenField.classList.remove('show-offers');\r\n hiddenField.classList.add('hidden-offers');\r\n });\r\n }\r\n } else {\r\n console.log('Field type not supported.');\r\n }\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ListingMakeAnOffer.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--14-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ListingMakeAnOffer.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ListingMakeAnOffer.vue?vue&type=template&id=75634235&\"\nimport script from \"./ListingMakeAnOffer.vue?vue&type=script&lang=ts&\"\nexport * from \"./ListingMakeAnOffer.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./ListingMakeAnOffer.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ListingMakeAnOffer.vue?vue&type=style&index=0&lang=css&\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SteppedForm.vue?vue&type=style&index=0&id=6993258e&scoped=true&lang=css&\"","import Vue from \"vue\";\r\nimport { Component } from \"vue-property-decorator\";\r\nimport { AnalyticsEvent, AnalyticsEventObject, AnalyticsPageView, IAnalyticsAdapter, PROListAnalyticsAdapter } from \"../../services/Analytics\";\r\nimport { HeadService } from \"../../services/HeadService\";\r\nimport { ServiceManager, ServiceType } from \"../../services/ServiceManager\";\r\nimport { RouteMeta } from \"../meta\";\r\n\r\ninterface ViewBase {\r\n getAnalyticsEvent?(): AnalyticsEvent | null;\r\n getAnalyticsData?(): AnalyticsEventObject | null;\r\n head?(): RouteMeta | Promise | null;\r\n}\r\n\r\n@Component\r\nclass ViewBase extends Vue {\r\n protected prolistAnalyticsService = ServiceManager.Get(ServiceType.Analytics, 'PROListAnalyticsAdapter');\r\n protected headService = ServiceManager.Require(ServiceType.Head)!;\r\n\r\n public updateAnalytics() {\r\n let evt: AnalyticsEvent | null = null;\r\n let obj: AnalyticsEventObject | null = null;\r\n\r\n if (typeof this.getAnalyticsEvent !== 'undefined') {\r\n evt = this.getAnalyticsEvent.call(this);\r\n } else if(typeof this.getAnalyticsData !== 'undefined') {\r\n obj = this.getAnalyticsData.call(this);\r\n }\r\n\r\n if (evt === null) evt = new AnalyticsPageView(this.$route.path, this.$route.name || '', obj || undefined);\r\n\r\n this.triggerAnalyticsEvent(evt);\r\n }\r\n\r\n public triggerAnalyticsEvent(event: AnalyticsEvent) {\r\n ServiceManager.GetAll(ServiceType.Analytics).forEach((adapter) => {\r\n adapter.Record(event);\r\n });\r\n }\r\n\r\n public triggerCustomAnalyticsEvent(event: AnalyticsEvent) {\r\n if (this.prolistAnalyticsService !== null) this.prolistAnalyticsService.Record(event);\r\n }\r\n\r\n protected updateHead() {\r\n if ('head' in this) {\r\n const result = this.head!.bind(this)();\r\n\r\n if(result instanceof Promise) {\r\n result.then((meta: RouteMeta | null) => {\r\n this.headService.Update(meta);\r\n });\r\n } else {\r\n this.headService.Update(result as RouteMeta | null);\r\n }\r\n } else {\r\n this.headService.UpdateWithStatic(this.$route.path);\r\n }\r\n }\r\n}\r\n\r\n@Component\r\nclass View extends ViewBase {\r\n public mounted() {\r\n requestAnimationFrame(() => {\r\n this.updateHead();\r\n this.updateAnalytics();\r\n });\r\n }\r\n}\r\n\r\n@Component\r\nclass AsyncView extends ViewBase {\r\n public mounted() {\r\n this.$on('updateView', () => {\r\n requestAnimationFrame(() => {\r\n this.updateHead();\r\n this.updateAnalytics();\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport {\r\n View,\r\n AsyncView\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('form',{staticClass:\"form form--stepped\",class:{'form--full-height': _vm.fullHeight},style:({'--field-bg': _vm.fieldBg, '--field-colour': _vm.fieldColour, '--label-colour': _vm.labelColour, '--label-focused-colour': _vm.labelFocusedColour})},[(_vm.definition)?[_c('div',{staticClass:\"form__steps-wrap\"},[(_vm.loading || _vm.errored || _vm.submitted)?_c('div',{staticClass:\"form__ancillaries\"},[_c('ContentContainer',[_c('Loader',{attrs:{\"loading\":_vm.loading}}),(_vm.errored)?_c('div',{staticClass:\"form__panel form__panel--errored\"},[_c('p',[_vm._v(\" An error occurred. Please try again later. \")])]):_vm._e(),(_vm.submitted)?_c('div',{staticClass:\"form__panel form__panel--success\"},[_c('p',{domProps:{\"innerHTML\":_vm._s(_vm.definition.Options.SubmittedText)}})]):_vm._e()],1)],1):_vm._e(),(!_vm.submitted)?[_c('div',{staticClass:\"form__nav-wrap\"},[_c('ul',{staticClass:\"form__nav\"},[_c('li',{staticClass:\"form__nav__spacer\",class:{'form__nav__item--active': _vm.currentStep === 0, 'form__nav__item--passed': _vm.currentStep > 0}}),_vm._l((_vm.definition.Sections),function(section,idx){return _c('li',{key:section.SectionId,staticClass:\"form__nav__item\",class:{'form__nav__item--passed': idx < _vm.currentStep, 'form__nav__item--active': idx === _vm.currentStep}},[_c('span',{staticClass:\"form__nav__item__number\"},[_vm._v(_vm._s(idx + 1))]),_c('span',{staticClass:\"form__nav__item__label\"},[_vm._v(\": \"+_vm._s(section.Title))])])}),_c('li',{staticClass:\"form__nav__spacer\",class:{'form__nav__item--active': _vm.currentStep === _vm.definition.Sections.length - 1}})],2)]),_c('div',{staticClass:\"form__steps\",class:{'form__steps--validating': _vm.validatingStep},style:({'--step': _vm.currentStep})},[_c('div',{staticClass:\"form__steps__viewport\"},_vm._l((_vm.definition.Sections),function(section,idx){return _c('div',{key:section.SectionId,staticClass:\"form__step\",class:{'form__step--active': idx === _vm.currentStep}},[_c('ContentContainer',{staticClass:\"content-container--narrow\"},[_c('Section',{ref:section.SectionId,refInFor:true,attrs:{\"def\":section,\"errors\":_vm.errors,\"form-context\":_vm.ctx,\"form-type\":_vm.type},on:{\"field_input\":_vm.handleFieldInput}}),_c('div',{staticClass:\"form__step__nav\"},[(idx > 0)?_c('Button',{attrs:{\"backgroundColour\":\"var(--brand-secondary)\"},on:{\"click\":_vm.goBack}},[_vm._v(\"Back\")]):_vm._e(),(idx !== _vm.definition.Sections.length - 1)?_c('Button',{attrs:{\"loading\":_vm.validatingStep && idx === _vm.currentStep},on:{\"click\":_vm.goForward}},[_vm._v(\"Next\")]):_c('Button',{staticClass:\"form__submit-btn\",class:_vm.submitButtonClass,attrs:{\"loading\":_vm.loading,\"colour\":_vm.submitButtonColour,\"background-colour\":_vm.submitButtonBackgroundColour},on:{\"click\":_vm.submitForm}},[_vm._v(_vm._s(_vm.definition.Options.SubmitButtonText))])],1)],1)],1)}),0)])]:_vm._e()],2)]:_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop } from 'vue-property-decorator';\r\nimport { FormDefinition, FormSubmissionValidationError, FormField, FormValue } from 'client-website-ts-library/types/Forms';\r\nimport {\r\n ServiceManager,\r\n ServiceType,\r\n API,\r\n Config,\r\n Logger,\r\n LogLevel,\r\n ReCaptchaService,\r\n} from 'client-website-ts-library/services';\r\nimport { Context } from 'client-website-ts-library/types';\r\nimport { PDFFieldData } from 'client-website-ts-library/types/Forms/FieldTypes';\r\nimport { IRequestProgressDelegate } from 'client-website-ts-library/services/API/IRequestProgressDelegate';\r\n\r\nimport Section from './Section.vue';\r\nimport Loader from '../UI/Loader.vue';\r\n\r\n@Component({\r\n components: {\r\n Section,\r\n Loader,\r\n },\r\n})\r\nexport default class SteppedForm extends Vue implements IRequestProgressDelegate {\r\n currentStep = 0\r\n\r\n validatingStep = false\r\n\r\n @Prop({ default: false })\r\n private readonly fullHeight!: boolean;\r\n\r\n @Prop({ default: () => ({ Items: [] }) })\r\n private readonly context!: Context;\r\n\r\n @Prop()\r\n private readonly type!: string;\r\n\r\n @Prop()\r\n private readonly submitButtonColour!: string;\r\n\r\n @Prop()\r\n private readonly submitButtonBackgroundColour!: string;\r\n\r\n @Prop()\r\n private readonly submitButtonClass!: string;\r\n\r\n @Prop()\r\n private readonly autosaveNamespace!: string;\r\n\r\n @Prop()\r\n private readonly enableAutosave!: boolean;\r\n\r\n @Prop({ default: 'var(--form-field-bg)' })\r\n private readonly fieldBg!: string;\r\n\r\n @Prop({ default: 'var(--form-field-colour)' })\r\n private readonly fieldColour!: string;\r\n\r\n @Prop({ default: 'var(--form-label-colour)' })\r\n private readonly labelColour!: string;\r\n\r\n @Prop({ default: 'var(--form-field-border-colour)' })\r\n private readonly borderColour!: string;\r\n\r\n @Prop({ default: 'var(--form-label-focused-bg)' })\r\n private readonly labelFocusedBg!: string;\r\n\r\n @Prop({ default: 'var(--form-label-focused-colour)' })\r\n private readonly labelFocusedColour!: string;\r\n\r\n private ctx: Context = this.context;\r\n\r\n private errored = false;\r\n\r\n private submitted = false;\r\n\r\n private errors: FormSubmissionValidationError[] = [];\r\n\r\n private loading = true;\r\n\r\n private definition: FormDefinition | null = null;\r\n\r\n private submitPercent = 0;\r\n\r\n private recaptchaService = ServiceManager.Require(ServiceType.ReCaptcha) as ReCaptchaService;\r\n\r\n onProgress(progress: number, total: number) {\r\n this.submitPercent = Math.round((progress / total) * 100);\r\n\r\n console.log(this.submitPercent);\r\n }\r\n\r\n mounted() {\r\n if (this.ctx === null) {\r\n this.ctx = {\r\n Items: [],\r\n ClientWebsiteId: Config.Website.Id,\r\n };\r\n }\r\n\r\n if (this.ctx.ClientWebsiteId === undefined) {\r\n this.ctx.ClientWebsiteId = Config.Website.Id;\r\n }\r\n\r\n API.Forms.GetForm(this.type, this.context).then((def) => {\r\n this.loading = false;\r\n this.definition = def;\r\n }).catch(() => {\r\n this.errored = true;\r\n });\r\n }\r\n\r\n private handleFieldInput(fieldDef: FormField): void {\r\n this.errors = this.errors.filter((err) => err.Key !== fieldDef.Key);\r\n }\r\n\r\n submitForm(): void {\r\n if (this.loading) return;\r\n\r\n this.loading = true;\r\n\r\n this.errors = [];\r\n\r\n this.collectData(true).then((data) => {\r\n const normalisedData = SteppedForm.normaliseData(data);\r\n\r\n this.loading = false;\r\n\r\n API.Forms.SubmitForm(this.type, this.context, normalisedData).then((result) => {\r\n this.loading = false;\r\n\r\n if (!result.Valid) {\r\n // Reset ReCaptcha\r\n this.resetRecaptcha();\r\n\r\n // Update errors\r\n this.errors = result.ValidationState.Errors;\r\n } else if (result.Submitted) {\r\n // Inform the user that the form was submitted\r\n this.submitted = true;\r\n\r\n this.$emit('submitted');\r\n }\r\n }).catch(() => {\r\n // Reset ReCaptcha\r\n this.resetRecaptcha();\r\n\r\n // Inform the user that there was an error\r\n this.errored = true;\r\n });\r\n });\r\n }\r\n\r\n private static normaliseData(data: FormValue[]): FormValue[] {\r\n const newValues: FormValue[] = [];\r\n\r\n data.forEach((entry) => {\r\n if (entry.Value instanceof Array) {\r\n if (entry.Value.length) {\r\n newValues.push({\r\n Key: `${entry.Key}_length`,\r\n Value: entry.Value.length,\r\n });\r\n\r\n for (let i = 0; i < entry.Value.length; i += 1) {\r\n newValues.push({\r\n Key: `${entry.Key}_${i}`,\r\n Value: entry.Value[i],\r\n });\r\n }\r\n }\r\n } else {\r\n newValues.push(entry);\r\n }\r\n });\r\n\r\n return newValues;\r\n }\r\n\r\n private collectData(includeRecaptcha: boolean): Promise {\r\n return new Promise((resolve, reject) => {\r\n const data: FormValue[] = [];\r\n\r\n // Loop through each form secction and collect the data from it\r\n this.definition!.Sections.forEach((section) => {\r\n try {\r\n const sectionComponent = (this.$refs[section.SectionId] as Vue[])[0] as Section;\r\n data.push(...sectionComponent.collectData());\r\n } catch (ex) { /* */ }\r\n });\r\n\r\n // If we also need to submit the ReCaptcha response, make sure we call getResponse on the ReCaptcha component\r\n if (includeRecaptcha) {\r\n this.getRecaptchaResponse().then((recaptchaResponse: string) => {\r\n Logger.Log(LogLevel.Debug, '[Form]', 'Got ReCaptcha response');\r\n\r\n data.push({\r\n Key: '_recaptcha',\r\n Value: recaptchaResponse,\r\n });\r\n\r\n resolve(data);\r\n }).catch(reject);\r\n\r\n return;\r\n }\r\n\r\n // If we don't need ReCaptcha, resolve straight away\r\n resolve(data);\r\n });\r\n }\r\n\r\n private resetRecaptcha(): void {\r\n this.recaptchaService.Reset();\r\n }\r\n\r\n private getRecaptchaResponse(): Promise {\r\n return this.recaptchaService.GetResponse();\r\n }\r\n\r\n goForward() {\r\n if (this.validatingStep) return;\r\n\r\n this.validatingStep = true;\r\n\r\n this.errors = [];\r\n\r\n this.collectData(false).then((data) => {\r\n const normalisedData = SteppedForm.normaliseData(data);\r\n\r\n API.Forms.ValidateSection(this.type, this.context, normalisedData, this.currentStep).then((result) => {\r\n this.loading = false;\r\n\r\n if (!result.Valid) {\r\n // Update errors\r\n this.errors = result.Errors;\r\n this.validatingStep = false;\r\n } else {\r\n // Move to next step\r\n this.validatingStep = false;\r\n this.currentStep += 1;\r\n }\r\n }).catch(() => {\r\n // Inform the user that there was an error\r\n this.validatingStep = false;\r\n this.errored = true;\r\n });\r\n });\r\n }\r\n\r\n goBack() {\r\n this.currentStep -= 1;\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SteppedForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SteppedForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./SteppedForm.vue?vue&type=template&id=6993258e&scoped=true&\"\nimport script from \"./SteppedForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./SteppedForm.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./SteppedForm.vue?vue&type=style&index=0&id=6993258e&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6993258e\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}