{"version":3,"sources":["webpack:///./node_modules/core-js/modules/es.string.includes.js","webpack:///./src/views/Campaign/Campaign.vue?4a17","webpack:///./node_modules/core-js/internals/not-a-regexp.js","webpack:///./src/views/Campaign/Campaign.vue?d1ea","webpack:///./src/composables/serviceFunctions.ts","webpack:///./src/views/Campaign/Campaign.vue?a279","webpack:///./src/views/Campaign/Campaign.vue?d8ec","webpack:///./src/views/Campaign/Campaign.vue?cf68","webpack:///./node_modules/core-js/internals/correct-is-regexp-logic.js","webpack:///./node_modules/core-js/modules/es.array.includes.js"],"names":["$","notARegExp","requireObjectCoercible","toString","correctIsRegExpLogic","target","proto","forced","includes","searchString","this","indexOf","arguments","length","undefined","isRegExp","module","exports","it","TypeError","render","_vm","_h","$createElement","_c","_self","staticClass","_v","currentStateIs","states","LOADING","_e","ERROR","COMPLETE","_s","currentYear","on","$event","preventDefault","sendTip","ref","attrs","inputFields","name","inputChange","email","colleagueName","colleagueEmail","directives","rawName","value","approveCampaign","expression","domProps","Array","isArray","_i","$$a","$$el","$$c","checked","$$v","$$i","$set","concat","slice","campaignTermsAndConditions","_l","error","key","emailPreviewHtml","staticRenderFns","ServiceFunctions","_classCallCheck","_createClass","relativeUrl","querystringItems","url","i","addQuerystringItem","fetch","method","headers","then","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_context","prev","next","abrupt","Promise","resolve","stop","_x","apply","catch","useServiceFunctions","serviceFunctions","Campaign","_mixins","_inherits","_super","_createSuper","_this$currentUser$emp","_this$currentUser$emp2","_this","formLoaded","campaignRequestSuccess","umbracoVariables","currentUser","employeeDetails","fullName","required","type","placeholder","customErrorMessage","errors","inline","emailAddress","options","getEmailPreviewDebounced","_","debounce","getEmailPreview","get","date","Date","now","getFullYear","$store","state","CampaignTermsAndConditionsUrl","valid","$refs","validate","_this2","Object","entries","forEach","_ref2","_slicedToArray","errorKey","errorValue","_ref3","_ref4","fieldKey","fieldValue","toLowerCase","values","_getEmailPreview","_user$registration","user","api","_this3","CampaignApi","campaignGetCampaignEmailPreview","registration","registrationId","_ref5","data","setState","_getUmbracoVariables","_callee2","_context2","getData","process","sent","ok","json","getUmbracoVariables","_sendTip","_callee3","_this$currentUser","_this$currentUser$reg","command","_this4","_context3","clearErrors","validateInput","campaignCreateCampaignTip","_mounted","_callee4","_context4","mounted","mixins","State","__decorate","Component","components","Content","Toolbar","FormInput","FormButton","component","wellKnownSymbol","MATCH","METHOD_NAME","regexp","error1","error2","$includes","addToUnscopables","el"],"mappings":"gHACA,IAAIA,EAAI,EAAQ,QACZC,EAAa,EAAQ,QACrBC,EAAyB,EAAQ,QACjCC,EAAW,EAAQ,QACnBC,EAAuB,EAAQ,QAInCJ,EAAE,CAAEK,OAAQ,SAAUC,OAAO,EAAMC,QAASH,EAAqB,aAAe,CAC9EI,SAAU,SAAkBC,GAC1B,SAAUN,EAASD,EAAuBQ,OACvCC,QAAQR,EAASF,EAAWQ,IAAgBG,UAAUC,OAAS,EAAID,UAAU,QAAKE,O,oCCZzF,W,gDCAA,IAAIC,EAAW,EAAQ,QAEvBC,EAAOC,QAAU,SAAUC,GACzB,GAAIH,EAASG,GACX,MAAMC,UAAU,iDAChB,OAAOD,I,yCCLX,IAAIE,EAAS,WAAa,IAAIC,EAAIX,KAASY,EAAGD,EAAIE,eAAmBC,EAAGH,EAAII,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,sBAAsB,CAACF,EAAG,UAAU,CAACA,EAAG,KAAK,GAAG,CAACH,EAAIM,GAAG,kBAAkBH,EAAG,UAAU,CAAEH,EAAIO,eAAeP,EAAIQ,OAAOC,SAAUN,EAAG,UAAUH,EAAIU,KAAMV,EAAIO,eAAeP,EAAIQ,OAAOG,OAAQR,EAAG,aAAa,CAAEH,EAAc,WAAE,CAACA,EAAIM,GAAG,+FAA+F,CAACN,EAAIM,GAAG,mGAAmG,GAAGN,EAAIU,KAAMV,EAA0B,uBAAEG,EAAG,eAAe,CAACH,EAAIM,GAAG,+CAAgD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AAkB,EAAQ,QAE1BC,EAAQD,EAAgB,SAE5BvL,EAAOC,QAAU,SAAUwL,GACzB,IAAIC,EAAS,IACb,IACE,MAAMD,GAAaC,GACnB,MAAOC,GACP,IAEE,OADAD,EAAOF,IAAS,EACT,MAAMC,GAAaC,GAC1B,MAAOE,KACT,OAAO,I,kCCZX,IAAI5M,EAAI,EAAQ,QACZ6M,EAAY,EAAQ,QAA+BrM,SACnDsM,EAAmB,EAAQ,QAI/B9M,EAAE,CAAEK,OAAQ,QAASC,OAAO,GAAQ,CAClCE,SAAU,SAAkBuM,GAC1B,OAAOF,EAAUnM,KAAMqM,EAAInM,UAAUC,OAAS,EAAID,UAAU,QAAKE,MAKrEgM,EAAiB","file":"js/chunk-027b3d83.564c20f8.js","sourcesContent":["'use strict';\nvar $ = require('../internals/export');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\n// `String.prototype.includes` method\n// https://tc39.es/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~toString(requireObjectCoercible(this))\n .indexOf(toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","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!./Campaign.vue?vue&type=style&index=0&id=087f4b98&prod&lang=css&\"","var isRegExp = require('../internals/is-regexp');\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"view view--toolbar\"},[_c('Toolbar',[_c('h2',{},[_vm._v(\"Startweken\")])]),_c('Content',[(_vm.currentStateIs(_vm.states.LOADING))?_c('Loader'):_vm._e(),(_vm.currentStateIs(_vm.states.ERROR))?_c('AlertError',[(_vm.formLoaded)?[_vm._v(\" Er ging iets mis bij het versturen van de tip! Probeer het over enkele minuten nog eens. \")]:[_vm._v(\" Er ging iets mis bij het laden van het formulier! Probeer het over enkele minuten nog eens. \")]],2):_vm._e(),(_vm.campaignRequestSuccess)?_c('AlertSuccess',[_vm._v(\" Bedankt voor het tippen van je collega! \")]):(_vm.currentStateIs(_vm.states.COMPLETE))?_c('div',[_c('h2',[_vm._v(\"Tip je collega en win!\")]),_c('p',{staticClass:\"paragraph\"},[_vm._v(\" Heb jij zelf al een bedrijfsfitnessabonnement? Een gezonde zaak! Je kan meedoen aan de Bedrijfsfitness Startweken \"+_vm._s(_vm.currentYear)+\" door jouw collega te tippen die nog niet deelneemt. Dankzij jouw tip wordt je collega eenmalig op de hoogte gebracht van de aantrekkelijke bedrijfsfitnessregeling van jouw werkgever en van de actie. Je verplicht je collega tot niets en maakt zelf kans op fantastische prijzen! \")]),_c('p',{staticClass:\"paragraph\"},[_vm._v(\" Zie jij jezelf al wegdromen in een mooie stad, of jouw resultaten tracken in de sportschool met de nieuwe Fitbit Charge? Kom dan in actie en tip je collega! \")]),_c('h2',[_vm._v(\"Oke, verstuur die tip!\")]),_c('p',[_vm._v(\"Hiermee maak ik kans op het winnen van een fantastische prijs.\")]),_c('form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.sendTip()}}},[_c('h3',[_vm._v(\"Mijn gegevens:\")]),_c('FormInput',{ref:\"name\",attrs:{\"inputField\":_vm.inputFields.name},on:{\"change\":_vm.inputChange}}),_c('FormInput',{ref:\"email\",attrs:{\"inputField\":_vm.inputFields.email}}),_c('h3',[_vm._v(\"Gegevens van mijn collega:\")]),_c('FormInput',{ref:\"colleagueName\",attrs:{\"inputField\":_vm.inputFields.colleagueName},on:{\"change\":_vm.inputChange}}),_c('FormInput',{ref:\"colleagueEmail\",attrs:{\"inputField\":_vm.inputFields.colleagueEmail}}),_c('div',{staticClass:\"input__wrapper terms\"},[_c('div',[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.inputFields.approveCampaign.value),expression:\"inputFields.approveCampaign.value\"}],attrs:{\"type\":\"checkbox\",\"name\":_vm.inputFields.approveCampaign.name},domProps:{\"value\":true,\"checked\":Array.isArray(_vm.inputFields.approveCampaign.value)?_vm._i(_vm.inputFields.approveCampaign.value,true)>-1:(_vm.inputFields.approveCampaign.value)},on:{\"change\":function($event){var $$a=_vm.inputFields.approveCampaign.value,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=true,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.$set(_vm.inputFields.approveCampaign, \"value\", $$a.concat([$$v])))}else{$$i>-1&&(_vm.$set(_vm.inputFields.approveCampaign, \"value\", $$a.slice(0,$$i).concat($$a.slice($$i+1))))}}else{_vm.$set(_vm.inputFields.approveCampaign, \"value\", $$c)}}}}),_vm._v(\" \"),_c('label',{domProps:{\"innerHTML\":_vm._s(_vm.campaignTermsAndConditions)}})]),(_vm.inputFields.approveCampaign.errors)?_c('div',{staticClass:\"input__errors\"},_vm._l((_vm.inputFields.approveCampaign.errors),function(error,key){return _c('div',{key:(\"error-\" + key)},[_vm._v(_vm._s(error))])}),0):_vm._e()]),_c('FormButton',{attrs:{\"caption\":'Versturen',\"loading\":_vm.currentStateIs(_vm.states.LOADING)}})],1),_c('div',[_c('h2',[_vm._v(\"Preview van de mail\")]),_c('div',{staticClass:\"preview\",domProps:{\"innerHTML\":_vm._s(_vm.emailPreviewHtml)}})])]):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export default class ServiceFunctions {\r\n getData (relativeUrl: string, querystringItems: Array<{ key: string; value: string }> | undefined = undefined) {\r\n let url = relativeUrl\r\n if (querystringItems && querystringItems.length) {\r\n for (let i = 0; i < querystringItems.length; i++) {\r\n url = this.addQuerystringItem(url, querystringItems[i].key, querystringItems[i].value)\r\n }\r\n }\r\n return fetch(url,\r\n {\r\n method: 'get',\r\n headers: { 'Content-Type': 'application/json' }\r\n })\r\n .then(async (result) => {\r\n return Promise.resolve(result)\r\n })\r\n .catch((error) => {\r\n return Promise.resolve(error)\r\n })\r\n }\r\n\r\n addQuerystringItem (url: string, key: string, value: string) {\r\n if (key && value) {\r\n if (!url.includes('?')) {\r\n url = `${url}?${key}=${value}`\r\n } else {\r\n url = `${url}&${key}=${value}`\r\n }\r\n }\r\n return url\r\n }\r\n}\r\n\r\nexport function useServiceFunctions () {\r\n const serviceFunctions = new ServiceFunctions()\r\n return serviceFunctions\r\n}\r\n","\r\nimport Component, { mixins } from 'vue-class-component'\r\nimport { State } from '@/mixins/state'\r\n\r\nimport Content from '@/components/Content.vue'\r\nimport Toolbar from '@/components/Layout/Toolbar.vue'\r\nimport FormInput, { InputField } from '@/components/Form/Input.vue'\r\nimport FormButton from '@/components/Form/Button.vue'\r\nimport { User } from '@/types'\r\nimport { CampaignApi, AddCampaignTipAndGenerateLotteryNumbersCommand } from '@/api'\r\nimport _ from 'lodash'\r\nimport { useServiceFunctions } from '@/composables/serviceFunctions'\r\nimport { UmbracoVariables } from '@/interfaces/umbracoVariables'\r\n\r\ninterface InputFields {\r\n name: InputField;\r\n email: InputField;\r\n colleagueName: InputField;\r\n colleagueEmail: InputField;\r\n approveCampaign: InputField;\r\n}\r\n\r\n@Component({\r\n components: {\r\n Content,\r\n Toolbar,\r\n FormInput,\r\n FormButton\r\n }\r\n})\r\n\r\nexport default class Campaign extends mixins(State) {\r\n get currentYear (): number {\r\n const date = new Date(Date.now())\r\n return date.getFullYear()\r\n }\r\n\r\n get currentUser (): User {\r\n return this.$store.state.currentUser\r\n }\r\n\r\n get campaignTermsAndConditions (): string {\r\n if (this.umbracoVariables) {\r\n return `Ik neem deel aan de \"Bedrijfsfitness Startweken\" campagne en ga akkoord met de actievoorwaarden.`\r\n }\r\n\r\n return 'Ik neem deel aan de \"Bedrijfsfitness Startweken\" campagne en ga akkoord met de actievoorwaarden'\r\n }\r\n\r\n emailPreviewHtml = ''\r\n formLoaded = false\r\n campaignRequestSuccess = false\r\n umbracoVariables: UmbracoVariables | undefined = undefined\r\n\r\n serviceFunctions = useServiceFunctions()\r\n\r\n inputFields: InputFields = {\r\n name: {\r\n name: 'name',\r\n value: this.currentUser.employeeDetails?.fullName || '',\r\n required: true,\r\n type: 'text',\r\n placeholder: 'Mijn naam',\r\n customErrorMessage: 'Oops, je bent je naam vergeten in te vullen',\r\n errors: [],\r\n inline: false\r\n },\r\n email: {\r\n name: 'email',\r\n value: this.currentUser.employeeDetails?.emailAddress || '',\r\n required: true,\r\n type: 'email',\r\n placeholder: 'Mijn e-mailadres',\r\n customErrorMessage: 'Oops, je bent je e-mailadres vergeten in te vullen',\r\n errors: [],\r\n inline: false\r\n },\r\n colleagueName: {\r\n name: 'colleagueName',\r\n value: '',\r\n required: true,\r\n type: 'text',\r\n placeholder: 'Naam collega',\r\n errors: [],\r\n inline: false\r\n },\r\n colleagueEmail: {\r\n name: 'colleagueEmail',\r\n value: '',\r\n required: true,\r\n type: 'text',\r\n placeholder: 'E-mailadres collega',\r\n errors: [],\r\n inline: false\r\n },\r\n approveCampaign: {\r\n name: 'approveCampaign',\r\n value: '',\r\n required: true,\r\n type: 'singleCheckbox',\r\n customErrorMessage: 'Oops, je bent nog niet akkoord gegaan met de campagne actievoorwaarden',\r\n placeholder: '',\r\n errors: [],\r\n options: [],\r\n inline: true\r\n }\r\n }\r\n\r\n private validateInput () {\r\n let valid = true\r\n\r\n valid = (this.$refs.name as FormInput).validate() && valid\r\n valid = (this.$refs.email as FormInput).validate() && valid\r\n valid = (this.$refs.colleagueName as FormInput).validate() && valid\r\n valid = (this.$refs.colleagueEmail as FormInput).validate() && valid\r\n // approveCampaign is no FormInput, so it is present in this.$refs.\r\n // Quick fix by just checking the input itself.\r\n // valid = (this.$refs.approveCampaign as FormInput).validate() && valid\r\n valid = (this.inputFields.approveCampaign.value + '') === 'true' && valid\r\n\r\n return valid\r\n }\r\n\r\n public setErrors (errors: []) {\r\n Object.entries(errors).forEach(([errorKey, errorValue]) => {\r\n Object.entries(this.inputFields).forEach(([fieldKey, fieldValue]) => {\r\n if (errorKey.toLowerCase() === fieldKey.toLowerCase()) {\r\n fieldValue.errors = errorValue\r\n }\r\n })\r\n })\r\n }\r\n\r\n public clearErrors () {\r\n Object.values(this.inputFields).forEach((fieldValue: InputField) => {\r\n fieldValue.errors = []\r\n })\r\n }\r\n\r\n public inputChange () {\r\n this.getEmailPreviewDebounced()\r\n }\r\n\r\n public async getEmailPreview () {\r\n const user = this.currentUser\r\n\r\n const api = new CampaignApi()\r\n await api.campaignGetCampaignEmailPreview(user?.registration?.registrationId, this.inputFields.name.value, this.inputFields.colleagueName.value)\r\n .then(({ data }) => {\r\n this.emailPreviewHtml = data\r\n this.setState(this.states.COMPLETE)\r\n })\r\n .catch(() => {\r\n this.setState(this.states.ERROR)\r\n })\r\n }\r\n\r\n public getEmailPreviewDebounced = _.debounce(() => this.getEmailPreview(), 750)\r\n\r\n public async getUmbracoVariables () {\r\n const result = await this.serviceFunctions.getData(`${process.env.VUE_APP_UMBRACO_REGISTRATION_API}registration/getumbracovariables`)\r\n if (result.ok) {\r\n this.umbracoVariables = (await result.json()) as UmbracoVariables\r\n }\r\n }\r\n\r\n public async sendTip () {\r\n this.clearErrors()\r\n if (!this.validateInput()) {\r\n return\r\n }\r\n const command = {\r\n registrationId: this.currentUser?.registration?.registrationId,\r\n name: this.inputFields.name.value,\r\n email: this.inputFields.email.value,\r\n colleagueName: this.inputFields.colleagueName.value,\r\n colleagueEmail: this.inputFields.colleagueEmail.value,\r\n approveCampaign: this.inputFields.approveCampaign.value || false\r\n } as AddCampaignTipAndGenerateLotteryNumbersCommand\r\n\r\n const api = new CampaignApi()\r\n await api.campaignCreateCampaignTip(command)\r\n .then(() => {\r\n this.campaignRequestSuccess = true\r\n }).catch(() => {\r\n this.setState(this.states.ERROR)\r\n })\r\n }\r\n\r\n async mounted () {\r\n this.setState(this.states.LOADING)\r\n\r\n await this.getUmbracoVariables()\r\n await this.getEmailPreview()\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!./Campaign.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!./Campaign.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Campaign.vue?vue&type=template&id=087f4b98&\"\nimport script from \"./Campaign.vue?vue&type=script&lang=ts&\"\nexport * from \"./Campaign.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Campaign.vue?vue&type=style&index=0&id=087f4b98&prod&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","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n"],"sourceRoot":""}