{"version":3,"file":"EurojackpotGame.js","names":["defineDs","m","Model","EurojackpotApi","EurojackpotInfo","EurojackpotUtils","DataLayer","EurojackpotGame","content","_this","infoFeed","api","_generatedRows","prop","_generatedJokerRowsSaturday","_generatedJokerRowsWednesday","couponId","isAddToCartTracked","isProductDetailsTracked","isPurchaseCompleteTracked","numberOfDraws","getDrawRepeatDefault","playType","plusSubscriptionJackpot","firstDepositInfo","purchaseTracked","ready","deferred","rebuyCouponId","rows","rowsToGenerate","startUrl","window","location","href","split","status","systemName","withJokerSaturday","withJokerWednesday","playTogetherDepositType","verticalType","getDrawRepeatMax","rowPriceChanged","originalNumberOfDraws","originalPrice","reducedWeeks","clientContext","trackedInteractionCreationAction","gameVersionNo","getOpenDraw","manualGameVersionNo","originalGameVersionNo","drawDays","classicMaxRows","numberOfDrawsOptions","getDrawRepeatOptions","numbersIntervalMax","stakePerJoker","getJokerPrice","starNumbersIntervalMax","starNumbersPerRowMax","numbersPerRowMin","numbersPerRow","bind","numbersPerRowMax","type","getSystemNumberAmount","starNumbersPerRowMin","totalNumbersPerRowMax","rowCount","count","amount","length","i","row","sortRow","numbers","sort","a","b","number","addNumber","autogenerated","getRow","push","save","removeNumber","index","splice","addStarNumber","starNumber","starNumbers","removeStarNumber","addRow","state","removeRow","removeAllRows","resetRow","rowNumber","setRow","autogenerateNumbers","self","j","options","requiredNumbers","requiredStarNumbers","system","getRandomNumbers","then","manualSelectedNumbers","filter","manualSelectedStarNumbers","generated","generatedNumbers","generatedStarNumbers","indexOf","resolve","reject","promise","areAllRowsValid","every","isRowValid","autofillClassicRows","_asyncToGenerator","promises","emptyRows","fullyGeneratedRows","emptyRow","Promise","all","gameGenerateRows","console","error","selectedNumbers","generatedRows","getSystemKeys","systemKeys","map","join","gameGenerateJokerRows","getRandomJokerNumbers","generatedJokerRows","value","setNumberOfDraws","draws","purchase","params","proceed","drawId","errorMessage","getRowsSummary","totalPrice","parseInt","multidraw","salesChannel","isMobile","isTabletDevice","notifyPrizeEmail","notifyPrizeSms","jokerSaturdayRows","getJokerRowsSummary","jokerWednesdayRows","request","createCoupon","data","prepareConfirm","confirmUrl","sync","createDataLayerJoker","day","subscription","joker","numberOfJokers","jokerDrawDates","draw","dayName","name","price","rowPrice","brand","category","categoryName","variant","variantName","quantity","coupon","createDataLayerProduct","event","dataLayerProducts","product","rowAmount","getRowAmount","firstDrawName","openDraw","closingTime","parseISO8601","variantBrandName","trackingAddToCart","addToCart","warn","trackingProductDetails","productDetail","trackingPurchaseComplete","purchaseCompleted","toString","id","fallbackFakeCouponId","Math","random","slice","checkOnlyMaxLimit","arguments","undefined","totalNumbers","getRows","valid","hasNumber","hasStarNumber","drawDateHtml","delimiter","date","Date","result","formatISO8601","toISOString","includeTime","setDate","getDate","drawDateHtmlShort","dates","drawDates","firstDate","lastDate","getMonth","getFullYear","drawsFromEurojackpotInfo","firstDraw","firstDrawIndex","feedDrawDates","hasJoker","jokerDraws","jokerData","jokerWednesday","firstWednesdayJoker","jokerSaturday","firstSaturdayJoker","getTime","rawDrawsDataFromInfoFeed","drawTimes","feedDraw","drawDatesWithoutJokerInfo","drawObject","campaigns","campaignNumbers","drawDay","saturdayDraws","wednesdayDraws","combinedDraws","concat","localeCompare","nextValidJokerDraws","campaignDrawsCount","wantedCampaign","reduce","_draw$campaigns","Array","isArray","_draw$campaignNumbers","some","campaignNumber","includes","_draw$campaignNumbers2","c","checkGeneratedConsistency","useGenerated","summary","getSystemRowAmount","rowIndex","totalRowsPricePerDraw","drawIndex","singleDrawPerWeekTotal","totalJokerPrice","getJokerCount","jokerPrice","verticalTypesWithTwoDrawsPerWeek","isGameValid","hasValidRows","isSubscriptionValid","trackPurchase","DSAPI","multiClientPath","receiptUrl","cancelUrl","copyFromOldCoupon","getCoupon","multiWagers","rebuyDrawRepeatMax","toLowerCase","games","forEach","game","rowNumbers","gameType","extraNumbers","systemNumbers","test","charAt","toUpperCase","sendToSubscription","_this$linkToPlusPurch","link","linkToPlusPurchase","call","linkArr","shift","toJSON","init","getLuckyDefaultRowCount","setupGame","gameInstanceId","get","construct"],"sources":["DanskeSpil/Domain/Eurojackpot/Scripts/Models/EurojackpotGame.js"],"sourcesContent":["defineDs('DanskeSpil/Domain/Eurojackpot/Scripts/Models/EurojackpotGame',\r\n [\r\n 'Shared/Framework/Mithril/Scripts/Core/Mithril',\r\n 'Shared/Framework/Mithril/Scripts/Core/Model',\r\n 'DanskeSpil/Domain/Eurojackpot/Scripts/Helpers/EurojackpotApi',\r\n 'DanskeSpil/Domain/Eurojackpot/Scripts/Helpers/EurojackpotInfo',\r\n 'DanskeSpil/Domain/Eurojackpot/Scripts/Helpers/EurojackpotUtils',\r\n 'DanskeSpil/Framework/NumberGames/Scripts/Helpers/DataLayer'\r\n ],\r\n function (m, Model, EurojackpotApi, EurojackpotInfo, EurojackpotUtils, DataLayer) {\r\n\r\n // Model:\r\n var EurojackpotGame = Model('EurojackpotGame', function (content) {\r\n this.infoFeed = () => {\r\n return EurojackpotInfo;\r\n };\r\n this.api = () => {\r\n return EurojackpotApi;\r\n };\r\n\r\n // Data:\r\n this._generatedRows = m.prop(content._generatedRows || []);\r\n this._generatedJokerRowsSaturday = m.prop(content._generatedJokerRowsSaturday || []);\r\n this._generatedJokerRowsWednesday = m.prop(content._generatedJokerRowsWednesday || []);\r\n this.couponId = m.prop(content.couponId || null);\r\n this.isAddToCartTracked = m.prop(content.isAddToCartTracked || false);\r\n this.isProductDetailsTracked = m.prop(content.isProductDetailsTracked || false);\r\n this.isPurchaseCompleteTracked = m.prop(content.isPurchaseCompleteTracked || false);\r\n this.numberOfDraws = m.prop(typeof content.numberOfDraws !== 'undefined' ? content.numberOfDraws : EurojackpotInfo.getDrawRepeatDefault()); // NEED TO USE TYPEOF UNDEFINED CHECK HERE, BECAUSE 0 IS A VALID OPTION\r\n this.playType = m.prop(content.playType || null);\r\n this.plusSubscriptionJackpot = m.prop(content.plusSubscriptionJackpot || null);\r\n this.firstDepositInfo = m.prop(content.firstDepositInfo || null);\r\n this.purchaseTracked = m.prop(content.purchaseTracked || false);\r\n this.ready = m.prop(m.deferred());\r\n this.rebuyCouponId = m.prop(content.rebuyCouponId || null);\r\n this.rows = m.prop(content.rows || []);\r\n this.rowsToGenerate = m.prop(content.rowsToGenerate || 0);\r\n this.startUrl = m.prop(content.startUrl || window.location.href.split('?')[0]);\r\n this.status = m.prop(content.status || 'open');\r\n this.systemName = m.prop(content.systemName || (this.playType() === 'System' ? 'M 6-6' : null));\r\n // we want to check the typeof `withJoker...` as it would be set to `false` when the user selects `no joker`\r\n // if the game instance is new or the user has not interacted with the joker selector than we want to set it to `null`\r\n this.withJokerSaturday = m.prop(typeof content.withJokerSaturday === 'boolean' ? content.withJokerSaturday : null);\r\n this.withJokerWednesday = m.prop(typeof content.withJokerWednesday === 'boolean' ? content.withJokerWednesday : null);\r\n this.playTogetherDepositType = m.prop(content.playTogetherDepositType || null);\r\n this.verticalType = m.prop(content.verticalType);\r\n this.getDrawRepeatMax = m.prop(EurojackpotInfo.getDrawRepeatMax());\r\n this.rowPriceChanged = m.prop(false);\r\n this.originalNumberOfDraws = m.prop(null);\r\n this.originalPrice = m.prop(null);\r\n this.reducedWeeks = m.prop(false);\r\n this.clientContext = m.prop(content.clientContext || null);\r\n this.trackedInteractionCreationAction = m.prop(content.trackedInteractionCreationAction || null);\r\n\r\n this.gameVersionNo = m.prop(EurojackpotInfo.getOpenDraw() ? EurojackpotInfo.getOpenDraw().gameVersionNo : 1 || 1);\r\n if (content.gameVersionNo) this.gameVersionNo(content.gameVersionNo);\r\n if (content.manualGameVersionNo) this.gameVersionNo(content.manualGameVersionNo);\r\n this.originalGameVersionNo = m.prop(this.gameVersionNo());\r\n\r\n // Set draw days for Eurojackpot, Tuesday and Friday for newer games, Friday only for older games.\r\n this.drawDays = m.prop(this.gameVersionNo() === 2\r\n ? [false, true, false, false, true, false, false]\r\n : [false, false, false, false, true, false, false]);\r\n\r\n // Constants:\r\n this.classicMaxRows = m.prop(50);\r\n this.numberOfDrawsOptions = m.prop(EurojackpotInfo.getDrawRepeatOptions());\r\n this.numbersIntervalMax = m.prop(50);\r\n this.stakePerJoker = m.prop(EurojackpotInfo.getJokerPrice());\r\n\r\n this.starNumbersIntervalMax = m.prop(this.gameVersionNo() === 2 ? 12 : 10);\r\n this.starNumbersPerRowMax = m.prop(2);\r\n\r\n // Functions:\r\n this.numbersPerRowMin = function () {\r\n return this.numbersPerRow('min');\r\n }.bind(this);\r\n\r\n this.numbersPerRowMax = function () {\r\n return this.numbersPerRow('max');\r\n }.bind(this);\r\n\r\n this.numbersPerRow = function (type) {\r\n var playType = this.playType();\r\n\r\n // System:\r\n if (playType === 'System') {\r\n return this.getSystemNumberAmount();\r\n }\r\n\r\n // Lucky:\r\n if (playType === 'Lucky') {\r\n return type === 'min' ? 0 : 5;\r\n }\r\n\r\n // Classic:\r\n return 5;\r\n }.bind(this);\r\n\r\n this.starNumbersPerRowMin = function () {\r\n return this.playType() === 'Lucky' ? 0 : 2;\r\n }.bind(this);\r\n\r\n this.totalNumbersPerRowMax = function () {\r\n if (this.playType() === 'Lucky') {\r\n return 6;\r\n }\r\n\r\n return this.numbersPerRowMax() + this.starNumbersPerRowMax();\r\n }.bind(this);\r\n\r\n // Functions - For manipulating rows:\r\n this.rowCount = function () {\r\n var count = 0;\r\n var rows = this.rows();\r\n var amount = rows.length;\r\n\r\n for (var i = 0; i < amount; i++) {\r\n var row = rows[i];\r\n\r\n if (row.count > count) {\r\n count = row.count + 1;\r\n } else {\r\n count++;\r\n }\r\n }\r\n\r\n return count;\r\n }.bind(this);\r\n\r\n this.sortRow = function (numbers) {\r\n numbers.sort(function (a, b) {\r\n return a.number < b.number ? -1 : 1;\r\n });\r\n\r\n return numbers;\r\n };\r\n\r\n this.addNumber = function (row, number, autogenerated) {\r\n row = this.getRow(row);\r\n\r\n if (row.numbers.length >= this.numbersPerRowMax()) {\r\n return;\r\n }\r\n\r\n row.numbers.push({ number: number, autogenerated: autogenerated || false });\r\n row.numbers = this.sortRow(row.numbers);\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.removeNumber = function (row, number) {\r\n row = this.getRow(row);\r\n\r\n var index = -1;\r\n var numbers = row.numbers;\r\n\r\n for (var i = 0; i < numbers.length; i++) {\r\n if (numbers[i].number === number) {\r\n index = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (index > -1) {\r\n row.numbers.splice(index, 1);\r\n }\r\n\r\n row.numbers = this.sortRow(row.numbers);\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.addStarNumber = function (row, starNumber, autogenerated) {\r\n row = this.getRow(row);\r\n\r\n if (row.starNumbers.length >= this.starNumbersPerRowMax()) {\r\n return;\r\n }\r\n\r\n row.starNumbers.push({ number: starNumber, autogenerated: autogenerated || false });\r\n row.starNumbers = this.sortRow(row.starNumbers);\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.removeStarNumber = function (row, starNumber) {\r\n row = this.getRow(row);\r\n\r\n var index = -1;\r\n var starNumbers = row.starNumbers;\r\n\r\n for (var i = 0; i < starNumbers.length; i++) {\r\n if (starNumbers[i].number === starNumber) {\r\n index = i;\r\n\r\n break;\r\n }\r\n }\r\n\r\n if (index > -1) {\r\n row.starNumbers.splice(index, 1);\r\n }\r\n\r\n row.starNumbers = this.sortRow(row.starNumbers);\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.addRow = function (numbers) {\r\n numbers = numbers || [];\r\n\r\n var count = this.rowCount();\r\n\r\n this.rows().push({ count: count, numbers: numbers, state: 'clean', starNumbers: [] });\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.removeRow = function (row) {\r\n var rows = this.rows();\r\n\r\n rows.splice(row - 1, 1);\r\n\r\n this.rows(rows);\r\n\r\n if (rows.length === 0) {\r\n this.addRow();\r\n }\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.removeAllRows = function () {\r\n this.rows([]);\r\n\r\n // We need double rows, as we're practically resetting the rows to original state\r\n this.addRow();\r\n this.addRow();\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.resetRow = function (rowNumber) {\r\n var row = this.getRow(rowNumber);\r\n\r\n row.numbers = [];\r\n row.starNumbers = [];\r\n row.state = 'clean';\r\n\r\n this.setRow(rowNumber, row);\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n this.setRow = function (row, content) {\r\n var rows = this.rows();\r\n\r\n rows[row - 1] = content;\r\n\r\n this.rows(rows);\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n // Eurojackpot Classic and Eurojackpot System: generate numbers for a specific row:\r\n this.autogenerateNumbers = function (rowNumber) {\r\n var self = this;\r\n var deferred = m.deferred();\r\n var numbers = [];\r\n var row = this.getRow(rowNumber);\r\n var starNumbers = [];\r\n\r\n // Prepare list of existing user selected numbers:\r\n for (var i = 0; i < row.numbers.length; i++) {\r\n var number = row.numbers[i];\r\n\r\n if (!number.autogenerated) {\r\n numbers.push(number.number);\r\n }\r\n }\r\n\r\n for (var j = 0; j < row.starNumbers.length; j++) {\r\n var starNumber = row.starNumbers[j];\r\n\r\n if (!starNumber.autogenerated) {\r\n starNumbers.push(starNumber.number);\r\n }\r\n }\r\n\r\n // Setup options for random service:\r\n var options = {\r\n playType: this.playType(),\r\n requiredNumbers: numbers,\r\n requiredStarNumbers: starNumbers,\r\n gameVersionNo: this.gameVersionNo()\r\n };\r\n\r\n if (this.playType() === 'System') {\r\n options.system = this.systemName();\r\n }\r\n\r\n EurojackpotApi.getRandomNumbers(options).then(function (rows) {\r\n rows = rows[0];\r\n\r\n const manualSelectedNumbers = row.numbers.filter((number) => !number.autogenerated);\r\n const manualSelectedStarNumbers = row.starNumbers.filter((number) => !number.autogenerated);\r\n row.numbers = manualSelectedNumbers;\r\n row.starNumbers = manualSelectedStarNumbers;\r\n self.setRow(rowNumber, row);\r\n\r\n var generated = null;\r\n var generatedNumbers = rows.numbers;\r\n var generatedStarNumbers = rows.starNumbers;\r\n\r\n for (var i = 0; i < generatedNumbers.length; i++) {\r\n generated = generatedNumbers[i];\r\n\r\n if (numbers.indexOf(generated) === -1) {\r\n self.addNumber(rowNumber, generated, true);\r\n }\r\n }\r\n\r\n for (var j = 0; j < generatedStarNumbers.length; j++) {\r\n generated = generatedStarNumbers[j];\r\n\r\n if (starNumbers.indexOf(generated) === -1) {\r\n self.addStarNumber(rowNumber, generated, true);\r\n }\r\n }\r\n\r\n deferred.resolve();\r\n }, function () {\r\n deferred.reject();\r\n });\r\n\r\n return deferred.promise;\r\n }.bind(this);\r\n\r\n this.areAllRowsValid = () => {\r\n return this.rows().every((row) => this.isRowValid(row.count + 1));\r\n };\r\n\r\n this.autofillClassicRows = async () => {\r\n const promises = [];\r\n const emptyRows = [];\r\n for (let i = 0; i < this.rows().length; i++) {\r\n const row = this.rows()[i];\r\n const rowNumber = row.count + 1;\r\n if (!this.isRowValid(rowNumber)) {\r\n if (row.numbers.length > 0 || row.starNumbers.length > 0) {\r\n promises.push(this.autogenerateNumbers(rowNumber));\r\n } else {\r\n emptyRows.push(row);\r\n }\r\n }\r\n }\r\n if (emptyRows.length > 0) {\r\n const fullyGeneratedRows = this.api().getRandomNumbers({ rowsToGenerate: emptyRows.length }).then((rows) => {\r\n for (let i = 0; i < rows.length; i++) {\r\n const row = rows[i];\r\n const emptyRow = emptyRows[i];\r\n for (let j = 0; j < row.numbers.length; j++) {\r\n this.addNumber(emptyRow.count + 1, row.numbers[j], true);\r\n }\r\n for (let j = 0; j < row.starNumbers.length; j++) {\r\n this.addStarNumber(emptyRow.count + 1, row.starNumbers[j], true);\r\n }\r\n }\r\n });\r\n promises.push(fullyGeneratedRows);\r\n }\r\n await Promise.all(promises);\r\n\r\n this.save();\r\n };\r\n\r\n // Eurojackpot Lightning, Eurojackpot Lucky and Eurojackpot System: generate output rows:\r\n this.gameGenerateRows = function () {\r\n var self = this;\r\n var deferred = m.deferred();\r\n\r\n if (['Lightning', 'Lucky', 'System'].indexOf(this.playType()) === -1) {\r\n console.error('EurojackpotGame gameGenerateRows: This method cannot be used for playType', this.playType());\r\n\r\n deferred.reject();\r\n\r\n return;\r\n }\r\n\r\n if (this.playType() === 'System') {\r\n var selectedNumbers = this.getRow(1).numbers;\r\n var starNumbers = this.getRow(1).starNumbers;\r\n var generatedRows = [];\r\n\r\n EurojackpotApi.getSystemKeys(this.systemName()).then(function (systemKeys) {\r\n if (systemKeys) {\r\n generatedRows = systemKeys.map(function (row, i) {\r\n var numbers = row.map(function (index) {\r\n // replace each index with the numbers chosen by the user\r\n return { number: selectedNumbers[index - 1].number, autogenerated: true };\r\n });\r\n\r\n return { count: i, numbers: numbers, starNumbers: starNumbers, state: 'clean' };\r\n\r\n });\r\n }\r\n\r\n self.generatedRows(generatedRows);\r\n self.save();\r\n\r\n deferred.resolve();\r\n }, function () {\r\n deferred.reject();\r\n });\r\n } else {\r\n\r\n // Lightning and Lucky:\r\n var options = { rowsToGenerate: this.rowsToGenerate() };\r\n var requiredNumbers = [];\r\n var requiredStarNumbers = [];\r\n var row = this.getRow(1);\r\n\r\n if (row && row.numbers.length > 0) {\r\n requiredNumbers = row.numbers.map(function (number) {\r\n return number.number;\r\n });\r\n }\r\n\r\n if (row && row.starNumbers.length > 0) {\r\n requiredStarNumbers = row.starNumbers.map(function (number) {\r\n return number.number;\r\n });\r\n }\r\n\r\n if (this.playType() === 'Lucky') {\r\n options.requiredNumbers = requiredNumbers.join(',');\r\n options.requiredStarNumbers = requiredStarNumbers.join(',');\r\n }\r\n\r\n EurojackpotApi.getRandomNumbers(options).then(function (rows) {\r\n var generatedRows = [];\r\n\r\n for (var i = 0; i < rows.length; i++) {\r\n var row = rows[i];\r\n var numbers = row.numbers.map(function (number) {\r\n return { number: number, autogenerated: true };\r\n });\r\n var starNumbers = row.starNumbers.map(function (starNumber) {\r\n return { number: starNumber, autogenerated: true };\r\n });\r\n\r\n generatedRows.push({ count: i, numbers: numbers, state: 'clean', starNumbers: starNumbers });\r\n }\r\n\r\n // Store generated rows to our object:\r\n self.generatedRows(generatedRows);\r\n\r\n self.save();\r\n\r\n deferred.resolve();\r\n }, function () {\r\n deferred.reject();\r\n }).bind(this);\r\n }\r\n\r\n return deferred.promise;\r\n }.bind(this);\r\n\r\n this.gameGenerateJokerRows = function (type) {\r\n var deferred = m.deferred();\r\n var self = this;\r\n\r\n EurojackpotApi.getRandomJokerNumbers(type).then(function (rows) {\r\n var generatedJokerRows = [];\r\n\r\n for (var i = 0; i < rows.length; i++) {\r\n var row = rows[i];\r\n var numbers = row.map(function (number) {\r\n return { number: number, autogenerated: true };\r\n });\r\n\r\n generatedJokerRows.push({ count: i, numbers: numbers, state: 'clean' });\r\n }\r\n\r\n self.generatedJokerRows(type, generatedJokerRows);\r\n self.save();\r\n\r\n deferred.resolve();\r\n }, function () {\r\n deferred.reject();\r\n });\r\n\r\n return deferred.promise;\r\n }.bind(this);\r\n\r\n this.generatedJokerRows = function (type, value) {\r\n if (value) {\r\n this['_generatedJokerRows' + type](value);\r\n }\r\n\r\n return this['_generatedJokerRows' + type]();\r\n }.bind(this);\r\n\r\n // Functions for number of draws:\r\n this.setNumberOfDraws = function (draws) {\r\n this.numberOfDraws(draws);\r\n // when selecting to play as subscription we need to change the gameVersionNo to 2\r\n // TODO: once Ejp is completely running on V2 then we can remove this check and the originalGameVersionNo\r\n this.gameVersionNo(this.numberOfDraws() === 0 ? 2 : this.originalGameVersionNo());\r\n\r\n this.save();\r\n }.bind(this);\r\n\r\n // Functions for purchase:\r\n this.purchase = function (params) {\r\n params = params || {};\r\n\r\n var self = this;\r\n var proceed = true;\r\n var deferred = m.deferred();\r\n\r\n if (this.status() != 'open') {\r\n deferred.reject();\r\n } else if (!params.drawId) {\r\n console.error('No drawId given.');\r\n\r\n deferred.reject({ errorMessage: 'NUMBERGAMES.NO_OPEN_DRAW' });\r\n } else {\r\n this.status('pending-confirmation');\r\n this.save();\r\n\r\n var rows = this.playType() === 'System' ? this.getRowsSummary(false) : this.getRowsSummary();\r\n\r\n var options = {\r\n drawId: params.drawId,\r\n totalPrice: parseInt(self.totalPrice(), 10),\r\n multidraw: parseInt(self.numberOfDraws(), 10),\r\n playType: this.playType() || null,\r\n rows: rows,\r\n salesChannel: (EurojackpotUtils.isMobile() || EurojackpotUtils.isTabletDevice()) ? 'mobile' : 'web'\r\n };\r\n\r\n // Prize notification - register only enabling\r\n if (params.notifyPrizeEmail) {\r\n options.notifyPrizeEmail = true;\r\n }\r\n if (params.notifyPrizeSms) {\r\n options.notifyPrizeSms = true;\r\n }\r\n\r\n // Jokers:\r\n if (this.withJokerSaturday()) {\r\n options.jokerSaturdayRows = this.getJokerRowsSummary('Saturday');\r\n\r\n if (options.jokerSaturdayRows.length === 0) {\r\n proceed = false;\r\n\r\n deferred.reject('joker-saturday-error');\r\n }\r\n }\r\n\r\n if (this.withJokerWednesday()) {\r\n options.jokerWednesdayRows = this.getJokerRowsSummary('Wednesday');\r\n\r\n if (options.jokerWednesdayRows.length === 0) {\r\n proceed = false;\r\n\r\n deferred.reject('joker-wednesday-error');\r\n }\r\n }\r\n // Proceed:\r\n if (proceed) {\r\n // System\r\n if (this.playType() === 'System') {\r\n options.system = this.systemName();\r\n }\r\n\r\n // Create request\r\n var request = EurojackpotApi.createCoupon(options);\r\n\r\n request.then(function (data) {\r\n self.status('completed');\r\n self.couponId(data.couponId);\r\n self.save();\r\n\r\n deferred.resolve(data);\r\n }, function (data) {\r\n self.status('open');\r\n self.save();\r\n\r\n deferred.reject(data);\r\n });\r\n }\r\n }\r\n\r\n return deferred.promise;\r\n }.bind(this);\r\n\r\n this.prepareConfirm = function () {\r\n var confirmUrl = this.confirmUrl();\r\n var deferred = m.deferred();\r\n var status = this.status();\r\n\r\n if (status !== 'processing') {\r\n var promises = this.playType() !== 'Classic' ? [this.gameGenerateRows()] : [];\r\n var self = this;\r\n\r\n if (status === 'prepare-confirm-error') {\r\n status = 'open';\r\n }\r\n\r\n this.status(this.numberOfDraws() > 0 ? 'processing' : status);\r\n\r\n if (this.withJokerSaturday()) {\r\n promises.push(this.gameGenerateJokerRows('Saturday'));\r\n }\r\n\r\n if (this.withJokerWednesday()) {\r\n promises.push(this.gameGenerateJokerRows('Wednesday'));\r\n }\r\n\r\n m.sync(promises).then(function () {\r\n self.status(status);\r\n\r\n self.save();\r\n\r\n deferred.resolve(confirmUrl);\r\n }, function () {\r\n self.status('prepare-confirm-error');\r\n\r\n self.save();\r\n\r\n deferred.reject();\r\n });\r\n } else {\r\n deferred.resolve(confirmUrl);\r\n }\r\n\r\n return deferred.promise;\r\n }.bind(this);\r\n\r\n // Functions - For tracking (DataLayer eCommerce buzzword)\r\n this.createDataLayerJoker = function (day, subscription) {\r\n var joker;\r\n\r\n if (!subscription) {\r\n var numberOfJokers = function () {\r\n if (this.jokerDrawDates && this.jokerDrawDates().length) {\r\n return this.jokerDrawDates().filter(function (draw) {\r\n return draw.dayName === day;\r\n }).length;\r\n }\r\n return this.numberOfDraws();\r\n }.bind(this);\r\n joker = {\r\n name: 'joker',\r\n price: DataLayer.rowPrice(this.stakePerJoker(), numberOfJokers(), 'joker'),\r\n brand: 'dlo_jok',\r\n category: DataLayer.categoryName(this.playType()),\r\n variant: DataLayer.variantName('joker', numberOfJokers(), day),\r\n quantity: 1\r\n };\r\n }\r\n\r\n if (subscription) {\r\n joker = {\r\n name: 'plus',\r\n price: DataLayer.rowPrice(this.stakePerJoker(), this.numberOfDraws(), 'plus_joker'),\r\n brand: 'dlo_plu',\r\n category: DataLayer.categoryName(this.playType()),\r\n variant: DataLayer.variantName('plus_joker', this.numberOfDraws(), day),\r\n quantity: 1\r\n };\r\n }\r\n\r\n if (this.trackedInteractionCreationAction()) {\r\n joker.coupon = this.trackedInteractionCreationAction();\r\n }\r\n\r\n return joker;\r\n };\r\n\r\n this.createDataLayerProduct = function (type, event) {\r\n var data = EurojackpotInfo.data();\r\n var dataLayerProducts = [];\r\n var numberOfDraws = this.numberOfDraws();\r\n var playType = this.playType();\r\n var product = {};\r\n var rowAmount = this.getRowAmount();\r\n var subscription = type === 'plus';\r\n var firstDrawName = data && data.openDraw && data.openDraw.closingTime ? EurojackpotUtils.parseISO8601(data.openDraw.closingTime).dayName : null;\r\n var variantBrandName = 'eurojackpot' + (firstDrawName ? '_' + firstDrawName : '');\r\n\r\n if (type === 'plus') {\r\n product.name = 'plus';\r\n product.price = DataLayer.rowPrice(data, numberOfDraws, 'plus');\r\n product.brand = 'dlo_plu';\r\n product.category = DataLayer.categoryName(playType);\r\n product.variant = DataLayer.variantName('plus_eurojackpot', numberOfDraws, playType);\r\n product.quantity = rowAmount;\r\n } else {\r\n product.name = 'eurojackpot';\r\n product.price = DataLayer.rowPrice(data, numberOfDraws);\r\n product.brand = 'dlo_ejp';\r\n product.category = DataLayer.categoryName(playType);\r\n product.variant = DataLayer.variantName(variantBrandName, numberOfDraws, playType);\r\n\r\n if (type === 'playtogether') {\r\n product.category = 'spil_sammen';\r\n }\r\n\r\n if (event !== 'productDetails') {\r\n product.quantity = rowAmount;\r\n }\r\n\r\n if (this.trackedInteractionCreationAction()) {\r\n product.coupon = this.trackedInteractionCreationAction();\r\n }\r\n }\r\n\r\n dataLayerProducts.push(product);\r\n\r\n // Check for Joker Saturday:\r\n if (this.withJokerSaturday()) {\r\n !subscription ? dataLayerProducts.push(this.createDataLayerJoker('saturday')) : dataLayerProducts.push(this.createDataLayerJoker('saturday', 'plus'));\r\n }\r\n\r\n // Check for Joker Wednesday:\r\n if (this.withJokerWednesday()) {\r\n !subscription ? dataLayerProducts.push(this.createDataLayerJoker('wednesday')) : dataLayerProducts.push(this.createDataLayerJoker('wednesday', 'plus'));\r\n }\r\n\r\n return dataLayerProducts;\r\n };\r\n\r\n this.trackingAddToCart = function (type) {\r\n if (!this.isAddToCartTracked()) {\r\n this.isAddToCartTracked(true);\r\n\r\n this.save();\r\n\r\n if (type === 'plus' || type === 'playtogether') {\r\n DataLayer.addToCart(this.createDataLayerProduct(type));\r\n } else {\r\n DataLayer.addToCart(this.createDataLayerProduct(false));\r\n }\r\n } else {\r\n console.warn('addToCart has been pushed already!');\r\n }\r\n }.bind(this);\r\n\r\n this.trackingProductDetails = function () {\r\n if (!this.isProductDetailsTracked()) {\r\n this.isProductDetailsTracked(true);\r\n\r\n this.save();\r\n\r\n DataLayer.productDetail(this.createDataLayerProduct(false, 'productDetails'));\r\n } else {\r\n console.warn('productDetails has been pushed already!');\r\n }\r\n }.bind(this);\r\n\r\n this.trackingPurchaseComplete = function (type) {\r\n if (!this.isPurchaseCompleteTracked()) {\r\n this.isPurchaseCompleteTracked(true);\r\n\r\n this.save();\r\n\r\n DataLayer.purchaseCompleted({\r\n totalPrice: this.totalPrice().toString(),\r\n id: this.couponId() || this.fallbackFakeCouponId()\r\n }, this.createDataLayerProduct(type));\r\n } else {\r\n console.warn('purchaseCompleted has been pushed already!');\r\n }\r\n }.bind(this);\r\n\r\n // Ensighten will group all events together if the ID is not unique.\r\n // In Playtogether we don't have a couponId upon purchase, so we create a fake one\r\n this.fallbackFakeCouponId = function () {\r\n var couponId = 'NA-EJP-' + Math.random().toString(36).slice(2);\r\n\r\n return couponId;\r\n };\r\n\r\n // Functions - For extracting data:\r\n this.getRow = function (row) {\r\n // Note: the row index starts with 1:\r\n\r\n return this.rows()[row - 1];\r\n }.bind(this);\r\n\r\n this.isRowValid = function (rowNumber, { checkOnlyMaxLimit = false } = {}) {\r\n var playType = this.playType();\r\n var row = this.getRow(rowNumber) || {};\r\n\r\n // Lucky:\r\n if (playType === 'Lucky') {\r\n var totalNumbers = (row.numbers.length || 0) + (row.starNumbers.length || 0);\r\n\r\n if (checkOnlyMaxLimit) {\r\n return totalNumbers === 6 && row.numbers.length <= 5;\r\n }\r\n return totalNumbers >= 1 && totalNumbers <= 6 && row.numbers.length <= 5;\r\n }\r\n\r\n // System:\r\n if (playType === 'System') {\r\n return row.numbers.length === this.getSystemNumberAmount() && row.starNumbers.length >= this.starNumbersPerRowMin();\r\n }\r\n\r\n // All other play types:\r\n return row.numbers.length >= this.numbersPerRowMin() && row.numbers.length <= this.numbersPerRowMax() && row.starNumbers.length >= this.starNumbersPerRowMin() && row.starNumbers.length <= this.starNumbersPerRowMax();\r\n }.bind(this);\r\n\r\n this.getRows = function (valid) {\r\n var self = this;\r\n\r\n return this.rows().filter(function (row, index) {\r\n if (row.state === 'remove') {\r\n return false;\r\n }\r\n\r\n return !valid || self.isRowValid(index + 1);\r\n });\r\n }.bind(this);\r\n\r\n this.hasNumber = function (row, number) {\r\n row = this.getRow(row);\r\n\r\n var numbers = row.numbers;\r\n\r\n for (var i = 0; i < numbers.length; i++) {\r\n if (numbers[i].number === number) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }.bind(this);\r\n\r\n this.hasStarNumber = function (row, starNumber) {\r\n row = this.getRow(row);\r\n\r\n var starNumbers = row.starNumbers;\r\n\r\n for (var i = 0; i < starNumbers.length; i++) {\r\n if (starNumbers[i].number === starNumber) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }.bind(this);\r\n\r\n this.drawDateHtml = function (delimiter) {\r\n delimiter = delimiter || ' - ';\r\n\r\n var openDraw = EurojackpotInfo.data().openDraw;\r\n if (!openDraw || !openDraw.closingTime) {\r\n return '';\r\n }\r\n\r\n var closingTime = openDraw.closingTime;\r\n var draws = this.numberOfDraws();\r\n\r\n var date = new Date(closingTime);\r\n\r\n var result = EurojackpotUtils.formatISO8601(date.toISOString(), { includeTime: false });\r\n\r\n if (draws > 1) {\r\n date.setDate(date.getDate() + ((draws - 1) * 7));\r\n result = '' + result + delimiter + EurojackpotUtils.formatISO8601(date.toISOString(), { includeTime: false }) + '';\r\n }\r\n\r\n return result;\r\n }.bind(this);\r\n\r\n this.drawDateHtmlShort = function () {\r\n var dates = this.drawDates();\r\n var firstDate = dates[0];\r\n var lastDate = dates[dates.length - 1];\r\n\r\n // if there's more than one date, output the range. otherwise output the first date.\r\n if (dates.length > 1) {\r\n return firstDate.draw.getDate() + '/' + (firstDate.draw.getMonth() + 1) + ' - ' + lastDate.draw.getDate() + '/' + (lastDate.draw.getMonth() + 1) + ' ' + lastDate.draw.getFullYear();\r\n } else {\r\n return firstDate.draw.getDate() + '/' + (firstDate.draw.getMonth() + 1) + ' ' + firstDate.draw.getFullYear();\r\n }\r\n }.bind(this);\r\n\r\n this.drawDates = function (numberOfDraws) {\r\n var drawDates = [];\r\n var openDraw = EurojackpotInfo.data().openDraw;\r\n var draws = numberOfDraws || this.numberOfDraws();\r\n var drawsFromEurojackpotInfo = EurojackpotInfo.data().draws;\r\n var firstDraw = EurojackpotInfo.data().openDraw;\r\n\r\n if (!openDraw || !openDraw.closingTime) {\r\n return drawDates;\r\n }\r\n\r\n var firstDrawIndex = -1;\r\n\r\n for (var i = 0; i < drawsFromEurojackpotInfo.length; i++) {\r\n if (drawsFromEurojackpotInfo[i].id === firstDraw.id) {\r\n firstDrawIndex = i;\r\n break;\r\n }\r\n }\r\n var feedDrawDates = drawsFromEurojackpotInfo.slice(firstDrawIndex, firstDrawIndex + draws);\r\n drawDates = feedDrawDates.map(function (draw) {\r\n return {\r\n draw: new Date(draw.closingTime),\r\n hasJoker: false\r\n };\r\n }.bind(this));\r\n\r\n if (this.gameVersionNo() === 2) {\r\n if (this.withJokerWednesday() || this.withJokerSaturday()) {\r\n var jokerDraws = this.jokerDrawDates();\r\n\r\n for (var j = 0; j < jokerDraws.length; j++) {\r\n drawDates.push({\r\n draw: new Date(jokerDraws[j].closingTime),\r\n hasJoker: true\r\n });\r\n }\r\n }\r\n } else {\r\n // if joker on wednesdays are added, add their dates.\r\n if (this.withJokerWednesday()\r\n && EurojackpotInfo.jokerData()\r\n && EurojackpotInfo.jokerData().jokerWednesday\r\n && EurojackpotInfo.jokerData().jokerWednesday.openDraw\r\n && EurojackpotInfo.jokerData().jokerWednesday.openDraw.closingTime) {\r\n\r\n var firstWednesdayJoker = new Date(EurojackpotInfo.jokerData().jokerWednesday.openDraw.closingTime);\r\n\r\n draws = this.numberOfDraws();\r\n while (draws--) {\r\n drawDates.push({\r\n draw: new Date(firstWednesdayJoker),\r\n hasJoker: true\r\n });\r\n firstWednesdayJoker.setDate(firstWednesdayJoker.getDate() + 7);\r\n }\r\n }\r\n\r\n // if joker on saturdays are added, add their dates.\r\n if (this.withJokerSaturday()\r\n && EurojackpotInfo.jokerData()\r\n && EurojackpotInfo.jokerData().jokerSaturday\r\n && EurojackpotInfo.jokerData().jokerSaturday.openDraw\r\n && EurojackpotInfo.jokerData().jokerSaturday.openDraw.closingTime) {\r\n\r\n var firstSaturdayJoker = new Date(EurojackpotInfo.jokerData().jokerSaturday.openDraw.closingTime);\r\n\r\n draws = this.numberOfDraws();\r\n while (draws--) {\r\n drawDates.push({\r\n draw: new Date(firstSaturdayJoker),\r\n hasJoker: true\r\n });\r\n firstSaturdayJoker.setDate(firstSaturdayJoker.getDate() + 7);\r\n }\r\n }\r\n }\r\n\r\n drawDates.sort(function (a, b) {\r\n return a.draw.getTime() - b.draw.getTime();\r\n });\r\n\r\n return drawDates;\r\n }.bind(this);\r\n\r\n this.rawDrawsDataFromInfoFeed = () => {\r\n const drawTimes = this.drawDates().map((draw) => {\r\n return new Date(draw.draw).getTime();\r\n });\r\n\r\n return EurojackpotInfo.data().draws.filter((feedDraw) => {\r\n return drawTimes.indexOf(new Date(feedDraw.closingTime).getTime()) !== -1;\r\n });\r\n };\r\n\r\n this.drawDatesWithoutJokerInfo = function (numberOfDraws) {\r\n var drawDates = [];\r\n var openDraw = EurojackpotInfo.data().openDraw;\r\n var draws = numberOfDraws || this.numberOfDraws();\r\n var drawsFromEurojackpotInfo = EurojackpotInfo.data().draws;\r\n var firstDraw = EurojackpotInfo.data().openDraw;\r\n\r\n if (!openDraw || !openDraw.closingTime) {\r\n return drawDates;\r\n }\r\n\r\n var firstDrawIndex = -1;\r\n\r\n for (var i = 0; i < drawsFromEurojackpotInfo.length; i++) {\r\n if (drawsFromEurojackpotInfo[i].id === firstDraw.id) {\r\n firstDrawIndex = i;\r\n break;\r\n }\r\n }\r\n var feedDrawDates = drawsFromEurojackpotInfo.slice(firstDrawIndex, firstDrawIndex + draws);\r\n drawDates = feedDrawDates.map(function (draw) {\r\n const drawObject = {\r\n draw: new Date(draw.closingTime)\r\n };\r\n\r\n if (draw.campaigns) {\r\n drawObject.campaigns = draw.campaigns;\r\n drawObject.campaignNumbers = draw.campaignNumbers;\r\n }\r\n\r\n return drawObject;\r\n }.bind(this));\r\n\r\n drawDates.sort(function (a, b) {\r\n return a.draw.getTime() - b.draw.getTime();\r\n });\r\n\r\n return drawDates;\r\n }.bind(this);\r\n\r\n this.jokerDrawDates = function (drawDay) {\r\n if (!(EurojackpotInfo.jokerData()\r\n && EurojackpotInfo.jokerData().jokerSaturday\r\n && EurojackpotInfo.jokerData().jokerWednesday\r\n && EurojackpotInfo.jokerData().jokerSaturday.draws\r\n && EurojackpotInfo.jokerData().jokerWednesday.draws)) return;\r\n\r\n if (this.drawDatesWithoutJokerInfo().length === 0) return [];\r\n\r\n var saturdayDraws = EurojackpotInfo.jokerData().jokerSaturday.draws.map(function (draw) {\r\n draw.dayName = 'saturday';\r\n return draw;\r\n });\r\n var wednesdayDraws = EurojackpotInfo.jokerData().jokerWednesday.draws.map(function (draw) {\r\n draw.dayName = 'wednesday';\r\n return draw;\r\n });\r\n var combinedDraws = saturdayDraws.concat(wednesdayDraws);\r\n combinedDraws.sort(function (a, b) {\r\n return (a.closingTime).localeCompare((b.closingTime));\r\n });\r\n\r\n if (this.gameVersionNo() === 2) {\r\n var nextValidJokerDraws = combinedDraws.filter(function (draw) {\r\n return new Date(draw.closingTime).getTime() > this.drawDatesWithoutJokerInfo()[0].draw.getTime();\r\n }.bind(this));\r\n\r\n return nextValidJokerDraws.slice(0, this.numberOfDraws());\r\n }\r\n\r\n switch (drawDay) {\r\n case 'saturday':\r\n return saturdayDraws.slice(0, this.numberOfDraws());\r\n case 'wednesday':\r\n return wednesdayDraws.slice(0, this.numberOfDraws());\r\n case 'both':\r\n return combinedDraws.slice(0, (this.numberOfDraws() * 2));\r\n }\r\n }.bind(this);\r\n\r\n this.campaignDrawsCount = (wantedCampaign) => {\r\n return this.rawDrawsDataFromInfoFeed().reduce(function (count, draw) {\r\n if (Array.isArray(wantedCampaign)) {\r\n return draw?.campaignNumbers?.some((campaignNumber) => {\r\n return wantedCampaign.includes(campaignNumber);\r\n }) ? ++count : count;\r\n }\r\n if (typeof wantedCampaign === 'number') {\r\n return draw?.campaignNumbers?.includes(wantedCampaign) ? ++count : count;\r\n }\r\n return draw?.campaigns?.some(function (c) {\r\n return c.indexOf(wantedCampaign) === 0;\r\n }) ? ++count : count;\r\n }, 0);\r\n };\r\n\r\n this.generatedRows = function (value) {\r\n var playType = this.playType();\r\n\r\n // Classic and Lightning:\r\n if (playType === 'Classic') {\r\n if (value) {\r\n console.error('EurojackpotGame: play type Classic does not support setting generatedRows.');\r\n }\r\n\r\n return this.getRows(true);\r\n }\r\n\r\n // Lightning, Lucky and System:\r\n if (playType === 'Lightning' || playType === 'Lucky' || playType === 'System') {\r\n if (value) {\r\n this._generatedRows(value);\r\n }\r\n\r\n return this._generatedRows();\r\n }\r\n }.bind(this);\r\n\r\n this.checkGeneratedConsistency = function () {\r\n var playType = this.playType();\r\n\r\n if (playType === 'Classic' || playType === 'Lightning') {\r\n return true;\r\n }\r\n\r\n if (playType === 'Lucky') {\r\n return this.generatedRows().length !== this.rowsToGenerate();\r\n }\r\n\r\n if (playType === 'System') {\r\n // TODO: check that amount of generated rows corresponds to the chosen system.\r\n\r\n return true;\r\n }\r\n }.bind(this);\r\n\r\n this.getRowsSummary = function (useGenerated) {\r\n useGenerated = typeof useGenerated === 'undefined' ? true : useGenerated;\r\n\r\n var summary = [];\r\n var rows = useGenerated ? this.generatedRows() : this.getRows(true);\r\n\r\n for (var i = 0; i < rows.length; i++) {\r\n var row = {\r\n numbers: rows[i].numbers.map(function (numbers) {\r\n return numbers.number;\r\n }),\r\n starNumbers: rows[i].starNumbers.map(function (starNumbers) {\r\n return starNumbers.number;\r\n })\r\n };\r\n\r\n summary.push(row);\r\n }\r\n\r\n return summary;\r\n }.bind(this);\r\n\r\n this.getJokerRowsSummary = function (type) {\r\n var summary = [];\r\n var rows = this['_generatedJokerRows' + type]();\r\n\r\n for (var i = 0; i < rows.length; i++) {\r\n var row = rows[i].numbers.map(function (numbers) {\r\n return numbers.number;\r\n });\r\n\r\n summary.push({ numbers: row });\r\n }\r\n\r\n return summary;\r\n }.bind(this);\r\n\r\n this.getRowAmount = function () {\r\n var playType = this.playType();\r\n\r\n if (playType === 'Lucky' || playType === 'Lightning') {\r\n return this.rowsToGenerate();\r\n }\r\n\r\n if (playType === 'System') {\r\n return this.getSystemRowAmount();\r\n }\r\n\r\n // Classic:\r\n return this.getRows(true).length;\r\n }.bind(this);\r\n\r\n this.rowPrice = function (rowIndex) {\r\n var data = EurojackpotInfo.data();\r\n var rowPrice = rowIndex !== undefined && data.draws && data.draws[rowIndex] && data.draws[rowIndex].rowPrice ? data.draws[rowIndex].rowPrice : 0;\r\n\r\n return rowPrice;\r\n };\r\n\r\n this.totalRowsPricePerDraw = function (drawIndex) {\r\n var rowAmount = this.getRowAmount();\r\n var price = 0;\r\n\r\n if (drawIndex !== undefined) {\r\n return this.rowPrice(drawIndex) * rowAmount;\r\n }\r\n\r\n for (var i = 0; i < this.numberOfDraws(); i++) {\r\n price += rowAmount * this.rowPrice(i);\r\n }\r\n\r\n return price;\r\n }.bind(this);\r\n\r\n this.totalPrice = function () { // Required by PurchaseBar\r\n var singleDrawPerWeekTotal = this.totalJokerPrice() + this.totalRowsPricePerDraw();\r\n switch (this.gameVersionNo()) {\r\n case 2:\r\n if (this.plusSubscriptionJackpot()) {\r\n return this.totalRowsPricePerDraw() + (this.getJokerCount() ? this.jokerPrice() : 0);\r\n }\r\n var verticalTypesWithTwoDrawsPerWeek = ['plus'];\r\n if (this.verticalType() && (verticalTypesWithTwoDrawsPerWeek.indexOf(this.verticalType()) > -1)) {\r\n return (this.totalRowsPricePerDraw() * 2) + this.totalJokerPrice();\r\n }\r\n return singleDrawPerWeekTotal;\r\n default:\r\n return singleDrawPerWeekTotal;\r\n }\r\n }.bind(this);\r\n\r\n this.jokerPrice = function () {\r\n return EurojackpotInfo.getJokerPrice() * 2;\r\n }.bind(this);\r\n\r\n this.totalJokerPrice = function () {\r\n return this.getJokerCount() * this.stakePerJoker() * (this.numberOfDraws() || 1);\r\n }.bind(this);\r\n\r\n this.getJokerCount = function () {\r\n if (['plus', 'jackpot'].indexOf(this.verticalType()) !== -1) {\r\n if (this.verticalType() === 'jackpot' &&\r\n (this.withJokerSaturday() || this.withJokerWednesday())) {\r\n return 2;\r\n }\r\n return this.withJokerSaturday() || this.withJokerWednesday() ? 4 : 0;\r\n }\r\n if (this.gameVersionNo() === 2) {\r\n return this.withJokerSaturday() || this.withJokerWednesday() ? 2 : 0;\r\n }\r\n return (this.withJokerSaturday() ? 2 : 0) + (this.withJokerWednesday() ? 2 : 0);\r\n }.bind(this);\r\n\r\n this.isGameValid = function () { // Required by PurchaseBar\r\n var playType = this.playType();\r\n\r\n // Not valid, if numberOfDraws is higher than known upcomming draws in the feed\r\n if (this.numberOfDraws() > EurojackpotInfo.data().draws.length) {\r\n return false;\r\n }\r\n\r\n // Lightning:\r\n if (playType === 'Lightning') {\r\n return this.totalPrice() > 0 || this.numberOfDraws() === 0;\r\n }\r\n\r\n // Rows:\r\n var hasValidRows = false;\r\n\r\n for (var i = 0; i < this.rows().length; i++) {\r\n if (this.isRowValid(i + 1)) {\r\n hasValidRows = true;\r\n }\r\n }\r\n\r\n if (!hasValidRows) {\r\n return false;\r\n }\r\n\r\n // System:\r\n if (playType === 'System') {\r\n return (this.systemName() && this.getSystemNumberAmount() == this.getRow(1).numbers.length);\r\n\r\n // Lucky, Classic:\r\n } else if (playType === 'Lucky' || playType === 'Classic') {\r\n return this.getRows(true).length > 0 && (this.totalPrice() > 0 || this.numberOfDraws() === 0);\r\n }\r\n }.bind(this);\r\n\r\n this.isSubscriptionValid = function () {\r\n if (this.playType() === 'System') {\r\n // TODO - CR: System - ingen systemer, der overstiger 2.000 kr. (Kasper har listen, hvis det er)\r\n return true;\r\n }\r\n\r\n // Classic, Lykke, Lyn - mindst 1 række\r\n return this.getRowAmount() >= 1;\r\n }.bind(this);\r\n\r\n // Helpers for Eurojackpot System:\r\n this.getSystemNumberAmount = function () {\r\n return this.systemName() ? parseInt(this.systemName().split(' ')[1].split('-')[0], 10) : 0;\r\n }.bind(this);\r\n\r\n this.getSystemRowAmount = function () {\r\n return this.systemName() ? parseInt(this.systemName().split(' ')[1].split('-')[1], 10) : 0;\r\n }.bind(this);\r\n\r\n this.trackPurchase = function () {\r\n var self = this;\r\n\r\n if (!self.purchaseTracked() && self.status() == 'completed') {\r\n window.DSAPI && DSAPI.ready(function () {\r\n self.purchaseTracked(true);\r\n });\r\n\r\n this.trackingPurchaseComplete();\r\n }\r\n }.bind(this);\r\n\r\n this.confirmUrl = function () {\r\n var data = EurojackpotInfo.data();\r\n var numberOfDraws = this.numberOfDraws();\r\n\r\n if (numberOfDraws === 0 || (data && data.confirmUrl)) {\r\n if (numberOfDraws > 0 && this.clientContext() === 'multiClient') {\r\n var multiClientPath = window.location.href.split('#/')[1];\r\n multiClientPath = multiClientPath.split('/')[0] + '/confirm';\r\n return this.startUrl().split('#/')[0] + '?gameInstanceId=' + this.id() + '#/' + multiClientPath;\r\n }\r\n\r\n return (numberOfDraws === 0 ? '/plus-abonnement/plus-vaelg-spil-eurojackpot?gameType=eurojackpot&gameId=' + this.id() : data.confirmUrl) + '?gameInstanceId=' + this.id();\r\n }\r\n\r\n console.error('EurojackpotGame: unable to return confirmUrl, feed is not loaded.');\r\n }.bind(this);\r\n\r\n this.receiptUrl = function () {\r\n var data = EurojackpotInfo.data();\r\n\r\n if (data && data.receiptUrl) {\r\n return data.receiptUrl + '?gameInstanceId=' + this.id();\r\n }\r\n\r\n console.error('EurojackpotGame: unable to return receiptUrl, feed is not loaded.');\r\n }.bind(this);\r\n\r\n this.cancelUrl = function () {\r\n if (this.rebuyCouponId()) {\r\n // This is called when going from confirm page, back to completed games overview page.\r\n return this.startUrl();\r\n }\r\n\r\n if (this.clientContext() === 'multiClient') {\r\n var multiClientPath = window.location.href.split('#/')[1];\r\n\r\n // if the cancelUrl will redirect to the confirm or receipt flow step the user\r\n // would be in a infinite loop since on this steps we require the user to be logged in\r\n if (['confirm', 'receipt'].indexOf(multiClientPath.split('/')[1]) !== -1) {\r\n multiClientPath = multiClientPath.split('/')[0] + '/joker';\r\n }\r\n\r\n return this.startUrl().split('#/')[0] + '?gameInstanceId=' + this.id() + '#/' + multiClientPath;\r\n }\r\n\r\n // This is called when going from confirm page, back to game.\r\n return this.startUrl() + '?gameInstanceId=' + this.id();\r\n }.bind(this);\r\n\r\n this.copyFromOldCoupon = function () {\r\n var self = this;\r\n\r\n EurojackpotApi.getCoupon(this.rebuyCouponId()).then(function (data) {\r\n self.numberOfDraws(!data.multiWagers ? 1 : data.multiWagers.length);\r\n self.playType(data.playType);\r\n self.systemName(data.systemName);\r\n self.reducedWeeks(data.rebuyDrawRepeatMax && data.rebuyDrawRepeatMax < self.numberOfDraws());\r\n self.rowPriceChanged(data.rowPriceChanged);\r\n\r\n if (self.rowPriceChanged()) {\r\n self.originalPrice((data.price * self.numberOfDraws()) + self.totalJokerPrice());\r\n }\r\n\r\n if (self.reducedWeeks()) {\r\n self.originalPrice((data.price * self.numberOfDraws()) + self.totalJokerPrice());\r\n self.originalNumberOfDraws(self.numberOfDraws());\r\n self.numberOfDraws(data.rebuyDrawRepeatMax);\r\n }\r\n\r\n var promises = [];\r\n\r\n // If systemName is defined, set playType to System, otherwise Classic:\r\n if (!self.playType() || self.playType().toLowerCase() === 'unknown') {\r\n self.playType(self.systemName() ? 'System' : 'Classic');\r\n }\r\n\r\n data.games.forEach(function (game) {\r\n var rows = [];\r\n var rowNumbers = [];\r\n\r\n // Eurojackpot:\r\n if (game.gameType.toLowerCase() === 'eurojackpot') {\r\n\r\n // Classic:\r\n if (self.playType() === 'Classic') {\r\n game.rows.forEach(function (row, index) {\r\n rowNumbers = { count: index, numbers: [], starNumbers: [], state: 'clean' };\r\n\r\n row.numbers.forEach(function (number) {\r\n rowNumbers.numbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n row.extraNumbers.forEach(function (number) {\r\n rowNumbers.starNumbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n self.rows().push(rowNumbers);\r\n });\r\n\r\n // System:\r\n } else if (self.playType() === 'System') {\r\n rowNumbers = { count: 0, numbers: [], starNumbers: [], state: 'clean' };\r\n\r\n game.systemNumbers.numbers.forEach(function (number) {\r\n rowNumbers.numbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n game.systemNumbers.extraNumbers.forEach(function (number) {\r\n rowNumbers.starNumbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n self.rows().push(rowNumbers);\r\n\r\n promises.push(self.gameGenerateRows());\r\n\r\n // Lightning and Lucky:\r\n } else if (self.playType() === 'Lucky' || self.playType() === 'Lightning') {\r\n game.rows.forEach(function (row, index) {\r\n rowNumbers = { count: index, numbers: [], starNumbers: [], state: 'clean' };\r\n\r\n row.numbers.forEach(function (number) {\r\n rowNumbers.numbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n row.extraNumbers.forEach(function (number) {\r\n rowNumbers.starNumbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n rows.push(rowNumbers);\r\n });\r\n\r\n self.generatedRows(rows);\r\n self.rowsToGenerate(rows.length);\r\n }\r\n\r\n // Joker:\r\n } else {\r\n var gameType = /wednesday/.test(game.gameType.toLowerCase()) ? 'wednesday' : 'saturday';\r\n\r\n rows = [];\r\n\r\n if (gameType === 'wednesday') {\r\n self.withJokerWednesday(true);\r\n } else {\r\n self.withJokerSaturday(true);\r\n }\r\n\r\n game.rows.forEach(function (row, index) {\r\n var rowNumbers = { count: index, numbers: [], state: 'clean' };\r\n\r\n row.numbers.forEach(function (number) {\r\n rowNumbers.numbers.push({ autogenerated: false, number: number.number });\r\n });\r\n\r\n rows.push(rowNumbers);\r\n });\r\n\r\n self.generatedJokerRows(gameType.charAt(0).toUpperCase() + gameType.slice(1), rows);\r\n }\r\n\r\n\r\n });\r\n\r\n m.sync(promises).then(function () {\r\n self.save();\r\n\r\n self.ready().resolve();\r\n });\r\n }, function () {\r\n self.ready().reject('coupon-not-found');\r\n });\r\n }.bind(this);\r\n\r\n this.sendToSubscription = function () {\r\n // Tracking for DataLayer\r\n this.trackingAddToCart('plus');\r\n\r\n const link = this.linkToPlusPurchase?.();\r\n\r\n if (link) {\r\n const linkArr = link.split('?');\r\n if (!(linkArr.includes('plus') || linkArr.includes('jackpot'))) linkArr.push('plus');\r\n linkArr.push('mcGameType=eurojackpot');\r\n linkArr.push('mcGameId=' + this.id());\r\n location.href = linkArr.shift() + '?' + linkArr.join('&');\r\n } else {\r\n location.href = '/plus-abonnement/se-kurv?plus&mcGameType=eurojackpot&mcGameId=' + this.id();\r\n }\r\n }.bind(this);\r\n\r\n this.toJSON = function () {\r\n return {\r\n _generatedJokerRowsSaturday: this._generatedJokerRowsSaturday(),\r\n _generatedJokerRowsWednesday: this._generatedJokerRowsWednesday(),\r\n id: this.id(),\r\n state: this.state(),\r\n status: this.status(),\r\n playType: this.playType(),\r\n numberOfDraws: this.numberOfDraws(),\r\n rows: this.rows(),\r\n systemName: this.systemName(),\r\n withJokerSaturday: this.withJokerSaturday(),\r\n withJokerWednesday: this.withJokerWednesday(),\r\n rowsToGenerate: this.rowsToGenerate(),\r\n startUrl: this.startUrl(),\r\n purchaseTracked: this.purchaseTracked(),\r\n _generatedRows: this._generatedRows(),\r\n couponId: this.couponId(),\r\n isProductDetailsTracked: this.isProductDetailsTracked(),\r\n isAddToCartTracked: this.isAddToCartTracked(),\r\n isPurchaseCompleteTracked: this.isPurchaseCompleteTracked(),\r\n firstDepositInfo: this.firstDepositInfo(),\r\n plusSubscriptionJackpot: this.plusSubscriptionJackpot(),\r\n playTogetherDepositType: this.playTogetherDepositType(),\r\n gameVersionNo: this.gameVersionNo(),\r\n verticalType: this.verticalType(),\r\n drawDays: this.drawDays(),\r\n trackedInteractionCreationAction: this.trackedInteractionCreationAction(),\r\n };\r\n }.bind(this);\r\n\r\n // Init:\r\n this.init = function () {\r\n\r\n // Rebuy coupon:\r\n if (this.rebuyCouponId() && this.state() === 'new') {\r\n this.copyFromOldCoupon();\r\n\r\n // Regular coupon:\r\n } else {\r\n if (this.state() === 'new') {\r\n this.addRow();\r\n this.addRow();\r\n\r\n if (this.playType() === 'Lucky') {\r\n this.rowsToGenerate(this.rowsToGenerate() || EurojackpotInfo.getLuckyDefaultRowCount());\r\n }\r\n }\r\n\r\n this.ready().resolve();\r\n }\r\n\r\n }.bind(this);\r\n\r\n });\r\n\r\n EurojackpotGame.setupGame = function (options) {\r\n var game = undefined;\r\n\r\n if (options.gameInstanceId) {\r\n game = EurojackpotGame.get(options.gameInstanceId);\r\n\r\n if (!game || game.status() === 'completed' || (options.playType && game.playType() !== options.playType)) {\r\n game = undefined;\r\n }\r\n }\r\n\r\n if (!game) {\r\n game = EurojackpotGame.construct(options, options.state || 'new');\r\n }\r\n\r\n if (options.linkToPlusPurchase && !game.linkToPlusPurchase) {\r\n game.linkToPlusPurchase = m.prop(options.linkToPlusPurchase);\r\n }\r\n\r\n return game;\r\n };\r\n\r\n // Public functions:\r\n return EurojackpotGame;\r\n\r\n });\r\n"],"mappings":";;AAAAA,QAAQ,CAAC,8DAA8D,EACrE,CACE,+CAA+C,EAC/C,6CAA6C,EAC7C,8DAA8D,EAC9D,+DAA+D,EAC/D,gEAAgE,EAChE,4DAA4D,CAC7D,EACD,UAAUC,CAAC,EAAEC,KAAK,EAAEC,cAAc,EAAEC,eAAe,EAAEC,gBAAgB,EAAEC,SAAS,EAAE;EAEhF;EACA,IAAIC,eAAe,GAAGL,KAAK,CAAC,iBAAiB,EAAE,UAAUM,OAAO,EAAE;IAAA,IAAAC,KAAA;IAChE,IAAI,CAACC,QAAQ,GAAG,MAAM;MACpB,OAAON,eAAe;IACxB,CAAC;IACD,IAAI,CAACO,GAAG,GAAG,MAAM;MACf,OAAOR,cAAc;IACvB,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