{"version":3,"file":"WednesdayLottoApi.js","names":["defineDs","ApiRequest","LottoUtils","baseURL","baseJokerURL","prepareParamString","getCompletedDrawDates","options","params","url","localCacheTTL","unwrapSuccess","response","drawDates","getWinningNumbersLotto","getRandomJokerNumbers","rows","length","i","push","split"],"sources":["DanskeSpil/Domain/Lotto/Scripts/Helpers/WednesdayLottoApi.js"],"sourcesContent":["defineDs('DanskeSpil/Domain/Lotto/Scripts/Helpers/WednesdayLottoApi',\r\n [\r\n 'Shared/Framework/Mithril/Scripts/Helpers/ApiRequest',\r\n 'DanskeSpil/Domain/Lotto/Scripts/Helpers/LottoUtils'\r\n ],\r\n function (ApiRequest, LottoUtils) {\r\n\r\n // Variables:\r\n var baseURL = '/dlo/scapi/danskespil/numbergames/onsdagslotto';\r\n var baseJokerURL = '/dlo/scapi/danskespil/numbergames/jokerwednesday';\r\n\r\n // Functions:\r\n var prepareParamString = LottoUtils.prepareParamString;\r\n\r\n var getCompletedDrawDates = function (options) {\r\n var params = prepareParamString(options);\r\n\r\n return ApiRequest({\r\n url: baseURL + '/completedDrawDates' + params,\r\n localCacheTTL: 60,\r\n unwrapSuccess: function (response) {\r\n return response && response.drawDates ? response.drawDates : [];\r\n }\r\n });\r\n };\r\n\r\n var getWinningNumbersLotto = function (options) {\r\n var params = prepareParamString(options);\r\n\r\n return ApiRequest({\r\n url: baseURL + '/winningNumbers' + params,\r\n localCacheTTL: 60,\r\n unwrapSuccess: function (response) {\r\n return response;\r\n }\r\n });\r\n };\r\n\r\n var getRandomJokerNumbers = function (options) {\r\n var params = prepareParamString(options);\r\n\r\n return ApiRequest({\r\n url: baseJokerURL + '/random' + params,\r\n unwrapSuccess: function (response) {\r\n var rows = [];\r\n\r\n if (response && response.length > 0) {\r\n for (var i = 0; i < response.length; i++) {\r\n rows.push(response[i].split(''));\r\n }\r\n }\r\n\r\n return rows;\r\n }\r\n });\r\n };\r\n\r\n // Public functions:\r\n return {\r\n getCompletedDrawDates: getCompletedDrawDates,\r\n getWin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