{"version":3,"sources":["webpack:///./assets/bundles/promotionalGiveaway/index.js","webpack:///./assets/entryPoints/PromoGiveawayEntryPoint.js","webpack:///./assets/components/PromotionalGiveaway/PromotionalGiveaway.js","webpack:///./assets/components/PromotionalGiveaway/PromotionalGiveawayRegistration.js","webpack:///./assets/components/PromotionalGiveaway/templates/_PromotionalGiveawayModal.hbs","webpack:///./assets/components/PromotionalGiveaway/PromotionalGiveawayTrivia.js","webpack:///./assets/components/PromotionalGiveaway/PromotionalGiveawayEngineeringQuiz.js","webpack:///./assets/components/PromotionalGiveaway/templates/_PromotionalGiveawayEngineeringQuestion.hbs","webpack:///./assets/components/PromotionalGiveaway/PromotionalGiveawayModal.js"],"names":["_uikit","__webpack_require__","_PromoGiveawayEntryPoint","uikit","registerEntryPoints","PromoGiveaway","PromotionalGiveawayEntryPoint","_PromotionalGiveaway","components","register","createPromotionalGiveaway","priority","ajaxable","EntryPoint","$parent","find","each","n","el","PromotionalGiveawayTrivia","_jquery2","PromotionalGiveawayEngineeringQuizView","assignImageSwap","PromotionalGiveawayRegistrationView","PromotionalGiveawayNotificationBar","$el","$promotionalGiveawayBannerEl","imageDesktop","data","imageMobile","applyImage","image","css","mediator","on","config","events","breakpoint","phablet","tablet","window","innerWidth","breakpoints","_backbone","_CartUserService","options","_classCallCheck3","this","click .PromotionalGiveaway-registration-submitButton","change select#PromotionalGiveaway-registration-countryInput","change select#PromotionalGiveaway-registration-dobMonthInput","change select#PromotionalGiveaway-registration-dobYearInput","_this2","_possibleConstructorReturn3","__proto__","_getPrototypeOf2","call","apiUrl","promoGiveaway","$form","configuration","$countriesDropdown","$statesDropdown","$dobDayDropdown","$dobMonthDropdown","$dobYearDropdown","initializeCountriesState","runValidationOnStartup","populateDobDayDropdown","getUserInfoPromise","getUserInfo","length","validate","value","val","parts","split","attr","selectedCountry","removeAttr","selected","hide","show","year","month","daysNumber","Date","getDate","daysInMonth","remove","i","append","userData","_this3","prepareRequestData","referralGuid","referralSource","Registration","Extended","FirstName","firstName","LastName","lastName","AgreeToRules","is","OptIn","Phone","Email","email","ReferringUserGuid","Source","Birthdate","Address","Address1","City","PostalCode","State","Country","JobFunction","JobLevel","Industry","Interests","Company","_promise2","resolve","referralInfo","cookies","get","promotionalGiveaway","referralGuidCookie","referralPublicGuid","referralParts","getGuid","then","guid","requestData","fail","singleCta","PromotionalGiveawayModal","open","_this4","rules","PromotionalGiveaway-registration-phoneInput","digits","submitHandler","$global","$body","addClass","classes","loadingClass","createUser","userService","_this5","_this","collectAndFormatFormData","requestDataSerialized","_stringify2","$","ajax","type","url","createUserPath","contentType","processData","done","userEmail","all","setUserPublicIdCookie","triggerConfirmationEmail","pushAnalyticsEvent","showModal","title","completionModal","message","cta1Link","cta","link","cta1Text","text","removeClass","publicIdentifier","getGuidPath","encodeURIComponent","global","getPublicUserIdPath","userPublicId","Id","set","userGuidCookie","expires","userGuidCookieExpiration","cacheCookieHelper","setCacheCookie","triggerConfirmationEmailPath","dataType","action","analytics","actions","promotionalGiveawayRegistration","gaActionPrefix","eventData","event","gtmFormSubmission","category","categories","label","labels","submit","pushToEventFramework","View","Handlebars","module","exports","template","1","container","depth0","helpers","partials","helper","alias1","nullContext","alias2","hooks","helperMissing","alias4","escapeExpression","lookupProperty","parent","propertyName","Object","prototype","hasOwnProperty","name","hash","loc","start","line","column","end","3","compiler","main","stack1","fn","program","inverse","useData","initialize","initialzeElements","previewFile","showAnswers","$videoTrivia","renderVideoTrivia","triviaUserResponseList","photoUploadResponse","onSubmitSuccess","$previewFile","videoTriviaEl","startingTime","now","videoTriviaData","$videoQuestions","$videoButtonNext","$videoButtonSubmit","$videoButtonSubmitTrivia","$videoQuestionInstructions","videoQuestionGUID","click","updateTriviaResponseList","nextClicked","videoList","VideoTriviaQuestionandAnswersGuidList","currentQuestionIndex","VideosAvailableInCurrentQuiz","preventDefault","firstVideoItem","shift","requestVideoData","res","html","initializeVideoElements","CtaText1","CtaText2","isActive","trigger","ui","ajaxContentLoaded","triviaUserAnswers","QuestionItemId","UserAnswerChoice","push","triviaLandingItemId","VideoTriviaLandingItemId","userPromoRegestrationGuid","isVideoTrivia","isEngineeringQuiz","triviaActionType","VideoTriviaActionType","completionTime","timeCompleted","postAnswers","videoTriviaUrl","method","finishTime","minutes","Math","floor","seconds","toFixed","triviaData","videoTriviaPostUrl","triviaResponse","onSubmitFailed","modal","ActionCompleteTitleText","ActionCompleteDescription","ReturntoCta1Url","ReturntoCta1Text","cta2Link","ReturnToCta2Url","cta2Text","ReturnToCta2Text","youtubePlayer","change","e","files","currentTarget","isAcceptableImageType","isAcceptableImageSize","reader","FileReader","imageName","onload","$imagePreview","$photoControls","target","result","readAsDataURL","alert","file","imageTypes","png","jpeg","gif","jpg","size","requestEngineeringQuizData","quizResponse","engineerQuizData","model","headerText","QuizBanner","headerDescription","QuizDescription","currentQuestion","QuizQuestionsJson","currentIndex","currentQuestionNumber","questionsLength","nextText","QuizNavigationNextCtaValue","previousText","QuizNavigationPreviousCtaValue","quizQuestionIndexText","QuizQuestionIndexText","quizQuestionUnAnsweredErrorMsg","QuizQuestionUnAnsweredErrorMsg","renderEngineeringQuiz","answer","submitEngineerQuiz","QuizNavigationSubmitCtaValue","prop","_PromotionalGiveawayEngineeringQuestion2","$engineerQuizPrevious","TriviaLandingItemId","TriviaActionType","formatEngineerQuiz","answerList","index","answerObject","questionItemId","QuestionCmsId","userAnswerChoice","getEngineeringQuizDataUrl","engineeringQuizResult","ActionPostFailTitleText","ActionPostFailMessage","change input[type=radio]","click .PromotionalGiveaway-EngineerQuiz-next","click .PromotionalGiveaway-EngineerQuiz-previous","Backbone","lambda","alias3","noop","ModalView","extend","PromotionalGiveawayModalTemplate"],"mappings":"oDAEA,MAAAA,EAAAC,EAAA,wCACAC,EAAAD,EAAA,MAEAA,EAAA,MAEAE,UAAMC,qBACJC,cAAe,IAAIC,yNCNrBL,EAAA,KAEAM,EAAAN,EAAA,2DAEaK,wOAETH,UAAMK,WAAWC,SAASC,6BAA6BC,UAAU,EAAOC,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G,KAAA2K,EAAA9K,EAAAnK,KAAAoK,GAA4Oa,KAAA,wBAAAC,QAAwC9M,OAAA+M,KAAoBC,OAASC,KAAA,GAAAC,OAAA,IAAsBC,KAAQF,KAAA,GAAAC,OAAA,OAAwBnB,GACvW,IACAM,SAAAN,EAAA,OAAAA,EAAAQ,EAAAV,EAAA,iCAAAD,EAAAW,EAAAX,EAAA,yBAAAA,IAAAG,EAAAG,KAAA2K,EAAA9K,EAAAnK,KAAAoK,GAA4Oa,KAAA,wBAAAC,QAAwC9M,OAAA+M,KAAoBC,OAASC,KAAA,GAAAC,OAAA,IAAsBC,KAAQF,KAAA,GAAAC,OAAA,QAAyBnB,GACxW,IACAM,SAAAN,EAAA,OAAAA,EAAAQ,EAAAV,EAAA,2BAAAD,EAAAW,EAAAX,EAAA,mBAAAA,IAAAG,EAAAG,KAAA2K,EAAA9K,EAAAnK,KAAAoK,GAAgOa,KAAA,kBAAAC,QAAkC9M,OAAA+M,KAAoBC,OAASC,KAAA,GAAAC,OAAA,KAAuBC,KAAQF,KAAA,GAAAC,OAAA,QAAyBnB,GACvV,yBACC4B,SAAA,4GC5CD,QAAAtP,EAAA,SACAA,EAAA,oEAEe0Y,UAAUC,QACvBvL,SAAUwL","file":"js/bundle.promotionalGiveaway.53dc6889e0a00ad8e34e.js","sourcesContent":["'use strict';\r\n\r\nimport uikit from '../../uikit';\r\nimport {PromotionalGiveawayEntryPoint} from '../../entryPoints/PromoGiveawayEntryPoint';\r\n\r\nimport './index.scss';\r\n\r\nuikit.registerEntryPoints({\r\n PromoGiveaway: new PromotionalGiveawayEntryPoint()\r\n});\r\n\n\n\n// WEBPACK FOOTER //\n// ./assets/bundles/promotionalGiveaway/index.js","'use strict';\r\n\r\nimport uikit from '../uikit';\r\n\r\nimport {createPromotionalGiveaway} from '../components/PromotionalGiveaway/PromotionalGiveaway';\r\n\r\nexport class PromotionalGiveawayEntryPoint extends uikit.EntryPoint {\r\n register() {\r\n uikit.components.register(createPromotionalGiveaway, { priority: false, ajaxable: true }); \r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./assets/entryPoints/PromoGiveawayEntryPoint.js","'use strict';\r\n\r\nimport $ from 'jquery';\r\nimport mediator from '../../js/mediator';\r\nimport config from '../../js/config';\r\nimport PromotionalGiveawayRegistrationView from './PromotionalGiveawayRegistration';\r\nimport PromotionalGiveawayTrivia from './PromotionalGiveawayTrivia';\r\nimport PromotionalGiveawayEngineeringQuizView from './PromotionalGiveawayEngineeringQuiz';\r\nimport PromotionalGiveawayNotificationBar from './PromotionalGiveawayNotificationBar';\r\n\r\nconst assignImageSwap = ($el) => {\r\n const $promotionalGiveawayBannerEl = $el.find('.PromotionalGiveaway-landing-banner-wrapper');\r\n const imageDesktop = $promotionalGiveawayBannerEl.data('image-desktop');\r\n const imageMobile = $promotionalGiveawayBannerEl.data('image-mobile');\r\n let applyImage = (image) => { $promotionalGiveawayBannerEl.css('background-image', 'url(' + image + ')') };\r\n /* Assigning event handlers */\r\n mediator.on(config.events.breakpoint.phablet, () => { applyImage(imageMobile) });\r\n mediator.on(config.events.breakpoint.tablet, () => { applyImage(imageDesktop) });\r\n /* Setting up default background image */\r\n if (window.innerWidth <= config.breakpoints.phablet) {\r\n applyImage(imageMobile);\r\n } else {\r\n applyImage(imageDesktop);\r\n }\r\n}\r\n\r\nexport function createPromotionalGiveaway($parent) {\r\n $parent.find('.PromotionalGiveawayTrivia').each((n, el) => {\r\n new PromotionalGiveawayTrivia($(el));\r\n });\r\n\r\n $parent.find('.PromotionalGiveaway-EngineerQuiz').each((n, el) => {\r\n new PromotionalGiveawayEngineeringQuizView({el});\r\n });\r\n\r\n $parent.find('.PromotionalGiveaway-landing-banner').each((n, el) => {\r\n assignImageSwap($(el));\r\n });\r\n\r\n $parent.find('.PromotionalGiveaway-registration').each((n, el) => new PromotionalGiveawayRegistrationView({ el }));\r\n\r\n $parent.find('.PromotionalGiveaway-notificationBar').each((n, el) => new PromotionalGiveawayNotificationBar({ el }));\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./assets/components/PromotionalGiveaway/PromotionalGiveaway.js","'use strict';\r\n\r\nimport { View } from 'backbone';\r\nimport $ from 'jquery';\r\nimport cookies from 'js-cookie';\r\nimport config from '../../js/config';\r\nimport { userService } from '../../services/CartUserService';\r\nimport analytics from '../Analytics/Analytics';\r\nimport PromotionalGiveawayModal from './PromotionalGiveawayModal';\r\nimport $global from '../../js/globalElements';\r\nimport cacheCookieHelper from '../../components/CacheCookieHelper/CacheCookieHelper';\r\n\r\nfunction daysInMonth(month, year) {\r\n return new Date(year, month, 0).getDate();\r\n}\r\n\r\nexport default class PromotionalGiveawayRegistrationView extends View {\r\n\r\n constructor(options) {\r\n options.events = {\r\n 'click .PromotionalGiveaway-registration-submitButton': 'submitData',\r\n 'change select#PromotionalGiveaway-registration-countryInput': 'updateStates',\r\n 'change select#PromotionalGiveaway-registration-dobMonthInput': 'updateDobDay',\r\n 'change select#PromotionalGiveaway-registration-dobYearInput': 'updateDobDay'\r\n };\r\n super(options);\r\n this.apiUrl = config.promoGiveaway.apiUrl;\r\n this.$form = this.$el.find('form');\r\n this.configuration = this.$el.data('registrationConfiguration');\r\n this.$countriesDropdown = this.$el.find('#PromotionalGiveaway-registration-countryInput');\r\n this.$statesDropdown = this.$el.find('#PromotionalGiveaway-registration-stateInput');\r\n this.$dobDayDropdown = this.$el.find('#PromotionalGiveaway-registration-dobDayInput');\r\n this.$dobMonthDropdown = this.$el.find('#PromotionalGiveaway-registration-dobMonthInput');\r\n this.$dobYearDropdown = this.$el.find('#PromotionalGiveaway-registration-dobYearInput');\r\n this.initializeCountriesState();\r\n this.runValidationOnStartup();\r\n this.populateDobDayDropdown(30);\r\n this.getUserInfoPromise = this.getUserInfo();\r\n }\r\n\r\n runValidationOnStartup() {\r\n if (this.$el.find('#PromotionalGiveaway-registration-shouldRunFEValidation').length > 0) {\r\n this.$form.validate();\r\n }\r\n }\r\n\r\n initializeCountriesState() {\r\n this.$statesDropdown.find('option').each(function() {\r\n let $el = $(this);\r\n let value = $el.val();\r\n if (value) {\r\n let parts = value.split(' ');\r\n $el.attr('data-country', parts[0]);\r\n $el.val(parts[1]);\r\n }\r\n });\r\n }\r\n\r\n updateStates() {\r\n let selectedCountry = $('#PromotionalGiveaway-registration-countryInput option:selected')[0].value;\r\n this.$statesDropdown.removeAttr('disabled');\r\n this.$statesDropdown.find('option')[0].selected = true;\r\n this.$statesDropdown.find('option[data-country]').hide();\r\n this.$statesDropdown.find(`option[data-country=${selectedCountry}]`).show();\r\n }\r\n\r\n updateDobDay() {\r\n let year = this.$dobYearDropdown.val();\r\n let month = this.$dobMonthDropdown.val();\r\n if (month && year) {\r\n let daysNumber = daysInMonth(month, year);\r\n this.populateDobDayDropdown(daysNumber);\r\n }\r\n }\r\n\r\n populateDobDayDropdown(daysNumber) {\r\n this.$dobDayDropdown.find('option[value]').remove();\r\n for (let i = 1; i <= daysNumber; i++) {\r\n this.$dobDayDropdown.append($(``));\r\n }\r\n }\r\n\r\n collectAndFormatFormData(userData) {\r\n let prepareRequestData = (userData, referralGuid, referralSource) => {\r\n let data = {Registration: {}, Extended: {}};\r\n\r\n data.Registration.FirstName = userData.firstName;\r\n data.Registration.LastName = userData.lastName;\r\n data.Registration.AgreeToRules = this.$el.find('#PromotionalGiveaway-registration-tosInput').is(':checked');\r\n data.Registration.OptIn = this.$el.find('#PromotionalGiveaway-registration-marketingBoxInput').is(':checked');\r\n data.Registration.Phone = this.$el.find('#PromotionalGiveaway-registration-phoneInput').val();\r\n data.Registration.Email = userData.email;\r\n data.Registration.ReferringUserGuid = referralGuid;\r\n data.Registration.Source = referralSource;\r\n data.Registration.Birthdate = this.$el.find('#PromotionalGiveaway-registration-dobYearInput').val()\r\n + '-' + this.$el.find('#PromotionalGiveaway-registration-dobMonthInput').val()\r\n + '-' + this.$el.find('#PromotionalGiveaway-registration-dobDayInput').val();\r\n data.Registration.Address = {\r\n Address1: this.$el.find('#PromotionalGiveaway-registration-addressInput').val(),\r\n City: this.$el.find('#PromotionalGiveaway-registration-cityInput').val(),\r\n PostalCode: this.$el.find('#PromotionalGiveaway-registration-zipcodeInput').val(),\r\n State: this.$el.find('#PromotionalGiveaway-registration-stateInput').val(),\r\n Country: this.$el.find('#PromotionalGiveaway-registration-countryInput').val()\r\n };\r\n data.Extended.JobFunction = this.$el.find('#PromotionalGiveaway-registration-jobFunctionInput').val();\r\n data.Extended.JobLevel = this.$el.find('#PromotionalGiveaway-registration-jobLevelInput').val();\r\n data.Extended.Industry = this.$el.find('#PromotionalGiveaway-registration-industryInput').val();\r\n data.Extended.Interests = this.$el.find('#PromotionalGiveaway-registration-interestsInput').val();\r\n data.Extended.Company = this.$el.find('#PromotionalGiveaway-registration-companyInput').val();\r\n\r\n return data;\r\n };\r\n\r\n return new Promise(resolve => {\r\n let referralInfo = cookies.get(config.cookies.promotionalGiveaway.referralGuidCookie);\r\n let referralPublicGuid = null;\r\n let referralSource = null;\r\n if (referralInfo) {\r\n let referralParts = referralInfo.split('|');\r\n referralPublicGuid = referralParts[0];\r\n referralSource = referralParts[1];\r\n }\r\n if (referralPublicGuid && referralPublicGuid.length > 0)\r\n {\r\n this.getGuid(referralPublicGuid)\r\n .then(guid => {\r\n let requestData = prepareRequestData(userData, guid, referralSource);\r\n resolve(requestData);\r\n })\r\n .fail(() => {\r\n let requestData = prepareRequestData(userData);\r\n resolve(requestData);\r\n })\r\n }\r\n else\r\n {\r\n let requestData = prepareRequestData(userData);\r\n resolve(requestData);\r\n }\r\n });\r\n }\r\n\r\n showModal(configuration) {\r\n configuration.singleCta = true;\r\n let modal = new PromotionalGiveawayModal();\r\n modal.open(configuration);\r\n }\r\n\r\n submitData() {\r\n this.$form.validate({\r\n rules: {\r\n 'PromotionalGiveaway-registration-phoneInput': {\r\n digits: true\r\n },\r\n 'Phone': {\r\n digits: true\r\n }\r\n },\r\n submitHandler: () => {\r\n this.getUserInfoPromise.then((userData) => {\r\n $global.$body.addClass(config.classes.loadingClass);\r\n this.createUser(userData);\r\n })\r\n }\r\n });\r\n }\r\n\r\n getUserInfo() {\r\n return userService\r\n .getUserInfo(true);\r\n }\r\n\r\n createUser(userData) {\r\n let _this = this;\r\n this.collectAndFormatFormData(userData).then(requestData => {\r\n let requestDataSerialized = JSON.stringify(requestData);\r\n $.ajax({\r\n type: 'POST',\r\n url: this.apiUrl + config.promoGiveaway.createUserPath,\r\n data: requestDataSerialized,\r\n contentType: 'application/json',\r\n processData: false\r\n })\r\n .done(data => {\r\n let userEmail = data.Email;\r\n Promise.all([\r\n _this.setUserPublicIdCookie(userEmail),\r\n _this.triggerConfirmationEmail(userEmail)\r\n ]).then(() => {\r\n this.pushAnalyticsEvent();\r\n _this.showModal({\r\n title: _this.configuration.completionModal.title,\r\n message: _this.configuration.completionModal.message,\r\n cta1Link: _this.configuration.completionModal.cta.link,\r\n cta1Text: _this.configuration.completionModal.cta.text\r\n });\r\n })\r\n })\r\n .fail(() => {\r\n $global.$body.removeClass(config.classes.loadingClass);\r\n })\r\n });\r\n }\r\n\r\n getGuid(publicIdentifier) {\r\n return $.ajax({\r\n type: 'GET',\r\n url: this.apiUrl + config.promoGiveaway.getGuidPath + encodeURIComponent(publicIdentifier),\r\n global: false\r\n })\r\n }\r\n\r\n setUserPublicIdCookie(userEmail) {\r\n return $.ajax({\r\n type: 'GET',\r\n url: this.apiUrl + config.promoGiveaway.getPublicUserIdPath + encodeURIComponent(userEmail)\r\n })\r\n .done(data => {\r\n let userPublicId = data.Id;\r\n cookies.set(\r\n config.cookies.promotionalGiveaway.userGuidCookie,\r\n userPublicId,\r\n { expires: config.cookies.promotionalGiveaway.userGuidCookieExpiration });\r\n\r\n if (cacheCookieHelper) {\r\n cacheCookieHelper.setCacheCookie();\r\n }\r\n })\r\n }\r\n\r\n triggerConfirmationEmail(userEmail) {\r\n return $.ajax({\r\n type: 'GET',\r\n url: this.apiUrl + config.promoGiveaway.triggerConfirmationEmailPath + encodeURIComponent(userEmail),\r\n dataType: 'text'\r\n })\r\n }\r\n\r\n pushAnalyticsEvent() {\r\n let action = config.analytics.actions.promotionalGiveawayRegistration;\r\n if (this.configuration.gaActionPrefix) {\r\n action = this.configuration.gaActionPrefix + action;\r\n }\r\n let eventData = {\r\n event: config.analytics.events.gtmFormSubmission,\r\n category: config.analytics.categories.promotionalGiveaway,\r\n action,\r\n label: config.analytics.labels.submit\r\n };\r\n analytics.pushToEventFramework(eventData);\r\n }\r\n\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./assets/components/PromotionalGiveaway/PromotionalGiveawayRegistration.js","var Handlebars = require(\"../../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \" \\r\\n\";\n},\"3\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"
\\r\\n \"\n + alias4(((helper = (helper = lookupProperty(helpers,\"cta1Text\") || (depth0 != null ? lookupProperty(depth0,\"cta1Text\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"cta1Text\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":15,\"column\":96},\"end\":{\"line\":15,\"column\":108}}}) : helper)))\n + \"\\r\\n
\\r\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"
\\r\\n

\\r\\n \"\n + container.escapeExpression(((helper = (helper = lookupProperty(helpers,\"title\") || (depth0 != null ? lookupProperty(depth0,\"title\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"title\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":4},\"end\":{\"line\":3,\"column\":13}}}) : helper)))\n + \"\\r\\n

\\r\\n\\r\\n
\\r\\n

\"\n + ((stack1 = ((helper = (helper = lookupProperty(helpers,\"message\") || (depth0 != null ? lookupProperty(depth0,\"message\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"message\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":7,\"column\":49},\"end\":{\"line\":7,\"column\":62}}}) : helper))) != null ? stack1 : \"\")\n + \"

\\r\\n\"\n + ((stack1 = lookupProperty(helpers,\"if\").call(alias1,(depth0 != null ? lookupProperty(depth0,\"cta2Link\") : depth0),{\"name\":\"if\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.program(3, data, 0),\"data\":data,\"loc\":{\"start\":{\"line\":8,\"column\":4},\"end\":{\"line\":17,\"column\":11}}})) != null ? stack1 : \"\")\n + \"
\\r\\n
\";\n},\"useData\":true});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/components/PromotionalGiveaway/templates/_PromotionalGiveawayModal.hbs\n// module id = 1489\n// module chunks = 7","'use strict';\r\n\r\nimport $ from 'jquery';\r\nimport mediator from '../../js/mediator';\r\nimport config from '../../js/config';\r\nimport PromotionalGiveawayModal from './PromotionalGiveawayModal';\r\nimport cookies from 'js-cookie';\r\n\r\nexport default class PromotionalGiveawayTrivia {\r\n constructor($el) {\r\n this.$el = $el;\r\n this.initialize();\r\n }\r\n initialize() {\r\n this.initialzeElements();\r\n this.previewFile();\r\n this.showAnswers();\r\n if (this.$videoTrivia.length) {\r\n this.renderVideoTrivia();\r\n this.triviaUserResponseList = [];\r\n }\r\n if (this.photoUploadResponse) {\r\n this.onSubmitSuccess();\r\n }\r\n }\r\n\r\n initialzeElements() {\r\n this.photoUploadResponse = this.$el.find('.PromotionalGiveaway-photoUpload').data('photoUploadResponse');\r\n this.$previewFile = this.$el.find('.PromotionalGiveaway-photoUpload-file-selector');\r\n this.$videoTrivia = this.$el.find('.PromotionalGiveaway-videoTrivia');\r\n this.videoTriviaEl = this.$el.find('.PromotionalGiveaway-videoTrivia .Content');\r\n this.startingTime = Date.now();\r\n this.videoTriviaData = this.videoTriviaEl.data('videoTriviaInfo');\r\n }\r\n\r\n initializeVideoElements() {\r\n this.$videoQuestions = this.$el.find('.PromotionalGiveaway-videoTrivia-form');\r\n this.$videoButtonNext = this.$el.find('.PromotionalGiveaway-videoTrivia-button--next');\r\n this.$videoButtonSubmit = this.$el.find('.PromotionalGiveaway-videoTrivia-button--submit');\r\n this.$videoButtonSubmitTrivia = this.$el.find('.PromotionalGiveaway-videoTrivia-button--submit');\r\n this.$videoQuestionInstructions = this.$el.find('.PromotionalGiveaway-videoTrivia-form--instructions');\r\n this.videoQuestionGUID = this.$el.find('.PromotionalGiveaway-question').data('triviaItemid');\r\n this.$videoButtonNext.click((event) => {this.renderVideoTrivia(event)});\r\n this.$videoButtonSubmit.click(() => {this.updateTriviaResponseList()});\r\n }\r\n\r\n renderVideoTrivia(nextClicked) {\r\n // retrieve GUID list\r\n this.videoList = this.videoTriviaData.VideoTriviaQuestionandAnswersGuidList;\r\n let videosAvailableInCurrentQuiz = this.videoTriviaData.VideosAvailableInCurrentQuiz;\r\n let currentQuestionIndex = videosAvailableInCurrentQuiz - this.videoList.length + 1;\r\n if (nextClicked) {\r\n nextClicked.preventDefault();\r\n this.updateTriviaResponseList();\r\n }\r\n\r\n if (this.videoList.length) {\r\n let firstVideoItem = this.videoList.shift();\r\n this.requestVideoData(firstVideoItem, currentQuestionIndex).done(res => {\r\n this.videoTriviaEl.html(res);\r\n this.initializeVideoElements();\r\n this.$videoButtonNext.text(this.videoTriviaEl.data('videoTriviaInfo').CtaText1);\r\n if (this.videoList.length === 0) {\r\n this.$videoButtonSubmitTrivia.attr('value', this.videoTriviaEl.data('videoTriviaInfo').CtaText2);\r\n this.$videoButtonSubmitTrivia.addClass(config.classes.isActive);\r\n this.$videoButtonNext.removeClass(config.classes.isActive);\r\n }\r\n mediator.trigger(config.events.ui.ajaxContentLoaded, this.$el);\r\n });\r\n }\r\n }\r\n\r\n updateTriviaResponseList() {\r\n let triviaUserAnswers = {};\r\n let videoTriviaData = {};\r\n triviaUserAnswers.QuestionItemId = this.videoQuestionGUID;\r\n triviaUserAnswers.UserAnswerChoice = $('.PromotionalGiveaway-videoTrivia-form input[type=radio]:checked').val();\r\n this.triviaUserResponseList.push(triviaUserAnswers);\r\n\r\n if (this.videoList.length === 0) {\r\n videoTriviaData = {\r\n triviaLandingItemId: this.videoTriviaEl.data('videoTriviaInfo').VideoTriviaLandingItemId,\r\n userPromoRegestrationGuid: cookies.get('PromotionalGiveawayGUID'),\r\n isVideoTrivia: true,\r\n isEngineeringQuiz: false,\r\n triviaActionType: this.videoTriviaEl.data('videoTriviaInfo').VideoTriviaActionType,\r\n triviaUserResponseList: this.triviaUserResponseList,\r\n completionTime: this.timeCompleted(Date.now())\r\n }\r\n this.postAnswers(JSON.stringify(videoTriviaData));\r\n }\r\n }\r\n\r\n requestVideoData(guid ,currentQuestionIndex) {\r\n let url = config.promoGiveaway.videoTriviaUrl + guid;\r\n url = `${url}¤tQuestionIndex=${currentQuestionIndex}`;\r\n return $.ajax({\r\n dataType: 'html',\r\n method: 'GET',\r\n url\r\n });\r\n }\r\n\r\n timeCompleted(finishTime) {\r\n let timeCompleted = finishTime - this.startingTime;\r\n let minutes = Math.floor(timeCompleted / 60000);\r\n let seconds = ((timeCompleted % 60000) / 1000).toFixed(0);\r\n return minutes + ':' + (seconds < 10 ? '0' : '') + seconds;\r\n }\r\n\r\n postAnswers(triviaData) {\r\n $.ajax(config.promoGiveaway.videoTriviaPostUrl, {\r\n contentType: 'application/json',\r\n method: 'POST',\r\n data: triviaData\r\n })\r\n .done(triviaResponse => {\r\n this.onSubmitSuccess(triviaResponse);\r\n })\r\n .fail(() => {this.onSubmitFailed(); });\r\n }\r\n\r\n onSubmitSuccess() {\r\n let modal = new PromotionalGiveawayModal();\r\n if (this.photoUploadResponse) {\r\n modal.open({\r\n title: this.photoUploadResponse.ActionCompleteTitleText,\r\n message: this.photoUploadResponse.ActionCompleteDescription,\r\n cta1Link: this.photoUploadResponse.ReturntoCta1Url,\r\n cta1Text: this.photoUploadResponse.ReturntoCta1Text,\r\n cta2Link: this.photoUploadResponse.ReturnToCta2Url,\r\n cta2Text: this.photoUploadResponse.ReturnToCta2Text\r\n });\r\n }\r\n else {\r\n modal.open({\r\n title: this.videoTriviaData.ActionCompleteTitleText,\r\n message: this.videoTriviaData.ActionCompleteDescription,\r\n cta1Link: this.videoTriviaData.ReturntoCta1Url,\r\n cta1Text: this.videoTriviaData.ReturntoCta1Text,\r\n cta2Link: this.videoTriviaData.ReturnToCta2Url,\r\n cta2Text: this.videoTriviaData.ReturnToCta2Text\r\n });\r\n }\r\n }\r\n\r\n onSubmitFailed() {\r\n let modal = new PromotionalGiveawayModal();\r\n modal.open({\r\n title: 'Duh oh',\r\n message: 'Network error, try again'\r\n });\r\n }\r\n\r\n showAnswers() {\r\n mediator.on(config.events.youtubePlayer.done, () => {\r\n this.$videoQuestions.addClass(config.classes.isActive);\r\n this.$videoQuestionInstructions.removeClass(config.classes.isActive);\r\n });\r\n }\r\n\r\n previewFile() {\r\n this.$previewFile.change((e) => {\r\n let files = e.currentTarget.files;\r\n if (files && files[0] && this.isAcceptableImageType(files[0]) && this.isAcceptableImageSize(files[0])) {\r\n let reader = new FileReader();\r\n let imageName = $('.PromotionalGiveaway-photoUpload-file-name');\r\n\r\n reader.onload = function(e) {\r\n let $imagePreview = $('.PromotionalGiveaway-photoUpload-preview-photo');\r\n let $photoControls = $('.PromotionalGiveaway-photoUpload-preview');\r\n $imagePreview.attr('src',e.target.result);\r\n $photoControls.addClass(config.classes.isActive);\r\n }\r\n\r\n reader.readAsDataURL(files[0]);\r\n imageName.attr('placeholder', files[0].name);\r\n }\r\n else {\r\n alert('Please select an acceptable image type or select a smaller image');\r\n }\r\n });\r\n }\r\n\r\n isAcceptableImageType(file) {\r\n let fileExtention = file.type.split('/')[1];\r\n switch (fileExtention) {\r\n case config.imageTypes.png:\r\n return true;\r\n case config.imageTypes.jpeg:\r\n return true;\r\n case config.imageTypes.gif:\r\n return true;\r\n case config.imageTypes.jpg:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n isAcceptableImageSize(file) {\r\n let fileSizeBytes = file.size;\r\n // If file is greater than 5MB\r\n return fileSizeBytes > 5000000 ? false : true;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./assets/components/PromotionalGiveaway/PromotionalGiveawayTrivia.js","'use strict';\r\n\r\nimport $ from 'jquery';\r\nimport Backbone from 'backbone';\r\nimport config from '../../js/config';\r\nimport PromotionalGiveawayModal from './PromotionalGiveawayModal';\r\nimport PromotionalGiveawayEngineeringQuestionTemplate from './templates/_PromotionalGiveawayEngineeringQuestion.hbs';\r\nimport cookies from 'js-cookie';\r\n\r\nexport default class PromotionalGiveawayEngineeringQuizView extends Backbone.View {\r\n constructor($el) {\r\n super($el);\r\n }\r\n get events() {\r\n return {\r\n 'change input[type=radio]': 'changedRadio',\r\n 'click .PromotionalGiveaway-EngineerQuiz-next': 'getNextQuestion',\r\n 'click .PromotionalGiveaway-EngineerQuiz-previous': 'getPreviousQuestion'\r\n }\r\n }\r\n initialize() {\r\n this.requestEngineeringQuizData(this.$el.find('.questions').data('engineeringQuizItem')).done(quizResponse => {\r\n this.engineerQuizData = quizResponse;\r\n this.startingTime = Date.now();\r\n this.model = {};\r\n if (this.engineerQuizData) {\r\n this.model.headerText = this.engineerQuizData.QuizBanner;\r\n this.model.headerDescription = this.engineerQuizData.QuizDescription;\r\n this.model.currentQuestion = this.engineerQuizData.QuizQuestionsJson[0];\r\n this.model.currentIndex = 0;\r\n this.model.currentQuestionNumber = this.model.currentIndex + 1;\r\n this.model.questionsLength = this.engineerQuizData.QuizQuestionsJson.length;\r\n this.model.nextText = this.engineerQuizData.QuizNavigationNextCtaValue;\r\n this.model.previousText = this.engineerQuizData.QuizNavigationPreviousCtaValue;\r\n this.model.quizQuestionIndexText = this.engineerQuizData.QuizQuestionIndexText;\r\n this.model.quizQuestionUnAnsweredErrorMsg = this.engineerQuizData.QuizQuestionUnAnsweredErrorMsg;\r\n this.renderEngineeringQuiz();\r\n }\r\n });\r\n }\r\n\r\n changedRadio(event) {\r\n this.$el.find('.validation').addClass('PromotionalGiveaway-EngineerQuiz-is-hidden');\r\n this.engineerQuizData.QuizQuestionsJson[this.model.currentIndex].answer = event.target.value;\r\n }\r\n\r\n getNextQuestion() {\r\n if (this.engineerQuizData.QuizQuestionsJson[this.model.currentIndex].answer) {\r\n this.model.currentIndex++;\r\n this.model.currentQuestionNumber++;\r\n if (this.model.currentIndex === this.engineerQuizData.QuizQuestionsJson.length) {\r\n this.submitEngineerQuiz();\r\n }\r\n else {\r\n if (this.model.currentIndex === this.engineerQuizData.QuizQuestionsJson.length - 1) {\r\n this.model.nextText = this.engineerQuizData.QuizNavigationSubmitCtaValue;\r\n }\r\n this.model.currentQuestion = this.engineerQuizData.QuizQuestionsJson[this.model.currentIndex];\r\n this.renderEngineeringQuiz();\r\n this.$el.find(':radio[value=' + this.engineerQuizData.QuizQuestionsJson[this.model.currentIndex].answer + ']').prop('checked', true);\r\n }\r\n }\r\n else {\r\n this.$el.find('.PromotionalGiveaway-EngineerQuiz-validation').removeClass('PromotionalGiveaway-EngineerQuiz-is-hidden');\r\n }\r\n }\r\n /**\r\n * This method will be triggered when user clicks on previous button\r\n */\r\n getPreviousQuestion() {\r\n this.model.currentIndex--;\r\n this.model.currentQuestionNumber--;\r\n this.model.currentQuestion = this.engineerQuizData.QuizQuestionsJson[this.model.currentIndex];\r\n if (this.model.currentIndex !== this.engineerQuizData.QuizQuestionsJson.length) {\r\n this.model.nextText = this.engineerQuizData.QuizNavigationNextCtaValue;\r\n }\r\n this.renderEngineeringQuiz();\r\n this.$el.find(':radio[value=' + this.engineerQuizData.QuizQuestionsJson[this.model.currentIndex].answer + ']').prop('checked', true);\r\n }\r\n\r\n renderEngineeringQuiz() {\r\n this.$el.find('.question').html(PromotionalGiveawayEngineeringQuestionTemplate(this.model));\r\n this.$engineerQuizPrevious = this.$el.find('.PromotionalGiveaway-EngineerQuiz-previous');\r\n if (this.model.currentIndex) {\r\n this.$engineerQuizPrevious.removeClass('PromotionalGiveaway-EngineerQuiz-is-hidden');\r\n }\r\n }\r\n\r\n submitEngineerQuiz() {\r\n let engineerQuizData = {\r\n triviaLandingItemId: this.engineerQuizData.TriviaLandingItemId,\r\n userPromoRegestrationGuid: cookies.get('PromotionalGiveawayGUID'),\r\n isVideoTrivia: false,\r\n isEngineeringQuiz: true,\r\n triviaActionType: this.engineerQuizData.TriviaActionType,\r\n triviaUserResponseList: this.formatEngineerQuiz(),\r\n completionTime: this.timeCompleted(Date.now())\r\n }\r\n this.postAnswers(JSON.stringify(engineerQuizData));\r\n\r\n }\r\n\r\n timeCompleted(finishTime) {\r\n let timeCompleted = finishTime - this.startingTime;\r\n let minutes = Math.floor(timeCompleted / 60000);\r\n let seconds = ((timeCompleted % 60000) / 1000).toFixed(0);\r\n return minutes + ':' + (seconds < 10 ? '0' : '') + seconds;\r\n }\r\n\r\n formatEngineerQuiz() {\r\n let answerList = [];\r\n for (var index = 0; index < this.engineerQuizData.QuizQuestionsJson.length; index++) {\r\n let answerObject = {};\r\n answerObject.questionItemId = this.engineerQuizData.QuizQuestionsJson[index].QuestionCmsId;\r\n answerObject.userAnswerChoice = this.engineerQuizData.QuizQuestionsJson[index].answer;\r\n answerList.push(answerObject);\r\n }\r\n return answerList;\r\n }\r\n\r\n postAnswers(triviaData) {\r\n $.ajax(config.promoGiveaway.videoTriviaPostUrl, {\r\n contentType: 'application/json',\r\n method: 'POST',\r\n data: triviaData\r\n })\r\n .done(triviaResponse => {\r\n this.onSubmitSuccess(triviaResponse);\r\n })\r\n .fail(() => { this.onSubmitFailed(); });\r\n }\r\n\r\n requestEngineeringQuizData(guid) {\r\n let url = config.promoGiveaway.getEngineeringQuizDataUrl + guid;\r\n return $.ajax({\r\n contentType: 'application/json',\r\n method: 'POST',\r\n url\r\n });\r\n }\r\n\r\n onSubmitSuccess(triviaResponse) {\r\n let modal = new PromotionalGiveawayModal();\r\n if (this.engineerQuizData) {\r\n modal.open({\r\n title: this.engineerQuizData.ActionCompleteTitleText,\r\n message: (triviaResponse && triviaResponse.engineeringQuizResult) ?\r\n triviaResponse.engineeringQuizResult : this.engineerQuizData.ActionCompleteDescription,\r\n cta1Link: this.engineerQuizData.ReturntoCta1Url,\r\n cta1Text: this.engineerQuizData.ReturntoCta1Text,\r\n cta2Link: this.engineerQuizData.ReturnToCta2Url,\r\n cta2Text: this.engineerQuizData.ReturnToCta2Text\r\n });\r\n }\r\n }\r\n onSubmitFailed() {\r\n let modal = new PromotionalGiveawayModal();\r\n modal.open({\r\n title: this.engineerQuizData.ActionPostFailTitleText,\r\n message: this.engineerQuizData.ActionPostFailMessage\r\n });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./assets/components/PromotionalGiveaway/PromotionalGiveawayEngineeringQuiz.js","var Handlebars = require(\"../../../../node_modules/handlebars/runtime.js\");\nfunction __default(obj) { return obj && (obj.__esModule ? obj[\"default\"] : obj); }\nmodule.exports = (Handlebars[\"default\"] || Handlebars).template({\"1\":function(container,depth0,helpers,partials,data) {\n var helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \" \\r\\n\";\n},\"compiler\":[8,\">= 4.3.0\"],\"main\":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=\"function\", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"
\\r\\n

\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"headerText\") || (depth0 != null ? lookupProperty(depth0,\"headerText\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"headerText\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":2,\"column\":57},\"end\":{\"line\":2,\"column\":71}}}) : helper)))\n + \"

\\r\\n

\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"headerDescription\") || (depth0 != null ? lookupProperty(depth0,\"headerDescription\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"headerDescription\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":3,\"column\":59},\"end\":{\"line\":3,\"column\":80}}}) : helper)))\n + \"

\\r\\n
\\r\\n
\\r\\n \\r\\n \"\n + alias4(((helper = (helper = lookupProperty(helpers,\"currentQuestionNumber\") || (depth0 != null ? lookupProperty(depth0,\"currentQuestionNumber\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"currentQuestionNumber\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":7,\"column\":73},\"end\":{\"line\":7,\"column\":98}}}) : helper)))\n + \" | \"\n + alias4(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,\"currentQuestion\") : depth0)) != null ? lookupProperty(stack1,\"Question\") : stack1), depth0))\n + \"\\r\\n
\\r\\n\"\n + ((stack1 = lookupProperty(helpers,\"each\").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,\"currentQuestion\") : depth0)) != null ? lookupProperty(stack1,\"ChoiceOptions\") : stack1),{\"name\":\"each\",\"hash\":{},\"fn\":container.program(1, data, 0),\"inverse\":container.noop,\"data\":data,\"loc\":{\"start\":{\"line\":9,\"column\":17},\"end\":{\"line\":11,\"column\":26}}})) != null ? stack1 : \"\")\n + \"
\\r\\n
\\r\\n
\\r\\n
\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"quizQuestionUnAnsweredErrorMsg\") || (depth0 != null ? lookupProperty(depth0,\"quizQuestionUnAnsweredErrorMsg\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"quizQuestionUnAnsweredErrorMsg\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":15,\"column\":108},\"end\":{\"line\":15,\"column\":142}}}) : helper)))\n + \"
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\"\n + alias4(((helper = (helper = lookupProperty(helpers,\"currentQuestionNumber\") || (depth0 != null ? lookupProperty(depth0,\"currentQuestionNumber\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"currentQuestionNumber\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":20,\"column\":69},\"end\":{\"line\":20,\"column\":94}}}) : helper)))\n + \" \"\n + alias4(((helper = (helper = lookupProperty(helpers,\"quizQuestionIndexText\") || (depth0 != null ? lookupProperty(depth0,\"quizQuestionIndexText\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"quizQuestionIndexText\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":20,\"column\":95},\"end\":{\"line\":20,\"column\":120}}}) : helper)))\n + \" \"\n + alias4(((helper = (helper = lookupProperty(helpers,\"questionsLength\") || (depth0 != null ? lookupProperty(depth0,\"questionsLength\") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{\"name\":\"questionsLength\",\"hash\":{},\"data\":data,\"loc\":{\"start\":{\"line\":20,\"column\":121},\"end\":{\"line\":20,\"column\":140}}}) : helper)))\n + \"
\\r\\n
\";\n},\"useData\":true});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/components/PromotionalGiveaway/templates/_PromotionalGiveawayEngineeringQuestion.hbs\n// module id = 1492\n// module chunks = 7","'use strict';\r\n\r\nimport ModalView from '../../js/components/ModalView';\r\nimport PromotionalGiveawayModalTemplate from './templates/_PromotionalGiveawayModal.hbs';\r\n\r\nexport default ModalView.extend({\r\n template: PromotionalGiveawayModalTemplate\r\n});\n\n\n// WEBPACK FOOTER //\n// ./assets/components/PromotionalGiveaway/PromotionalGiveawayModal.js"],"sourceRoot":""}