!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SWAGAPI",[],t):"object"==typeof exports?exports.SWAGAPI=t():e.SWAGAPI=t()}(window,(function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([ /*!********************************************!*\ !*** ./node_modules/handlebars/runtime.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n(/*! ./dist/cjs/handlebars.runtime */17).default}, /*!**************************************************************!*\ !*** ./node_modules/handlebars/dist/cjs/handlebars/utils.js ***! \**************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var n=0,a=e.length;n":">",'"':""","'":"'","`":"`","=":"="},o=/[&<>"'`=]/g,i=/[&<>"'`=]/;function s(e){return r[e]}function l(e){for(var t=1;t'+e.error+"

",window.addEventListener("keypress",d,!0))}))};return i.addEventListener("click",(function(e){e.preventDefault(),p(e)}),!0),u.addEventListener("click",(function(e){e.preventDefault(),t.cleanStage(),t.renderDialog("usercreate",{})}),!0),window.addEventListener("keypress",d,!0),new Promise((function(e,t){e({})}))},renderUserCreateDialog:function(e){var t=this,n=(document.getElementById("swag-dialog"),document.getElementById("swag-dialog-content")),a=t.templates.dialogUserCreate(e);n.classList.remove("loading"),n.innerHTML=a;var r=document.getElementById("swag-logincreate-username"),o=document.getElementById("swag-logincreate-mail"),i=document.getElementById("swag-logincreate-password"),u=document.getElementById("swag-logincreate-submit"),c=document.getElementById("swag-logincreate-message");r.focus();var d=function(e){13===e.keyCode&&p()};l.wrapper.querySelectorAll('div[data-action="back"]').forEach((function(e){e.addEventListener("click",(function(e){window.removeEventListener("keypress",d,!0)}),!0)}));var p=function(e){window.removeEventListener("keypress",d,!0),u.classList.add("loading"),u.disabled=!0,c.innerHTML="",s.userCreate({username:r.value,mail:o.value,password:i.value}).then((function(e){u.classList.remove("loading"),u.disabled=!1,e&&!e.error?(t.cleanStage(),window.removeEventListener("keypress",d,!0)):e&&e.error&&(c.innerHTML='

'+e.error+"

",window.addEventListener("keypress",d,!0))}))};return u.addEventListener("click",(function(e){e.preventDefault(),p(e)}),!0),window.addEventListener("keypress",d,!0),new Promise((function(e,t){e({})}))},cleanStage:function(){r.clearAllBodyScrollLocks(),document.body.classList.remove("swag-dialog-open");var e=l.wrapper.getElementsByClassName("swag-dialog-wrapper");Array.prototype.forEach.call(e,(function(e){e.parentNode.removeChild(e)}))},populateLevelSelect:function(e){return s.getScoreCategories().then((function(t){var n=document.getElementById(e);n&&t.map((function(e){var t=document.createElement("option");t.value=e.level_key,t.innerHTML=e.name,n.appendChild(t)}))}))},populateDaySelect:function(e,t){return s.getDays(t).then((function(t){var n=document.getElementById(e);n&&t.map((function(e){var t=document.createElement("option");t.value=e,t.innerHTML=e,n.appendChild(t)}))}))},resize:function(){o.debug("resize"),o.applyBreakpointClass()},populateAchievementSelect:function(e){return s.getAchievementCategories().then((function(t){var n=document.getElementById(e);t.map((function(e){var t=document.createElement("option");t.value=e.achievement_key,t.innerHTML=e.name,n.appendChild(t)}))}))},startGame:function(){return new Promise((function(e,t){console.log("::: start game method invoked :::"),e({})}))},endGame:function(){return new Promise((function(e,t){console.log("::: end game method invoked :::"),e({})}))},showAd:function(){return new Promise((function(e,t){e({})}))},getBrandingLogo:function(){return new Promise((function(e,t){var n=new Image;n.onload=function(){e(n)},n.src=a.resourceRoot+"shockwave-logo.svg"}))},getBrandingLogoUrl:function(){return new Promise((function(e,t){e(a.resourceRoot+"shockwave-logo.svg")}))},showBrandingAnimation:function(e,t){var n=this,a=document.getElementById(e);return new Promise((function(e,r){var o=n.templates.brandingAnimation();a.insertAdjacentHTML("afterbegin",o),a.classList.add("swag-branding-active");var i=document.getElementById("swag-branding-animation-wrapper");document.getElementById("swag-branding-animation").onload=function(){window.setTimeout((function(){i.parentNode.removeChild(i),a.classList.remove("swag-branding-active"),t&&t(),e()}),4500)}}))},leaderboardComponent:function(e,t,n){return new Promise((function(e,t){e()}))},onCloseDialog:function(e){e.preventDefault(),this.cleanStage(),this.emit(this.events.UI_EVENT,a.events.DIALOG_CLOSED)}};e.exports=Object.assign(i,u)}, /*!*************************************************************!*\ !*** ./node_modules/handlebars/dist/cjs/handlebars/base.js ***! \*************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=u;var r=n(/*! ./utils */1),o=a(n(/*! ./exception */5)),i=n(/*! ./helpers */18),s=n(/*! ./decorators */26),l=a(n(/*! ./logger */28));function u(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},i.registerDefaultHelpers(this),s.registerDefaultDecorators(this)}t.VERSION="4.1.0",t.COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"},u.prototype={constructor:u,logger:l.default,log:l.default.log,registerHelper:function(e,t){if("[object Object]"===r.toString.call(e)){if(t)throw new o.default("Arg not supported with multiple helpers");r.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===r.toString.call(e))r.extend(this.partials,e);else{if(void 0===t)throw new o.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===r.toString.call(e)){if(t)throw new o.default("Arg not supported with multiple decorators");r.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var c=l.default.log;t.log=c,t.createFrame=r.createFrame,t.logger=l.default}, /*!***************************************************!*\ !*** multi ./styles/main.scss ./src/api/index.js ***! \***************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){n(/*! ./styles/main.scss */12),e.exports=n(/*! ./src/api/index.js */13) /*!**************************!*\ !*** ./styles/main.scss ***! \**************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */},function(e,t,n){}, /*!**************************!*\ !*** ./src/api/index.js ***! \**************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var a=n(/*! ../config.js */2),r=n(/*! ./ui */9),o=n(/*! ./api */47);console.log("SWAG API "+a.version),e.exports={getInstance:function(e){return console.log(e),new o(e)},showBrandingAnimation:function(e,t){return r.showBrandingAnimation(e,t)},showLeaderboard:function(e,t,n){return r.leaderboardComponent(e,t,n)}}}, /*!*****************************************************************!*\ !*** ./node_modules/body-scroll-lock/lib/bodyScrollLock.esm.js ***! \*****************************************************************/ /*! exports provided: disableBodyScroll, clearAllBodyScrollLocks, enableBodyScroll */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/api/ui.js (referenced with cjs require) */function(e,t,n){"use strict";n.r(t),n.d(t,"disableBodyScroll",(function(){return v})),n.d(t,"clearAllBodyScrollLocks",(function(){return m})),n.d(t,"enableBodyScroll",(function(){return g}));var a=!1;if("undefined"!=typeof window){var r={get passive(){a=!0}};window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}var o="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),i=[],s=!1,l=-1,u=void 0,c=void 0,d=function(e){return i.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},p=function(e){var t=e||window.event;return!!d(t.target)||t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1)},f=function(){void 0!==c&&(document.body.style.paddingRight=c,c=void 0),void 0!==u&&(document.body.style.overflow=u,u=void 0)},v=function(e,t){if(e){if(!i.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};i=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?p(e):e.stopPropagation())}(t,e)},s||(document.addEventListener("touchmove",p,a?{passive:!1}:void 0),s=!0)):function(e){if(void 0===c){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(c=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===u&&(u=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},m=function(){o?(i.forEach((function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null})),s&&(document.removeEventListener("touchmove",p,a?{passive:!1}:void 0),s=!1),l=-1):f(),i=[]},g=function(e){e?(i=i.filter((function(t){return t.targetElement!==e})),o?(e.ontouchstart=null,e.ontouchmove=null,s&&0===i.length&&(document.removeEventListener("touchmove",p,a?{passive:!1}:void 0),s=!1)):i.length||f()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")}}, /*!*******************!*\ !*** ./src/ui.js ***! \*******************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var a=n(/*! component-emitter */6);n(/*! config */2),n(/*! element-resize-event */7),n(/*! utils */4),n(/*! data */8),n(/*! session */3),e.exports=a({})}, /*!*********************************************!*\ !*** ./src/templates/api/dialog.handlebars ***! \*********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,a,r,o){var i;return'
\n
\n'+(null!=(i=e.invokePartial(n(/*! ./dialog-header.handlebars */33),t,{name:"dialog-header",data:o,indent:" ",helpers:a,partials:r,decorators:e.decorators}))?i:"")+'
\n
\n
\n'},usePartial:!0,useData:!0})}, /*!****************************************************************!*\ !*** ./node_modules/handlebars/dist/cjs/handlebars.runtime.js ***! \****************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var o=r(n(/*! ./handlebars/base */10)),i=a(n(/*! ./handlebars/safe-string */29)),s=a(n(/*! ./handlebars/exception */5)),l=r(n(/*! ./handlebars/utils */1)),u=r(n(/*! ./handlebars/runtime */30)),c=a(n(/*! ./handlebars/no-conflict */31));function d(){var e=new o.HandlebarsEnvironment;return l.extend(e,o),e.SafeString=i.default,e.Exception=s.default,e.Utils=l,e.escapeExpression=l.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var p=d();p.create=d,c.default(p),p.default=p,t.default=p,e.exports=t.default}, /*!****************************************************************!*\ !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers.js ***! \****************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){r.default(e),o.default(e),i.default(e),s.default(e),l.default(e),u.default(e),c.default(e)};var r=a(n(/*! ./helpers/block-helper-missing */19)),o=a(n(/*! ./helpers/each */20)),i=a(n(/*! ./helpers/helper-missing */21)),s=a(n(/*! ./helpers/if */22)),l=a(n(/*! ./helpers/log */23)),u=a(n(/*! ./helpers/lookup */24)),c=a(n(/*! ./helpers/with */25))}, /*!*************************************************************************************!*\ !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js ***! \*************************************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";t.__esModule=!0;var a=n(/*! ../utils */1);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,n){var r=n.inverse,o=n.fn;if(!0===t)return o(this);if(!1===t||null==t)return r(this);if(a.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):r(this);if(n.data&&n.ids){var i=a.createFrame(n.data);i.contextPath=a.appendContextPath(n.data.contextPath,n.name),n={data:i}}return o(t,n)}))},e.exports=t.default}, /*!*********************************************************************!*\ !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js ***! \*********************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.__esModule=!0;var r,o=n(/*! ../utils */1),i=(r=n(/*! ../exception */5))&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new i.default("Must pass iterator to #each");var n=t.fn,r=t.inverse,s=0,l="",u=void 0,c=void 0;function d(t,a,r){u&&(u.key=t,u.index=a,u.first=0===a,u.last=!!r,c&&(u.contextPath=c+t)),l+=n(e[t],{data:u,blockParams:o.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(u=o.createFrame(t.data)),e&&"object"===a(e))if(o.isArray(e))for(var p=e.length;s=0?t:parseInt(e,10)}return e},log:function(e){if(e=r.lookupLevel(e),"undefined"!=typeof console&&r.lookupLevel(r.level)<=e){var t=r.methodMap[e];console[t]||(t="log");for(var n=arguments.length,a=Array(n>1?n-1:0),o=1;o'+e.escapeExpression(e.lambda((o=r&&r.root)&&o.title,t))+""},3:function(e,t,n,a,r){return''},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o,i=null!=t?t:e.nullContext||{};return'
\n \n '+(null!=(o=n.if.call(i,(o=r&&r.root)&&o.title,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?o:"")+"\n "+(null!=(o=n.if.call(i,(o=(o=r&&r.root)&&o.header)&&o.backButton,{name:"if",hash:{},fn:e.program(3,r,0),inverse:e.noop,data:r}))?o:"")+"\n
\n"},useData:!0})}, /*!****************************************************!*\ !*** ./src/templates/api/dialog-scores.handlebars ***! \****************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o,i=null!=t?t:e.nullContext||{},s=n.helperMissing,l=e.escapeExpression;return' \n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return'
\n
\n
\n
\n \n \n
\n
\n
\n'},useData:!0})}, /*!**********************************************************!*\ !*** ./src/templates/api/dialog-daily-scores.handlebars ***! \**********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o=e.lambda,i=e.escapeExpression;return' \n"},3:function(e,t,n,a,r){var o,i=null!=t?t:e.nullContext||{},s=n.helperMissing,l=e.escapeExpression;return' \n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o,i=null!=t?t:e.nullContext||{};return'
\n
\n
\n
\n \n \n
\n
\n
\n'},useData:!0})}, /*!****************************************************************!*\ !*** ./src/templates/api/dialog-score-confirmation.handlebars ***! \****************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return'
Your score of '+e.escapeExpression("function"==typeof(o=null!=(o=n.value||(null!=t?t.value:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"value",hash:{},data:r}):o)+' has been submitted!
\n
Ok
\n'},useData:!0})}, /*!**************************************************!*\ !*** ./src/templates/api/data-scores.handlebars ***! \**************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){return"col5"},3:function(e,t,n,a,r){var o;return'
'+e.escapeExpression(e.lambda(null!=(o=null!=t?t.category:t)?o.metaName:o,t))+"
\n"},5:function(e,t,n,a,r){return'class="col5"'},7:function(e,t,n,a,r,o,i){var s;return null!=(s=n.each.call(null!=t?t:e.nullContext||{},null!=t?t.scores:t,{name:"each",hash:{},fn:e.program(8,r,0,o,i),inverse:e.noop,data:r}))?s:""},8:function(e,t,n,a,r,o,i){var s,l,u=null!=t?t:e.nullContext||{},c=n.helperMissing,d=e.escapeExpression;return'
\n
'+d("function"==typeof(l=null!=(l=n.position||(null!=t?t.position:t))?l:c)?l.call(u,{name:"position",hash:{},data:r}):l)+'
\n
'+d("function"==typeof(l=null!=(l=n.screen_name||(null!=t?t.screen_name:t))?l:c)?l.call(u,{name:"screen_name",hash:{},data:r}):l)+"
\n"+(null!=(s=n.if.call(u,null!=(s=null!=i[1]?i[1].category:i[1])?s.metaValue:s,{name:"if",hash:{},fn:e.program(9,r,0,o,i),inverse:e.noop,data:r}))?s:"")+'
'+d("function"==typeof(l=null!=(l=n.value||(null!=t?t.value:t))?l:c)?l.call(u,{name:"value",hash:{},data:r}):l)+'
\n
'+d("function"==typeof(l=null!=(l=n.date_created||(null!=t?t.date_created:t))?l:c)?l.call(u,{name:"date_created",hash:{},data:r}):l)+"
\n
\n"},9:function(e,t,n,a,r){var o;return'
'+e.escapeExpression("function"==typeof(o=null!=(o=n.meta||(null!=t?t.meta:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"meta",hash:{},data:r}):o)+"
\n"},11:function(e,t,n,a,r){return'
No scores for found for this period\n'},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r,o,i){var s,l=null!=t?t:e.nullContext||{};return'
\n
#
\n
Name
\n'+(null!=(s=n.if.call(l,null!=(s=null!=t?t.category:t)?s.metaValue:s,{name:"if",hash:{},fn:e.program(3,r,0,o,i),inverse:e.noop,data:r}))?s:"")+'
'+e.escapeExpression(e.lambda(null!=(s=null!=t?t.category:t)?s.value_name:s,t))+'
\n
Date
\n
\n
\n"+(null!=(s=n.if.call(l,null!=(s=null!=t?t.scores:t)?s.length:s,{name:"if",hash:{},fn:e.program(7,r,0,o,i),inverse:e.program(11,r,0,o,i),data:r}))?s:"")+"
\n"},useData:!0,useDepths:!0})}, /*!*********************************************************!*\ !*** ./src/templates/api/data-score-context.handlebars ***! \*********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o;return"
Today's best score: "+e.escapeExpression(e.lambda(null!=(o=null!=(o=null!=t?t.context:t)?o.dailyBest:o)?o.value:o,t))+"
\n"+(null!=(o=n.if.call(null!=t?t:e.nullContext||{},null!=(o=null!=(o=null!=t?t.context:t)?o.scorePosition:o)?o.value:o,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.program(4,r,0),data:r}))?o:"")},2:function(e,t,n,a,r){var o,i=e.lambda,s=e.escapeExpression;return"
You placed #"+s(i(null!=(o=null!=(o=null!=t?t.context:t)?o.scorePosition:o)?o.value:o,t))+" out of "+s(i(null!=(o=null!=(o=null!=t?t.context:t)?o.totalScores:o)?o.value:o,t))+" scores today
\n"},4:function(e,t,n,a,r){return"
Not yet placed
\n"},6:function(e,t,n,a,r){return"
No scores yet today
\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return null!=(o=n.if.call(null!=t?t:e.nullContext||{},null!=(o=null!=(o=null!=t?t.context:t)?o.totalScores:o)?o.value:o,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(6,r,0),data:r}))?o:""},useData:!0})}, /*!****************************************************************!*\ !*** ./src/templates/api/data-daily-scores-context.handlebars ***! \****************************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o;return"
Your best best score for this day: "+e.escapeExpression(e.lambda(null!=(o=null!=(o=null!=t?t.context:t)?o.dailyBest:o)?o.value:o,t))+"
\n"+(null!=(o=n.if.call(null!=t?t:e.nullContext||{},null!=(o=null!=(o=null!=t?t.context:t)?o.scorePosition:o)?o.value:o,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.program(4,r,0),data:r}))?o:"")},2:function(e,t,n,a,r){var o,i=e.lambda,s=e.escapeExpression;return"
You placed #"+s(i(null!=(o=null!=(o=null!=t?t.context:t)?o.scorePosition:o)?o.value:o,t))+" out of "+s(i(null!=(o=null!=(o=null!=t?t.context:t)?o.totalScores:o)?o.value:o,t))+" scores for this day
\n"},4:function(e,t,n,a,r){return"
Not yet placed
\n"},6:function(e,t,n,a,r){return"
No scores yet for this day
\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return null!=(o=n.if.call(null!=t?t:e.nullContext||{},null!=(o=null!=(o=null!=t?t.context:t)?o.totalScores:o)?o.value:o,{name:"if",hash:{},fn:e.program(1,r,0),inverse:e.program(6,r,0),data:r}))?o:""},useData:!0})}, /*!**********************************************************!*\ !*** ./src/templates/api/dialog-achievements.handlebars ***! \**********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return'
\n
'+e.escapeExpression(e.lambda((o=r&&r.root)&&o.title,t))+'
\n
\n
\n
\n
\n'},useData:!0})}, /*!********************************************************!*\ !*** ./src/templates/api/data-achievements.handlebars ***! \********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o,i,s=null!=t?t:e.nullContext||{},l=n.helperMissing,u=e.escapeExpression;return'
\n
\n
'+u("function"==typeof(i=null!=(i=n.name||(null!=t?t.name:t))?i:l)?i.call(s,{name:"name",hash:{},data:r}):i)+'
\n
'+u("function"==typeof(i=null!=(i=n.description||(null!=t?t.description:t))?i:l)?i.call(s,{name:"description",hash:{},data:r}):i)+"
\n
\n
\n"},2:function(e,t,n,a,r){return"achieved"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return null!=(o=n.each.call(null!=t?t:e.nullContext||{},null!=t?t.achievements:t,{name:"each",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?o:""},useData:!0})}, /*!**********************************************************!*\ !*** ./src/templates/api/dialog-weeklyscores.handlebars ***! \**********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o,i=null!=t?t:e.nullContext||{},s=n.helperMissing,l=e.escapeExpression;return' \n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return'
\n \n
\n
\n
\n
Day
\n
Score
\n
\n
\n
\n'},useData:!0})}, /*!********************************************************!*\ !*** ./src/templates/api/data-weeklyscores.handlebars ***! \********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({1:function(e,t,n,a,r){var o,i,s=null!=t?t:e.nullContext||{};return'
\n
'+e.escapeExpression("function"==typeof(i=null!=(i=n.day_name||(null!=t?t.day_name:t))?i:n.helperMissing)?i.call(s,{name:"day_name",hash:{},data:r}):i)+'
\n
'+(null!=(o=n.if.call(s,null!=t?t.value:t,{name:"if",hash:{},fn:e.program(2,r,0),inverse:e.program(4,r,0),data:r}))?o:"")+"
\n
\n"},2:function(e,t,n,a,r){var o;return e.escapeExpression("function"==typeof(o=null!=(o=n.value||(null!=t?t.value:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"value",hash:{},data:r}):o)},4:function(e,t,n,a,r){return"-"},compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){var o;return null!=(o=n.each.call(null!=t?t:e.nullContext||{},null!=t?t.weeklyscores:t,{name:"each",hash:{},fn:e.program(1,r,0),inverse:e.noop,data:r}))?o:""},useData:!0})}, /*!*********************************************************!*\ !*** ./src/templates/api/branding-animation.handlebars ***! \*********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){return'
\n \n
\n'},useData:!0})}, /*!********************************************************!*\ !*** ./src/templates/api/dialog-user-login.handlebars ***! \********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){return'
\n
\n \n \n \n
\n
\n
\n

Not a member yet?

\n \n
\n
\n'},useData:!0})}, /*!*********************************************************!*\ !*** ./src/templates/api/dialog-user-create.handlebars ***! \*********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var a=n(/*! ../../../node_modules/handlebars/runtime.js */0);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){return'
\n
\n \n \n \n \n
\n
\n
\n'},useData:!0})}, /*!************************!*\ !*** ./src/api/api.js ***! \************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var a=n(/*! component-emitter */6),r=n(/*! ../config */2),o=n(/*! element-resize-event */7),i=n(/*! ../session */3),s=n(/*! ./data */48),l=n(/*! ./ui */9),u=n(/*! ../utils */4);function c(e){var t=this,n=e.wrapper,r=e.api_key;this._options={wrapper:n,api_key:r},this._init(),a(this),l.on("UI_EVENT",(function(e){t.emit(e,{type:e})})),l.on("UI_ERROR",(function(e){t._emitError(e)})),l.on("DATA_ERROR",(function(e){t._emitError(e)})),s.on("DATA_EVENT",(function(e){t.emit("DATA_EVENT",{type:e})})),s.on("DATA_ERROR",(function(e){t._emitError(e)}))}var d={startSession:function(){var e=this;return u.debug("start session"),s.getEntity().then((function(){u.debug("session ready"),e.emit(r.events.SESSION_READY,{session_ready:!0})}))},getScoreCategories:function(){return s.getScoreCategories()},getDays:function(e){return s.getDays(e)},getScores:function(e){return s.getScores(e)},postScore:function(e,t,n){return s.postScore(e,t,n).then((function(){n&&!0===n.confirmation&&l.renderDialog("scoreconfirmation",{value:t})}))},postDailyScore:function(e,t,n){return s.postDailyScore(e,t,n)},getAchievementCategories:function(){return s.getAchievementCategories()},postAchievement:function(e){return s.postAchievement(e)},getUserAchievements:function(){return s.getUserAchievements()},postDatastore:function(e,t){return s.postDatastore(e,t)},getUserDatastore:function(){return s.getUserDatastore()},populateLevelSelect:function(e){return l.populateLevelSelect(e)},populateDaySelect:function(e,t){return l.populateDaySelect(e,t)},populateAchievementSelect:function(e){return l.populateAchievementSelect(e)},getCurrentEntity:function(){return i.entity},showDialog:function(e,t){return l.renderDialog(e,t)},isSubscriber:function(){return s.isSubscriber()},hasDailyScore:function(e){return s.hasDailyScore(e)},getCurrentDay:function(){return s.getCurrentDay()},getBrandingLogo:function(){return l.getBrandingLogo()},getBrandingLogoUrl:function(){return l.getBrandingLogoUrl()},startGame:function(){return l.startGame()},endGame:function(){return l.endGame()},showAd:function(){return l.showAd()},postExternalMessage:function(e){return s.postExternalMessage(e)},getCurrentUser:function(){return s.getCurrentUser()},userLogout:function(){return s.userLogout()},_init:function(){var e=this._getSiteMode();i.api_key=this._options.api_key,i.wrapper=this._options.wrapper,i.wrapper.classList.add("swag-wrapper"),i.theme=e,i.provider=e,i.apiRoot=r.themes[e].apiRoot,o(i.wrapper,(function(){setTimeout((function(){l.resize()}),400)}))},_getSiteMode:function(){var e=window.SWAGTHEME;return r.themes[e]?e:"shockwave"},_emitError:function(e){this.emit(this.ERROR,{type:e})},_parseUrlOptions:function(e){var t={};return-1===window.location.href.indexOf("?")?t:(decodeURIComponent(window.location.href.slice(window.location.href.indexOf("?")+1)).split("&").forEach((function(e,n){var a=e.split("=",2);t[a[0]]=a[1]})),e&&e in t?t[e]:t)}};Object.assign(c.prototype,d),e.exports=c}, /*!*************************!*\ !*** ./src/api/data.js ***! \*************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var a=n(/*! ../config */2),r=(n(/*! ../utils */4),n(/*! ../session */3)),o=n(/*! ../data */8),i={apiMethods:Object.assign(o.apiMethods,{postScore:"/v1/score",postDailyScore:"/v1/dailyscore",postAchievement:"/v1/achievement",postDatastore:"/v1/datastore"}),postScore:function(e,t,n){var a={game:r.api_key,level_key:e,value:t};n&&n.meta&&(a.meta=n.meta);var o=this.buildUrlParamString(a);return this.postAPIData({method:this.apiMethods.postScore,body:a,params:o})},postDailyScore:function(e,t,n,a){var o={game:r.api_key,day:e,level_key:t,value:n},i=this.buildUrlParamString(o);return this.postAPIData({method:this.apiMethods.postDailyScore,body:o,params:i})},postAchievement:function(e){var t={game:r.api_key,achievement_key:e},n=this.buildUrlParamString(t);return this.postAPIData({method:this.apiMethods.postAchievement,body:t,params:n})},postDatastore:function(e,t){var n={game:r.api_key,key:e,value:t},a=this.buildUrlParamString(n);return this.postAPIData({method:this.apiMethods.postDatastore,body:n,params:a})},postExternalMessage:function(e){if(e&&e.type){if(window&&window.top){var t,n=(t=e,type=t.type,o=t.data,t);window.top.postMessage(n,"*")}}else self.emit(events.DATA_ERROR,a.events.INVALID_MESSAGE)}};e.exports=Object.assign(o,i)}])}));