fansunited-sdk-umd 1.71.0 → 1.71.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FansUnitedSDK=e():t.FansUnitedSDK=e()}(self,(()=>(()=>{var t={6313:t=>{var e=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,i;try{e=Map}catch(t){e=function(){}}try{n=Set}catch(t){n=function(){}}try{i=Promise}catch(t){i=function(){}}function r(s,o,u,l,c){"object"==typeof o&&(u=o.depth,l=o.prototype,c=o.includeNonEnumerable,o=o.circular);var d=[],h=[],f="undefined"!=typeof Buffer;return void 0===o&&(o=!0),void 0===u&&(u=1/0),function s(u,p){if(null===u)return null;if(0===p)return u;var m,v;if("object"!=typeof u)return u;if(t(u,e))m=new e;else if(t(u,n))m=new n;else if(t(u,i))m=new i((function(t,e){u.then((function(e){t(s(e,p-1))}),(function(t){e(s(t,p-1))}))}));else if(r.__isArray(u))m=[];else if(r.__isRegExp(u))m=new RegExp(u.source,a(u)),u.lastIndex&&(m.lastIndex=u.lastIndex);else if(r.__isDate(u))m=new Date(u.getTime());else{if(f&&Buffer.isBuffer(u))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(m),m;t(u,Error)?m=Object.create(u):void 0===l?(v=Object.getPrototypeOf(u),m=Object.create(v)):(m=Object.create(l),v=l)}if(o){var _=d.indexOf(u);if(-1!=_)return h[_];d.push(u),h.push(m)}for(var y in t(u,e)&&u.forEach((function(t,e){var n=s(e,p-1),i=s(t,p-1);m.set(n,i)})),t(u,n)&&u.forEach((function(t){var e=s(t,p-1);m.add(e)})),u){var g;v&&(g=Object.getOwnPropertyDescriptor(v,y)),g&&null==g.set||(m[y]=s(u[y],p-1))}if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(u);for(y=0;y<b.length;y++){var w=b[y];(!(E=Object.getOwnPropertyDescriptor(u,w))||E.enumerable||c)&&(m[w]=s(u[w],p-1),E.enumerable||Object.defineProperty(m,w,{enumerable:!1}))}}if(c){var I=Object.getOwnPropertyNames(u);for(y=0;y<I.length;y++){var E,M=I[y];(E=Object.getOwnPropertyDescriptor(u,M))&&E.enumerable||(m[M]=s(u[M],p-1),Object.defineProperty(m,M,{enumerable:!1}))}}return m}(s,u)}function s(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return r.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},r.__objToStr=s,r.__isDate=function(t){return"object"==typeof t&&"[object Date]"===s(t)},r.__isArray=function(t){return"object"==typeof t&&"[object Array]"===s(t)},r.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===s(t)},r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)},7187:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,i){function r(n){t.removeListener(e,s),i(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}m(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&m(t,"error",e,{once:!0})}(t,r)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,n,i){var r,s,a,l;if(o(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),void 0===a)a=s[e]=n,++t._eventsCount;else if("function"==typeof a?a=s[e]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=u(t))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,l=c,console&&console.warn&&console.warn(l)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=c.bind(i);return r.listener=n,i.wrapFn=r,r}function h(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(r):p(r,r.length)}function f(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function m(t,e,n,i){if("function"==typeof t.on)i.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(s){i.once&&t.removeEventListener(e,r),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=s[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var l=u.length,c=p(u,l);for(n=0;n<l;++n)i(c[n],this,e)}return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return o(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return o(e),this.prependListener(t,d(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,i,r,s,a;if(o(e),void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,r),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var r,s=Object.keys(n);for(i=0;i<s.length;++i)"removeListener"!==(r=s[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return h(this,t,!0)},s.prototype.rawListeners=function(t){return h(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},6245:(t,e,n)=>{"use strict";function i(t){this.message=t}n.r(e),n.d(e,{InvalidTokenError:()=>a,default:()=>o}),i.prototype=new Error,i.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new i("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,a=0,o="";r=e.charAt(a++);~r&&(n=s%4?64*n+r:r,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function s(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(r(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return r(e)}}function a(t){this.message=t}a.prototype=new Error,a.prototype.name="InvalidTokenError";const o=function(t,e){if("string"!=typeof t)throw new a("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(s(t.split(".")[n]))}catch(t){throw new a("Invalid token specified: "+t.message)}}},321:function(t,e,n){(function(){(t.exports=n(5282)).version="5.1.2"}).call(this)},5282:function(t,e,n){(function(){var e,i,r=[].splice,s=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},a=[].indexOf;i=n(6313),e=n(7187).EventEmitter,t.exports=function(){class t extends e{constructor(t={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=t,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach((t=>{var e;e=this[t],this[t]=function(...t){var n,i;if(i=t,[...t]=i,[n]=r.call(t,-1),"function"!=typeof n)return e(...t,n);try{n(null,e(...t))}catch(t){n(t)}}}))),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(e){var n;if(s(this,t),null!=(n=this._isInvalidKey(e)))throw n;return null!=this.data[e]&&this._check(e,this.data[e])?(this.stats.hits++,this._unwrap(this.data[e])):void this.stats.misses++}mget(e){var n,i,r,a,o;if(s(this,t),!Array.isArray(e))throw this._error("EKEYSTYPE");for(o={},i=0,a=e.length;i<a;i++){if(r=e[i],null!=(n=this._isInvalidKey(r)))throw n;null!=this.data[r]&&this._check(r,this.data[r])?(this.stats.hits++,o[r]=this._unwrap(this.data[r])):this.stats.misses++}return o}set(e,n,i){var r,a;if(s(this,t),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw this._error("ECACHEFULL");if(this.options.forceString,null==i&&(i=this.options.stdTTL),null!=(r=this._isInvalidKey(e)))throw r;return a=!1,this.data[e]&&(a=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[e],!1))),this.data[e]=this._wrap(n,i),this.stats.vsize+=this._getValLength(n),a||(this.stats.ksize+=this._getKeyLength(e),this.stats.keys++),this.emit("set",e,n),!0}mset(e){var n,i,r,a,o,u,l,c,d;if(s(this,t),this.options.maxKeys>-1&&this.stats.keys+e.length>=this.options.maxKeys)throw this._error("ECACHEFULL");for(i=0,u=e.length;i<u;i++){if(o=e[i],({key:a,val:d,ttl:c}=o),c&&"number"!=typeof c)throw this._error("ETTLTYPE");if(null!=(n=this._isInvalidKey(a)))throw n}for(r=0,l=e.length;r<l;r++)o=e[r],({key:a,val:d,ttl:c}=o),this.set(a,d,c);return!0}del(e){var n,i,r,a,o,u;for(s(this,t),Array.isArray(e)||(e=[e]),n=0,r=0,o=e.length;r<o;r++){if(a=e[r],null!=(i=this._isInvalidKey(a)))throw i;null!=this.data[a]&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[a],!1)),this.stats.ksize-=this._getKeyLength(a),this.stats.keys--,n++,u=this.data[a],delete this.data[a],this.emit("del",a,u.v))}return n}take(e){var n;return s(this,t),null!=(n=this.get(e))&&this.del(e),n}ttl(e,n){var i;if(s(this,t),n||(n=this.options.stdTTL),!e)return!1;if(null!=(i=this._isInvalidKey(e)))throw i;return!(null==this.data[e]||!this._check(e,this.data[e])||(n>=0?this.data[e]=this._wrap(this.data[e].v,n,!1):this.del(e),0))}getTtl(e){var n;if(s(this,t),e){if(null!=(n=this._isInvalidKey(e)))throw n;return null!=this.data[e]&&this._check(e,this.data[e])?this.data[e].t:void 0}}keys(){return s(this,t),Object.keys(this.data)}has(e){return s(this,t),null!=this.data[e]&&this._check(e,this.data[e])}getStats(){return s(this,t),this.stats}flushAll(e=!0){s(this,t),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(e),this.emit("flush")}flushStats(){s(this,t),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){s(this,t),this._killCheckPeriod()}_checkData(e=!0){var n,i,r;for(n in s(this,t),i=this.data)r=i[n],this._check(n,r);e&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,1e3*this.options.checkperiod,e),null!=this.checkTimeout&&null!=this.checkTimeout.unref&&this.checkTimeout.unref())}_killCheckPeriod(){if(null!=this.checkTimeout)return clearTimeout(this.checkTimeout)}_check(e,n){var i;return s(this,t),i=!0,0!==n.t&&n.t<Date.now()&&(this.options.deleteOnExpire&&(i=!1,this.del(e)),this.emit("expired",e,this._unwrap(n))),i}_isInvalidKey(e){var n;if(s(this,t),n=typeof e,a.call(this.validKeyTypes,n)<0)return this._error("EKEYTYPE",{type:typeof e})}_wrap(e,n,r=!0){var a;return s(this,t),this.options.useClones||(r=!1),a=Date.now(),{t:0===n?0:n?a+1e3*n:0===this.options.stdTTL?this.options.stdTTL:a+1e3*this.options.stdTTL,v:r?i(e):e}}_unwrap(t,e=!0){return this.options.useClones||(e=!1),null!=t.v?e?i(t.v):t.v:null}_getKeyLength(t){return t.toString().length}_getValLength(e){return s(this,t),"string"==typeof e?e.length:this.options.forceString?JSON.stringify(e).length:Array.isArray(e)?this.options.arrayValueSize*e.length:"number"==typeof e?8:"function"==typeof(null!=e?e.then:void 0)?this.options.promiseValueSize:("undefined"!=typeof Buffer&&null!==Buffer?Buffer.isBuffer(e):void 0)?e.length:null!=e&&"object"==typeof e?this.options.objectValueSize*Object.keys(e).length:"boolean"==typeof e?8:0}_error(e,n={}){var i;return s(this,t),(i=new Error).name=e,i.errorcode=e,i.message=null!=this.ERRORS[e]?this.ERRORS[e](n):"-",i.data=n,i}_initErrors(){var e,n,i;for(n in s(this,t),this.ERRORS={},i=this._ERRORS)e=i[n],this.ERRORS[n]=this.createErrorMessage(e)}createErrorMessage(t){return function(e){return t.replace("__key",e.type)}}}return t.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},t}.call(this)}).call(this)},6595:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(682),s=n(2141),a=i(n(4241)),o=i(n(6391)),u=i(n(1512)),l=i(n(4392)),c=i(n(320)),d=i(n(7631)),h=i(n(6965)),f=i(n(9158));e.default=function(){var t=this;this.validate=function(e){var n=t.checkFieldsForValues(e);return n.isValid=t.containsErrorMessage(n),n},this.checkFieldsForValues=function(t){for(var e=new d.default,n={apiKey:new u.default,environment:new o.default,idSchema:new l.default,clientId:new h.default,lang:new a.default,errorHandlingMode:new f.default,authProvider:new c.default},i=0,r=Object.entries(e);i<r.length;i++){var s=r[i],p=s[0];s[1],"isValid"!==p&&n[p].validate(t)}return Object.keys(n).forEach((function(i){e[i]=n[i].validate(t)})),e},this.containsErrorMessage=function(t){for(var e=!0,n=0,i=Object.entries(t);n<i.length;n++){var a=i[n],o=a[0],u=a[1];if(o!==r.ConfigFieldEnum.authProvider){if("isValid"!==o&&u.message.type===s.LogEnum.ERROR)return!1;if("isValid"!==o&&u.message.type===s.LogEnum.WARNING)return!0}else if(u.message.type===s.LogEnum.ERROR)return!1}return e}}},682:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigFieldEnum=void 0,(n=e.ConfigFieldEnum||(e.ConfigFieldEnum={})).apiKey="apiKey",n.environment="environment",n.idSchema="idSchema",n.clientId="clientId",n.lang="lang",n.authProvider="authProvider"},2671:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.EnvironmentEnum=void 0,(n=e.EnvironmentEnum||(e.EnvironmentEnum={})).DEV="dev",n.PROD="prod",n.STAGING="staging",n.WATG="watg"},9580:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorHandlingModeEnum=void 0,(n=e.ErrorHandlingModeEnum||(e.ErrorHandlingModeEnum={})).DEFAULT="default",n.STANDARD="standard"},4946:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.IdSchemaEnum=void 0,(n=e.IdSchemaEnum||(e.IdSchemaEnum={})).NATIVE="native",n.ENETPULSE="enetpulse",n.SPORTRADAR="sportradar",n.SPORTAL_365="sportal365",n.API_FOOTBALL="api_football"},9377:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LangEnum=void 0,(n=e.LangEnum||(e.LangEnum={})).EN="en",n.BG="bg",n.RO="ro",n.EL="el",n.SK="sk",n.PT="pt",n.SR="sr",n.HU="hu",n.SV="sv",n.ES="es",n.FR="fr",n.NL="nl",n.DE="de",n.IT="it"},2141:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LogEnum=void 0,(n=e.LogEnum||(e.LogEnum={})).ERROR="error",n.WARNING="warning"},9028:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationMessageEnum=void 0,(n=e.ValidationMessageEnum||(e.ValidationMessageEnum={})).API_KEY="The field apiKey with valid value must be provided to use Fans United JS SDK",n.CLIENT_ID="The field clientId must be provided to use Fans United JS SDK",n.LANG_MISSING="If no lang is passed the default one will be set which is: en",n.LANG_INVALID="This lang value is not supported, the default one will be set which is: en",n.ID_SCHEMA_MISSING="If no idSchema is passed the default one will be set which is: native",n.ID_SCHEMA_INVALID="This idSchema value is not supported, the default one will be set which is: native",n.ENVIRONMENT_MISSING="If no environment is passed the default one will be set which is: prod",n.ENVIRONMENT_INVALID="This environment value is not supported, the default one will be set which is: prod",n.ERROR_HANDLING_MODE_MISSING="If no errorHandlingMode is passed the default one will be set which is: default",n.ERROR_HANDLING_MODE_INVALID="This errorHandlingMode value is not supported, the default one will be set which is: default",n.AUTH_PROVIDER_CONFIG_PROP_MISSING="The following property is missing from the authProvider object:",n.AUTH_PROVIDER_CONFIG_INVALID_PROP="You have passed a property which is not supported for the authentication provider:",n.AUTH_PROVIDER_CONFIG_MISSING="The field authProvider must be provided to use this SDK",n.AUTH_PROVIDER_CONFIG_MISSING_CONFIG="The field authProvider has missing properties"},9627:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationResponseEnum=void 0,(n=e.ValidationResponseEnum||(e.ValidationResponseEnum={})).MISSING_VALUE="missing",n.INVALID_VALUE="invalid",n.VALID_VALUE="valid"},7070:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.getIdToken=null,this.logout=null}},2379:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3220));e.default=function(){this.validation=null,this.message=new r.default,this.getIdToken={validation:null,message:new r.default},this.logout={validation:null,message:new r.default}}},7631:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3074));e.default=function(){this.apiKey=null,this.environment=null,this.idSchema=null,this.clientId=null,this.lang=null,this.errorHandlingMode=null,this.authProvider={getIdToken:new r.default,logout:new r.default},this.isValid=!1}},3220:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.text=null,this.type=null}},3074:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},1512:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=function(){function t(){this.validateField=function(t){return null!=t&&t.length>0?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.ERROR;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.API_KEY),t===i.ValidationResponseEnum.VALID_VALUE&&(n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.apiKey);return{validation:e,message:this.generateMessage(e)}},t}();e.default=a},320:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(9627),s=n(9028),a=n(2141),o=i(n(7070)),u=i(n(2379)),l=function(){function t(){this.validateAuthProvider=function(t){var e=Object.keys(new o.default),n=new u.default;if(t){var i=Object.keys(t).filter((function(t){return!e.includes(t)}));i.length>0?(n.validation=r.ValidationResponseEnum.INVALID_VALUE,n.message.type=a.LogEnum.WARNING,n.message.text="".concat(s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_INVALID_PROP," ").concat(i.join(","))):n.validation=r.ValidationResponseEnum.VALID_VALUE}else n.validation=r.ValidationResponseEnum.MISSING_VALUE,n.message.type=a.LogEnum.ERROR,n.message.text=s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING;return n},this.validateAuthProviderConfigFields=function(t,e){return Object.keys(new o.default).forEach((function(n){t[n]?e[n].validation=r.ValidationResponseEnum.VALID_VALUE:e[n].validation=r.ValidationResponseEnum.MISSING_VALUE})),e},this.generateAuthProviderConfigMessages=function(t){return Object.keys(t).filter((function(t){return"validation"!==t&&"message"!==t})).forEach((function(e){var n=t[e];n.validation===r.ValidationResponseEnum.MISSING_VALUE&&(n.message.text="".concat(s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_PROP_MISSING," ").concat(e),n.message.type=a.LogEnum.ERROR)})),t},this.checkAuthProviderConfigMessagesForErrors=function(t){return Object.keys(t).filter((function(t){return"validation"!==t&&"message"!==t})).forEach((function(e){t[e].validation===r.ValidationResponseEnum.MISSING_VALUE&&t.validation===r.ValidationResponseEnum.VALID_VALUE&&(t.validation=r.ValidationResponseEnum.INVALID_VALUE,t.message.type=a.LogEnum.ERROR,t.message.text=s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING_CONFIG)})),t}}return t.prototype.validate=function(t){var e=this.validateAuthProvider(t.authProvider);return e.validation!==r.ValidationResponseEnum.MISSING_VALUE&&(e=this.validateAuthProviderConfigFields(t.authProvider,e),e=this.generateAuthProviderConfigMessages(e),e=this.checkAuthProviderConfigMessagesForErrors(e)),e},t}();e.default=l},6965:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=function(){function t(){this.validateField=function(t){return null!=t&&t.length>0?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.ERROR;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.CLIENT_ID),t===i.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.clientId);return{validation:e,message:this.generateMessage(e)}},t}();e.default=a},6391:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=n(2671),o=function(){function t(){this.validateField=function(t){var e=[a.EnvironmentEnum.DEV,a.EnvironmentEnum.STAGING,a.EnvironmentEnum.PROD,a.EnvironmentEnum.WATG];return null!=t&&t.length>0?e.includes(t)?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.INVALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.WARNING;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.ENVIRONMENT_MISSING),t===i.ValidationResponseEnum.INVALID_VALUE&&(e=r.ValidationMessageEnum.ENVIRONMENT_INVALID),t===i.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.environment);return{validation:e,message:this.generateMessage(e)}},t}();e.default=o},9158:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9580),r=n(2141),s=n(9028),a=n(9627);e.default=function(){var t=this;this.validate=function(e){var n=t.validateField(e.errorHandlingMode);return{validation:n,message:t.generateMessage(n)}},this.validateField=function(t){var e=[i.ErrorHandlingModeEnum.DEFAULT,i.ErrorHandlingModeEnum.STANDARD];return t?e.includes(t)?a.ValidationResponseEnum.VALID_VALUE:a.ValidationResponseEnum.INVALID_VALUE:a.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=r.LogEnum.WARNING;return t===a.ValidationResponseEnum.MISSING_VALUE&&(e=s.ValidationMessageEnum.ERROR_HANDLING_MODE_MISSING),t===a.ValidationResponseEnum.INVALID_VALUE&&(e=s.ValidationMessageEnum.ERROR_HANDLING_MODE_INVALID),t===a.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}},4392:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=n(4946),o=function(){function t(){this.validateField=function(t){var e=Object.values(a.IdSchemaEnum);return null!=t&&t.length>0?e.includes(t)?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.INVALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.WARNING;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.ID_SCHEMA_MISSING),t===i.ValidationResponseEnum.INVALID_VALUE&&(e=r.ValidationMessageEnum.ID_SCHEMA_INVALID),t===i.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.idSchema);return{validation:e,message:this.generateMessage(e)}},t}();e.default=o},4241:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9377),r=n(9627),s=n(9028),a=n(2141);e.default=function(){var t=this;this.validate=function(e){var n=t.validateField(e.lang);return{validation:n,message:t.generateMessage(n)}},this.validateField=function(t){var e=Object.values(i.LangEnum);return null!=t&&t.length>0?e.includes(t)?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.INVALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=a.LogEnum.WARNING;return t===r.ValidationResponseEnum.MISSING_VALUE&&(e=s.ValidationMessageEnum.LANG_MISSING),t===r.ValidationResponseEnum.INVALID_VALUE&&(e=s.ValidationMessageEnum.LANG_INVALID),t===r.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}},4021:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorCodes=void 0,(n=e.ErrorCodes||(e.ErrorCodes={}))[n.BAD_METHOD_CALL=400]="BAD_METHOD_CALL",n[n.UNAUTHORIZED=401]="UNAUTHORIZED",n[n.NOT_FOUND=404]="NOT_FOUND"},4904:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorStatuses=void 0,(n=e.ErrorStatuses||(e.ErrorStatuses={})).INVALID_TEMPLATE="INVALID_TEMPLATE",n.INVALID_PREDICTION="INVALID_PREDICTION",n.INVALID_MARKET="INVALID_MARKET",n.INVALID_FIELD="INVALID_FIELD",n.INVALID_TYPE="INVALID_TYPE",n.EXCEEDED_LENGTH="EXCEEDED_LENGTH",n.INVALID_TOKEN="invalid_token",n.UNAUTHORIZED="unauthorized",n.INVALID_FILTERS="invalid_filters",n.INVALID_AVATAR="invalid_avatar",n.INVALID_METHOD_CALL="invalid_method_call",n.INVALID_LIMIT="invalid_limit",n.INVALID_TEMPLATE_GROUP_ID="invalid_template_group_id",n.INVALID_TEMPLATE_GROUP_FILTERS="invalid_template_group_filters",n.INVALID_PAGE_NUMBER="invalid_page_number",n.INVALID_DISCUSSION_IDS="invalid_discussion_ids",n.ID_MAPPING_NOT_FOUND="id_mapping_not_found"},8097:function(t,e){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,i){var r=t.call(this)||this;return r.code=0,r.status=null,r.message=null,r.errorMessage=function(){return r.message},r.code=e,r.status=n,r.message=i,r}return i(e,t),e}(Error);e.default=r},8712:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){var n=this;this.data={error:{code:0,status:"",message:""}},this.status=0,this.statusText="",this.headers=null,this.errorMessage=function(){return n.data.error.message},this.data.error.code=e.code,this.data.error.status=e.status,this.data.error.message=e.message,this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}},2535:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,n){this.error={code:0,status:"",message:""},this.error.code=t,this.error.status=e,this.error.message=n}},1260:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.marketToKeySummaryMap=e.validFixtureFields=e.documentationLinks=e.ID_TYPES=void 0,e.ID_TYPES={native:"id",sportradar:"sportradar_id",sportal365:"sportal365_id",enetpulse:"enetpulse_id",api_football:"api_football_id"},e.documentationLinks={PREDICTOR_USER_RELATED_OPERATION:"https://docs.fansunitedmedia.com/docs/predictor-operations#user-related-operations"},e.validFixtureFields=["matchId","matchType","market","prediction"],e.marketToKeySummaryMap=(new Map).set("FT_1X2","fullTimeOneXTwo").set("HT_1X2","halfTimeOneXTwo").set("BOTH_TEAMS_SCORE","bothTeamsScore").set("DOUBLE_CHANCE","doubleChance").set("HT_FT","halfTimeFullTime").set("PLAYER_SCORE","playerScore").set("PLAYER_YELLOW_CARD","playerYellowCard").set("PLAYER_RED_CARD","playerRedCard").set("RED_CARD_MATCH","redCardMatch").set("PENALTY_MATCH","penaltyMatch").set("PLAYER_SCORE_FIRST_GOAL","playerScoreFirstGoal").set("CORNERS_MATCH","cornersMatch").set("CORRECT_SCORE","correctScore").set("CORRECT_SCORE_ADVANCED","correctScoreAdvanced").set("CORRECT_SCORE_HT","correctScoreHalfTime").set("PLAYER_SCORE_HATTRICK","playerScoreHattrick").set("PLAYER_SCORE_TWICE","playerScoreTwice").set("OVER_GOALS_0_5","overZeroPointFiveGoals").set("OVER_GOALS_1_5","overOnePointFiveGoals").set("OVER_GOALS_2_5","overTwoPointFiveGoals").set("OVER_GOALS_3_5","overThreePointFiveGoals").set("OVER_GOALS_4_5","overFourPointFiveGoals").set("OVER_GOALS_5_5","overFivePointFiveGoals").set("OVER_GOALS_6_5","overSixPointFiveGoals").set("OVER_CORNERS_6_5","overSixPointFiveCorners").set("OVER_CORNERS_7_5","overSevenPointFiveCorners").set("OVER_CORNERS_8_5","overEightPointFiveCorners").set("OVER_CORNERS_9_5","overNinePointFiveCorners").set("OVER_CORNERS_10_5","overTenPointFiveCorners").set("OVER_CORNERS_11_5","overElevenPointFiveCorners").set("OVER_CORNERS_12_5","overTwelvePointFiveCorners").set("OVER_CORNERS_13_5","overThirteenPointFiveCorners")},817:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.EntityTypeEnum=void 0,(n=e.EntityTypeEnum||(e.EntityTypeEnum={})).COMPETITION="competition",n.TEAM="team",n.PLAYER="player"},5409:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SportSourceEnum=void 0,(n=e.SportSourceEnum||(e.SportSourceEnum={})).FOOTBALL="FOOTBALL",n.CUSTOM="CUSTOM"},8358:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5601)),s=i(n(9018));e.default=function(){this.createLocalCacheInstance=function(t){return"undefined"==typeof window?s.default.getInstance(t):r.default.getInstance(t)}}},712:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.constructStringArrayWithProvidedLength=e.sortArrayInAscOrder=e.initDisableCache=e.isDisabledCache=e.transformIdsToBeUnique=e.setBaseUrl=e.limitIds=e.requestChunkBuild=void 0;var i=n(2671);e.requestChunkBuild=function(t){var e=[],n=0;return e[n]=[],t.forEach((function(t){e[n].length<=199?e[n].push(t):(n++,e[n]=[t])})),e},e.limitIds=function(t,e){for(var n=[];t.length>e;){var i=t.splice(0,e);n.push(i)}return n.push(t),n},e.setBaseUrl=function(t,e){return t===i.EnvironmentEnum.PROD?{profile:"https://profile.fansunitedapi.com/v1",football:"https://football.fansunitedapi.com/v1",idMapping:"https://id-mapping.fansunitedapi.com/v1",predictor:"https://prediction.fansunitedapi.com/v1",client:"https://client.fansunitedapi.com/v1",loyalty:"https://loyalty.fansunitedapi.com/v1",miniGames:"https://mini-games.fansunitedapi.com/v1",discussions:"https://discussions.fansunitedapi.com/v1",privateLeagues:"https://private-leagues.fansunitedapi.com/v1",voting:"https://voting.fansunitedapi.com/v1"}[e]:t===i.EnvironmentEnum.DEV?{profile:"http://localhost:8010/v1",football:"http://localhost:8080/v1",idMapping:"http://localhost:8030/v1",predictor:"http://localhost:8040/v1",client:"http://localhost:8070/v1",loyalty:"http://localhost:8060/v1",miniGames:"http://localhost:9040/v1",discussions:"http://localhost:9020/v1",privateLeagues:"http://localhost:9010/v1",voting:"http://localhost:9030/v1"}[e]:t===i.EnvironmentEnum.WATG?{profile:"https://profile.watg.fansunitedapi.com/v1",football:"https://football.watg.fansunitedapi.com/v1",idMapping:"https://id-mapping.watg.fansunitedapi.com/v1",predictor:"https://prediction.watg.fansunitedapi.com/v1",client:"https://client.watg.fansunitedapi.com/v1",loyalty:"https://loyalty.watg.fansunitedapi.com/v1",miniGames:"https://mini-games.watg.fansunitedapi.com/v1",discussions:"https://discussions.watg.fansunitedapi.com/v1",privateLeagues:"https://private-leagues.watg.fansunitedapi.com/v1",voting:"https://voting.watg.fansunitedapi.com/v1"}[e]:{profile:"https://profile.fansunitedstagingapi.com/v1",football:"https://football.fansunitedstagingapi.com/v1",idMapping:"https://id-mapping.fansunitedstagingapi.com/v1",predictor:"https://prediction.fansunitedstagingapi.com/v1",client:"https://client.fansunitedstagingapi.com/v1",loyalty:"https://loyalty.fansunitedstagingapi.com/v1",miniGames:"https://mini-games.fansunitedstagingapi.com/v1",discussions:"https://discussions.fansunitedstagingapi.com/v1",privateLeagues:"https://private-leagues.fansunitedstagingapi.com/v1",voting:"https://voting.fansunitedstagingapi.com/v1"}[e]},e.transformIdsToBeUnique=function(t){return Array.from(new Set(t))},e.isDisabledCache=function(t){return t||!1},e.initDisableCache=function(){return"&disable_cache=".concat(Date.now())},e.sortArrayInAscOrder=function(t){return JSON.parse(JSON.stringify(t.sort((function(t,e){return t.localeCompare(e)}))))},e.constructStringArrayWithProvidedLength=function(t,e){for(var n=[],i=0;i<e;i++)n[i]=t;return n}},5601:function(t,e,n){"use strict";var i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1260),s="FansUnited",a={football:{ids:[],countries:[],competitions:[],expirations:{ids:0}},profile:{info:{},statistics:{},badges:null,countries:[],expirations:{profile:0,statistics:0,badges:0}},client:{features:{},expirations:{features:0}}},o=function(){function t(t){var e=this;this.idSchema="",this.expirationProfileTimeout=600,this.expirationBadgesTimeout=3600,this.expirationClientFeaturesTimeout=14400,this.expirationFootballIdsTimeout=604800,this.clearData=function(){e.setData(a)},this.getEntityById=function(t,n){return void 0===t&&(t=""),void 0===n&&(n=""),e.getData().football.ids.find((function(i){var s=r.ID_TYPES[e.idSchema];return i&&"".concat(i[s])===n&&i.resource===t}))},this.getEntity=function(t,n,i){return Array.isArray(t)?e.getData().football.ids.filter((function(e){var s=r.ID_TYPES[i];return e&&t.includes("".concat(e[s]))&&e.resource===n})):e.getData().football.ids.find((function(e){var s=r.ID_TYPES[i];return e&&"".concat(e[s])===t&&e.resource===n}))},this.getEntityByNativeId=function(t,n){return void 0===t&&(t=""),void 0===n&&(n=""),e.getData().football.ids.find((function(e){return e&&"".concat(e.id)===n&&e.resource===t}))},this.checkForExistingIdObjs=function(t,n){var i=r.ID_TYPES[n],s={};return Object.keys(t).forEach((function(r){var a=t[r],o=e.getEntity(a,r,n).map((function(t){return t[i]})),u=t[r].filter((function(t){return!o.includes(t)}));s[r]=a.map((function(t){return u.includes(t)?{id:t,exists:!1}:{id:t,exists:!0}}))})),s},this.getIdsByType=function(t,n,i){var s=r.ID_TYPES[i],a=r.ID_TYPES[n],o={};return Object.keys(t).forEach((function(n){var i=t[n],r=[];e.getData().football.ids.forEach((function(t){i.forEach((function(e,i){e===t[a]&&n===t.resource&&(r[i]=t[s])}))})),o[n]=r})),o},this.addIdMapping=function(t){var n=e.getData();n.football.ids.push(t),e.setData(n)},this.addIdMappings=function(t){var n=e.getData(),r=n.football.ids;r=i(i([],r,!0),t,!0),n.football.ids=r,e.setData(n)},this.addTopIdMappings=function(t){var n=e.getData();if(n.football.ids.length){var r=JSON.parse(JSON.stringify(n.football.ids));r=r.filter((function(t){return"match"!==t.resource})),t=t.filter((function(t){return"match"===t.resource})),r=i(i([],r,!0),t,!0),n.football.ids=r}else n.football.ids=t;n.football.expirations.ids=Math.floor(Date.now()/1e3)+e.expirationFootballIdsTimeout,e.setData(n)},this.setOwnProfile=function(t){var n=e.getData();n.profile.info=t,n.profile.expirations.profile=Math.floor(Date.now()/1e3)+e.expirationProfileTimeout,e.setData(n)},this.getOwnProfile=function(){return e.getData().profile.info},this.getProfileCountries=function(){return e.getData().profile.countries},this.setProfileCountries=function(t){var n=e.getData();n.profile.countries=t,e.setData(n)},this.getProfileStats=function(){return e.getData().profile.statistics},this.setProfileStats=function(t){var n=e.getData();n.profile.statistics=t,n.profile.expirations.statistics=Math.floor(Date.now()/1e3)+e.expirationProfileTimeout,e.setData(n)},this.getProfileBadges=function(){return e.getData().profile.badges},this.setProfileBadges=function(t){var n=e.getData();n.profile.badges=t,n.profile.expirations.badges=Math.floor(Date.now()/1e3)+e.expirationBadgesTimeout,e.setData(n)},this.getFootballCountries=function(){return e.getData().football.countries},this.setFootballCountries=function(t){var n=e.getData();n.football.countries=t,e.setData(n)},this.getCompetitions=function(t){var n=e.getData();return t?t.competitionSearchFilter(n.football.competitions):n.football.competitions},this.setCompetitions=function(t){var n=e.getData(),r=i([],n.football.competitions,!0);r.push.apply(r,t),n.football.competitions=e.makeCompetitionsUnique(r),e.setData(n)},this.getCompetitionsLength=function(){return e.getData().football.competitions.length},this.getClientFeatures=function(){return e.getData().client.features},this.setClientFeatures=function(t){var n=e.getData(),i=JSON.parse(JSON.stringify(t));n.client.expirations.features=Math.floor(Date.now()/1e3)+e.expirationClientFeaturesTimeout,n.client.features=i,e.setData(n)},this.deleteClientFeatures=function(){var t=e.getData(),n=JSON.parse(JSON.stringify(t));n.client={features:{},expirations:{features:0}},e.setData(n)},this.getExpiration=function(t,n){e.initialNewSchema(t,"expirations");var i=e.getData();switch(n){case"profile":return i.profile.expirations.profile;case"statistics":return i.profile.expirations.statistics;case"badges":return i.profile.expirations.badges;case"features":return i.client.expirations.features;case"ids":return i.football.expirations.ids}},this.makeCompetitionsUnique=function(t){var e=new Set;return t.filter((function(t){var n=!e.has(t.id);return e.add(t.id),n}))},this.getData=function(){return localStorage.getItem(s)||e.setData(a),JSON.parse(localStorage.getItem(s))},this.setData=function(t){localStorage.setItem(s,JSON.stringify(t))},this.initialNewSchema=function(t,n){var i=e.getData();i&&i[t]&&i[t][n]||e.setData(a)},this.idSchema=t}return t.getInstance=function(e){return t.instance||(t.instance=new t(e)),t.instance},t}();e.default=o},5318:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.invalidTypeMessage=e.missingFieldsMessage=e.invalidFieldMessage=e.invalidMarketTopXMessage=e.invalidMarketMessage=e.invalidPredictionMessage=e.WarningMessages=e.ErrorMessages=void 0;var i,r=n(1260);(i=e.ErrorMessages||(e.ErrorMessages={})).INVALID_MATCH_ID="Match id is invalid!",i.INVALID_PLAYER_ID="Player id is invalid!",i.QUERY_PARAM_MATCH_IDS_EXCEEDED="Maximum matchIds in PredictionFilters should be 10 or less.",i.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED="Maximum limit for filtering games is 50 or less.",i.INVALID_PREDICTION_FIELD="Prediction field is invalid. For more information please visit our documentation",i.INVALID_TOKEN="Invalid JWT token is provided",i.EXPIRED_TOKEN="The provided JWT token is expired",i.ENTITIES_NEEDED="At least one of footballCompetitions, footballTeams or footballPlayers properties should be provided for filters.",i.ENTITIES_FOLLOWS_FILTERS_EXCEEDED="Maximum length per entity should be 24 or less.",i.INVALID_TYPE="You have provided invalid type. The valid type is ",i.INVALID_VALUE="You have provided invalid value. The valid value is ",i.INVALID_AVATAR="Invalid URL syntax for avatar image.",i.INVALID_GET_PROFILES_METHOD_CALL="The method 'getByIds' from Profile namespace is not called correctly. You need to provide 'profileIds' OR 'search' parameters to the method, but you can't use both of them or neither of them.",i.INVALID_LIMIT="Invalid limit filter. The maximum limit is 20",i.FILTER_COMBINATION_ERROR="You need to use both 'entityIds' and 'entityType' filters together",i.INVALID_ENTITY_TYPE="Invalid 'entityType' filter. Please use one of the following valid options: competition, team, or player",i.INVALID_TEMPLATE_GROUP_ID="There is no group in this template with the provided groupId",i.INVALID_TEMPLATE_GROUP_FILTERS="The provided template group has no filters",i.INVALID_PAGE_NUMBER="Invalid page number provided. Use number between 1 and max number of pages.",i.INVALID_DISCUSSION_IDS="Invalid discussion ids argument. Please provide at least one discussion id in an array",i.ID_MAPPING_NOT_FOUND="No ID mappings are available for the provided ID. ID argument: ",e.WarningMessages={UNEXPECTED_STATUS_PROP:"Unexpected provided property 'status'. You can NOT use this property for this method. For more information visit our documentation: \n ".concat(r.documentationLinks.PREDICTOR_USER_RELATED_OPERATION),UNEXPECTED_TYPE_PROP:"Unexpected provided property 'type'. You can NOT use this property for this method. For more information visit our documentation: \n ".concat(r.documentationLinks.PREDICTOR_USER_RELATED_OPERATION)},e.invalidPredictionMessage=function(t,e){return"The prediction '".concat(t,"' is invalid for market '").concat(e,"'. Please check again have you passed appropriate prediction model. For more information please visit our documentation: https://docs.fansunitedmedia.com/sdks/js/match.quiz#gamerelatedoperations")},e.invalidMarketMessage=function(t){return"The market '".concat(t,"' is not supported from Fans United. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction")},e.invalidMarketTopXMessage=function(t){return"The market '".concat(t,"' is not valid for Top X game. The only available market is CORRECT_SCORE.")},e.invalidFieldMessage=function(t){return"The field/s '".concat(t.length>1?t.join(", "):t[0],"' is/are invalid. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/javascript-sdk")},e.missingFieldsMessage=function(t,e){return"The following field/s is/are missing from ".concat(t,": '").concat(e.length>1?e.join(", "):e[0],"'. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction")},e.invalidTypeMessage=function(t,e){return"The field ".concat(t," has incorrect type. The correct type is ").concat(e)}},1282:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.primaryColor=null,this.secondaryColor=null,this.contentColor=null,this.backgroundColor=null,this.borderColor=null,this.additionalColor=null}},1997:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.mainLogo=null,this.mobileLogo=null,this.backgroundImage=null,this.mobileBackgroundImage=null,this.additionalImage=null}},6862:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.colors=null,this.urls=null,this.images=null}},2291:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.primaryUrl=null,this.secondaryUrl=null,this.privacyPolicyUrl=null,this.termsAndConditionsUrl=null,this.additionalUrl=null}},4800:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.limit=t&&t.limit?t.limit:null,this.startAfter=t&&t.startAfter?t.startAfter:null}return t.prototype.constructMainFiltersUrl=function(){var t="";return this.limit&&(t+="&",t+="limit=".concat(this.limit)),this.startAfter&&(t+="&",t+="start_after=".concat(this.startAfter)),t},t}();e.default=n},439:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.main=null,this.cover=null,this.mobile=null}},8872:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8902));e.default=function(){this.pagination=new r.default}},8902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.nextPageStartsAfter=null,this.itemsPerPage=null}},1553:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},3623:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.remapMetaData=function(t){var e=new r.default;return e.pagination.nextPageStartsAfter=t.pagination.next_page_starts_after,e.pagination.itemsPerPage=t.pagination.items_per_page,e}}},3483:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.entityId=null,this.entityType=null}},6692:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1282)),s=i(n(1997)),a=i(n(6862)),o=i(n(2291));e.default=function(){this.remapBranding=function(t){var e=new a.default;return t.colors&&(e.colors=new r.default,e.colors.primaryColor=t.colors.primary_color,e.colors.secondaryColor=t.colors.secondary_color,e.colors.contentColor=t.colors.content_color,e.colors.backgroundColor=t.colors.background_color,e.colors.borderColor=t.colors.border_color,e.colors.additionalColor=t.colors.additional_color),t.urls&&(e.urls=new o.default,e.urls.primaryUrl=t.urls.primary_url,e.urls.secondaryUrl=t.urls.secondary_url,e.urls.privacyPolicyUrl=t.urls.privacy_policy_url,e.urls.termsAndConditionsUrl=t.urls.terms_and_conditions_url,e.urls.additionalUrl=t.urls.additional_url),t.images&&(e.images=new s.default,e.images.mainLogo=t.images.main_logo,e.images.mobileLogo=t.images.mobile_logo,e.images.backgroundImage=t.images.background_image,e.images.mobileBackgroundImage=t.images.mobile_background_image,e.images.additionalImage=t.images.additional_image),e}}},9018:function(t,e,n){"use strict";var i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s,a=r(n(321)),o=n(1260);!function(t){t.PROFILE="profile",t.PROFILE_BADGES="profile_badges",t.PROFILE_STATS="profile_stats",t.PROFILE_COUNTRIES="profile_countries",t.IDS="ids",t.CLIENT="client",t.FOOTBALL_COMPETITIONS="football_competitions",t.FOOTBALL_COUNTIRES="football_countries"}(s||(s={}));var u=function(){function t(e){var n=this;this.profileTTL=600,this.clientTTL=14400,this.profileBadgesTTL=3600,this.idMappingsExpiration=0,this.idSchema="",this.clearData=function(){return t.nodeCache.flushAll()},this.getEntityById=function(e,i){var r=t.nodeCache.get(s.IDS);return r?r.find((function(t){var r=o.ID_TYPES[n.idSchema];return t&&"".concat(t[r])===i&&t.resource===e})):null},this.getEntity=function(e,n,i){var r=t.nodeCache.get(s.IDS);return r?Array.isArray(e)?[]:null:Array.isArray(e)?r.filter((function(t){var r=o.ID_TYPES[i];return t&&e.includes("".concat(t[r]))&&t.resource===n})):r.find((function(t){var r=o.ID_TYPES[i];return t&&"".concat(t[r])===e&&t.resource===n}))},this.checkForExistingIdObjs=function(t,e){var i=o.ID_TYPES[e],r={};return Object.keys(t).forEach((function(s){var a=t[s],o=n.getEntity(a,s,e).map((function(t){return t[i]})),u=t[s].filter((function(t){return!o.includes(t)}));r[s]=a.map((function(t){return u.includes(t)?{id:t,exists:!1}:{id:t,exists:!0}}))})),r},this.getIdsByType=function(e,n,i){var r=o.ID_TYPES[i],a=o.ID_TYPES[n],u=t.nodeCache.get(s.IDS),l={};return u?(Object.keys(e).forEach((function(t){var n=e[t],i=[];u.forEach((function(e){n.forEach((function(n,s){n===e[a]&&t===e.resource&&(i[s]=e[r])}))})),l[t]=i})),l):null},this.addIdMapping=function(e){var n=t.nodeCache.get(s.IDS);n.push(e),t.nodeCache.set(s.IDS,n)},this.addIdMappings=function(e){var n=t.nodeCache.get(s.IDS);n=i(i([],n,!0),e,!0),t.nodeCache.set(s.IDS,n)},this.addTopIdMappings=function(e){var r=t.nodeCache.get(s.IDS);if(r){var a=JSON.parse(JSON.stringify(r));a=a.filter((function(t){return"match"!==t.resource})),e=e.filter((function(t){return"match"===t.resource})),a=i(i([],a,!0),e,!0),t.nodeCache.set(s.IDS,a)}else t.nodeCache.set(s.IDS,e);n.idMappingsExpiration=Math.floor(Date.now()/1e3)+604800},this.setOwnProfile=function(e){return t.nodeCache.set(s.PROFILE,e,n.profileTTL)},this.getOwnProfile=function(){return t.nodeCache.get(s.PROFILE)},this.getProfileCountries=function(){return t.nodeCache.get(s.PROFILE_COUNTRIES)},this.setProfileCountries=function(e){return t.nodeCache.set(s.PROFILE_COUNTRIES,e)},this.getProfileStats=function(){return t.nodeCache.get(s.PROFILE_STATS)},this.setProfileStats=function(e){return t.nodeCache.set(s.PROFILE_STATS,e,n.profileTTL)},this.getProfileBadges=function(){return t.nodeCache.get(s.PROFILE_BADGES)},this.setProfileBadges=function(e){t.nodeCache.set(s.PROFILE_BADGES,e,n.profileBadgesTTL)},this.getFootballCountries=function(){return t.nodeCache.get(s.FOOTBALL_COUNTIRES)},this.setFootballCountries=function(e){return t.nodeCache.set(s.FOOTBALL_COUNTIRES,e)},this.getCompetitions=function(e){var n=t.nodeCache.get(s.FOOTBALL_COMPETITIONS);return n?e?e.competitionSearchFilter(n):n:null},this.setCompetitions=function(e){return t.nodeCache.set(s.FOOTBALL_COMPETITIONS,e)},this.getCompetitionsLength=function(){var e=t.nodeCache.get(s.FOOTBALL_COMPETITIONS);return e?e.length:0},this.getClientFeatures=function(){return t.nodeCache.get(s.CLIENT)},this.setClientFeatures=function(e){return t.nodeCache.set(s.CLIENT,e,n.clientTTL)},this.deleteClientFeatures=function(){return t.nodeCache.del(s.CLIENT)},this.getExpiration=function(e,i){var r=n.getKeyFromExpirationType(i);return r===s.IDS?n.idMappingsExpiration:t.nodeCache.getTtl(r)},this.getKeyFromExpirationType=function(t){switch(t){case"profile":return s.PROFILE;case"statistics":return s.PROFILE_STATS;case"badges":return s.PROFILE_BADGES;case"features":return s.CLIENT;case"ids":return s.IDS}}}return t.getInstance=function(e){return t.instance||(t.instance=new t(e),t.nodeCache.options.useClones=!1),t.instance},t.nodeCache=new a.default,t}();e.default=u},1022:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(2453)),c=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"loyalty"))||this;return n.activityRemapper=null,n.createActivity=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/activities".concat(this.apiSignInUrl),[4,this.fetchWithAuth(e,"There was a problem with creating activity","POST",t)];case 1:return n=i.sent(),[2,this.activityRemapper.remapSingleResponse(n)]}}))}))},n.deleteActivity=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/activities/".concat(t).concat(this.apiSignInUrl),n="There was a problem deleting the following activity: ".concat(t),[4,this.fetchWithAuth(e,n,"DELETE")];case 1:return i.sent(),[2,!0]}}))}))},n.getOwnActivities=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/activities".concat(this.apiSignInUrl),i=Date.now(),t&&(n+="".concat(t.constructFilterUrl())),e&&(n+="disable_cache=".concat(i)),[4,this.fetchWithAuth(n,"There was a problem with fetching own activities")];case 1:return r=s.sent(),[2,this.activityRemapper.remapActivitiesResponse(r)]}}))}))},n.getActivitiesForUser=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="/users/".concat(t,"/activities").concat(this.apiSignInUrl),r=Date.now(),s="There was a problem with fetching activities for user: ".concat(t),e&&(n+="".concat(e.constructFilterUrl())),i&&(n+="disable_cache=".concat(r)),[4,this.fetchWithoutAuth(n,s)];case 1:return o=a.sent(),[2,this.activityRemapper.remapActivitiesResponse(o)]}}))}))},n.getStats=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="",i="",r=null,t?(n+=(0,u.isDisabledCache)(e)?"/users/".concat(t,"/statistics").concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/users/".concat(t,"/statistics").concat(this.apiSignInUrl),i="There was a problem fetching statistics for profile: ".concat(t),[4,this.fetchWithoutAuth(n,i)]):[3,2];case 1:return r=s.sent(),[3,4];case 2:return n+="/statistics".concat(this.apiSignInUrl),i="There was a problem fetching profile`s statistics",[4,this.fetchWithAuth(n,i)];case 3:r=s.sent(),s.label=4;case 4:return[2,this.activityRemapper.remapStatsResponse(r.data)]}}))}))},n.activityRemapper=new l.default,n}return r(e,t),e}(o(n(7724)).default);e.default=c},7686:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureConfigType=void 0;var u,l=n(712),c=o(n(704)),d=o(n(7724)),h=o(n(8358));(u=e.FeatureConfigType||(e.FeatureConfigType={})).PREDICTOR="predictor",u.TOP_X="topX",u.MATCH_QUIZ="matchQuiz",u.LOYALTY="loyalty",u.DISCUSSIONS="discussions",u.FANTASY="fantasy";var f=function(t){function e(e){var n=t.call(this,e,(0,l.setBaseUrl)(e.environment,"client"))||this;return n.featureConfigRemapper=null,n.localStorage=null,n.clientId=null,n.getConfig=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r,s;return a(this,(function(a){switch(a.label){case 0:return(e=this.getCachedFeatures())?[3,2]:(n="/clients/".concat(this.clientId,"/features"),i=this.apiSignInUrl.split("&")[0],r=n+i,[4,this.fetchWithoutAuth(r,"There was a problem fetching client features from Client API")]);case 1:s=a.sent(),e=s.data,this.localStorage.setClientFeatures(e),a.label=2;case 2:switch(t){case"predictor":return[2,this.featureConfigRemapper.remapPredictorConfig(e.predictor)];case"topX":return[2,this.featureConfigRemapper.remapTopXConfig(e.top_x)];case"matchQuiz":return[2,this.featureConfigRemapper.remapMatchQuizConfig(e.match_quiz)];case"loyalty":return[2,this.featureConfigRemapper.remapLoyaltyConfig(e.loyalty)];case"discussions":return[2,this.featureConfigRemapper.remapDiscussionsConfig(e.discussions)];case"fantasy":return[2,this.featureConfigRemapper.remapFantasyConfig(e.football_fantasy)]}return[2]}}))}))},n.getNewLoyaltyConfig=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r,s,o;return a(this,(function(a){switch(a.label){case 0:return e="/clients/".concat(this.clientId,"/features"),n=this.apiSignInUrl.split("&")[0],i="There was a problem fetching client features from Client API",t?(s=e+n+(0,l.initDisableCache)(),[4,this.fetchWithoutAuthAdditionalHeaders(s,i,{"x-api-version":"2"})]):[3,2];case 1:o=a.sent(),this.localStorage.setClientFeatures(o.data),a.label=2;case 2:return(r=this.getCachedFeatures())?[3,4]:(s=e+n,[4,this.fetchWithoutAuthAdditionalHeaders(s,i,{"x-api-version":"2"})]);case 3:o=a.sent(),r=o.data,this.localStorage.setClientFeatures(r),a.label=4;case 4:return[2,this.featureConfigRemapper.remapLoyaltyNewConfig(r.loyalty)]}}))}))},n.getCachedFeatures=function(){var t=n.getLocalStorageData();if(t&&Object.keys(t).length)return t.predictor.client_id&&t.predictor.client_id!==n.clientId?(n.localStorage.deleteClientFeatures(),null):t},n.getLocalStorageData=function(){var t=Math.floor(Date.now()/1e3);return n.localStorage.getExpiration("client","features")>t?n.localStorage.getClientFeatures():null},n.clientId=e.clientId,n.localStorage=(new h.default).createLocalCacheInstance(e.idSchema),n.featureConfigRemapper=new c.default,n}return r(e,t),e}(d.default);e.default=f},7945:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(3476)),c=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"discussions"))||this;return n.remapper=null,n.getAll=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions"+this.apiSignInUrl,t&&(n+="".concat(t.constructMainFiltersUrl())),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting discussions")];case 1:return i=r.sent(),[2,this.remapper.remapToDiscussions(i)]}}))}))},n.getById=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/discussions/".concat(t)+this.apiSignInUrl,[4,this.fetchWithoutAuth(e,"There was a problem getting discussion")];case 1:return n=i.sent(),[2,this.remapper.remapToDiscussionById(n.data)]}}))}))},n.createPost=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/".concat(t,"/posts")+this.apiSignInUrl,[4,this.fetchWithAuth(n,"There was a problem creating post in discussion","POST",e)];case 1:return i=r.sent(),[2,this.remapper.remapToPostByIdBasic(i.data)]}}))}))},n.getPostById=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/posts/".concat(t)+this.apiSignInUrl,[4,this.fetchWithoutAuth(e,"There was a problem getting post by ID in discussion")];case 1:return n=i.sent(),[2,this.remapper.remapToPostByIdFull(n.data)]}}))}))},n.updatePost=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/posts/".concat(t)+this.apiSignInUrl,i={content:e},[4,this.fetchWithAuth(n,"There was a problem editing post in discussion","PUT",i)];case 1:return r=s.sent(),[2,this.remapper.remapToPostByIdBasic(r.data)]}}))}))},n.reactToPost=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/posts/".concat(t,"/reaction")+this.apiSignInUrl,i={reaction:e.toLocaleLowerCase()},[4,this.fetchWithAuth(n,"There was a problem reacting to post in discussion","PUT",i)];case 1:return r=s.sent(),[2,this.remapper.remapToPostByIdBasic(r.data)]}}))}))},n.deletePost=function(t){return s(n,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return e="/posts/".concat(t)+this.apiSignInUrl,[4,this.fetchWithAuth(e,"There was a problem deleting post in discussion","DELETE")];case 1:return n.sent(),[2,!0]}}))}))},n.getPosts=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/".concat(t,"/posts")+this.apiSignInUrl,e&&(n+="".concat(e.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(n,"There was a problem getting posts in discussion")];case 1:return i=r.sent(),[2,this.remapper.remapToPostsForDiscussion(i,"full")]}}))}))},n.getPostReplies=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/posts/".concat(t,"/replies")+this.apiSignInUrl,e&&(n+="".concat(e.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(n,"There was a problem getting post's replies in discussion")];case 1:return i=r.sent(),[2,this.remapper.remapToPostsForDiscussion(i,"full")]}}))}))},n.reportPost=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/posts/".concat(t,"/report")+this.apiSignInUrl,r={reason:e.toLocaleUpperCase(),reason_details:i||null},[4,this.fetchWithAuth(n,"There was a problem reporting post in discussion","POST",r)];case 1:return s=a.sent(),[2,this.remapper.remapToPostByIdBasic(s.data)]}}))}))},n.getOwnPosts=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/posts"+this.apiSignInUrl,t&&(e+="".concat(t.constructMainFiltersUrl())),[4,this.fetchWithAuth(e,"There was a problem getting own posts")];case 1:return n=i.sent(),[2,this.remapper.remapToPosts(n)]}}))}))},n.getUserPosts=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/posts/users/".concat(t)+this.apiSignInUrl,e&&(n+="".concat(e.constructMainFiltersUrl())),(0,u.isDisabledCache)(i)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting user's posts")];case 1:return r=s.sent(),[2,this.remapper.remapToPosts(r)]}}))}))},n.getPostsCount=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/posts/count"+this.apiSignInUrl+"&discussion_ids=".concat(t.join(",")),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting posts count for discussions")];case 1:return i=r.sent(),[2,this.remapper.remapToPostCount(i.data)]}}))}))},n.getTopDiscussions=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/top"+this.apiSignInUrl,t&&(n+="".concat(t.constructMainFiltersUrl())),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting top discussions")];case 1:return i=r.sent(),[2,this.remapper.remapToDiscussions(i)]}}))}))},n.remapper=new l.default,n}return r(e,t),e}(o(n(7724)).default);e.default=c},595:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(3430)),c=o(n(7316)),d=o(n(8758)),h=o(n(5827)),f=o(n(7821)),p=o(n(5284)),m=o(n(9330)),v=o(n(4729)),_=o(n(5157)),y=o(n(7943)),g=o(n(7287)),b=o(n(753)),w=o(n(1925)),I=o(n(7724)),E=o(n(9582)),M=o(n(9260)),O=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"football"))||this;return n.limitIds=200,n.countryRemapper=null,n.competitionBasicRemapper=null,n.competitionFullRemapper=null,n.teamBasicRemapper=null,n.teamFullRemapper=null,n.matchBasicRemapper=null,n.matchFullRemapper=null,n.playerBasicRemapper=null,n.playerFullRemapper=null,n.topPlayerRemapper=null,n.searchRemapper=null,n.footballMetaRemapper=null,n.fantasyRemapper=null,n.footballService=null,n.getCountries=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="/countries".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with the football countries request")];case 1:return i=r.sent(),[2,this.countryRemapper.countriesFromResponse(i.data)]}}))}))},n.getCompetitions=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f=this;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),i="There was a problem with football competitions request",e=e||!1,!(t&&t.competitionIds&&t.competitionIds.length>this.limitIds-1))return[3,5];r=[],s=(0,u.limitIds)(t.competitionIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.competitionIds=c,d="/competitions".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),e&&(d+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(d,i)]):[3,4];case 2:h=a.sent(),r.push(h.data.map((function(t){return f.competitionBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return[2,Array.prototype.concat.apply([],r)];case 5:return d="/competitions".concat(this.apiSignInUrl),t&&(d+="".concat(t.constructFilterUrl())),e&&(d+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(d,i)];case 6:return[2,(h=a.sent()).data.map((function(t){return f.competitionBasicRemapper.fromResponse(t)}))]}}))}))},n.getCompetitionById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/competitions/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football competition by ID request")];case 1:return r=s.sent(),[2,this.competitionFullRemapper.fromResponse(r.data)]}}))}))},n.getTopCompetitions=function(t){return s(n,void 0,void 0,(function(){var e,n,i=this;return a(this,(function(r){switch(r.label){case 0:return e="/competitions/top".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with top football competitions request")];case 1:return[2,r.sent().data.map((function(t){return i.competitionBasicRemapper.fromResponse(t)}))]}}))}))},n.getTeams=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f,p=this;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),i="There was a problem with football teams request",!(t&&t.teamIds&&t.teamIds.length>this.limitIds))return[3,5];r=[],s=(0,u.limitIds)(t.teamIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.teamIds=c,h="/teams".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),e&&(h+="disable_cache=".concat(n)),[4,this.fetchWithoutAuth(h,i)]):[3,4];case 2:f=a.sent(),r.push(f.data.map((function(t){return p.teamBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return[2,Array.prototype.concat.apply([],r)];case 5:return d=new b.default,h="/teams".concat(this.apiSignInUrl),t&&(h+="".concat(t.constructFilterUrl())),e&&(h+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(h,i)];case 6:return f=a.sent(),d.meta=this.footballMetaRemapper.remapMetaProp(f.meta),d.data=f.data.map((function(t){return p.teamBasicRemapper.fromResponse(t)})),[2,d]}}))}))},n.getTeamById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/teams/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football team by ID request")];case 1:return r=s.sent(),[2,this.teamFullRemapper.fromResponse(r.data)]}}))}))},n.getTopTeams=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r=this;return a(this,(function(s){switch(s.label){case 0:return e="/teams/top".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="$disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with top football teams request")];case 1:return[2,(i=s.sent()).data?i.data.map((function(t){return r.teamBasicRemapper.fromResponse(t)})):[]]}}))}))},n.getNextMatchForTeam=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/teams/".concat(t,"/next-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with next match for team request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getPrevMatchForTeam=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/teams/".concat(t,"/previous-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with previous match for team request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getPlayers=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f,p,m=this;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),i="There was a problem with football players request",!(t&&t.playerIds&&t.playerIds.length>this.limitIds-1))return[3,5];r=[],s=(0,u.limitIds)(t.playerIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.playerIds=c,f="/players".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),e&&(f+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(f,i)]):[3,4];case 2:p=a.sent(),r.push(p.data.map((function(t){return m.teamBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return d=Array.prototype.concat.apply([],r),(h=new b.default).data=d,[2,h];case 5:return h=new b.default,f="/players".concat(this.apiSignInUrl),t&&(f+="".concat(t.constructFilterUrl())),e&&(f+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(f,i)];case 6:return p=a.sent(),h.meta=this.footballMetaRemapper.remapMetaProp(p.meta),h.data=p.data.map((function(t){return m.playerBasicRemapper.fromResponse(t)})),[2,h]}}))}))},n.getPlayerById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/players/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football player by ID request")];case 1:return r=s.sent(),[2,this.playerFullRemapper.fromResponse(r.data)]}}))}))},n.getTopPlayers=function(t){return s(n,void 0,void 0,(function(){var e,n,i=this;return a(this,(function(r){switch(r.label){case 0:return e="/players/top".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with top football players request")];case 1:return[2,r.sent().data.map((function(t){return i.topPlayerRemapper.fromResponse(t)}))]}}))}))},n.getNextMatchForPlayer=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/players/".concat(t,"/next-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with next match for player request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getPrevMatchForPlayer=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/players/".concat(t,"/previous-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with previous match for player request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getMatchById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/matches/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with match by ID request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getMatches=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f,p=this;return a(this,(function(a){switch(a.label){case 0:if(n=new b.default,i="There was a problem with football matches request",!(t&&t.matchIds&&t.matchIds.length>this.limitIds))return[3,5];r=[],s=(0,u.limitIds)(t.matchIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.matchIds=c,h="/matches".concat(this.apiSignInUrl).concat(t.constructFilterUrl(!0),"&limit=").concat(c.length),e&&(h+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(h,i)]):[3,4];case 2:f=a.sent(),r.push(f.data.map((function(t){return p.matchBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return d=Array.prototype.concat.apply([],r),n.meta=this.footballService.setMetaDataBatchRequest(d.length,t.limit||20,t.page||1),n.data=this.footballService.finalizeMatchesDataBatchRequest(d,t),[2,n];case 5:return h="/matches".concat(this.apiSignInUrl),t&&(h+="".concat(t.constructFilterUrl())),e&&(h+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(h,i)];case 6:return f=a.sent(),n.meta=this.footballMetaRemapper.remapMetaProp(f.meta),n.data=f.data.map((function(t){return p.matchBasicRemapper.fromResponse(t)})),[2,n]}}))}))},n.search=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/search".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football search request")];case 1:return r=s.sent(),[2,this.searchRemapper.fromResponse(r.data)]}}))}))},n.getPlayersPoints=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/players/points/".concat(t).concat(this.apiSignInUrl),r=Date.now(),e&&(n+="&position=".concat(e.toLocaleLowerCase())),i&&(n+="&disable_cache=".concat(r)),[4,this.fetchWithoutAuth(n,"There was a problem with players points request")];case 1:return s=a.sent(),[2,this.fantasyRemapper.remapPlayersPoints(s)]}}))}))},n.getPlayerDetailedStatistics=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/players/".concat(e,"/points/").concat(t).concat(this.apiSignInUrl),r=Date.now(),i&&(n+="&disable_cache=".concat(r)),[4,this.fetchWithoutAuth(n,"There was a problem with detailed player points request")];case 1:return s=a.sent(),[2,this.fantasyRemapper.remapPlayerDetailedStats(s)]}}))}))},n.apiSignInUrl="en"!==e.lang?n.apiSignInUrl+"&lang=".concat(e.lang):n.apiSignInUrl,n.countryRemapper=new l.default,n.competitionBasicRemapper=new c.default,n.competitionFullRemapper=new d.default,n.teamBasicRemapper=new h.default,n.teamFullRemapper=new f.default,n.matchBasicRemapper=new p.default,n.matchFullRemapper=new m.default,n.playerBasicRemapper=new _.default,n.playerFullRemapper=new y.default,n.topPlayerRemapper=new v.default,n.searchRemapper=new g.default,n.footballMetaRemapper=new w.default,n.footballService=new E.default(e),n.fantasyRemapper=new M.default,n}return r(e,t),e}(I.default);e.default=O},7724:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=a(n(6245)),u=n(4021),l=n(4904),c=n(5318),d=a(n(8712)),h=a(n(2535));e.default=function(t,e){var n=this;this.baseUrl=null,this.apiSignInUrl=null,this.jwtToken=null,this.idSchema=null,this.retryRequest=!1,this.headers=null,this.authHeaders=null,this.errorHandlingMode=null,this.configuration=null,this.getJwtToken=function(){return n.configuration.authProvider.getIdToken()},this.getAuthHeaders=function(){return{"Content-Type":"application/json",Authorization:"Bearer ".concat(n.getJwtToken())}},this.fetchWithoutAuth=function(t,e){return r(n,void 0,void 0,(function(){var n,i,r;return s(this,(function(s){switch(s.label){case 0:return[4,fetch(this.baseUrl+t,{headers:this.headers})];case 1:return[4,(n=s.sent()).json()];case 2:if(i=s.sent(),!n.ok)throw r=this.transformFetchException(n,i),console.warn(e,r),r;return[2,i]}}))}))},this.fetchWithoutAuthAdditionalHeaders=function(t,e,a){return r(n,void 0,void 0,(function(){var n,r,o;return s(this,(function(s){switch(s.label){case 0:return[4,fetch(this.baseUrl+t,{headers:i(i({},this.headers),a)})];case 1:return[4,(n=s.sent()).json()];case 2:if(r=s.sent(),!n.ok)throw o=this.transformFetchException(n,r),console.warn(e,o),o;return[2,r]}}))}))},this.fetchWithAuth=function(t,e,i,a){return r(n,void 0,void 0,(function(){var n,r,o,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this.validateJWTToken(),n=null,r=null,i&&a?[4,fetch(this.baseUrl+t,{method:i,headers:this.getAuthHeaders(),body:JSON.stringify(a)})]:[3,2];case 1:return n=s.sent(),[3,6];case 2:return!i||a?[3,4]:[4,fetch(this.baseUrl+t,{method:i,headers:this.getAuthHeaders()})];case 3:return n=s.sent(),[3,6];case 4:return[4,fetch(this.baseUrl+t,{headers:this.getAuthHeaders()})];case 5:n=s.sent(),s.label=6;case 6:return"DELETE"===i?[3,8]:[4,n.json()];case 7:r=s.sent(),s.label=8;case 8:return n.ok?[3,14]:401!==n.status&&403!==n.status||this.retryRequest?[3,10]:(this.retryRequest=!0,[4,this.fetchWithAuth(t,e,i,a)]);case 9:s.sent(),s.label=10;case 10:return this.retryRequest=!1,u=this.transformFetchException,l=[n],r?(c=r,[3,13]):[3,11];case 11:return[4,n.json()];case 12:c=s.sent(),s.label=13;case 13:throw o=u.apply(this,l.concat([c])),console.warn(e,o),o;case 14:return this.retryRequest=!1,[2,r]}}))}))},this.fetchWithAuthNewBaseURL=function(t,e,i,a,o){return r(n,void 0,void 0,(function(){var n,r,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this.validateJWTToken(),n=null,r=null,a&&o?[4,fetch(t+e,{method:a,headers:this.getAuthHeaders(),body:JSON.stringify(o)})]:[3,2];case 1:return n=s.sent(),[3,6];case 2:return!a||o?[3,4]:[4,fetch(t+e,{method:a,headers:this.getAuthHeaders()})];case 3:return n=s.sent(),[3,6];case 4:return[4,fetch(t+e,{headers:this.getAuthHeaders()})];case 5:n=s.sent(),s.label=6;case 6:return"DELETE"===a?[3,8]:[4,n.json()];case 7:r=s.sent(),s.label=8;case 8:return n.ok?[3,14]:401!==n.status&&403!==n.status||this.retryRequest?[3,10]:(this.retryRequest=!0,[4,this.fetchWithAuthNewBaseURL(t,e,i,a,o)]);case 9:s.sent(),s.label=10;case 10:return this.retryRequest=!1,l=this.transformFetchException,c=[n],r?(d=r,[3,13]):[3,11];case 11:return[4,n.json()];case 12:d=s.sent(),s.label=13;case 13:throw u=l.apply(this,c.concat([d])),console.warn(i,u),u;case 14:return this.retryRequest=!1,[2,r]}}))}))},this.transformFetchException=function(t,e){if(!e&&t.status===u.ErrorCodes.UNAUTHORIZED){if("standard"===n.errorHandlingMode)return new h.default(u.ErrorCodes.UNAUTHORIZED,l.ErrorStatuses.UNAUTHORIZED,c.ErrorMessages.INVALID_TOKEN);var i={code:u.ErrorCodes.UNAUTHORIZED,status:l.ErrorStatuses.UNAUTHORIZED,message:c.ErrorMessages.INVALID_TOKEN};return new d.default(t,i)}var r=e.error,s=r.code,a=r.status,o=r.message;return"standard"===n.errorHandlingMode?new h.default(s,a,o):new d.default(t,e.error)},this.validateJWTToken=function(){var t=null;try{t=(0,o.default)(n.getJwtToken())}catch(t){if("default"===n.errorHandlingMode){var e={status:u.ErrorCodes.UNAUTHORIZED,statusText:t.message,headers:{}},i={code:u.ErrorCodes.UNAUTHORIZED,status:l.ErrorStatuses.INVALID_TOKEN,message:c.ErrorMessages.INVALID_TOKEN};throw new d.default(e,i)}if("standard"===n.errorHandlingMode)throw new h.default(u.ErrorCodes.UNAUTHORIZED,l.ErrorStatuses.INVALID_TOKEN,c.ErrorMessages.INVALID_TOKEN)}if(Date.now()>1e3*t.exp){if("default"===n.errorHandlingMode)throw e={status:u.ErrorCodes.UNAUTHORIZED,statusText:"",headers:{}},i={code:u.ErrorCodes.UNAUTHORIZED,status:l.ErrorStatuses.INVALID_TOKEN,message:c.ErrorMessages.EXPIRED_TOKEN},new d.default(e,i);if("standard"===n.errorHandlingMode)throw new h.default(u.ErrorCodes.UNAUTHORIZED,l.ErrorStatuses.INVALID_TOKEN,c.ErrorMessages.EXPIRED_TOKEN)}},this.baseUrl=e,this.configuration=t,this.apiSignInUrl="?key=".concat(t.apiKey,"&client_id=").concat(t.clientId),this.errorHandlingMode=t.errorHandlingMode,this.idSchema=t.idSchema,this.headers={"Content-Type":"application/json"}}},8539:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(712),c=u(n(7724)),d={player:"players",team:"teams",homeTeam:"teams",awayTeam:"teams",country:"countries",competition:"competitions",match:"matches"},h=function(t){function e(e){var n=t.call(this,e,(0,l.setBaseUrl)(e.environment,"idMapping"))||this;return n.getEntityById=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/football".concat(this.apiSignInUrl,"&input_provider=").concat(this.idSchema,"&").concat(d[t],"=").concat(e),i="There was a problem with id mapping request for the following id: ".concat(e),[4,this.fetchWithoutAuth(n,i)];case 1:return[2,r.sent()]}}))}))},n.getEntityByIdAndSchema=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/football".concat(this.apiSignInUrl,"&input_provider=").concat(i,"&").concat(d[t],"=").concat(e),r="There was a problem with id mapping request for the following id: ".concat(e),[4,this.fetchWithoutAuth(n,r)];case 1:return[2,s.sent()]}}))}))},n.getEntityIdsByIdsAndSchema=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/football".concat(this.apiSignInUrl,"&input_provider=").concat(i,"&").concat(d[t],"=").concat(e.join(",")),r="There was a problem with id mapping request for the following ids: ".concat(e.join(",")),[4,this.fetchWithoutAuth(n,r)];case 1:return[2,s.sent()]}}))}))},n.getEntitiesByIds=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,u,c,h,f,p;return a(this,(function(a){switch(a.label){case 0:e.sort((function(t,e){return t.localeCompare(e)})),n=(0,l.requestChunkBuild)(e),r=[],s=0,u=n,a.label=1;case 1:return s<u.length?(c=u[s],h="/football".concat(this.apiSignInUrl,"&input_provider=").concat(i,"&").concat(d[t],"=").concat(c.join(",")),f="There was a problem with id mapping request for the following ids :".concat(c.join(",")),[4,this.fetchWithoutAuth(h,f)]):[3,4];case 2:p=a.sent(),r=o(o([],r,!0),p.data,!0),a.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},n.getEntitiesByIdObjs=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,u,c,h,f,p;return a(this,(function(m){switch(m.label){case 0:n=[],i={},r=[],Object.keys(t).forEach((function(e){n.push.apply(n,t[e])})),s=(0,l.transformIdsToBeUnique)(n),o=(0,l.requestChunkBuild)(s),u=function(n){var s,o,u;return a(this,(function(a){switch(a.label){case 0:return s="",Object.keys(t).forEach((function(e){i[e]=[];var r=n.filter((function(n){return t[e].includes(n)}));r&&r.length>0&&(i[e]=r)})),Object.keys(i).forEach((function(t){i[t].length>0&&(i[t].sort((function(t,e){return t.localeCompare(e)})),s+="&",s+="".concat(d[t],"=").concat(i[t].join(",")))})),s&&s.length>0?(o="/football".concat(c.apiSignInUrl,"&input_provider=").concat(e||"native").concat(s),[4,c.fetchWithoutAuth(o,"There was a problem with id mapping request")]):[3,2];case 1:return u=a.sent(),r.push(u.data),[3,3];case 2:r.push([]),a.label=3;case 3:return[2]}}))},c=this,h=0,f=o,m.label=1;case 1:return h<f.length?(p=f[h],[5,u(p)]):[3,4];case 2:m.sent(),m.label=3;case 3:return h++,[3,1];case 4:return[2,Array.prototype.concat.apply([],r)]}}))}))},n.getTopEntities=function(){return s(n,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:return t="/football/top".concat(this.apiSignInUrl),[4,this.fetchWithoutAuth(t,"There was a problem with top id mappings request")];case 1:return[2,e.sent().data]}}))}))},n}return r(e,t),e}(c.default);e.default=h},7059:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(7419)),c=o(n(4533)),d=o(n(8899)),h=o(n(7746)),f=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"loyalty"))||this;return n.templateRemapper=null,n.leaderboardRemapper=null,n.rankingsRemapper=null,n.highestSuccessRateRemapper=null,n.getTemplates=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=t?"/leaderboard/templates/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()):"/leaderboard/templates/".concat(this.apiSignInUrl),n+=(0,u.isDisabledCache)(e)?(0,u.initDisableCache)():"",[4,this.fetchWithoutAuth(n,"There was a problem fetching the list of templates")];case 1:return i=s.sent(),(r=JSON.parse(JSON.stringify(i))).meta=this.templateRemapper.remapMeta(i.meta),r.data=this.templateRemapper.remapResponse(i.data),[2,r]}}))}))},n.getTemplateById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=(0,u.isDisabledCache)(e)?"/leaderboard/templates/".concat(t).concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/leaderboard/templates/".concat(t).concat(this.apiSignInUrl),i="There was a problem requesting the following template: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.templateRemapper.remapResponseId(r.data)]}}))}))},n.getLeaderboard=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n=(0,u.isDisabledCache)(e)?"/leaderboard/".concat(t).concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/leaderboard/".concat(t).concat(this.apiSignInUrl),r="There was a problem fetching the leaderboard for the following template: ".concat(t),i&&(n+="".concat(i.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),o=JSON.parse(JSON.stringify(s)),[2,this.leaderboardRemapper.remapResponse(o)]}}))}))},n.getLeaderboardForGame=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n=(0,u.isDisabledCache)(e)?"/leaderboard/games/".concat(t).concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/leaderboard/games/".concat(t).concat(this.apiSignInUrl),r="There was a problem fetching the leaderboard for the following game: ".concat(t),i&&(n+="".concat(i.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),o=JSON.parse(JSON.stringify(s)),[2,this.leaderboardRemapper.remapResponse(o)]}}))}))},n.getLeaderboardForLeague=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/private-league/".concat(t).concat(this.apiSignInUrl),i="There was a problem fetching the leaderboard for the following league: ".concat(t),e&&(n+="".concat(e.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.leaderboardRemapper.remapLeagueLeaderboardResponse(r)]}}))}))},n.getUserRankings=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/leaderboard/users/".concat(t,"/rankings").concat(this.apiSignInUrl),r="There was a problem fetching the rankings for the following user: ".concat(t),e&&(n+="".concat(e.constructFiltersUrl())),(0,u.isDisabledCache)(i)&&(n+="".concat((0,u.initDisableCache)())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),[2,this.rankingsRemapper.remapRankings(s)]}}))}))},n.getHighestSuccessRate=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/statistics/top".concat(this.apiSignInUrl),t&&(n+="".concat(t.constructFiltersUrl())),(0,u.isDisabledCache)(e)&&(n+="".concat((0,u.initDisableCache)())),[4,this.fetchWithoutAuth(n,"There was a problem fetching highest success rate")];case 1:return i=r.sent(),[2,this.highestSuccessRateRemapper.remapHighestSuccessRate(i.data)]}}))}))},n.getEntitiesFollows=function(t,e){return s(n,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=(0,u.isDisabledCache)(e)?"/statistics/follows".concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/statistics/follows".concat(this.apiSignInUrl),t.footballCompetitions&&(n+="&competitions=".concat(t.footballCompetitions.join(","))),t.footballTeams&&(n+="&teams=".concat(t.footballTeams.join(","))),t.footballPlayers&&(n+="&players=".concat(t.footballPlayers.join(","))),[4,this.fetchWithoutAuth(n,"There was a problem fetching follows for entities")];case 1:return[2,i.sent().data]}}))}))},n.getUserRankingsForPrivateLeagueAndChallenges=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/private-league/users/".concat(t,"/rankings").concat(this.apiSignInUrl,"&private_league_type=").concat("PRIVATE_LEAGUE"===e?"private":"one_vs_one"),r="There was a problem fetching user rankings for ".concat(e),i&&(n+="".concat(i.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),[2,"PRIVATE_LEAGUE"===e?this.rankingsRemapper.remapRankingsPrivateLeague(s):this.rankingsRemapper.remapRankingsChallenge(s)]}}))}))},n.templateRemapper=new d.default,n.leaderboardRemapper=new l.default,n.rankingsRemapper=new c.default,n.highestSuccessRateRemapper=new h.default,n}return r(e,t),e}(o(n(7724)).default);e.default=f},3022:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(2239)),c=o(n(7724)),d=o(n(4688)),h=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"miniGames"))||this;return n.classicQuizRemapper=null,n.eitherOrRemapper=null,n.getClassicQuizzes=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/classic-quizzes".concat(this.apiSignInUrl),t&&(n+=t.constructMainFiltersUrl()),n+=(0,u.isDisabledCache)(e)?(0,u.initDisableCache)():"",[4,this.fetchWithoutAuth(n,"There was a problem with fetching classic quizzes")];case 1:return i=r.sent(),[2,this.classicQuizRemapper.remapClassicQuizzes(i)]}}))}))},n.getClassicQuizById=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/classic-quizzes/".concat(t).concat(this.apiSignInUrl),e&&(n+="&include_correct_options=".concat(e)),(0,u.isDisabledCache)(i)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem with fetching classic quiz by ID")];case 1:return r=s.sent(),[2,this.classicQuizRemapper.remapClassicQuizById(r.data)]}}))}))},n.participateInClassicQuiz=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="/classic-quizzes/".concat(t,"/participate").concat(this.apiSignInUrl),r="There was a problem with participating in the following classic quiz: ".concat(t),s={questions:this.classicQuizRemapper.remapClassicQuizParticipationBody(e),include_correct_options:!!i},[4,this.fetchWithAuth(n,r,"POST",s)];case 1:return o=a.sent(),[2,this.classicQuizRemapper.remapClassicQuizParticipation(o.data)]}}))}))},n.getMyClassicQuizParticipations=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/classic-quizzes/participations".concat(this.apiSignInUrl),t&&(e+="".concat(t.constructMainFiltersUrl())),[4,this.fetchWithAuth(e,"There was a problem with fetching user's own Classic Quiz participations")];case 1:return n=i.sent(),[2,this.classicQuizRemapper.remapUserClassicQuizParticipations(n.data)]}}))}))},n.getLeaderboardForClassicQuizzes=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/classic-quizzes/rank".concat(this.apiSignInUrl),t&&(e+="".concat(t.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(e,"There was a problem with fetching classic quizzes leaderboard")];case 1:return n=i.sent(),[2,this.classicQuizRemapper.remapClassicQuizzesLeaderboard(n)]}}))}))},n.getClassicQuizzesUserRanking=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/classic-quizzes/users/".concat(t,"/rank").concat(this.apiSignInUrl),e&&(n+="".concat(e.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(n,"There was a problem with fetching user's rankings for classic quizzes")];case 1:return i=r.sent(),[2,this.classicQuizRemapper.remapClassicQuizUserRankings(i)]}}))}))},n.getEitherOrs=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or".concat(this.apiSignInUrl),t&&(n+=t.constructMainFiltersUrl()),n+=(0,u.isDisabledCache)(e)?(0,u.initDisableCache)():"",[4,this.fetchWithoutAuth(n,"There was a problem with fetching list of Either/Ors")];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrs(i)]}}))}))},n.getEitherOrById=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or/".concat(t).concat(this.apiSignInUrl),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem with fetching Either/Or by ID")];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrById(i.data)]}}))}))},n.getMyEitherOrStats=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/either-or/".concat(t,"/own-stats").concat(this.apiSignInUrl),[4,this.fetchWithAuth(e,"There was a problem with fetching Either/Or own statistics")];case 1:return n=i.sent(),[2,this.eitherOrRemapper.remapEitherOrOwnStats(n.data)]}}))}))},n.getEitherOrResults=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or/".concat(t,"/results").concat(this.apiSignInUrl).concat((0,u.isDisabledCache)(e)?(0,u.initDisableCache)():""),[4,this.fetchWithoutAuth(n,"There was a problem with fetching Either/Or results")];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrResults(i.data)]}}))}))},n.participateInEitherOr=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or/".concat(t,"/participate").concat(this.apiSignInUrl),[4,this.fetchWithAuth(n,"There was a problem with participating in Either/Or","POST",e)];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrParticipation(i.data)]}}))}))},n.classicQuizRemapper=new l.default,n.eitherOrRemapper=new d.default,n}return r(e,t),e}(c.default);e.default=h},2793:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=o(n(2726)),l=o(n(9679)),c=n(712),d=o(n(4780)),h=o(n(1553)),f=o(n(3623)),p=function(t){function e(e,n){var i=t.call(this,e,(0,c.setBaseUrl)(e.environment,"predictor"))||this;return i.predictionRemapper=null,i.matchSummaryRemapper=null,i.gamesRemapper=null,i.metaRemapper=null,i.makeFootballPrediction=function(t){return s(i,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/predictions".concat(this.apiSignInUrl),[4,this.fetchWithAuth(e,"There was a problem making POST request","POST",this.predictionRemapper.remapRequestBody(t))];case 1:return n=i.sent(),[4,this.predictionRemapper.remapResponseObjBody(n)];case 2:return[2,i.sent()]}}))}))},i.getMatchSummary=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=(0,c.isDisabledCache)(e)?"/predictions/summary/".concat(t).concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/predictions/summary/".concat(t).concat(this.apiSignInUrl),i="There was a problem fetching predictions for match: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.matchSummaryRemapper.remapResponse(r)]}}))}))},i.deleteFootballPrediction=function(t){return s(i,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/predictions/".concat(t).concat(this.apiSignInUrl),n="There was a problem deleting your prediction: ".concat(t),[4,this.fetchWithAuth(e,n,"DELETE")];case 1:return i.sent(),[2,!0]}}))}))},i.getMyPredictions=function(t){return s(i,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(s){switch(s.label){case 0:return e=new h.default,n="/predictions".concat(this.apiSignInUrl),t&&(n+="".concat(t.constructFiltersUrl())),[4,this.fetchWithAuth(n,"There was a problem fetching own predictions")];case 1:return i=s.sent(),e.meta=this.metaRemapper.remapMetaData(i.meta),r=e,[4,this.predictionRemapper.remapResponseArrayBody(i.data)];case 2:return r.data=s.sent(),[2,e]}}))}))},i.getMyPredictionsNoRemap=function(t){return s(i,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return e="/predictions".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()),[4,this.fetchWithAuth(e,"There was a problem fetching own predictions")];case 1:return[2,n.sent()]}}))}))},i.getUserPredictions=function(t,e,n){return s(i,void 0,void 0,(function(){var i,r,s,o,u;return a(this,(function(a){switch(a.label){case 0:return i=new h.default,r=(0,c.isDisabledCache)(e)?"/predictions/users/".concat(t).concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/predictions/users/".concat(t).concat(this.apiSignInUrl),s="There was a problem fetching predictions for user: ".concat(t),n&&(r+="".concat(n.constructFiltersUrl())),[4,this.fetchWithoutAuth(r,s)];case 1:return o=a.sent(),i.meta=this.metaRemapper.remapMetaData(o.meta),u=i,[4,this.predictionRemapper.remapResponseArrayBody(o.data)];case 2:return u.data=a.sent(),[2,i]}}))}))},i.getUserPredictionsNoRemap=function(t,e){return s(i,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/predictions/users/".concat(t).concat(this.apiSignInUrl).concat(e.constructFiltersUrl()),i="There was a problem fetching predictions for user: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return[2,r.sent()]}}))}))},i.getGames=function(t,e){return s(i,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n=(0,c.isDisabledCache)(e)?"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()).concat((0,c.initDisableCache)()):"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()),[4,this.fetchWithoutAuth(n,"There was a problem fetching the games list")];case 1:return i=r.sent(),[2,this.gamesRemapper.remapPaginatedGames(i)]}}))}))},i.getGameById=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=(0,c.isDisabledCache)(e)?"/games/".concat(t).concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/games/".concat(t).concat(this.apiSignInUrl),i="There was a problem fetching the following game: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.gamesRemapper.remapGameByIdResponse(r)]}}))}))},i.getGamePredictions=function(t,e,n){return s(i,void 0,void 0,(function(){var i,r,s,o,u;return a(this,(function(a){switch(a.label){case 0:return i=new h.default,r=(0,c.isDisabledCache)(e)?"/games/".concat(t,"/predictions").concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/games/".concat(t,"/predictions").concat(this.apiSignInUrl),s="There was a problem fetching the predictions for game: ".concat(t),n&&(r+="".concat(n.constructFiltersUrl())),[4,this.fetchWithoutAuth(r,s)];case 1:return o=a.sent(),i.meta=this.metaRemapper.remapMetaData(o.meta),u=i,[4,this.predictionRemapper.remapResponseArrayBody(o.data)];case 2:return u.data=a.sent(),[2,i]}}))}))},i.getUserGameEditions=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r,s=this;return a(this,(function(a){switch(a.label){case 0:return n=null,i=(0,c.isDisabledCache)(e)?"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()).concat((0,c.initDisableCache)()):"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()),[4,this.fetchWithoutAuth(i,"There was a problem fetching the games list")];case 1:return(r=a.sent()).data.forEach((function(t){"TOP_X"===t.type?n=s.gamesRemapper.remapPaginatedUserTopXEditions(r):"MATCH_QUIZ"===t.type&&(n=s.gamesRemapper.remapPaginatedUserMathQuizEditions(r))})),[2,n]}}))}))},i.getGameResults=function(t,e,n){return s(i,void 0,void 0,(function(){var i,r,s;return a(this,(function(a){switch(a.label){case 0:return i=(0,c.isDisabledCache)(e)?"/games/".concat(t,"/results/").concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/games/".concat(t,"/results/").concat(this.apiSignInUrl),r="There was a problem fetching the results for the following game: ".concat(t),n&&(i+="".concat(n.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(i,r)];case 1:return s=a.sent(),[2,this.gamesRemapper.remapPaginatedGameResults(s)]}}))}))},i.getMarketResultsForGame=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/games/".concat(t,"/correct-results/").concat(this.apiSignInUrl),i="There was a problem fetching the markets correct results for the following game: ".concat(t),(0,c.isDisabledCache)(e)&&(n+="".concat((0,c.initDisableCache)())),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.gamesRemapper.remapGameMarketsResults(r.data)]}}))}))},i.getContestWinners=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/winners/".concat(this.apiSignInUrl,"&contest_id=").concat(t),i="There was a problem fetching winners for the following game: ".concat(t),e&&(n+=(0,c.initDisableCache)()),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.gamesRemapper.remapContestWinners(r)]}}))}))},i.getPredictionById=function(t){return s(i,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="/predictions/".concat(t).concat(this.apiSignInUrl),n="There was a problem fetching info for the following prediction: ".concat(t),[4,this.fetchWithoutAuth(e,n)];case 1:return i=r.sent(),[4,this.predictionRemapper.remapResponseArrayBody([i.data])];case 2:return[2,r.sent()[0]]}}))}))},i.getPredictionsByIds=function(t){return s(i,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/predictions/by-ids".concat(this.apiSignInUrl,"&prediction_ids=").concat(t.join(",")),[4,this.fetchWithoutAuth(e,"There was a problem fetching predictions")];case 1:return n=i.sent(),[4,this.predictionRemapper.remapResponseArrayBody(n.data)];case 2:return[2,i.sent()]}}))}))},i.predictionRemapper=new u.default(e,n),i.matchSummaryRemapper=new l.default(e,n),i.gamesRemapper=new d.default,i.metaRemapper=new f.default,i}return r(e,t),e}(o(n(7724)).default);e.default=p},8863:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(4239)),c=o(n(7724)),d=o(n(3476)),h=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"privateLeagues"))||this;return n.remapper=null,n.discussionsRemapper=null,n.discussionsBaseURL=null,n.create=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/leagues"+this.apiSignInUrl,i="There was a problem ".concat("PRIVATE_LEAGUE"===e?"creating private league":"issuing challenge"),[4,this.fetchWithAuth(n,i,"POST",t)];case 1:return r=s.sent(),[2,this.remapper.remapToPrivateLeagueById(r.data)]}}))}))},n.update=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/leagues/".concat(t)+this.apiSignInUrl,r="There was a problem updating ".concat("PRIVATE_LEAGUE"===i?"private league":"challenge"),[4,this.fetchWithAuth(n,r,"PUT",e)];case 1:return s=a.sent(),[2,this.remapper.remapToPrivateLeagueById(s.data)]}}))}))},n.updateLeagueTemplate=function(t,e,i,r){return s(n,void 0,void 0,(function(){var n,s,o,u;return a(this,(function(a){switch(a.label){case 0:return n="/leagues/".concat(t,"/template")+this.apiSignInUrl,s="There was a problem updating template for the ".concat("PRIVATE_LEAGUE"===r?"private league":"challenge"),o={new_template_id:e,past_template_name:i},[4,this.fetchWithAuth(n,s,"POST",o)];case 1:return u=a.sent(),[2,this.remapper.remapToPrivateLeagueById(u.data)]}}))}))},n.getById=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/leagues/".concat(t)+this.apiSignInUrl,(0,u.isDisabledCache)(i)&&(n+=(0,u.initDisableCache)()),r="There was a problem getting ".concat("PRIVATE_LEAGUE"===e?"private league":"challenge"),[4,this.fetchWithAuth(n,r)];case 1:return s=a.sent(),[2,this.remapper.remapToPrivateLeagueById(s.data)]}}))}))},n.getMyLeagues=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r=this;return a(this,(function(s){switch(s.label){case 0:return n="/leagues"+this.apiSignInUrl+t.constructFiltersUrl(),i="There was a problem getting user's ".concat("PRIVATE_LEAGUE"===e?"private leagues":"challenges"),[4,this.fetchWithAuth(n,i)];case 1:return[2,s.sent().data.map((function(t){return r.remapper.remapToMyPrivateLeagues(t)}))]}}))}))},n.delete=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/leagues/".concat(t)+this.apiSignInUrl,i="There was a problem deleting ".concat("PRIVATE_LEAGUE"===e?"private league":"challenge"),[4,this.fetchWithAuth(n,i,"DELETE")];case 1:return r.sent(),[2,!0]}}))}))},n.invite=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/invite/".concat(t)+this.apiSignInUrl,i="There was a problem inviting the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"POST",r)];case 1:return[2,s.sent().data]}}))}))},n.deleteInvitation=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/invite/".concat(t)+this.apiSignInUrl,i="There was a problem deleting invitation for the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"DELETE",r)];case 1:return s.sent(),[2,!0]}}))}))},n.accept=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="/membership/accept/".concat(t)+this.apiSignInUrl+"&accept=".concat(e?"ACCEPT":"REJECT"),r="PRIVATE_LEAGUE"===i?"private league":"challenge",s="There was a problem ".concat(e?"accepting":"rejecting"," invitation for ").concat(r,": ").concat(t),[4,this.fetchWithAuth(n,s,"POST")];case 1:return o=a.sent(),[2,"PRIVATE_LEAGUE"===i?this.remapper.remapToAcceptPrivateLeague(o.data):this.remapper.remapToAcceptChallenge(o.data)]}}))}))},n.ban=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/ban/".concat(t)+this.apiSignInUrl,i="There was a problem banning the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"POST",r)];case 1:return[2,s.sent().data]}}))}))},n.unban=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/unban/".concat(t)+this.apiSignInUrl,i="There was a problem unbanning the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"POST",r)];case 1:return[2,s.sent().data]}}))}))},n.join=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/membership/join"+this.apiSignInUrl+"&invitation_code=".concat(t),[4,this.fetchWithAuth(e,"There was a problem joining league","POST")];case 1:return n=i.sent(),[2,this.remapper.remapToAcceptPrivateLeague(n.data)]}}))}))},n.leave=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/membership/leave/".concat(t)+this.apiSignInUrl,i="There was a problem leaving the following ".concat("PRIVATE_LEAGUE"===e?"league":"challenge",": ").concat(t),[4,this.fetchWithAuth(n,i,"POST")];case 1:return[2,r.sent().data]}}))}))},n.getInvitations=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/invitations"+this.apiSignInUrl+e.constructMainFiltersUrl(),i="There was a problem getting invitations for ".concat("PRIVATE_LEAGUE"===t?"leagues":"challenges"),[4,this.fetchWithAuth(n,i)];case 1:return r=s.sent(),[2,this.remapper.remapToPrivateLeagues(r)]}}))}))},n.getReportedPosts=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/discussions/".concat(t,"/posts/reported").concat(this.apiSignInUrl),i="There was a problem fetching posts for the following: ".concat(t),e&&(n+=e.constructMainFiltersUrl()),[4,this.fetchWithAuthNewBaseURL(this.discussionsBaseURL,n,i)];case 1:return r=s.sent(),[2,this.discussionsRemapper.remapToPostsForDiscussion(r,"full")]}}))}))},n.getPredictions=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/leagues/".concat(t,"/predictions")+this.apiSignInUrl,i="There was a problem getting predictions for private league: ".concat(t),e&&(n+=e.constructFiltersUrl()),[4,this.fetchWithAuth(n,i)];case 1:return r=s.sent(),[2,this.remapper.remapPredictions(r)]}}))}))},n.moderatePost=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/posts/".concat(t,"/admin/moderate").concat(this.apiSignInUrl),i="There was a problem moderating the following post: ".concat(t),r={moderation_reason:e},[4,this.fetchWithAuthNewBaseURL(this.discussionsBaseURL,n,i,"POST",r)];case 1:return s=a.sent(),[2,this.discussionsRemapper.remapToPostByIdBasic(s.data)]}}))}))},n.discussionsBaseURL=(0,u.setBaseUrl)(e.environment,"discussions"),n.remapper=new l.default,n.discussionsRemapper=new d.default,n}return r(e,t),e}(c.default);e.default=h},4275:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(441)),c=o(n(8673)),d=o(n(6277)),h=o(n(1712)),f=o(n(7724)),p="/profile",m="/profiles",v=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"profile"))||this;return n.profileRemapper=null,n.followingRemapper=null,n.followersRemapper=null,n.lang=null,n.limitIds=100,n.getCountries=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="&lang=".concat(this.lang),n="".concat("/countries").concat(this.apiSignInUrl).concat(e),i=Date.now(),t&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem fetching profile countries")];case 1:return[2,r.sent().data]}}))}))},n.getProfile=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="".concat(p).concat(this.apiSignInUrl),n="",t?(e="".concat(m,"/").concat(t).concat(this.apiSignInUrl),n="There was a problem fetching the following profile: ".concat(t),[4,this.fetchWithoutAuth(e,n)]):[3,2];case 1:case 3:return i=r.sent(),[2,this.profileRemapper.fullProfileFromResponse(i.data)];case 2:return n="There was a problem fetching your profile from API",[4,this.fetchWithAuth(e,n)]}}))}))},n.getProfiles=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o,l,c,d,h,f,p,v,_,y;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),r="There was a problem fetching the following profiles: ".concat(t.join(",")),!t||!t.length)return[3,7];if(!(t.length>this.limitIds))return[3,5];s=[],o=(0,u.limitIds)(t,this.limitIds),l=0,c=o,a.label=1;case 1:return l<c.length?(d=c[l],h="".concat(m).concat(this.apiSignInUrl,"&profile_ids=").concat(d.join(",")),r="There was a problem fetching the following profiles: ".concat(d.join(",")),i&&(h+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(h,r)]):[3,4];case 2:f=a.sent(),s.push.apply(s,this.profileRemapper.profilesFromResponse(f.data)),a.label=3;case 3:return l++,[3,1];case 4:return[2,s];case 5:return p="".concat(m).concat(this.apiSignInUrl,"&profile_ids=").concat(t.join(",")),i&&(p+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(p,r)];case 6:return v=a.sent(),[2,this.profileRemapper.profilesFromResponse(v.data)];case 7:return _="".concat(m).concat(this.apiSignInUrl,"&search=").concat(e),i&&(_+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(_,r)];case 8:return y=a.sent(),[2,this.profileRemapper.profilesFromResponse(y.data)]}}))}))},n.getFollowers=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="".concat(p,"/followers").concat(this.apiSignInUrl),i="There was a problem fetching the followers for own profile",!t||e?[3,2]:(n="".concat(p,"/followers").concat(this.apiSignInUrl).concat(t.constructFilterUrl()),[4,this.fetchWithAuth(n,i)]);case 1:return r=a.sent(),[2,this.followersRemapper.followersFromResponse(r)];case 2:return t||e?[3,4]:[4,this.fetchWithAuth(n,i)];case 3:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s)];case 4:return t&&e?n="".concat(p,"/").concat(e,"/followers").concat(this.apiSignInUrl).concat(t.constructFilterUrl()):!t&&e&&(n="".concat(p,"/").concat(e,"/followers").concat(this.apiSignInUrl)),i="There was a problem fetching the followers for profile: ".concat(e),[4,this.fetchWithoutAuth(n,i)];case 5:return o=a.sent(),[2,this.followersRemapper.followersFromResponse(o)]}}))}))},n.getFollowing=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="".concat(p,"/following").concat(this.apiSignInUrl),i="There was a problem fetching the followers of own profile",!t||e?[3,2]:(n="".concat(p,"/following").concat(this.apiSignInUrl).concat(t.constructFilterUrl()),[4,this.fetchWithAuth(n,i)]);case 1:return r=a.sent(),[2,this.followingRemapper.followingFromResponse(r)];case 2:return t||e?[3,4]:[4,this.fetchWithAuth(n,i)];case 3:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s)];case 4:return t&&e?n="".concat(p,"/").concat(e,"/following").concat(this.apiSignInUrl).concat(t.constructFilterUrl()):!t&&e&&(n="".concat(p,"/").concat(e,"/following").concat(this.apiSignInUrl)),i="There was a problem fetching the followers of the following profile: ".concat(e),[4,this.fetchWithoutAuth(n,i)];case 5:return o=a.sent(),[2,this.followingRemapper.followingFromResponse(o)]}}))}))},n.follow=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(s){switch(s.label){case 0:return(e=new h.default).profile_ids=t,n=p+"/follow".concat(this.apiSignInUrl),i="There was a problem with following profiles: ".concat(t.join(",")),[4,this.fetchWithAuth(n,i,"POST",e)];case 1:return r=s.sent(),[2,this.followingRemapper.followResponse(r.data)]}}))}))},n.unfollow=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return(e=new h.default).profile_ids=t,n=p+"/follow".concat(this.apiSignInUrl),i="There was a problem with unfollowing profiles: ".concat(t.join(",")),[4,this.fetchWithAuth(n,i,"DELETE",e)];case 1:return r.sent(),[2,!0]}}))}))},n.getBadges=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="".concat(p,"/badges").concat(this.apiSignInUrl),n="There was a problem with fetching own badges",t?(e="".concat(p,"/").concat(t,"/badges").concat(this.apiSignInUrl),n="There was a problem with fetching the badges",[4,this.fetchWithoutAuth(e,n)]):[3,2];case 1:case 3:return[2,i.sent().data];case 2:return[4,this.fetchWithAuth(e,n)]}}))}))},n.updateProfile=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e=p+this.apiSignInUrl,[4,this.fetchWithAuth(e,"There was a problem updating the own profile","PATCH",t)];case 1:return n=i.sent(),[2,this.profileRemapper.fullProfileFromResponse(n.data)]}}))}))},n.lang=e.lang,n.profileRemapper=new l.default,n.followingRemapper=new c.default,n.followersRemapper=new d.default,n}return r(e,t),e}(f.default);e.default=v},1613:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(6829)),c=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"voting"))||this;return n.pollRemapper=null,n.getPolls=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/polls".concat(this.apiSignInUrl),t&&(n+=t.constructMainFiltersUrl()),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem fetching polls")];case 1:return i=r.sent(),[2,this.pollRemapper.remapPolls(i)]}}))}))},n.getPollById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/polls/".concat(t).concat(this.apiSignInUrl),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),i="There was a problem fetching the following poll: "+t,[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.pollRemapper.remapPollById(r.data)]}}))}))},n.voteForPoll=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/polls/".concat(t,"/votes").concat(this.apiSignInUrl),i={option_id:e},r="There was a problem voting for the following poll: "+t,[4,this.fetchWithAuth(n,r,"PUT",i)];case 1:return s=a.sent(),[2,this.pollRemapper.remapUserVote(s.data)]}}))}))},n.deleteVoteForPoll=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/polls/".concat(t,"/votes").concat(this.apiSignInUrl),n="There was a problem deleting vote for the following poll: "+t,[4,this.fetchWithAuth(e,n,"DELETE")];case 1:return i.sent(),[2,!0]}}))}))},n.getMyPollVote=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="/polls/".concat(t,"/votes").concat(this.apiSignInUrl),n="There was a problem fetching user's own vote for the following poll: "+t,[4,this.fetchWithAuth(e,n)];case 1:return i=r.sent(),[2,this.pollRemapper.remapPollVote(i.data)]}}))}))},n.getMyPollsVotes=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/polls/votes".concat(this.apiSignInUrl),t&&(e+=t.constructMainFiltersUrl()),[4,this.fetchWithAuth(e,"There was a problem fetching user's votes for polls")];case 1:return n=i.sent(),[2,this.pollRemapper.remapPollsVotes(n)]}}))}))},n.pollRemapper=new l.default,n}return r(e,t),e}(o(n(7724)).default);e.default=c},5792:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8539)),o=s(n(8358));e.default=function(t){var e=this;this.localCache=null,this.https=null,this.getEntitiesByIds=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i,a,o;return r(this,(function(r){switch(r.label){case 0:return[4,this.setTopIdMappings()];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),e=this.localCache.checkForExistingIdObjs(t,n),i=this.splitForRequestAndExisting(e),[4,this.https.getEntitiesByIdObjs(i.request,n)];case 3:return a=r.sent(),this.localCache.addIdMappings(a),[2,this.localCache.getIdsByType(t,n,s)];case 4:return o=r.sent(),console.warn("There was a problem retrieving the entity ids ",o),[2,Promise.resolve([])];case 5:return[2]}}))}))},this.getEntityById=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return(e=this.localCache.getEntity(t,n,s))?[2,e]:[4,this.requestEntity(t,n,s)];case 1:return i=r.sent(),this.localCache.addIdMappings(i),i&&i.length>0?[2,i[0]]:[2,null]}}))}))},this.splitForRequestAndExisting=function(t){var e={},n={};return Object.keys(t).forEach((function(i){e[i]=t[i].filter((function(t){return!t.exists})).map((function(t){return t.id})),n[i]=t[i].filter((function(t){return t.exists})).map((function(t){return t.id}))})),{existing:n,request:e}},this.requestEntity=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=Array.isArray(t)?t:[t],[4,this.https.getEntitiesByIds(n,t,s)];case 1:return[2,i.sent()];case 2:return e=i.sent(),console.warn("There was a problem retrieving the requested entity: ".concat(e)),[2,null];case 3:return[2]}}))}))},this.setTopIdMappings=function(){return i(e,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return t=Math.floor(Date.now()/1e3),this.localCache.getExpiration("football","ids")>t?[2,Promise.resolve()]:[4,this.https.getTopEntities()];case 1:return e=n.sent(),this.localCache.addTopIdMappings(e),[2]}}))}))},this.localCache=(new o.default).createLocalCacheInstance(t.idSchema),this.https=new a.default(t)}},8900:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(5792)),u=s(n(7611)),l=s(n(9052));e.default=function(t){var e=this;this.idSchema="",this.idMappingFacade=null,this.getEntityIdBySchemaId=function(t,n){return e.idMappingFacade.getEntityById(n,t,e.idSchema)},this.remapEntities=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s;return r(this,(function(r){e=JSON.parse(JSON.stringify(t));try{return this.idSchema!==a.IdSchemaEnum.NATIVE?(i=new u.default,s=i.traverse(e,n),[2,this.idMappingFacade.getEntitiesByIds(s,"native",this.idSchema).then((function(t){return(new l.default).traverse(e,n,t)}))]):[2,t]}catch(t){return console.warn("There was a problem remapping entity: ".concat(n," with inner entity "),t),[2,[]]}return[2]}))}))},this.getEntityIdsBySchemaId=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return(e={})[n]=t,this.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.idMappingFacade.getEntitiesByIds(e,this.idSchema,s)];case 1:return[2,i.sent()];case 2:return[2,e]}}))}))},this.idSchema=t.idSchema,this.idMappingFacade=new o.default(t)}},3845:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConvert=void 0,e.typeConvert=function(t){switch(t){case"competitions":return"competition";case"players":case"relatedPlayer":case"squad":return"player";case"teams":case"participants":case"homeTeam":case"awayTeam":case"timeline":case"teamId":return"team";default:return t}}},7611:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3845);e.default=function(){var t=this;this.extractedObjIds={},this.traverse=function(e,n){return n=(0,i.typeConvert)(n),Array.isArray(e)?t.traverseArrExtract(e,n):e&&"object"==typeof e&&t.traverseObjExtract(e,n),t.extractedObjIds},this.traverseArrExtract=function(e,n){e&&e.length>0&&e.forEach((function(e){t.traverseObjExtract(e,n)}))},this.traverseObjExtract=function(e,n){e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(i){var r=e[i];"id"===i||"teamId"===i?(t.extractedObjIds.hasOwnProperty(n)||(t.extractedObjIds[n]=[]),r&&t.extractedObjIds[n].push(r)):e[i]&&t.traverse(e[i],i)}))}}},9052:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3845);e.default=function(){var t=this;this.replaceObjIdsIndex=null,this.remappedIdsObj={},this.traverse=function(e,n,r){return n=(0,i.typeConvert)(n),null===t.replaceObjIdsIndex&&(t.initReplaceObjIdsIndex(r),t.remappedIdsObj=r),Array.isArray(e)?t.traverseArrReplace(e,n):e&&"object"==typeof e&&t.traverseObjReplace(e,n),e},this.initReplaceObjIdsIndex=function(e){t.replaceObjIdsIndex={},Object.keys(e).forEach((function(e){t.replaceObjIdsIndex[e]=0}))},this.traverseArrReplace=function(e,n){e&&e.length>0&&e.forEach((function(e){t.traverseObjReplace(e,n)}))},this.traverseObjReplace=function(e,n){e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(i){"id"===i||"teamId"===i?e[i]&&(e[i]=t.remappedIdsObj[n][t.replaceObjIdsIndex[n]],t.replaceObjIdsIndex[n]=t.replaceObjIdsIndex[n]+1):e[i]&&t.traverse(e[i],i,t.remappedIdsObj)}))}}},7302:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(5936));e.default=function(t){var e=this;this.add=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.add(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.like=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.like(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.dislike=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.dislike(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addPageview=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addPageview(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addContentConsumed=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addContentConsumed(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addShare=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addShare(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addComment=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addComment(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addClickAd=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addClickAd(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addConversion=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addConversion(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getOwn=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.getOwn(t,n)];case 1:return[2,e.sent()]}}))}))},this.getForUser=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.getForUser(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.activityFacade=new a.default(t)}},1491:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ActionsEnum=void 0,(n=e.ActionsEnum||(e.ActionsEnum={})).LIKE="like",n.DISLIKE="dislike",n.PAGE_VIEW="page_view",n.CONTENT_CONSUMED="content_consumed",n.SHARE="share",n.COMMENT="comment",n.CLICK_AD="click_ad",n.CONVERSION="conversion",n.PREDICTION_MADE="prediction_made",n.CONVERT="convert",n.MANAGE_INTERESTS="manage_interests",n.GAME_PARTICIPATION="game_participation",n.ARTICLE_CONSUMED="article_consumed",n.VIDEO_CONSUMED="video_consumed",n.SHORT_VIDEO_CONSUMED="short_video_consumed",n.LONG_VIDEO_CONSUMED="long_video_consumed",n.AUDIO_CONSUMED="audio_consumed",n.GALLERY_CONSUMED="gallery_consumed",n.IMAGE_CONSUMED="image_consumed",n.POLL_PARTICIPATION="poll_participation"},5936:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=a(n(1022)),l=n(1491),c=a(n(4630)),d=a(n(8261)),h=a(n(629)),f=a(n(8636));e.default=function(t){var e=this;this.add=function(t,n,s,a){return i(e,void 0,void 0,(function(){var e,i,u,l,d;return r(this,(function(r){switch(r.label){case 0:return this.idSchema==o.IdSchemaEnum.NATIVE?[3,3]:(e=JSON.parse(JSON.stringify(n)),[4,this.activityService.remapTagsIds(n,this.idSchema,o.IdSchemaEnum.NATIVE)]);case 1:return i=r.sent(),u=new c.default(t,i,s,a),[4,this.activityHttps.createActivity(u)];case 2:return(l=r.sent()).context.tags=e,[2,l];case 3:return d=new c.default(t,n,s,a),[2,this.activityHttps.createActivity(d)]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityHttps.deleteActivity(t)];case 1:return[2,e.sent()]}}))}))},this.like=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.LIKE,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.dislike=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.DISLIKE,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addPageview=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.PAGE_VIEW,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addContentConsumed=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.CONTENT_CONSUMED,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addShare=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.SHARE,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addComment=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.COMMENT,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addClickAd=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.CLICK_AD,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addConversion=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.CONVERSION,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.getOwn=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s,a;return r(this,(function(r){switch(r.label){case 0:return n=n||!1,t&&(t=new h.default(t)),this.idSchema==o.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getOwnActivities(t,n)];case 1:e=r.sent(),i=0,s=e.data,r.label=2;case 2:return i<s.length?(a=s[i],[4,this.activityService.remapTagsIds(a.context.tags,o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:r.sent(),r.label=4;case 4:return i++,[3,2];case 5:return[2,e];case 6:return[4,this.activityHttps.getOwnActivities(t,n)];case 7:return[2,r.sent()]}}))}))},this.getForUser=function(t,n,a){return i(e,void 0,void 0,(function(){var e,i,u,l,c;return r(this,(function(r){switch(r.label){case 0:return a=a||!1,n&&(n=new f.default(n)),this.idSchema==o.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getActivitiesForUser(t,n,a)];case 1:e=r.sent(),i=JSON.parse(JSON.stringify(e)),u=0,l=i.data,r.label=2;case 2:return u<l.length?(c=l[u],[4,this.activityService.remapTagsIds(s([],c.context.tags,!0),o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:r.sent(),r.label=4;case 4:return u++,[3,2];case 5:return[2,i];case 6:return[4,this.activityHttps.getActivitiesForUser(t,n,a)];case 7:return[2,r.sent()]}}))}))},this.idSchema=t.idSchema,this.activityHttps=new u.default(t),this.activityService=new d.default(t)}},1517:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2820));e.default=function(){this.id=null,this.profileId=null,this.property=null,this.value=null,this.action=null,this.context=new r.default,this.points=0}},2195:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.page=null,this.limit=null,this.page=t.page?t.page:null,this.limit=t.limit?t.limit:null}},629:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.action=null,n.action=e.action?e.action:null,n}return r(e,t),e.prototype.constructFilterUrl=function(){var t="";return this.action&&(t+="&",t+="action=".concat(this.action)),this.page&&(t+="&",t+="page=".concat(this.page)),this.limit&&(t+="&",t+="limit=".concat(this.limit)),t},e}(s(n(2195)).default);e.default=a},8636:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.action=null,n.action=e.action?e.action:null,n}return r(e,t),e.prototype.constructFilterUrl=function(){var t="";return this.action&&(t+="&",t+="action=".concat(this.action)),this.page&&(t+="&",t+="page=".concat(this.page)),this.limit&&(t+="&",t+="limit=".concat(this.limit)),t},e}(s(n(2195)).default);e.default=a},6021:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3569)),s=i(n(1517));e.default=function(){this.meta=new r.default,this.data=[new s.default]}},2820:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.content=null,this.tags=[],this.campaign=null}},7060:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.source=null,this.type=null}},4630:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2820));e.default=function(t,e,n,i){this.action=null,this.context=new r.default,this.action=t,this.context.tags=e,n&&(this.context.content=n),i&&(this.context.campaign=i)}},2453:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(817),a=n(7974),o=r(n(1758)),u=r(n(6635)),l=r(n(3009)),c=r(n(7165)),d=r(n(5490)),h=r(n(1316)),f=r(n(3195)),p=r(n(1342)),m=r(n(9826)),v=r(n(3087)),_=r(n(1517)),y=r(n(6021));e.default=function(){var t=this;this.remapSingleResponse=function(t){var e=new _.default;return e.id=t.id,e.profileId=t.profile_id,e.property=t.property,e.value=t.value,e.action=t.action,e.context.content=t.context.content,e.context.tags=t.context.tags,e.context.campaign=t.context.campaign,e.points=t.points,e},this.remapActivitiesResponse=function(e){var n=new y.default;return n.meta.pagination.currentPage=e.meta.pagination.current_page,n.meta.pagination.itemsPerPage=e.meta.pagination.items_per_page,n.meta.pagination.numberOfPages=e.meta.pagination.number_of_pages,n.meta.pagination.totalItems=e.meta.pagination.total_items,n.data=e.data.map((function(e){return t.remapSingleResponse(e)})),n},this.remapStatsResponse=function(e){var n=new h.default;return n.profileId=e.profile_id,n.tier=e.tier,n.points=e.points,n.predictionsMade=e.predictions_made,n.successRates.overallPercent=e.success_rates.overall_percent,n.successRates.byFootballCompetition=t.constructNewRecord(e.success_rates.by_competition),n.successRates.byFootballTeam=t.constructNewRecord(e.success_rates.by_team),n.successRates.byFootballMarket=t.constructNewRecord(e.success_rates.by_market),n.predictions=e.predictions?t.remapPredictionsStats(e.predictions):null,n.tiers=e.tiers?t.remapAchievementsStats(e.tiers):null,n.badges=e.badges?t.remapAchievementsStats(e.badges):null,n.discussions=e.discussions?t.remapDiscussionStats(e.discussions):null,n.classicQuizzes=e.classic_quizzes?t.remapClassicQuizStats(e.classic_quizzes):null,n.eitherOr=e.either_or?t.remapEitherOrStats(e.either_or):null,n},this.constructNewRecord=function(e){var n;return Object.entries(e).length?(Object.entries(e).forEach((function(e){var r,s=e[0],o=e[1];n=i(i({},n),((r={})[s]=t.remapSuccessRatePercent(o),r)),a.MarketEnum[s]&&delete n[s].model})),n):e},this.remapSuccessRatePercent=function(t){var e=new m.default;return e.successRatePercent=t.success_rate_percent,e},this.remapPredictionsStats=function(e){var n=new d.default;return n.single=t.remapSinglePredictionsStats(e.single),n.topX=e.top_x,n.matchQuiz=e.match_quiz,n},this.remapSinglePredictionsStats=function(e){var n=new p.default;return n.predictionsMade=e.predictions_made,n.correct=e.correct,n.points=e.points,n.breakdown=t.remapBreakdownSinglePredictionsStats(e.breakdown),n},this.remapBreakdownSinglePredictionsStats=function(t){if(t&&Object.keys(t).length){var e=new v.default,n=[],i=[];return Object.keys(t).forEach((function(e){var r=new f.default;r.entityId=e,r.entityType=t[e].entity_type,r.entitySource=t[e].entity_source,r.predictionsMade=t[e].predictions_made,r.correct=t[e].correct,r.points=t[e].points,r.entityType===s.EntityTypeEnum.COMPETITION?n.push(r):r.entityType===s.EntityTypeEnum.TEAM&&i.push(r)})),e.footballCompetitions=n,e.footballTeams=i,e}return new v.default},this.remapAchievementsStats=function(t){return t.map((function(t){var e=new o.default;return e.id=t.id,e.achievedAt=t.achieved_at,e}))},this.remapDiscussionStats=function(t){var e=new l.default;return e.totalPoints=t.total_points,e.postPoints=t.post_points,e.postsMade=t.posts_made,e.reactionPoints=t.reaction_points,e.reactionCount=t.reaction_count,e},this.remapClassicQuizStats=function(t){var e=new u.default;return e.participationCount=t.participation_count,e.points=t.points,e},this.remapEitherOrStats=function(t){var e=new c.default;return e.participationCount=t.participation_count,e}}},8261:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900));e.default=function(t){var e=this;this.remapTagsIds=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i,a,o,u,l,c,d,h,f;return r(this,(function(r){switch(r.label){case 0:return t&&t.length?(e={},i={},a=[],t.forEach((function(t){e.hasOwnProperty(t.type)||(e[t.type]=[],i[t.type]=[]),e[t.type].push(t.id),i[t.type].push(t)})),[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,n,s)]):[2,t];case 1:for(o=r.sent(),u=function(t,e){e.forEach((function(e,n){e.id=o[t][n],a.push(e)}))},l=0,c=Object.entries(i);l<c.length;l++)d=c[l],h=d[0],f=d[1],u(h,f);return[2,a]}}))}))},this.idSchema=t.idSchema,this.idMapping=new a.default(t)}},4068:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(123));e.default=function(t){var e=this;this.facade=null,this.issue=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.issue(t,n)];case 1:return[2,e.sent()]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.update(t,n)];case 1:return[2,e.sent()]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.updateTemplate(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyChallenges=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyChallenges(t)];case 1:return[2,e.sent()]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.accept(t)];case 1:return[2,e.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.reject(t)];case 1:return[2,e.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.leave(t)];case 1:return[2,e.sent()]}}))}))},this.getMyChallengesStandings=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyChallengesStandings(t)];case 1:return[2,e.sent()]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getInvitations(t)];case 1:return[2,e.sent()]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getReportedPosts(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPredictions(t,n)];case 1:return[2,e.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},123:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7059)),o=s(n(8863)),u=s(n(5955)),l=s(n(3886)),c=s(n(9759)),d=n(4021),h=n(4904),f=s(n(2535)),p=n(5318),m=s(n(8247)),v=s(n(2590)),_=s(n(6409)),y=s(n(3820)),g=s(n(5230)),b=s(n(2388));e.default=function(t){var e=this;this.factory=null,this.https=null,this.loyaltyHttps=null,this.profile=null,this.service=null,this.discussionsService=null,this.issue=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s;return r(this,(function(r){switch(r.label){case 0:return e=this.factory.createRequestBodyFromParam(t,"ONE_VS_ONE"),[4,this.https.create(e,"CHALLENGE")];case 1:return i=r.sent(),[4,this.service.setTemplateModels(i)];case 2:return r.sent(),[4,this.https.invite(i.id,[n])];case 3:return s=r.sent(),i.invites=[],i.invites.push(s[0]),[2,i]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return e=this.factory.createUpdateRequestBodyFromParam(n,"ONE_VS_ONE"),[4,this.https.update(t,e,"CHALLENGE")];case 1:return i=r.sent(),[4,this.service.setTemplateModels(i)];case 2:return r.sent(),[2,i]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.https.updateLeagueTemplate(t,n,s,"CHALLENGE")];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.delete(t,"CHALLENGE")];case 1:return[2,e.sent()]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.https.getById(t,"CHALLENGE",n)];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.getMyChallenges=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return t=new b.default(t),[4,this.https.getMyLeagues(t,"CHALLENGE")];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e)];case 2:return n.sent(),[2,e]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!0,[4,this.https.accept(t,e,"CHALLENGE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!1,[4,this.https.accept(t,e,"CHALLENGE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.leave(t,"CHALLENGE")];case 1:return[2,e.sent()]}}))}))},this.finalizeAcceptModel=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return n?[4,this.getById(t.challengeId)]:[3,2];case 1:e=i.sent(),t.challengeModel=e,i.label=2;case 2:return[4,this.service.setProfileModel(t)];case 3:return i.sent(),[2,t]}}))}))},this.getMyChallengesStandings=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new y.default(t)),[4,this.profile.getOwn().getInfo()];case 1:return e=r.sent(),[4,this.loyaltyHttps.getUserRankingsForPrivateLeagueAndChallenges(e.id,"CHALLENGE",t)];case 2:n=r.sent(),i=0,s=n.data,r.label=3;case 3:return i<s.length?(a=s[i],[4,this.getById(a.challengeId)]):[3,6];case 4:o=r.sent(),a.challengeModel=o,r.label=5;case 5:return i++,[3,3];case 6:return this.service.setTemplateModelsFromLeagueModels(n.data,"CHALLENGE"),[2,n]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return(t=new l.default(t)).type="ONE_VS_ONE",[4,this.https.getInvitations("CHALLENGE",t)];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e.data)];case 2:return n.sent(),[2,e]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return n&&(n=new c.default(n)),[4,this.https.getReportedPosts(t,n)];case 1:return e=r.sent(),i=e,[4,this.discussionsService.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:if(n){if(n.limit&&n.limit>20)throw new f.default(d.ErrorCodes.BAD_METHOD_CALL,h.ErrorStatuses.INVALID_LIMIT,p.ErrorMessages.INVALID_LIMIT);n=new m.default(n)}return[4,this.https.getPredictions(t,n)];case 1:return e=i.sent(),[4,this.service.setModelsForPredictions(e)];case 2:return[2,i.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.factory=new u.default,this.https=new o.default(t),this.service=new v.default(t),this.loyaltyHttps=new a.default(t),this.profile=new _.default(t),this.discussionsService=new g.default(t)}},6085:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.profileId="",this.profileModel=null,this.challengeId="",this.challengeModel=null,this.message=""}},5124:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ONE_VS_ONE",e}return r(e,t),e}(s(n(2167)).default);e.default=a},9845:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ONE_VS_ONE",e}return r(e,t),e}(s(n(4584)).default);e.default=a},3820:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=null,this.page=null,this.challengeId=null,this.templateId=null,this.sortOrder=null,this.constructFiltersUrl=function(){var t="";return e.limit&&(t+="&limit=".concat(e.limit)),e.page&&(t+="&page=".concat(e.page)),e.challengeId&&(t+="&league_id=".concat(e.challengeId)),e.templateId&&(t+="&template_id=".concat(e.templateId)),e.sortOrder&&(t+="&sort_order=".concat(e.sortOrder)),t},this.limit=t&&t.limit?t.limit:null,this.page=t&&t.page?t.page:null,this.challengeId=t&&t.challengeId?t.challengeId:null,this.templateId=t&&t.templateId?t.templateId:null,this.sortOrder=t&&t.sortOrder?t.sortOrder:null}},2388:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.type="ONE_VS_ONE",this.userRole=null,this.constructFiltersUrl=function(){var t="&type=".concat(e.type);return e.userRole&&(t+="&user_role=".concat(e.userRole)),t},this.userRole=(null==t?void 0:t.userRole)||null}},1298:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId="",this.templateModel=null,this.challengeId="",this.challengeModel=null,this.position="",this.points=0,this.type="challenge"}},244:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(5645));e.default=function(t){var e=this;this.facade=null,this.getAll=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getAll(t,n)];case 1:return[2,e.sent()]}}))}))},this.getById=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getById(t)];case 1:return[2,e.sent()]}}))}))},this.createPost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.createPost(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPostById=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPostById(t)];case 1:return[2,e.sent()]}}))}))},this.updatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.updatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.deletePost=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.deletePost(t)];case 1:return[2,e.sent()]}}))}))},this.getPosts=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPosts(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPostReplies=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPostReplies(t,n)];case 1:return[2,e.sent()]}}))}))},this.react=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.reactToPost(t,n)];case 1:return[2,e.sent()]}}))}))},this.reportPost=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.reportPost(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getOwnPosts=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getOwnPosts(t)];case 1:return[2,e.sent()]}}))}))},this.getUserPosts=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getUserPosts(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.facade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getPostsCount=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPostsCount(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopDiscussions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getTopDiscussions(t,n)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},5645:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4946),c=n(4021),d=n(4904),h=u(n(8097)),f=u(n(2535)),p=n(5318),m=s(n(7686)),v=u(n(7945)),_=u(n(8261)),y=u(n(5383)),g=u(n(505)),b=u(n(9209)),w=u(n(4804)),I=u(n(5230));e.default=function(t){var e=this;this.idSchema=null,this.errorHandlingMode=null,this.https=null,this.clientHttps=null,this.activityService=null,this.service=null,this.factory=null,this.getAll=function(t,n){return a(e,void 0,void 0,(function(){var e,i,r,s;return o(this,(function(a){switch(a.label){case 0:return t&&(t=new g.default(t)),[4,this.https.getAll(t,n)];case 1:e=a.sent(),i=0,r=e.data,a.label=2;case 2:return i<r.length?(s=r[i],[4,this.remapTags(s,l.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:a.sent(),a.label=4;case 4:return i++,[3,2];case 5:return[2,e]}}))}))},this.getById=function(t){return a(e,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.https.getById(t)];case 1:return e=n.sent(),[4,this.remapTags(e,l.IdSchemaEnum.NATIVE,this.idSchema)];case 2:return n.sent(),[2,e]}}))}))},this.createPost=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return e=JSON.parse(JSON.stringify(n)),[4,this.remapTags(e,this.idSchema,l.IdSchemaEnum.NATIVE)];case 1:return r.sent(),i=this.factory.createRequestBodyFromParam(e),[4,this.https.createPost(t,i)];case 2:return[2,r.sent()]}}))}))},this.getPostById=function(t){return a(e,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.https.getPostById(t)];case 1:return e=n.sent(),[4,this.service.finalizePostFullModel([e])];case 2:return[2,n.sent()[0]]}}))}))},this.updatePost=function(t,n){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.updatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.deletePost=function(t){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.deletePost(t)];case 1:return[2,e.sent()]}}))}))},this.getPosts=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return n&&(n=new b.default(n)),[4,this.https.getPosts(t,n)];case 1:return e=r.sent(),i=e,[4,this.service.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.getPostReplies=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return n&&(n=new b.default(n)),[4,this.https.getPostReplies(t,n)];case 1:return e=r.sent(),i=e,[4,this.service.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.reactToPost=function(t,n){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.reactToPost(t,n)];case 1:return[2,e.sent()]}}))}))},this.reportPost=function(t,n,i){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.reportPost(t,n,i)];case 1:return[2,e.sent()]}}))}))},this.getOwnPosts=function(t){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return t&&(t=new b.default(t)),[4,this.https.getOwnPosts(t)];case 1:return[2,e.sent()]}}))}))},this.getUserPosts=function(t,n,i){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return n&&(n=new b.default(n)),[4,this.https.getUserPosts(t,n,i)];case 1:return[2,e.sent()]}}))}))},this.getConfig=function(){return a(e,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(m.FeatureConfigType.DISCUSSIONS)];case 1:return[2,t.sent()]}}))}))},this.getPostsCount=function(t,n){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||!Array.isArray(t)||!t.length){if("standard"===this.errorHandlingMode)throw new f.default(c.ErrorCodes.BAD_METHOD_CALL,d.ErrorStatuses.INVALID_DISCUSSION_IDS,p.ErrorMessages.INVALID_DISCUSSION_IDS);throw new h.default(c.ErrorCodes.BAD_METHOD_CALL,d.ErrorStatuses.INVALID_DISCUSSION_IDS,p.ErrorMessages.INVALID_DISCUSSION_IDS)}return[4,this.https.getPostsCount(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopDiscussions=function(t,n){return a(e,void 0,void 0,(function(){var e,i,r,s;return o(this,(function(a){switch(a.label){case 0:return t?(t=new w.default(t),[4,this.service.finalizeTopDiscussionsFilters(t)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,this.https.getTopDiscussions(t,n)];case 3:e=a.sent(),i=0,r=e.data,a.label=4;case 4:return i<r.length?(s=r[i],[4,this.remapTags(s,l.IdSchemaEnum.NATIVE,this.idSchema)]):[3,7];case 5:a.sent(),a.label=6;case 6:return i++,[3,4];case 7:return[2,e]}}))}))},this.remapTags=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r;return o(this,(function(s){switch(s.label){case 0:return this.idSchema!=l.IdSchemaEnum.NATIVE&&t.context&&t.context.tags&&t.context.tags.length?(e=JSON.parse(JSON.stringify(t.context.tags)),[4,this.activityService.remapTagsIds(e,n,i)]):[3,2];case 1:r=s.sent(),t.context.tags=r,s.label=2;case 2:return[2]}}))}))},this.idSchema=t.idSchema,this.errorHandlingMode=t.errorHandlingMode,this.https=new v.default(t),this.clientHttps=new m.default(t),this.activityService=new _.default(t),this.service=new I.default(t),this.factory=new y.default}},5383:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5678));e.default=function(){this.createRequestBodyFromParam=function(t){var e=new r.default;return e.content=t.content,e.reply_id=t.replyId,e.anonymous_nickname=t.userNickname,e.context=t.context,e}}},3949:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1079));e.default=function(){this.enabled=!1,this.moderateLinks=!1,this.linksWhitelist=[],this.moderatorProfileId="",this.dictionary=new r.default}},1079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.reason="",this.words=[]}},8543:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3949));e.default=function(){this.enabled=!1,this.clientId=null,this.automaticModeration=new r.default}},7897:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.label="",this.discussionType="LEAGUE",this.moderationType="USER",this.postsCount=0,this.pinnedPosts=[],this.lastPostId="",this.status="",this.deleted=!1,this.deletedAt="",this.deletedBy="",this.customFields=null,this.context=null,this.createdAt="",this.updatedAt=""}},505:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4800)),o=["CREATED_AT_ASC","CREATED_AT_DESC","POSTS_COUNT_ASC","POSTS_COUNT_DESC"],u=["ACTIVE","INACTIVE"],l=function(t){function e(e){var n=t.call(this,e)||this;return n.discussionIds=e&&e.discussionIds?e.discussionIds:null,n.label=e&&e.label?e.label:null,n.fromDate=e&&e.fromDate?e.fromDate:null,n.toDate=e&&e.toDate?e.toDate:null,n.fromCount=e&&e.fromCount?e.fromCount:null,n.toCount=e&&e.toCount?e.toCount:null,n.sort=e&&e.sort?e.sort:null,n.status=(null==e?void 0:e.status)||null,n.skipDeleted=e&&void 0!==e.skipDeleted?e.skipDeleted:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return null!==this.discussionIds&&(e+="&discussion_ids=".concat(this.discussionIds.join(","))),null!==this.label&&(e+="&label=".concat(this.label)),null!==this.fromDate&&(e+="&from_date=".concat(this.fromDate)),null!==this.toDate&&(e+="&to_date=".concat(this.toDate)),null!==this.fromCount&&(e+="&from_count=".concat(this.fromCount)),null!==this.toCount&&(e+="&to_count=".concat(this.toCount)),this.sort&&o.includes(this.sort.toUpperCase())&&(e+="&sort=".concat(this.sort.toUpperCase())),this.status&&u.includes(this.status.toUpperCase())&&(e+="&status=".concat(this.status.toUpperCase())),null!==this.skipDeleted&&(e+="&skip_deleted=".concat(this.skipDeleted)),e},e}(a.default);e.default=l},9209:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.skipDeleted=e&&void 0!==e.skipDeleted?e.skipDeleted:null,n.sort=e&&e.sort?e.sort.toLocaleLowerCase():null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return null!==this.skipDeleted&&(e+="&skip_deleted=".concat(this.skipDeleted)),this.sort&&(e+="&sort=".concat(this.sort)),e},e}(s(n(4800)).default);e.default=a},4804:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.fromDate=(null==e?void 0:e.fromDate)||null,n.toDate=(null==e?void 0:e.toDate)||null,n.entityIds=(null==e?void 0:e.entityIds)||null,n.entityType=(null==e?void 0:e.entityType)||null,n.contentType=(null==e?void 0:e.contentType)||null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return null!==this.fromDate&&(e+="&from_date=".concat(this.fromDate)),null!==this.toDate&&(e+="&to_date=".concat(this.toDate)),null!==this.entityIds&&this.entityIds.length>0&&(e+="&entity_ids=".concat(this.entityIds)),null!==this.contentType&&(e+="&content_type=".concat(this.contentType)),e},e}(s(n(4800)).default);e.default=a},4071:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.userId="",this.discussionId="",this.content="",this.repliesCount=0,this.replyId="",this.anonymousNickname="",this.reactions=[],this.reactionsCount=0,this.reports=[],this.reportsCount=0,this.versions=null,this.privatePost=!1,this.deleted=!1,this.deletedAt="",this.deletedBy="",this.moderated=!1,this.moderatedAt="",this.moderatedBy="",this.moderatedReason="",this.createdAt="",this.updatedAt=""}},2528:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.userModel=null,e}return r(e,t),e}(s(n(4071)).default);e.default=a},5678:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.content="",this.reply_id="",this.anonymous_nickname="",this.context=null}},377:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.postsCount=0}},9331:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9448));e.default=function(){this.meta=new r.default,this.data=[]}},4858:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9448));e.default=function(){this.meta=new r.default,this.data=[]}},9448:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.pagination={totalItems:0,nextPageStartsAfter:"",lastCommentCreateTimestamp:""}}},5831:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},1579:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.type="",this.userIds=[],this.reactionCount=0}},3476:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7897)),s=i(n(9448)),a=i(n(4071)),o=i(n(9331)),u=i(n(1579)),l=i(n(5789)),c=i(n(3687)),d=i(n(2528)),h=i(n(4858)),f=i(n(8872)),p=i(n(5831)),m=i(n(377));e.default=function(){var t=this;this.remapToDiscussions=function(e){return e.meta=t.remapToMeta(e.meta),e.data=e.data.map((function(e){return t.remapToDiscussionById(e)})),e},this.remapToDiscussionById=function(t){var e=new r.default;return e.id=t.id,e.label=t.label,e.status=t.status,e.deleted=t.deleted,e.deletedAt=t.deleted_at,e.deletedBy=t.deleted_by,e.discussionType=t.discussion_type,e.moderationType=t.moderation_type,e.postsCount=t.posts_count,e.pinnedPosts=t.pinned_posts,e.lastPostId=t.last_post_id,e.customFields=t.custom_fields,e.context=t.context,e.createdAt=t.created_at,e.updatedAt=t.updated_at,e},this.remapToPostsForDiscussion=function(e,n){var i=new o.default,r=new h.default;return i.meta=t.remapToPostMeta(e.meta),i.data=e.data.map((function(e){return t.remapToPostByIdBasic(e)})),r.meta=t.remapToPostMeta(e.meta),r.data=e.data.map((function(e){return t.remapToPostByIdFull(e)})),"basic"===n?i:r},this.remapToPosts=function(e){var n=new p.default;return n.meta=t.remapToMeta(e.meta),n.data=e.data.map((function(e){return t.remapToPostByIdBasic(e)})),n},this.remapToPostMeta=function(t){var e=new s.default;return e.pagination.totalItems=t.pagination.total_items,e.pagination.nextPageStartsAfter=t.pagination.next_page_starts_after,e.pagination.lastCommentCreateTimestamp=t.pagination.last_comment_create_timestamp,e},this.remapToMeta=function(t){var e=new f.default;return e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.nextPageStartsAfter=t.pagination.next_page_starts_after,e},this.remapToPostByIdBasic=function(e){var n=new a.default;return n.id=e.id,n.userId=e.user_id,n.discussionId=e.discussion_id,n.content=e.content,n.anonymousNickname=e.anonymous_nickname,n.reactionsCount=e.reactions_count,n.replyId=e.reply_id,n.reactions=e.reactions.length?e.reactions.map((function(e){return t.remapReactionsPost(e)})):e.reactions,n.repliesCount=e.replies_count,n.reports=e.reports.length?e.reports.map((function(e){return t.remapReportPost(e)})):e.reports,n.reportsCount=e.reports_count,n.versions=e.versions.length?e.versions.map((function(e){return t.remapVersionsPost(e)})):e.versions,n.privatePost=e.private_post,n.deleted=e.deleted,n.deletedAt=e.deleted_at,n.deletedBy=e.deleted_by,n.moderated=e.moderated,n.moderatedAt=e.moderated_at,n.moderatedBy=e.moderated_by,n.moderatedReason=e.moderated_reason,n.createdAt=e.created_at,n.updatedAt=e.updated_at,n},this.remapToPostByIdFull=function(e){var n=new d.default;return n.id=e.id,n.userId=e.user_id,n.discussionId=e.discussion_id,n.content=e.content,n.anonymousNickname=e.anonymous_nickname,n.reactionsCount=e.reactions_count,n.replyId=e.reply_id,n.reactions=e.reactions.length?e.reactions.map((function(e){return t.remapReactionsPost(e)})):e.reactions,n.repliesCount=e.replies_count,n.reports=e.reports.length?e.reports.map((function(e){return t.remapReportPost(e)})):e.reports,n.reportsCount=e.reports_count,n.versions=e.versions.length?e.versions.map((function(e){return t.remapVersionsPost(e)})):e.versions,n.privatePost=e.private_post,n.deleted=e.deleted,n.deletedAt=e.deleted_at,n.deletedBy=e.deleted_by,n.moderated=e.moderated,n.moderatedAt=e.moderated_at,n.moderatedBy=e.moderated_by,n.moderatedReason=e.moderated_reason,n.createdAt=e.created_at,n.updatedAt=e.updated_at,n},this.remapToPostCount=function(t){return t.map((function(t){var e=new m.default;return e.id=t.id,e.postsCount=t.posts_count,e}))},this.remapReactionsPost=function(t){var e=new u.default;return e.type=t.type,e.userIds=t.user_ids,e.reactionCount=t.reaction_count,e},this.remapVersionsPost=function(t){var e=new l.default;return e.content=t.content,e.updatedAt=t.updated_at,e},this.remapReportPost=function(t){var e=new c.default;return e.userId=t.user_id,e.reason=t.reason,e.reasonDetails=t.reason_details,e}}},3687:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.userId=null,this.reason="AD",this.reasonDetails=null}},5789:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.updatedAt="",this.content=""}},5230:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(8900)),u=s(n(9685)),l=s(n(6409));e.default=function(t){var e=this;this.idSchema=null,this.profile=null,this.validator=null,this.idMapping=null,this.finalizePostFullModel=function(t){return i(e,void 0,void 0,(function(){var e,n,i=this;return r(this,(function(r){switch(r.label){case 0:return e=t.map((function(t){return t.userId})),[4,this.profile.getByIds(e)];case 1:return n=r.sent(),[2,t.map((function(t){return t.userModel=i.extractModelById(n,t.userId),t}))]}}))}))},this.finalizeTopDiscussionsFilters=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return this.idSchema!==a.IdSchemaEnum.NATIVE&&t.entityIds&&t.entityIds.length>0?(this.validator.validateFilters(t),[4,this.idMapping.getEntityIdsBySchemaId(Array.from(t.entityIds),t.entityType,a.IdSchemaEnum.NATIVE)]):[3,2];case 1:e=n.sent(),t.entityIds=e[t.entityType],n.label=2;case 2:return[2]}}))}))},this.extractModelById=function(t,e){if(t.length){var n=t.find((function(t){return t.id===e}));return n?(delete n.interests,n):null}return null},this.idSchema=t.idSchema,this.profile=new l.default(t),this.validator=new u.default(t),this.idMapping=new o.default(t)}},8263:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=n(4946),d=s(n(7686)),h=l(n(595)),f=l(n(946));e.default=function(t){var e=this;this.idSchema=null,this.clientHttps=null,this.footballHttps=null,this.service=null,this.getConfig=function(){return a(e,void 0,void 0,(function(){var t,e;return o(this,(function(n){switch(n.label){case 0:return[4,this.clientHttps.getConfig(d.FeatureConfigType.FANTASY)];case 1:return t=n.sent(),this.idSchema===c.IdSchemaEnum.NATIVE?[3,3]:(e=t,[4,this.service.remapCompetitions(u([],t.competitionsWhitelist,!0))]);case 2:e.competitionsWhitelist=n.sent(),n.label=3;case 3:return[2,t]}}))}))},this.getPlayersPoints=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r;return o(this,(function(s){switch(s.label){case 0:return[4,this.footballHttps.getPlayersPoints(t,n,i)];case 1:return e=s.sent(),r=e,[4,this.service.addPlayerModels(e.data)];case 2:return r.data=s.sent(),[2,e]}}))}))},this.getPlayerDetailedStatistics=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r,s;return o(this,(function(a){switch(a.label){case 0:return e="",this.idSchema===c.IdSchemaEnum.NATIVE?[3,2]:[4,this.service.remapPlayerIdToNative(n)];case 1:e=a.sent(),a.label=2;case 2:return[4,this.footballHttps.getPlayerDetailedStatistics(t,e||n,i)];case 3:return(r=a.sent()).meta.filters.playerId=n,s=r,[4,this.service.addMatchModels(r.data)];case 4:return s.data=a.sent(),[2,r]}}))}))},this.idSchema=t.idSchema,this.clientHttps=new d.default(t),this.footballHttps=new h.default(t),this.service=new f.default(t)}},6139:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8263));e.default=function(t){var e=this;this.facade=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.facade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getPlayersPoints=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPlayersPoints(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getPlayerDetailedStatistics=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPlayerDetailedStatistics(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},4339:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.assists=null,this.shots=null,this.offsides=null,this.tackles=null,this.saves=null,this.minutesEqualOrOver60=null,this.minutesUnder60=null,this.yellowCards=null,this.redCards=null,this.goalsGoalkeeper=null,this.goalsDefender=null,this.goalsMidfielder=null,this.goalsForwards=null,this.penaltyGoals=null,this.ownGoals=null,this.cleanSheetsGoalkeeper=null,this.cleanSheetsDefender=null,this.cleanSheetsMidfielder=null,this.cleanSheetsForwards=null,this.shotsOn=null,this.foulsCommitted=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.concededGoals=null,this.caughtBall=null}},516:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4339)),s=i(n(1002));e.default=function(){this.enabled=!1,this.clientId=null,this.addPointsToProfileTotal=!1,this.coefficients=new r.default,this.players=new s.default,this.competitionsWhitelist=[]}},1002:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.total=null,this.minGoalkeepers=null,this.maxGoalkeepers=null,this.minDefenders=null,this.maxDefenders=null,this.minMidfielders=null,this.maxMidfielders=null,this.minStrikers=null,this.maxStrikers=null}},6808:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3096));e.default=function(){this.meta=new r.default,this.data=[]}},5769:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2158));e.default=function(){this.meta=new r.default,this.data=[]}},3096:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4563));e.default=function(){this.filters=new r.default}},2158:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1890));e.default=function(){this.filters=new r.default}},4563:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId=null,this.playerId=null}},1890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId=null}},6472:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.total=null,this.minutesPlayed=null,this.yellowCards=null,this.redCards=null,this.goals=null,this.penaltyGoals=null,this.ownGoals=null,this.assists=null,this.cleanSheets=null,this.shots=null,this.shotsOn=null,this.offsides=null,this.foulsCommitted=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.tackles=null,this.concededGoals=null,this.caughtBall=null,this.saves=null}},9922:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6472)),s=i(n(3327));e.default=function(){this.matchId=null,this.matchModel=null,this.points=new r.default,this.stats=new s.default}},8571:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.playerId=null,this.playerModel=null,this.points=null,this.rank=null}},3327:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.minutesPlayed=null,this.yellowCards=null,this.redCards=null,this.goals=null,this.penaltyGoals=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.penaltySaved=null,this.penaltyReceived=null,this.ownGoals=null,this.assists=null,this.cleanSheets=null,this.shots=null,this.shotsOn=null,this.shotsBlocked=null,this.offsides=null,this.foulsCommitted=null,this.foulsWon=null,this.tackles=null,this.tacklesBlocks=null,this.tacklesInterceptions=null,this.concededGoals=null,this.caughtBall=null,this.saves=null,this.passes=null,this.crosses=null,this.interceptions=null,this.keyPasses=null,this.passesAccuracy=null,this.duels=null,this.duelsWon=null,this.dribblesAttempts=null,this.dribblesSuccess=null,this.dribblesPast=null}},9260:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6808)),s=i(n(5769)),a=i(n(6472)),o=i(n(9922)),u=i(n(8571)),l=i(n(3327));e.default=function(){var t=this;this.remapPlayersPoints=function(e){var n=new s.default;return n.meta.filters.templateId=e.meta.filters.template_id,n.data=e.data.map((function(e){return t.remapPlayersPointsData(e)})),n},this.remapPlayersPointsData=function(t){var e=new u.default;return e.playerId=t.player_id,e.points=t.points,e.rank=t.rank,e},this.remapPlayerDetailedStats=function(e){var n=new r.default;return n.meta.filters.templateId=e.meta.filters.template_id,n.meta.filters.playerId=e.meta.filters.player_id,n.data=e.data.map((function(e){return t.remapPlayerDetailedData(e)})),n},this.remapPlayerDetailedData=function(e){var n=new o.default;return n.matchId=e.match_id,n.points=e.points?t.remapPlayerDetailedPoints(e.points):null,n.stats=e.stats?t.remapPlayerDetailedStatsData(e.stats):null,n},this.remapPlayerDetailedPoints=function(t){var e=new a.default;return e.total=t.total,e.minutesPlayed=t.minutes_played,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goals=t.goals,e.penaltyGoals=t.penalty_goals,e.ownGoals=t.own_goals,e.assists=t.assists,e.cleanSheets=t.clean_sheets,e.shots=t.shots,e.shotsOn=t.shots_on,e.offsides=t.offsides,e.foulsCommitted=t.fouls_committed,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.tackles=t.tackles,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e.saves=t.saves,e},this.remapPlayerDetailedStatsData=function(t){var e=new l.default;return e.minutesPlayed=t.minutes_played,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goals=t.goals,e.penaltyGoals=t.penalty_goals,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.penaltySaved=t.penalty_saved,e.penaltyReceived=t.penalty_received,e.ownGoals=t.own_goals,e.assists=t.assists,e.cleanSheets=t.clean_sheets,e.shots=t.shots,e.shotsOn=t.shots_on,e.shotsBlocked=t.shots_blocked,e.offsides=t.offsides,e.foulsCommitted=t.fouls_committed,e.foulsWon=t.fouls_won,e.tackles=t.tackles,e.tacklesBlocks=t.tackles_blocks,e.tacklesInterceptions=t.tackles_interceptions,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e.saves=t.saves,e.passes=t.passes,e.crosses=t.crosses,e.interceptions=t.interceptions,e.keyPasses=t.key_passes,e.passesAccuracy=t.passes_accuracy,e.duels=t.duels,e.duelsWon=t.duels_won,e.dribblesAttempts=t.dribbles_attempts,e.dribblesSuccess=t.dribbles_success,e.dribblesPast=t.dribbles_past,e}}},946:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=n(4021),u=n(4904),l=s(n(8097)),c=s(n(2535)),d=n(5318),h=s(n(8900)),f=s(n(8808));e.default=function(t){var e=this;this.idMapping=null,this.idSchema=null,this.errorHandlingModel=null,this.football=null,this.remapCompetitions=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e={competition:t},[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,a.IdSchemaEnum.NATIVE,this.idSchema)];case 1:return[2,n.sent().competition]}}))}))},this.addPlayerModels=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=t.map((function(t){return t.playerId})),[4,this.football.footballFacade.getPlayersMapWithNativeIds(e)];case 1:return n=i.sent(),t.forEach((function(t){var e;t.playerModel=Object.keys(n).length&&n[t.playerId]||null,t.playerId=(null===(e=t.playerModel)||void 0===e?void 0:e.id)||t.playerId})),[2,t]}}))}))},this.remapPlayerIdToNative=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.idMapping.getEntityIdBySchemaId("player",t)];case 1:return(e=n.sent())?[2,e.id]:(this.throwException(o.ErrorCodes.NOT_FOUND,u.ErrorStatuses.ID_MAPPING_NOT_FOUND,d.ErrorMessages.ID_MAPPING_NOT_FOUND+t),[2])}}))}))},this.addMatchModels=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=t.map((function(t){return t.matchId})),[4,this.football.footballFacade.getMatchesMapWithNativeIds(e)];case 1:return n=i.sent(),t.forEach((function(t){var e;t.matchModel=Object.keys(n).length&&n[t.matchId]||null,t.matchId=(null===(e=t.matchModel)||void 0===e?void 0:e.id)||t.matchId})),[2,t]}}))}))},this.throwException=function(t,n,i){if("standard"===e.errorHandlingModel)throw new c.default(t,n,i);throw new l.default(t,n,i)},this.idSchema=t.idSchema,this.errorHandlingModel=t.errorHandlingMode,this.football=new f.default(t),this.idMapping=new h.default(t)}},7e3:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2754)),o=n(712);e.default=function(t,e,n){var s=this;this.localStorage=null,this.https=null,this.idMapping=null,this.getCompetitionsIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,o,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),n=!1,t?(t=new a.default(t)).countryId?[4,this.idMapping.getEntityIdsBySchemaId(["".concat(t.countryId)],"country","native")]:[3,2]:[3,5];case 1:0===(i=r.sent()).country.length&&(n=!0),t.countryId=i.country[0],r.label=2;case 2:return t.competitionIds?[4,this.idMapping.getEntityIdsBySchemaId(t.competitionIds,"competition","native")]:[3,4];case 3:0===(s=r.sent()).competition.length&&(n=!0),t.competitionIds=s.competition,r.label=4;case 4:if(n)return[2,[]];r.label=5;case 5:return[4,this.getCompetitions(t,e)];case 6:return o=r.sent(),[4,this.idMapping.remapEntities(o,"competition")];case 7:return[2,r.sent()];case 8:throw u=r.sent(),console.warn("There was a problem browsing all of the competitions",u),u;case 9:return[2]}}))}))},this.getCompetitionsMapWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s,u,l;return r(this,(function(r){switch(r.label){case 0:return e=new Map,n=t.length,i=new a.default({competitionIds:t,limit:n}),[4,this.getCompetitions(i)];case 1:return(s=r.sent()).sort((function(t,e){return t.id.localeCompare(e.id)})),u=(0,o.sortArrayInAscOrder)(t),[4,this.idMapping.remapEntities(s,"competition")];case 2:return l=r.sent(),u.forEach((function(t,n){return e.set(t,l[n])})),[2,e]}}))}))},this.getCompetitions=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:if(n=null,e=e||!1,this.localStorage.getCompetitionsLength())return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.https.getCompetitions()];case 2:return n=r.sent(),[3,4];case 3:throw i=r.sent(),console.warn("There was a problem retrieving all competitions",i),i;case 4:this.localStorage.setCompetitions(n),r.label=5;case 5:return[2,this.localStorage.getCompetitions(t)]}}))}))},this.getCompetitionByIdIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"competition","native")];case 1:return n=r.sent(),i=n.competition[0],[4,this.getCompetitionById(i,e)];case 2:return s=r.sent(),[4,this.idMapping.remapEntities(s,"competition")];case 3:return[2,r.sent()];case 4:throw a=r.sent(),console.warn("There was a problem browsing the following competition:".concat(t),a),a;case 5:return[2]}}))}))},this.getCompetitionById=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getCompetitionById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the competition with the following id: ".concat(t),n),n;case 3:return[2]}}))}))},this.getTopCompetitionsIdMapping=function(t){return i(s,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getTopCompetitions(t)];case 1:return e=i.sent(),[4,this.idMapping.remapEntities(e,"competition")];case 2:return[2,i.sent()];case 3:throw n=i.sent(),console.warn("There was a problem browsing the top competitions",n),n;case 4:return[2]}}))}))},this.getTopCompetitions=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTopCompetitions(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the top competitions",e),e;case 3:return[2]}}))}))},this.localStorage=t,this.idMapping=n,this.https=e}},8350:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,r){var s=this;this.localCache=null,this.https=null,this.idMapping=null,this.getCountriesWithIdMapping=function(t){return n(s,void 0,void 0,(function(){var e,n;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getCountries(t)];case 1:return e=i.sent(),[2,this.idMapping.remapEntities(e,"country")];case 2:throw n=i.sent(),console.warn("There was a problem browsing countries as football entities",n),n;case 3:return[2]}}))}))},this.getCountries=function(t){return n(s,void 0,void 0,(function(){var e,n,r;return i(this,(function(i){switch(i.label){case 0:if(t=t||!1,(e=this.localCache.getFootballCountries())&&e.length>0)return[2,e];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.https.getCountries(t)];case 2:return n=i.sent(),this.localCache.setFootballCountries(n),[2,n];case 3:throw r=i.sent(),console.warn("There was a problem retrieving countries as football entities",r),r;case 4:return[2]}}))}))},this.localCache=t,this.idMapping=r,this.https=e}},4289:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8350)),o=s(n(7e3)),u=s(n(9693)),l=s(n(4272)),c=s(n(4545)),d=s(n(2140));e.default=function(t,e,n,s){var h=this;this.countriesFacade=null,this.competitionsFacade=null,this.teamsFacade=null,this.playerFacade=null,this.matchFacade=null,this.searchFacade=null,this.getCountries=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.countriesFacade.getCountriesWithIdMapping(t)]}))}))},this.getCompetitions=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.competitionsFacade.getCompetitionsIdMapping(t,e)]}))}))},this.getCompetitionById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.competitionsFacade.getCompetitionByIdIdMapping(t,e)]}))}))},this.getTopCompetitions=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.competitionsFacade.getTopCompetitionsIdMapping(t)]}))}))},this.getCompetitionsMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.competitionsFacade.getCompetitionsMapWithNativeIds(t)];case 1:return[2,e.sent()]}}))}))},this.getTeams=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getTeamsIdMapping(t,e)]}))}))},this.getTeamById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getTeamByIdIdMapping(t,e)]}))}))},this.getTopTeams=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.teamsFacade.getTopTeamsIdMapping(t)]}))}))},this.getNextMatchForTeam=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getNextMatchForTeamIdMapping(t,e)]}))}))},this.getPrevMatchForTeam=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getPrevMatchForTeamIdMapping(t,e)]}))}))},this.getTeamsMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.teamsFacade.getTeamsMapWithNativeIds(t)];case 1:return[2,e.sent()]}}))}))},this.getPlayers=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getPlayersIdMapping(t,e)]}))}))},this.getPlayerById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getPlayerIdMapping(t,e)]}))}))},this.getTopPlayers=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.playerFacade.getTopPlayersIdMapping(t)]}))}))},this.getNextMatchForPlayer=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getNextMatchForPlayerIdMapping(t,e)]}))}))},this.getPrevMatchForPlayer=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getPrevMatchForPlayerIdMapping(t,e)]}))}))},this.getPlayersMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.playerFacade.getPlayersMapWithNativeIds(t)]}))}))},this.getMatches=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.matchFacade.getMatchesIdMapping(t,e)]}))}))},this.getMatchesMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.matchFacade.getMatchesMapWithNativeIds(t)]}))}))},this.getMatchById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.matchFacade.getMatchIdMapping(t,e)]}))}))},this.search=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.searchFacade.searchIdMapping(t,e)]}))}))},this.countriesFacade=new a.default(e,n,s),this.competitionsFacade=new o.default(e,n,s),this.teamsFacade=new u.default(t,n,s),this.playerFacade=new l.default(t,n,s),this.matchFacade=new c.default(t,n,s),this.searchFacade=new d.default(n,s)}},4545:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(712),u=a(n(6134)),l=a(n(9582));e.default=function(t,e,n){var a=this;this.https=null,this.idMapping=null,this.footballService=null,this.getMatchesIdMapping=function(t,e){return i(a,void 0,void 0,(function(){var n,i,a,o,l,c,d,h;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,12,,13]),t?(t=new u.default(t)).countryIds&&t.countryIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.countryIds,"country","native")]:[3,2]:[3,8];case 1:n=r.sent(),t.countryIds=n.country,r.label=2;case 2:return t.competitionIds&&t.competitionIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.competitionIds,"competition","native")]:[3,4];case 3:i=r.sent(),t.competitionIds=i.competition,r.label=4;case 4:return t.matchIds&&t.matchIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.matchIds,"match","native")]:[3,6];case 5:a=r.sent(),t.matchIds=a.match,r.label=6;case 6:return t.teamIds&&t.teamIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.teamIds,"team","native")]:[3,8];case 7:o=r.sent(),t.teamIds=o.team,r.label=8;case 8:return[4,this.getMatches(t,e)];case 9:return l=r.sent(),c=l,[4,this.footballService.setAvailableMarketsForMatch(s([],l.data,!0))];case 10:return c.data=r.sent(),d=l,[4,this.idMapping.remapEntities(l.data,"match")];case 11:return d.data=r.sent(),[2,l];case 12:throw h=r.sent(),console.warn("There was a problem browsing the matches",h),h;case 13:return[2]}}))}))},this.getMatchesWithNativeIds=function(t){return i(a,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return e=t.length,n=new u.default({matchIds:t,limit:e}),[4,this.getMatches(n)];case 1:return(i=r.sent()).data.sort((function(t,e){return t.id.localeCompare(e.id)})),[4,this.idMapping.remapEntities(i.data,"match")];case 2:return[2,r.sent()]}}))}))},this.getMatchesMapWithNativeIds=function(t){return i(a,void 0,void 0,(function(){var e,n,i,s,a,l;return r(this,(function(r){switch(r.label){case 0:return e={},(n=(0,o.transformIdsToBeUnique)(t)).sort((function(t,e){return t.localeCompare(e)})),[4,this.getMatchesWithNativeIds(Array.from(n))];case 1:return i=r.sent(),n.length===i.length?[3,3]:(s=new u.default({matchIds:n,limit:n.length}),[4,this.getMatches(s)]);case 2:a=r.sent(),l=n.filter((function(t){if(a.data.every((function(e){return e.id!==t})))return t})),n=n.filter((function(t){if(!l.includes(t))return t})),r.label=3;case 3:return n.forEach((function(t,n){return e[t]=i[n]})),[2,e]}}))}))},this.getMatches=function(t,e){return i(a,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getMatches(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the matches",n),n;case 3:return[2]}}))}))},this.getMatchIdMapping=function(t,e){return i(a,void 0,void 0,(function(){var n,i,s,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.idMapping.getEntityIdsBySchemaId([t],"match","native")];case 1:return n=r.sent(),[4,this.getMatchById(n.match[0],e)];case 2:return i=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(i)];case 3:return s=r.sent(),[4,this.idMapping.remapEntities(s,"match")];case 4:return[2,r.sent()];case 5:throw a=r.sent(),console.warn("There was a problem browsing the following match: ".concat(t),a),a;case 6:return[2]}}))}))},this.getMatchById=function(t,e){return i(a,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getMatchById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the following match: ".concat(t),n),n;case 3:return[2]}}))}))},this.https=e,this.idMapping=n,this.footballService=new l.default(t)}},4272:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(6477)),o=n(712),u=s(n(9582));e.default=function(t,e,n){var s=this;this.https=null,this.footballService=null,this.idMapping=null,this.getPlayersIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,o,u,l,c;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,10,,11]),n=!1,t?(t=new a.default(t)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([t.countryId],"country","native")]:[3,2]:[3,7];case 1:0===(i=r.sent()).country.length&&(n=!0),t.countryId=i.country[0],r.label=2;case 2:return t.playerIds?[4,this.idMapping.getEntityIdsBySchemaId(t.playerIds,"player","native")]:[3,4];case 3:0===(s=r.sent()).player.length&&(n=!0),t.playerIds=s.player,r.label=4;case 4:return t.scope?[4,this.idMapping.getEntityIdsBySchemaId(t.scope,"competition","native")]:[3,6];case 5:0===(o=r.sent()).competition.length&&(n=!0),t.scope=o.competition,r.label=6;case 6:if(n)return[2,[]];r.label=7;case 7:return[4,this.getPlayers(t,e)];case 8:return u=r.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"player")];case 9:return l.data=r.sent(),[2,u];case 10:throw c=r.sent(),console.warn("There was a problem browsing the players",c),c;case 11:return[2]}}))}))},this.getPlayersWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return e=t.length,n=new a.default({playerIds:t,limit:e}),[4,this.getPlayers(n)];case 1:return(i=r.sent()).data.sort((function(t,e){return t.id.localeCompare(e.id)})),[4,this.idMapping.remapEntities(i.data,"player")];case 2:return[2,r.sent()]}}))}))},this.getPlayersMapWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return e={},(n=(0,o.transformIdsToBeUnique)(t)).sort((function(t,e){return t.localeCompare(e)})),[4,this.getPlayersWithNativeIds(Array.from(n))];case 1:return i=r.sent(),n.forEach((function(t,n){return e[t]=i[n]})),[2,e]}}))}))},this.getPlayers=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getPlayers(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the players",n),n;case 3:return[2]}}))}))},this.getPlayerIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"player","native")];case 1:return n=r.sent(),[4,this.getPlayerById(n.player[0],e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"player")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the following player:".concat(t),s),s;case 5:return[2]}}))}))},this.getPlayerById=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getPlayerById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the following player: ".concat(t),n),n;case 3:return[2]}}))}))},this.getTopPlayersIdMapping=function(t){return i(s,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getTopPlayers(t)];case 1:return e=i.sent(),[4,this.idMapping.remapEntities(e,"player")];case 2:return[2,i.sent()];case 3:throw n=i.sent(),console.warn("There was a problem browsing the top players",n),n;case 4:return[2]}}))}))},this.getTopPlayers=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTopPlayers(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the top players",e),e;case 3:return[2]}}))}))},this.getNextMatchForPlayerIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"player","native")];case 1:return n=r.sent(),t=n.player[0],[4,this.getNextMatchForPlayer(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the next match for player:".concat(t),s),s;case 5:return[2]}}))}))},this.getNextMatchForPlayer=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getNextMatchForPlayer(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the next match for player: ".concat(t),i),i;case 4:return[2]}}))}))},this.getPrevMatchForPlayerIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"player","native")];case 1:return n=r.sent(),t=n.player[0],[4,this.getPrevMatchForPlayer(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the previous match for player:".concat(t),s),s;case 5:return[2]}}))}))},this.getPrevMatchForPlayer=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getPrevMatchForPlayer(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the previous match for player: ".concat(t),i),i;case 4:return[2]}}))}))},this.idMapping=n,this.https=e,this.footballService=new u.default(t)}},2140:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(604));e.default=function(t,e){var n=this;this.https=null,this.idMapping=null,this.searchIdMapping=function(t,e){return i(n,void 0,void 0,(function(){var n,i,s,o,u,l;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,10,,11]),(t=new a.default(t)).scope?[4,this.idMapping.getEntityIdsBySchemaId(t.scope,"competition","native")]:[3,2];case 1:n=r.sent(),t.scope=n.competition,r.label=2;case 2:return[4,this.search(t,e)];case 3:return(i=r.sent()).teams&&i.teams.length>0?[4,this.idMapping.remapEntities(i.teams,"team")]:[3,5];case 4:s=r.sent(),i.teams=s,r.label=5;case 5:return i.players&&i.players.length>0?[4,this.idMapping.remapEntities(i.players,"player")]:[3,7];case 6:o=r.sent(),i.players=o,r.label=7;case 7:return i.competitions&&i.competitions.length>0?[4,this.idMapping.remapEntities(i.competitions,"competition")]:[3,9];case 8:u=r.sent(),i.competitions=u,r.label=9;case 9:return[2,i];case 10:throw l=r.sent(),console.warn("There was a problem with browsing the search result",l),l;case 11:return[2]}}))}))},this.search=function(t,e){return i(n,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.https.search(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the search response",n),n;case 3:return[2]}}))}))},this.https=t,this.idMapping=e}},9693:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9920)),o=s(n(9582)),u=n(712);e.default=function(t,e,n){var s=this;this.footballService=null,this.https=null,this.idMapping=null,this.getTeamsIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,o,u,l,c;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,9,,10]),n=!1,t?(t=new a.default(t)).countryId?[4,this.idMapping.getEntityIdsBySchemaId(["".concat(t.countryId)],"country","native")]:[3,2]:[3,6];case 1:0===(i=r.sent()).country.length&&(n=!0),t.countryId=i.country[0],r.label=2;case 2:return t.scope?[4,this.idMapping.getEntityIdsBySchemaId(t.scope,"competition","native")]:[3,4];case 3:0===(s=r.sent()).competition.length&&(n=!0),t.scope=s.competition,r.label=4;case 4:return t.teamIds?[4,this.idMapping.getEntityIdsBySchemaId(t.teamIds,"team","native")]:[3,6];case 5:0===(o=r.sent()).team.length&&(n=!0),t.teamIds=o.team,r.label=6;case 6:return n?[2,[]]:[4,this.getTeams(t,e)];case 7:return u=r.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"team")];case 8:return l.data=r.sent(),[2,u];case 9:throw c=r.sent(),console.warn("There was a problem browsing all teams",c),c;case 10:return[2]}}))}))},this.getTeamsMapWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s,o,l;return r(this,(function(r){switch(r.label){case 0:return e=new Map,n=t.length,i=new a.default({teamIds:t,limit:n}),[4,this.getTeams(i)];case 1:return(s=r.sent().data).sort((function(t,e){return t.id.localeCompare(e.id)})),o=(0,u.sortArrayInAscOrder)(t),[4,this.idMapping.remapEntities(s,"team")];case 2:return l=r.sent(),o.forEach((function(t,n){return e.set(t,l[n])})),[2,e]}}))}))},this.getTeams=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTeams(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving all teams",n),n;case 3:return[2]}}))}))},this.getTeamByIdIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"team","native")];case 1:return n=r.sent(),t=n.team[0],[4,this.getTeamById(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"team")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the following team:".concat(t),s),s;case 5:return[2]}}))}))},this.getTeamById=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTeamById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the following team: ".concat(t),n),n;case 3:return[2]}}))}))},this.getTopTeamsIdMapping=function(t){return i(s,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getTopTeams(t)];case 1:return e=i.sent(),[4,this.idMapping.remapEntities(e,"team")];case 2:return[2,i.sent()];case 3:throw n=i.sent(),console.warn("There was a problem browsing the top teams",n),n;case 4:return[2]}}))}))},this.getTopTeams=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTopTeams(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the top teams",e),e;case 3:return[2]}}))}))},this.getNextMatchForTeamIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"team","native")];case 1:return n=r.sent(),t=n.team[0],[4,this.getNextMatchForTeam(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the next match for the following team:".concat(t),s),s;case 5:return[2]}}))}))},this.getNextMatchForTeam=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getNextMatchForTeam(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the next match for the following team: ".concat(t),i),i;case 4:return[2]}}))}))},this.getPrevMatchForTeamIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"team","native")];case 1:return n=r.sent(),t=n.team[0],[4,this.getPrevMatchForTeam(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the previous match for the following team:".concat(t),s),s;case 5:return[2]}}))}))},this.getPrevMatchForTeam=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getPrevMatchForTeam(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the previous match for the following team: ".concat(t),i),i;case 4:return[2]}}))}))},this.idMapping=n,this.https=e,this.footballService=new o.default(t)}},8808:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900)),o=s(n(595)),u=s(n(4289)),l=s(n(8358));e.default=function(t){var e=this;this.https=null,this.idMapping=null,this.localCache=null,this.footballFacade=null,this.getCountries=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getCountries(t)];case 1:return[2,e.sent()]}}))}))},this.getCompetitions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getCompetitions(t,n)];case 1:return[2,e.sent()]}}))}))},this.getCompetitionById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getCompetitionById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopCompetitions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTopCompetitions(t)];case 1:return[2,e.sent()]}}))}))},this.getTeams=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTeams(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTeamById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTeamById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopTeams=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTopTeams(t)];case 1:return[2,e.sent()]}}))}))},this.getNextMatchForTeam=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getNextMatchForTeam(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPrevMatchForTeam=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPrevMatchForTeam(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPlayers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPlayers(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPlayerById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPlayerById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopPlayers=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTopPlayers(t)];case 1:return[2,e.sent()]}}))}))},this.getNextMatchForPlayer=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getNextMatchForPlayer(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPrevMatchForPlayer=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPrevMatchForPlayer(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMatches=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getMatches(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMatchById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getMatchById(t,n)];case 1:return[2,e.sent()]}}))}))},this.search=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.search(t,n)];case 1:return[2,e.sent()]}}))}))},this.https=new o.default(t),this.idMapping=new a.default(t),this.localCache=(new l.default).createLocalCacheInstance(t.idSchema),this.footballFacade=new u.default(t,this.localCache,this.https,this.idMapping)}},6975:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name=""}},2754:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.countryId=null,this.name=null,this.gender=null,this.type=null,this.sortField=null,this.sortOrder=null,this.competitionIds=null,this.constructFilterUrl=function(){var t="";return e.countryId&&(t+="&",t+="country_id=".concat(e.countryId)),e.gender&&(t+="&",t+="gender=".concat(e.gender)),e.type&&(t+="&",t+="type=".concat(e.type)),e.sortField&&(t+="&",t+="sort_field=".concat(e.sortField)),e.sortOrder&&(t+="&",t+="sort_order=".concat(e.sortOrder)),e.name&&(t+="&",t+="name=".concat(e.name)),e.competitionIds&&e.competitionIds.length>0&&(t+="&",t+="competition_ids=".concat(e.competitionIds.join(","))),t},this.competitionSearchFilter=function(t){try{var n=e.filter(t);return e.sortField||e.sortOrder?e.sort(n):n}catch(t){return console.warn("There was a problem filtering the local competitions",t),[]}},this.filter=function(t){var n=e.entitiesToSearchWith();return t.filter((function(t){var i=!0;return n.forEach((function(n){"sortOrder"!==n&&"sortField"!==n&&("countryId"===n?i&&(i=t.country.id===e[n]):"name"===n?i&&(i=t.name.toLocaleLowerCase().includes(e[n].toLocaleLowerCase())):"competitionIds"===n?i&&(i=e[n].some((function(e){return t.id===e}))):i&&(i=t[n].toLocaleLowerCase()===e[n].toLocaleLowerCase()))})),i}))},this.entitiesToSearchWith=function(){var t=[];return e.countryId&&t.push("countryId"),e.name&&t.push("name"),e.gender&&t.push("gender"),e.type&&t.push("type"),e.sortField&&t.push("sortField"),e.sortOrder&&t.push("sortOrder"),e.competitionIds&&t.push("competitionIds"),t},this.sort=function(t){var n=[];return"name"===e.sortField?n=t.sort((function(t,n){return e.sortOrder&&"desc"===e.sortOrder?n.name.localeCompare(t.name):t.name.localeCompare(n.name)})):"country"===e.sortField?n=t.sort((function(t,n){return e.sortOrder&&"desc"===e.sortOrder?n.country.name.localeCompare(t.country.name):t.country.name.localeCompare(n.country.name)})):"scope"===e.sortField?t.forEach((function(t){return n[e.competitionIds.indexOf(t.id)]=t})):e.sortField||"desc"!==e.sortOrder||(n=t.sort((function(t,e){return e.id.localeCompare(t.id)}))),n},this.countryId=t.countryId?"".concat(t.countryId):null,this.name=t.name?t.name:null,this.gender=t.gender?t.gender:null,this.type=t.type?t.type:null,this.sortField=t.sortField?"".concat(t.sortField):null,this.sortOrder=t.sortOrder?"".concat(t.sortOrder):null,this.competitionIds=t.competitionIds?t.competitionIds:null}},3321:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name="",this.participants=[]}},7316:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6975)),s=i(n(3430)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new s.default}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.id=t.id,e.country=this.countryRemapper.countryFromResponse(t.country),e.gender=t.gender,e.assets=t.assets,e.type=t.type,e.name=t.name,e}catch(t){throw console.warn("There was a problem remapping the competition response",t),t}},t}();e.default=a},8758:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3321)),s=i(n(3430)),a=i(n(5827)),o=function(){function t(){this.countryRemapper=null,this.teamBasicRemapper=null,this.countryRemapper=new s.default,this.teamBasicRemapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new r.default;return n.id=t.id,n.country=this.countryRemapper.countryFromResponse(t.country),n.gender=t.gender,n.assets=t.assets,n.type=t.type,n.name=t.name,n.participants=t.participants.map((function(t){return e.teamBasicRemapper.fromResponse(t)})),n}catch(t){throw console.warn("There was a problem remapping the competition response",t),t}},t}();e.default=o},4427:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.alias="",this.countryCode="",this.assets=null,this.name=""}},3430:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4427));e.default=function(){var t=this;this.countriesFromResponse=function(e){if(e)return e.map((function(e){return t.countryFromResponse(e)}))},this.countryFromResponse=function(t){try{if(t){var e=new r.default;return e.id=t.id,e.alias=t.alias,e.assets=t.assets,e.countryCode=t.country_code,e.name=t.name,e}}catch(t){throw t}return null}}},8470:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.homeTeam={players:[]},this.awayTeam={players:[]}}},3098:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8470)),s=i(n(3550)),a=function(){function t(){this.playerRemapper=null,this.playerRemapper=new s.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new r.default;return n.homeTeam.players=t.home_team&&t.home_team.players?t.home_team.players.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n.awayTeam.players=t.away_team&&t.away_team.players?t.away_team.players.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping the lineups",t),t}},t}();e.default=a},3572:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.homeTeam=null,this.awayTeam=null,this.isDeleted=!1,this.undecided=!1,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.context={competition:null},this.status={type:null,subType:null}}},6134:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.countryIds=null,this.competitionIds=null,this.matchIds=null,this.status=null,this.teamIds=null,this.fromDate=null,this.toDate=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(t){var n="";return e.countryIds&&(n+="&",n+="countries=".concat(e.countryIds.join(","))),e.competitionIds&&e.competitionIds.length>0&&(n+="&",n+="competitions=".concat(e.competitionIds.join(","))),e.matchIds&&e.matchIds.length>0&&(n+="&",n+="matches=".concat(e.matchIds.join(","))),e.status&&(n+="&",n+="status=".concat(e.status)),e.teamIds&&e.teamIds.length>0&&(n+="&",n+="teams=".concat(e.teamIds.join(","))),e.fromDate&&(n+="&",n+="from_date=".concat(e.fromDate)),e.toDate&&(n+="&",n+="to_date=".concat(e.toDate)),e.limit&&!t&&(n+="&",n+="limit=".concat(e.limit)),e.page&&!t&&(n+="&",n+="page=".concat(e.page)),e.sortField&&(n+="&",n+="sort_field=".concat(e.sortField)),e.sortOrder&&(n+="&",n+="sort_order=".concat(e.sortOrder)),n},this.countryIds=t.countryIds?t.countryIds:null,this.competitionIds=t.competitionIds?t.competitionIds:null,this.matchIds=t.matchIds?t.matchIds:null,this.status=t.status?t.status:null,this.teamIds=t.teamIds?t.teamIds:null,this.fromDate=t.fromDate?t.fromDate:null,this.toDate=t.toDate?t.toDate:null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null,this.sortField=t.sortField?t.sortField:null,this.sortOrder=t.sortOrder?t.sortOrder:null}},9661:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899));e.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.isDeleted=!1,this.undecided=!1,this.homeTeam=null,this.awayTeam=null,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.stats=null,this.playerStats=[],this.context={competition:null},this.timeline=[],this.status=new r.default,this.lineups=null}},6780:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.playerId=null,this.minutesPlayed=null,this.yellowCards=null,this.redCards=null,this.goals=null,this.penaltyGoals=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.penaltySaved=null,this.penaltyReceived=null,this.ownGoals=null,this.assists=null,this.cleanSheets=null,this.shots=null,this.shotsOn=null,this.shotsBlocked=null,this.offsides=null,this.foulsCommitted=null,this.foulsWon=null,this.tackles=null,this.tacklesBlocks=null,this.tacklesInterceptions=null,this.concededGoals=null,this.caughtBall=null,this.saves=null,this.passes=null,this.crosses=null,this.interceptions=null,this.keyPasses=null,this.passesAccuracy=null,this.duels=null,this.duelsWon=null,this.dribblesAttempts=null,this.dribblesSuccess=null,this.dribblesPast=null,this.updatedAt=null}},4976:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6780)),s=function(){function t(){}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.playerId=t.player_id,e.minutesPlayed=t.minutes_played,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goals=t.goals,e.penaltyGoals=t.penalty_goals,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.penaltySaved=t.penalty_saved,e.penaltyReceived=t.penalty_received,e.ownGoals=t.own_goals,e.assists=t.assists,e.cleanSheets=t.clean_sheets,e.shots=t.shots,e.shotsOn=t.shots_on,e.shotsBlocked=t.shots_blocked,e.offsides=t.offsides,e.foulsCommitted=t.fouls_committed,e.foulsWon=t.fouls_won,e.tackles=t.tackles,e.tacklesBlocks=t.tackles_blocks,e.tacklesInterceptions=t.tackles_interceptions,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e.saves=t.saves,e.passes=t.passes,e.crosses=t.crosses,e.interceptions=t.interceptions,e.keyPasses=t.key_passes,e.passesAccuracy=t.passes_accuracy,e.duels=t.duels,e.duelsWon=t.duels_won,e.dribblesAttempts=t.dribbles_attempts,e.dribblesSuccess=t.dribbles_success,e.dribblesPast=t.dribbles_past,e.updatedAt=t.updated_at,e}catch(t){throw console.warn("There was a problem remapping the player stats",t),t}},t}();e.default=s},5284:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3572)),s=i(n(5827)),a=i(n(7316)),o=i(n(1441)),u=function(){function t(){this.teamRemapper=null,this.competitionRemapper=null,this.scoresRemapper=null,this.teamRemapper=new s.default,this.competitionRemapper=new a.default,this.scoresRemapper=new o.default}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.id=t.id,e.kickoffAt=t.kickoff_at,e.finishedAt=t.finished_at,e.updatedAt=t.updated_at,e.isDeleted=t.is_deleted,e.undecided=t.undecided,e.homeTeam=this.teamRemapper.fromResponse(t.home_team),e.awayTeam=this.teamRemapper.fromResponse(t.away_team),e.lineupsConfirmed=t.lineups_confirmed,e.startedAt=t.started_at,e.minute=t.minute,e.scores=this.scoresRemapper.fromResponse(t.scores),e.context={competition:t.context.competition?this.competitionRemapper.fromResponse(t.context.competition):null},e.status={type:t.status.type,subType:t.status.sub_type},e}catch(t){throw console.warn("There was a problem remapping the match response",t),t}},t}();e.default=u},9330:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9661)),s=i(n(5827)),a=i(n(7316)),o=i(n(7122)),u=i(n(1441)),l=i(n(3098)),c=i(n(8470)),d=i(n(92)),h=i(n(4976)),f=function(){function t(){this.teamMapper=null,this.competitionsMapper=null,this.lineupsMapper=null,this.scoresMapper=null,this.statsMapper=null,this.timelineMapper=null,this.playerStatsMapper=null,this.teamMapper=new s.default,this.competitionsMapper=new a.default,this.lineupsMapper=new l.default,this.scoresMapper=new u.default,this.statsMapper=new o.default,this.timelineMapper=new d.default,this.playerStatsMapper=new h.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new r.default;return n.id=t.id,n.kickoffAt=t.kickoff_at,n.finishedAt=t.finished_at,n.updatedAt=t.updated_at,n.isDeleted=t.is_deleted,n.undecided=t.undecided,n.homeTeam=t.home_team?this.teamMapper.fromResponse(t.home_team):null,n.awayTeam=t.away_team?this.teamMapper.fromResponse(t.away_team):null,n.lineupsConfirmed=t.lineups_confirmed,n.startedAt=t.started_at,n.minute=t.minute,n.scores=this.scoresMapper.fromResponse(t.scores),n.stats=this.statsMapper.fromResponse(t.stats),n.playerStats=t.player_stats?t.player_stats.map((function(t){return e.playerStatsMapper.fromResponse(t)})):t.player_stats,n.context={competition:this.competitionsMapper.fromResponse(t.context.competition)},n.timeline=t.timeline?t.timeline.map((function(t){return e.timelineMapper.fromResponse(t)})):[],n.status={type:t.status.type,subType:t.status.sub_type},n.lineups=t.lineups?this.lineupsMapper.fromResponse(t.lineups):new c.default,n}catch(t){throw console.warn("There was a problem remapping the match response",t),t}},t}();e.default=f},4652:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.ftScore=null,this.htScore=null,this.aetScore=null,this.aggScore=null,this.penScore=null}},1441:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4652)),s=function(){function t(){this.statEntityFromResponse=function(t){return{homeGoals:t.home_goals,awayGoals:t.away_goals}}}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.ftScore=this.statEntityFromResponse(t.ft_score),e.htScore=this.statEntityFromResponse(t.ht_score),e.aetScore=this.statEntityFromResponse(t.aet_score),e.aggScore=this.statEntityFromResponse(t.agg_score),e.penScore=this.statEntityFromResponse(t.pen_score),e}catch(t){throw console.warn("There was a problem remapping the scores",t),t}},t}();e.default=s},7950:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.corners=null,this.cornersFirstHalf=null,this.cornersSecondHalf=null,this.cornersExtraTime=null,this.crosses=null,this.crossesFirstHalf=null,this.crossesSecondHalf=null,this.crossesExtraTime=null,this.offside=null,this.offsideFirstHalf=null,this.offsideSecondHalf=null,this.offsideExtraTime=null,this.shotsOn=null,this.shotsOnFirstHalf=null,this.shotsOnSecondHalf=null,this.shotsOnExtraTime=null,this.throwIn=null,this.throwInFirstHalf=null,this.throwInSecondHalf=null,this.throwInExtraTime=null,this.redCards=null,this.redCardsFirstHalf=null,this.redCardsSecondHalf=null,this.redCardsExtraTime=null,this.shotsOff=null,this.shotsOffFirstHalf=null,this.shotsOffSecondHalf=null,this.shotsOffExtraTime=null,this.goalKicks=null,this.goalKicksFirstHalf=null,this.goalKicksSecondHalf=null,this.goalKicksExtraTime=null,this.possession=null,this.possessionFirstHalf=null,this.possessionSecondHalf=null,this.possessionExtraTime=null,this.treatments=null,this.treatmentsFirstHalf=null,this.treatmentsSecondHalf=null,this.treatmentsExtraTime=null,this.yellowCards=null,this.yellowCardsFirstHalf=null,this.yellowCardsSecondHalf=null,this.yellowCardsExtraTime=null,this.shotsBlocked=null,this.shotsBlockedFirstHalf=null,this.shotsBlockedSecondHalf=null,this.shotsBlockedExtraTime=null,this.substitutions=null,this.substitutionsFirstHalf=null,this.substitutionsSecondHalf=null,this.substitutionsExtraTime=null,this.counterAttacks=null,this.counterAttacksFirstHalf=null,this.counterAttacksSecondHalf=null,this.counterAttacksExtraTime=null,this.foulsCommitted=null,this.foulsCommittedFirstHalf=null,this.foulsCommittedSecondHalf=null,this.foulsCommittedExtraTime=null}},7122:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7950)),s=function(){function t(){this.statEntityFromResponse=function(t){return{homeTeam:t?t.home_team:null,awayTeam:t?t.away_team:null}}}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.corners=this.statEntityFromResponse(t.corners),e.cornersFirstHalf=this.statEntityFromResponse(t.corners_1h),e.cornersSecondHalf=this.statEntityFromResponse(t.corners_2h),e.cornersExtraTime=this.statEntityFromResponse(t.corners_et),e.crosses=this.statEntityFromResponse(t.crosses),e.crossesFirstHalf=this.statEntityFromResponse(t.crosses_1h),e.crossesSecondHalf=this.statEntityFromResponse(t.crosses_2h),e.crossesExtraTime=this.statEntityFromResponse(t.crosses_et),e.offside=this.statEntityFromResponse(t.offside),e.offsideFirstHalf=this.statEntityFromResponse(t.offside_1h),e.offsideSecondHalf=this.statEntityFromResponse(t.offside_2h),e.offsideExtraTime=this.statEntityFromResponse(t.offside_et),e.shotsOn=this.statEntityFromResponse(t.shots_on),e.shotsOnFirstHalf=this.statEntityFromResponse(t.shots_on_1h),e.shotsOnSecondHalf=this.statEntityFromResponse(t.shots_on_2h),e.shotsOnExtraTime=this.statEntityFromResponse(t.shots_on_et),e.throwIn=this.statEntityFromResponse(t.throw_in),e.throwInFirstHalf=this.statEntityFromResponse(t.throw_in_1h),e.throwInSecondHalf=this.statEntityFromResponse(t.throw_in_2h),e.throwInExtraTime=this.statEntityFromResponse(t.throw_in_et),e.redCards=this.statEntityFromResponse(t.red_cards),e.redCardsFirstHalf=this.statEntityFromResponse(t.red_cards_1h),e.redCardsSecondHalf=this.statEntityFromResponse(t.red_cards_2h),e.redCardsExtraTime=this.statEntityFromResponse(t.red_cards_et),e.shotsOff=this.statEntityFromResponse(t.shots_off),e.shotsOffFirstHalf=this.statEntityFromResponse(t.shots_off_1h),e.shotsOffSecondHalf=this.statEntityFromResponse(t.shots_off_2h),e.shotsOffExtraTime=this.statEntityFromResponse(t.shots_off_et),e.goalKicks=this.statEntityFromResponse(t.goal_kicks),e.goalKicksFirstHalf=this.statEntityFromResponse(t.goal_kicks_1h),e.goalKicksSecondHalf=this.statEntityFromResponse(t.goal_kicks_2h),e.goalKicksExtraTime=this.statEntityFromResponse(t.goal_kicks_et),e.possession=this.statEntityFromResponse(t.possession),e.possessionFirstHalf=this.statEntityFromResponse(t.possession_1h),e.possessionSecondHalf=this.statEntityFromResponse(t.possession_2h),e.possessionExtraTime=this.statEntityFromResponse(t.possession_et),e.treatments=this.statEntityFromResponse(t.treatments),e.treatmentsFirstHalf=this.statEntityFromResponse(t.treatments_1h),e.treatmentsSecondHalf=this.statEntityFromResponse(t.treatments_2h),e.treatmentsExtraTime=this.statEntityFromResponse(t.treatments_et),e.yellowCards=this.statEntityFromResponse(t.yellow_cards),e.yellowCardsFirstHalf=this.statEntityFromResponse(t.yellow_cards_1h),e.yellowCardsSecondHalf=this.statEntityFromResponse(t.yellow_cards_2h),e.yellowCardsExtraTime=this.statEntityFromResponse(t.yellow_cards_et),e.shotsBlocked=this.statEntityFromResponse(t.shots_blocked),e.shotsBlockedFirstHalf=this.statEntityFromResponse(t.shots_blocked_1h),e.shotsBlockedSecondHalf=this.statEntityFromResponse(t.shots_blocked_2h),e.shotsBlockedExtraTime=this.statEntityFromResponse(t.shots_blocked_et),e.substitutions=this.statEntityFromResponse(t.substitutions),e.substitutionsFirstHalf=this.statEntityFromResponse(t.substitutions_1h),e.substitutionsSecondHalf=this.statEntityFromResponse(t.substitutions_2h),e.substitutionsExtraTime=this.statEntityFromResponse(t.substitutions_et),e.counterAttacks=this.statEntityFromResponse(t.counter_attacks),e.counterAttacksFirstHalf=this.statEntityFromResponse(t.counter_attacks_1h),e.counterAttacksSecondHalf=this.statEntityFromResponse(t.counter_attacks_2h),e.counterAttacksExtraTime=this.statEntityFromResponse(t.counter_attacks_et),e.foulsCommitted=this.statEntityFromResponse(t.fouls_committed),e.foulsCommittedFirstHalf=this.statEntityFromResponse(t.fouls_committed_1h),e.foulsCommittedSecondHalf=this.statEntityFromResponse(t.fouls_committed_2h),e.foulsCommittedExtraTime=this.statEntityFromResponse(t.fouls_committed_et),e}catch(t){throw console.warn("There was a problem remapping the stats",t),t}},t}();e.default=s},6899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.type=null,this.subType=null}},9452:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.minute="",this.type="",this.teamId="",this.player=null,this.relatedPlayer=null,this.updatedAt=""}},92:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9452)),s=i(n(3550)),a=function(){function t(){this.playerRemapper=null,this.playerRemapper=new s.default}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.minute=t.minute,e.type=t.type,e.teamId=t.team_id,e.player=this.playerRemapper.fromResponse(t.player),e.relatedPlayer=t.related_player?this.playerRemapper.fromResponse(t.related_player):null,e.updatedAt=t.updated_at,e}catch(t){throw console.warn("There was a problem remapping timeline",t),t}},t}();e.default=a},753:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3569));e.default=function(){this.meta=new r.default,this.data=[]}},3569:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155));e.default=function(){this.pagination=new r.default}},155:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.currentPage=null,this.itemsPerPage=null,this.totalItems=null,this.numberOfPages=null}},1925:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3569));e.default=function(){this.remapMetaProp=function(t){var e=new r.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e}}},4426:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.teams=[]}},6477:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.countryId=null,this.scope=null,this.name=null,this.playerIds=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(){var t="";return e.countryId&&(t+="&",t+="country_id=".concat(e.countryId)),e.scope&&e.scope.length>0&&(t+="&",t+="scope=".concat(e.scope.join(","))),e.name&&(t+="&",t+="name=".concat(e.name)),e.playerIds&&e.playerIds.length>0&&(t+="&",t+="player_ids=".concat(e.playerIds.join(","))),e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.page&&(t+="&",t+="page=".concat(e.page)),e.sortField&&(t+="&",t+="sort_field=".concat(e.sortField)),e.sortOrder&&(t+="&",t+="sort_order=".concat(e.sortOrder)),t},this.countryId=t.countryId?t.countryId:null,this.scope=t.scope?t.scope:null,this.name=t.name?t.name:null,this.playerIds=t.playerIds?t.playerIds:null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null,this.sortField=t.sortField?t.sortField:null,this.sortOrder=t.sortOrder?t.sortOrder:null}},1837:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.competitions=[],this.teams=[]}},4803:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.name="",this.position="",this.assets=null,this.type=""}},9071:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.startDate="",this.endDate="",this.loan=!1,this.position="",this.country=null,this.name="",this.assets=null,this.birthDate=""}},5157:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(4426)),a=i(n(5827)),o=function(){function t(){this.countryRemapper=null,this.teamRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new s.default;return n.id=t.id,n.firstName=t.first_name?t.first_name:null,n.lastName=t.last_name?t.last_name:null,n.name=t.name?t.name:null,n.birthDate=t.birth_date,n.country=this.countryRemapper.countryFromResponse(t.country),n.assets=t.assets,n.teams=t.teams?t.teams.map((function(t){return e.teamRemapper.fromResponse(t)})):[],n.position=t.position,n.isDeleted=t.is_deleted,n}catch(t){throw console.warn("There was a problem remapping players response",t),t}},t}();e.default=o},7943:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(1837)),a=i(n(5827)),o=i(n(7316)),u=function(){function t(){this.countryRemapper=null,this.teamRemapper=null,this.competitionRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new a.default,this.competitionRemapper=new o.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new s.default;return n.id=t.id,n.firstName=t.first_name?t.first_name:null,n.lastName=t.last_name?t.last_name:null,n.name=t.name?t.name:null,n.birthDate=t.birth_date,n.country=this.countryRemapper.countryFromResponse(t.country),n.assets=t.assets,n.teams=t.teams?t.teams.map((function(t){return e.teamRemapper.fromResponse(t)})):[],n.position=t.position,n.isDeleted=t.is_deleted,n.competitions=t.competitions?t.competitions.map((function(t){return e.competitionRemapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping player response",t),t}},t}();e.default=u},3550:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4803)),s=function(){function t(){}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.id=t.id,e.name=t.name,e.position=t.position,e.shirtNumber=t.shirt_number,e.assets=t.assets,e.type=t.type,e}catch(t){throw console.warn("There was a problem remapping the player from timeline",t),t}},t}();e.default=s},4085:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(9071)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new r.default}return t.prototype.fromResponse=function(t){try{var e=new s.default;return e.id=t.id,e.startDate=t.start_date,e.endDate=t.end_date,e.shirtNumber=t.shirt_number,e.loan=t.loan,e.position=t.position,e.country=this.countryRemapper.countryFromResponse(t.country),e.name=t.name,e.assets=t.assets,e.birthDate=t.birth_date,e}catch(t){throw console.warn("There was a problem remapping the player from squad",t),t}},t}();e.default=a},4729:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(56)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new r.default}return t.prototype.fromResponse=function(t){try{var e=new s.default;return e.id=t.id,e.firstName=t.first_name?t.first_name:null,e.lastName=t.last_name?t.last_name:null,e.name=t.name?t.name:null,e.birthDate=t.birth_date,e.country=this.countryRemapper.countryFromResponse(t.country),e.assets=t.assets,e.position=t.position,e}catch(t){throw console.warn("There was a problem remapping top player response",t),t}},t}();e.default=a},56:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null}},604:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.entities=null,this.query=null,this.scope=null,this.constructFilterUrl=function(){var t="";return e.entities&&(t+="&",t+="entities=".concat(e.entities.join(","))),e.query&&(t+="&",t+="q=".concat(e.query)),e.scope&&(t+="&",t+="scope=".concat(e.scope.join(","))),t},this.entities=t.entities?t.entities:null,this.query=t.query?t.query:null,this.scope=t.scope?t.scope:null}},6967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.teams=null,this.players=null,this.competitions=null}},7287:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5827)),s=i(n(5157)),a=i(n(7316)),o=i(n(6967)),u=function(){function t(){this.teamRemapper=null,this.playerRemapper=null,this.competitionremapper=null,this.teamRemapper=new r.default,this.playerRemapper=new s.default,this.competitionremapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new o.default;return n.teams=t.teams?t.teams.map((function(t){return e.teamRemapper.fromResponse(t)})):[],n.players=t.players?t.players.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n.competitions=t.competitions?t.competitions.map((function(t){return e.competitionremapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping search response",t),t}},t}();e.default=u},5827:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(9314)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new r.default}return t.prototype.fromResponse=function(t){try{var e=new s.default;return e.id=t.id,e.country=this.countryRemapper.countryFromResponse(t.country),e.gender=t.gender,e.assets=t.assets,e.code=t.code,e.national=t.national,e.fullName=t.full_name,e.shortName=t.short_name,e.name=t.name,e.isDeleted=t.is_deleted,e.undecided=t.undecided,e}catch(t){throw console.warn("There was a problem remapping teams response",t),t}},t}();e.default=a},7821:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(1986)),a=i(n(4085)),o=i(n(7316)),u=function(){function t(){this.countryRemapper=null,this.competitionRemapper=null,this.playerRemapper=null,this.countryRemapper=new r.default,this.competitionRemapper=new o.default,this.playerRemapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new s.default;return n.id=t.id,n.country=this.countryRemapper.countryFromResponse(t.country),n.gender=t.gender,n.assets=t.assets,n.code=t.code,n.national=t.national,n.fullName=t.full_name,n.shortName=t.short_name,n.name=t.name,n.isDeleted=t.is_deleted,n.undecided=t.undecided,n.competitions=t.competitions?t.competitions.map((function(t){return e.competitionRemapper.fromResponse(t)})):[],n.colors=t.colors?t.colors:n.colors,n.squad=t.squad?t.squad.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping team response",t),t}},t}();e.default=u},9314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.code="",this.national=!1,this.undecided=!1,this.fullName="",this.shortName="",this.isDeleted=!1}},3773:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.primary=null,this.secondary=null,this.tertiary=null}},9920:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.name=null,this.countryId=null,this.national=!1,this.gender=null,this.limit=null,this.page=null,this.scope=null,this.sortField=null,this.sortOrder=null,this.teamIds=null,this.constructFilterUrl=function(){var t="";return e.name&&(t+="&",t+="name=".concat(e.name)),e.countryId&&(t+="&",t+="country_id=".concat(e.countryId)),e.national&&(t+="&",t+="national=".concat(e.national)),e.gender&&(t+="&",t+="gender=".concat(e.gender)),e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.scope&&e.scope.length>0&&(t+="&",t+="scope=".concat(e.scope.join(","))),e.page&&(t+="&",t+="page=".concat(e.page)),e.sortField&&(t+="&",t+="sort_field=".concat(e.sortField)),e.sortOrder&&(t+="&",t+="sort_order=".concat(e.sortOrder)),e.teamIds&&e.teamIds.length>0&&(t+="&",t+="team_ids=".concat(e.teamIds.join(","))),t},this.name=t.name?t.name:null,this.countryId=t.countryId?"".concat(t.countryId):null,this.national=!!t.national&&t.national,this.gender=t.gender?t.gender:null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null,this.scope=t.scope?t.scope:null,this.sortField=t.sortField?"".concat(t.sortField):null,this.sortOrder=t.sortOrder?"".concat(t.sortOrder):null,this.teamIds=t.teamIds?t.teamIds:null}},1986:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3773));e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.competitions=[],this.code="",this.national=!1,this.fullName="",this.shortName="",this.isDeleted=!1,this.undecided=!1,this.colors=new r.default,this.squad=[]}},9582:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4021),c=n(4904),d=u(n(8097)),h=u(n(2535)),f=n(5318),p=s(n(7686)),m=u(n(3569));e.default=function(t){var e=this;this.clientHttps=null,this.errorHandlingMode=null,this.setAvailableMarketsForMatch=function(t){return a(e,void 0,void 0,(function(){var e,n,i,r=this;return o(this,(function(s){switch(s.label){case 0:return[4,this.clientHttps.getConfig(p.FeatureConfigType.PREDICTOR)];case 1:return e=s.sent(),n=e.fullCoverageCompetitions,i=e.markets,Array.isArray(t)?[2,t.map((function(t){return r.setAvailableMarkets(t,n,i)}))]:"object"==typeof t&&Object.keys(t).length?[2,this.setAvailableMarkets(t,n,i)]:[2]}}))}))},this.setAvailableMarkets=function(t,n,i){var r,s=null===(r=t.context.competition)||void 0===r?void 0:r.id;return s&&e.isMatchInCoverageCompetition(s,n)?(t.availableMarkets=i.all,t):(t.availableMarkets=i.main,t)},this.setMetaDataBatchRequest=function(t,n,i){var r=new m.default;if(r.pagination.totalItems=t,r.pagination.itemsPerPage=n,r.pagination.numberOfPages=t?Math.ceil(t/n):0,r.pagination.currentPage=i,r.pagination.numberOfPages>0&&i>r.pagination.numberOfPages){if("standard"===e.errorHandlingMode)throw new h.default(l.ErrorCodes.BAD_METHOD_CALL,c.ErrorStatuses.INVALID_PAGE_NUMBER,f.ErrorMessages.INVALID_PAGE_NUMBER);throw new d.default(l.ErrorCodes.BAD_METHOD_CALL,c.ErrorStatuses.INVALID_PAGE_NUMBER,f.ErrorMessages.INVALID_PAGE_NUMBER)}return r},this.finalizeMatchesDataBatchRequest=function(t,e){t=t.sort((function(t,e){return new Date(t.kickoffAt).getTime()-new Date(e.kickoffAt).getTime()}));var n=e.limit||20;if(e.page){var i=e.page>1?n*(e.page-1):0;t=t.slice(i,i+n)}return!e.page&&t.length>n&&(t=t.slice(0,n)),t},this.isMatchInCoverageCompetition=function(t,e){var n=!1;return e.includes(t)?n=!0:n},this.clientHttps=new p.default(t),this.errorHandlingMode=t.errorHandlingMode}},3822:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=n(7686),l=a(n(3142)),c=a(n(7232)),d=a(n(1139)),h=a(n(9502)),f=a(n(8900)),p=a(n(1859)),m=a(n(2793)),v=a(n(3247)),_=a(n(8061)),y=a(n(8808));e.default=function(t,e,n,a,g){var b=this;this.config=null,this.clientHttps=null,this.loyaltyHttps=null,this.loyaltyService=null,this.profileFacade=null,this.loyaltyValidator=null,this.idMapping=null,this.topXFacade=null,this.matchQuizFacade=null,this.predictorHttps=null,this.errorHandlingMode=null,this.football=null,this.getConfig=function(){return i(b,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(u.FeatureConfigType.LOYALTY)];case 1:return[2,t.sent()]}}))}))},this.getConfigV2=function(t){return i(b,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.clientHttps.getNewLoyaltyConfig(t)];case 1:return e=n.sent(),[4,this.loyaltyService.addEntityModelToFootballBadges(e.rewards.badges)];case 2:return n.sent(),[4,this.loyaltyService.addGameModelToGamesBadges(e.rewards.badges)];case 3:return n.sent(),[2,e]}}))}))},this.getClientBadges=function(){return i(b,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.getConfig()];case 1:return t=e.sent(),[2,this.loyaltyService.buildOldClientBadges(t.rewards.badges)]}}))}))},this.getClientBadgesV2=function(t){return i(b,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.clientHttps.getNewLoyaltyConfig(t)];case 1:return e=n.sent(),[2,this.loyaltyService.buildNewClientBadges(e.rewards.badges)]}}))}))},this.getTemplates=function(t,e){return i(b,void 0,void 0,(function(){var n,i,a,u,l;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new _.default(t)),this.config.idSchema!==o.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyHttps.getTemplates(t,e)];case 1:return[2,r.sent()];case 2:return[4,this.loyaltyHttps.getTemplates(t,e)];case 3:return n=r.sent(),i=n,[4,this.loyaltyService.remapTemplatesIds(s([],n.data,!0))];case 4:i.data=r.sent(),a=0,u=n.data,r.label=5;case 5:return a<u.length?(l=u[a],[4,this.loyaltyService.remapTemplateGroupMatchIds(l.groups)]):[3,8];case 6:r.sent(),r.label=7;case 7:return a++,[3,5];case 8:return[2,n]}}))}))},this.getTemplateById=function(t,e){return i(b,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.loyaltyHttps.getTemplateById(t,e)];case 1:return n=r.sent(),this.config.idSchema===o.IdSchemaEnum.NATIVE?[2,n]:[4,this.loyaltyService.remapTemplatesIds([n])];case 2:return i=r.sent(),[4,this.loyaltyService.remapTemplateGroupMatchIds(i[0].groups)];case 3:return r.sent(),[2,i[0]]}}))}))},this.getLeaderboard=function(t,e,n){return i(b,void 0,void 0,(function(){var i,s;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"loyalty"),[4,this.loyaltyHttps.getLeaderboard(t,n,e)];case 1:return i=r.sent(),s=i,[4,this.loyaltyService.addProfileModelToLeaderboard(i.data)];case 2:return s.data=r.sent(),[2,i]}}))}))},this.getLeaderboardForGame=function(t,e,n){return i(b,void 0,void 0,(function(){var i,s;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"loyalty"),[4,this.loyaltyHttps.getLeaderboardForGame(t,n,e)];case 1:return i=r.sent(),s=i,[4,this.loyaltyService.addProfileModelToLeaderboard(i.data)];case 2:return s.data=r.sent(),[2,i]}}))}))},this.getLeaderboardForLeague=function(t,e){return i(b,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"league_leaderboard"),[4,this.loyaltyHttps.getLeaderboardForLeague(t,e)];case 1:return n=r.sent(),i=n,[4,this.loyaltyService.addProfileModelToLeaderboard(n.data)];case 2:return i.data=r.sent(),[2,n]}}))}))},this.getOwnRankings=function(t,e){return i(b,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return[4,this.profileFacade.getOwn()];case 1:return n=i.sent().id,[2,this.getUserRankings(n,t,e)]}}))}))},this.getUserRankings=function(t,e,n){return i(b,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"rankings"),[4,this.loyaltyHttps.getUserRankings(t,e,n)];case 1:return i=r.sent(),[4,this.getModelsForUserRankings(i)];case 2:return[2,r.sent()]}}))}))},this.getHighestSuccessRate=function(t,e){return i(b,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return t&&(t=new v.default(t),this.loyaltyValidator.validate(t,this.errorHandlingMode)),[4,this.loyaltyHttps.getHighestSuccessRate(t,e)];case 1:return n=i.sent(),[2,this.loyaltyService.addProfileModelToHighestSuccessRate(n)]}}))}))},this.getTemplateWinners=function(t,e){return i(b,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(t,e)];case 1:return n=r.sent(),[4,this.getTemplateById(t)];case 2:return i=r.sent(),n.contestModel=i,[2,this.loyaltyService.completeContestWinners(n)]}}))}))},this.getEntitiesFollows=function(t,e){return i(b,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return this.loyaltyService.validateEntitiesFollowsFilters(t),this.config.idSchema===o.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyService.remapEntitiesFollowsFilters(t)];case 1:t=i.sent(),i.label=2;case 2:return[4,this.loyaltyHttps.getEntitiesFollows(t,e)];case 3:return n=i.sent(),[4,this.loyaltyService.addModelsToEntitiesFollows(n)];case 4:return[2,i.sent()]}}))}))},this.getModelsForUserRankings=function(t){return i(b,void 0,void 0,(function(){var e,n,i,s,a,o,u,l,c,d,h,f;return r(this,(function(r){switch(r.label){case 0:return e=null,n=null,i=null,s=this.loyaltyService.extractRankingsIdsMap(t.data),a=s[0],o=s[1],(u=s[2]).length?[4,this.getTemplates()]:[3,2];case 1:l=r.sent(),e=l.data.filter((function(t){return u.includes(t.id)})),r.label=2;case 2:return a.length?(c={gameIds:a},[4,this.topXFacade.getGames(c)]):[3,4];case 3:d=r.sent(),n=d.data,r.label=4;case 4:return o.length?(h={gameIds:o},[4,this.matchQuizFacade.getGames(h)]):[3,6];case 5:f=r.sent(),i=f.data,r.label=6;case 6:return[2,this.loyaltyService.setModelsForUserRankings(n,i,e,t)]}}))}))},this.getTemplateMatches=function(t,e,n){return i(b,void 0,void 0,(function(){var i,s;return r(this,(function(r){switch(r.label){case 0:return[4,this.getTemplateById(t,n)];case 1:return(i=r.sent()).competitionIds&&0!==i.competitionIds.length||i.teamIds&&0!==i.teamIds.length||i.matchIds&&0!==i.matchIds.length||i.groups&&0!==i.groups.length?(s=this.loyaltyService.initMatchFiltersForTemplates(i,e),[4,this.football.getMatches(s,n)]):[2,[]];case 2:return[2,r.sent().data]}}))}))},this.config=t,this.clientHttps=e,this.loyaltyHttps=n,this.profileFacade=new c.default(g,a),this.loyaltyService=new l.default(this.config),this.loyaltyValidator=new d.default,this.idMapping=new f.default(t),this.topXFacade=new h.default(t,this.idMapping),this.matchQuizFacade=new p.default(t),this.predictorHttps=new m.default(t,this.idMapping),this.errorHandlingMode=t.errorHandlingMode,this.football=new y.default(t)}},2962:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7686)),o=s(n(7059)),u=s(n(3822)),l=s(n(4275)),c=s(n(8358));e.default=function(t){var e=this;this.clientHttps=null,this.profileHttps=null,this.loyaltyHttps=null,this.loyaltyFacade=null,this.localCache=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getConfigV2=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getConfigV2(t)];case 1:return[2,e.sent()]}}))}))},this.getClientBadges=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getClientBadges()];case 1:return[2,t.sent()]}}))}))},this.getClientBadgesV2=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getClientBadgesV2(t)];case 1:return[2,e.sent()]}}))}))},this.getTemplates=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplates(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTemplateById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplateById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboard=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getLeaderboard(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboardForGame=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getLeaderboardForGame(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboardForLeague=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getLeaderboardForLeague(t,n)];case 1:return[2,e.sent()]}}))}))},this.getOwnRankings=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getOwnRankings(t,n)];case 1:return[2,e.sent()]}}))}))},this.getUserRankings=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getUserRankings(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getHighestSuccessRate=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getHighestSuccessRate(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTemplateWinners=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplateWinners(t,n)];case 1:return[2,e.sent()]}}))}))},this.getEntitiesFollows=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getEntitiesFollows(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTemplateMatches=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplateMatches(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.clientHttps=new a.default(t),this.profileHttps=new l.default(t),this.loyaltyHttps=new o.default(t),this.localCache=(new c.default).createLocalCacheInstance(t.idSchema),this.loyaltyFacade=new u.default(t,this.clientHttps,this.loyaltyHttps,this.profileHttps,this.localCache)}},8153:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},5111:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8153));e.default=function(){this.value=[new r.default]}},8608:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.general=[],this.predictor=[],this.topX=[],this.matchQuiz=[]}},246:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1429));e.default=function(){this.assets={mainImageUrl:""},this.requirements=new r.default}},8687:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},7983:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2354));e.default=function(){this.assets={mainImageUrl:""},this.requirements=new r.default}},2354:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.postPoints=null,e.postsCount=null,e.reactionsCount=null,e.totalDiscussionPoints=null,e}return r(e,t),e}(s(n(1429)).default);e.default=a},1429:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.points=null,this.gameParticipationCount=null,this.entityId=null,this.entityType=null,this.predictionsMade=null,this.correctPredictions=null}},9750:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7978));e.default=function(){this.predictor=[],this.topX=[],this.matchQuiz=[],this.games=[],this.football=[],this.classicQuizzes=[],this.eitherOr=[],this.discussions=[],this.voting=new r.default}},9805:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.assets={mainImageUrl:""}}},3636:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},75:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},3101:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(75)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},1963:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.entityModel=null}},3035:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(1963)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},4270:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},8699:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(4270)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},3626:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},6268:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(3626)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},5643:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},8574:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(5643)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},3143:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},5793:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(3143)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},4646:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(1821)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},1821:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},7978:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.potm=[],this.poll=[]}},515:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5111)),s=i(n(4226));e.default=function(){this.enabled=!1,this.clientId=null,this.conditions={list:null},this.actions=new r.default,this.rewards=new s.default}},6866:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5111)),s=i(n(6483));e.default=function(){this.enabled=!1,this.clientId=null,this.conditions={list:null},this.actions=new r.default,this.rewards=new s.default}},3247:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.market=t.market?t.market:null,this.fromDate=t.fromDate?t.fromDate:null,this.toDate=t.toDate?t.toDate:null,this.usersCount=t.usersCount?t.usersCount:null,this.minimumPredictions=t.minimumPredictions?t.minimumPredictions:null}return t.prototype.constructFiltersUrl=function(){var t="";return this.market&&(t+="&",t+="market=".concat(this.market)),this.fromDate&&(t+="&",t+="from_date=".concat(this.fromDate)),this.toDate&&(t+="&",t+="to_date=".concat(this.toDate)),this.usersCount&&(t+="&",t+="users_count=".concat(this.usersCount)),this.minimumPredictions&&(t+="&",t+="minimum_predictions=".concat(this.minimumPredictions)),t},t}();e.default=n},4169:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.templateId=null,n.templateId=(null==e?void 0:e.templateId)||null,n}return r(e,t),e.prototype.constructFiltersUrl=function(){var e=t.prototype.constructFiltersUrl.call(this);return this.templateId&&(e+="&template_id=".concat(this.templateId)),e},e}(s(n(7910)).default);e.default=a},7910:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.limit=null,this.page=null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null}return t.prototype.constructFiltersUrl=function(){var t="";return this.limit&&(t+="&",t+="limit=".concat(this.limit)),this.page&&(t+="&",t+="page=".concat(this.page)),t},t}();e.default=n},4996:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.sortOrder=null,n.rankType=null,n.leaderboardIds=null,n.gameType=null,n.constructFiltersUrl=function(){var e=t.prototype.constructFiltersUrl.call(n);return n.sortOrder&&(e+="&",e+="sort_order=".concat(n.sortOrder)),n.rankType&&(e+="&",e+="rank_type=".concat(n.rankType)),n.leaderboardIds&&(e+="&",e+="type_ids=".concat(n.leaderboardIds.join(","))),n.gameType&&(e+="&",e+="game_type=".concat(n.gameType)),e},n.sortOrder=e.sortOrder,n.rankType=e.rankType,n.leaderboardIds=e.leaderboardIds,n.gameType=e.type&&"game"===e.type.toLowerCase()?e.gameType:null,n}return r(e,t),e}(s(n(7910)).default);e.default=a},8061:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.flags=null,this.status=null,this.type=null,this.activeFrom=null,this.activeTo=null,this.createdFrom=null,this.createdTo=null,this.updatedFrom=null,this.updatedTo=null,this.flags=t.flags?t.flags:null,this.status=t.status?t.status:null,this.type=t.type?t.type:null,this.activeFrom=t.activeFrom?t.activeFrom:null,this.activeTo=t.activeTo?t.activeTo:null,this.createdFrom=t.createdFrom?t.createdFrom:null,this.createdTo=t.createdTo?t.createdTo:null,this.updatedFrom=t.updatedFrom?t.updatedFrom:null,this.updatedTo=t.updatedTo?t.updatedTo:null}return t.prototype.constructFiltersUrl=function(){var t="";return this.flags&&this.flags.length>0&&(t+="&",t+="flags=".concat(this.flags.join(","))),this.status&&(t+="&",t+="status=".concat(this.status)),this.type&&(t+="&",t+="type=".concat(this.type)),this.activeFrom&&(t+="&",t+="active_from=".concat(this.activeFrom)),this.activeTo&&(t+="&",t+="active_to=".concat(this.activeTo)),this.createdFrom&&(t+="&",t+="created_from=".concat(this.createdFrom)),this.createdTo&&(t+="&",t+="created_to=".concat(this.createdTo)),this.updatedFrom&&(t+="&",t+="updated_from=".concat(this.updatedFrom)),this.updatedTo&&(t+="&",t+="updated_to=".concat(this.updatedTo)),t},t}();e.default=n},6507:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.points=null,this.predictionsMade=null,this.profileId=null,this.profileModel=null,this.successRatePercent=null}},7746:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6507));e.default=function(){this.remapHighestSuccessRate=function(t){return t.map((function(t){var e=new r.default;return e.position=t.position,e.points=t.points,e.predictionsMade=t.predictions_made,e.profileId=t.profile_id,e.successRatePercent=t.success_rate_percent,e}))}}},9642:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.profileId=null,this.profileModel=null,this.points=null,this.predictionsMade=null}},7419:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8988)),s=i(n(5828)),a=i(n(9642));e.default=function(){var t=this;this.remapResponse=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapData(e.data),e},this.remapLeagueLeaderboardResponse=function(e){return e.meta=t.remapLeagueLeaderboardMeta(e.meta),e.data=t.remapData(e.data),e},this.remapMeta=function(t){var e=new s.default;return e.rankType=t.rank_type,e.fromDate=t.from_date,e.toDate=t.to_date,e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e},this.remapLeagueLeaderboardMeta=function(t){var e=new r.default;return e.templateId=t.template_id,e.privateLeagueId=t.private_league_id,e.fromDate=t.from_date,e.toDate=t.to_date,e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e},this.remapData=function(t){var e=[];return t.forEach((function(t){var n=new a.default;n.position=t.position,n.profileId=t.profile_id,n.points=t.points,n.predictionsMade=t.predictions_made,e.push(n)})),e}}},3409:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.flags="",this.status="",this.type="",this.activeFrom="",this.activeTo="",this.createdFrom="",this.createdTo="",this.updatedFrom="",this.updatedTo=""}},8988:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155));e.default=function(){this.templateId=null,this.privateLeagueId=null,this.fromDate=null,this.toDate=null,this.pagination=new r.default}},5828:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155));e.default=function(){this.rankType=null,this.fromDate=null,this.toDate=null,this.pagination=new r.default}},9012:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155)),s=i(n(3409));e.default=function(){this.pagination=new r.default,this.filters=new s.default}},4187:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.general=null,this.predictor=null,this.activity=null,this.topX=null,this.matchQuiz=null,this.discussionPost=null}},9013:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id=null,e.rankType=null,e.model=null,e.gameType=null,e}return r(e,t),e}(s(n(9642)).default);e.default=a},4533:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1298)),s=i(n(3569)),a=i(n(9659)),o=i(n(9013)),u=function(){function t(){var t=this;this.remapRankings=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapData(e.data),e},this.remapRankingsPrivateLeague=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapDataUserRankingPrivateLeague(e.data),e},this.remapRankingsChallenge=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapDataUserRankingChallenge(e.data),e},this.remapMeta=function(t){var e=new s.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.numberOfPages=t.pagination.number_of_pages,e.pagination.totalItems=t.pagination.total_items,e}}return t.prototype.remapData=function(t){var e=[];return t.forEach((function(t){var n=new o.default;n.id=t.id,n.rankType=t.rank_type,n.position=t.position,n.points=t.points,n.gameType=t.game_type,delete n.profileId,delete n.profileModel,delete n.predictionsMade,e.push(n)})),e},t.prototype.remapDataUserRankingPrivateLeague=function(t){var e=[];return t.forEach((function(t){var n=new a.default;n.templateId=t.template_id,n.privateLeagueId=t.private_league_id,n.position=t.position,n.points=t.points,e.push(n)})),e},t.prototype.remapDataUserRankingChallenge=function(t){var e=[];return t.forEach((function(t){var n=new r.default;n.templateId=t.template_id,n.challengeId=t.private_league_id,n.position=t.position,n.points=t.points,e.push(n)})),e},t}();e.default=u},4226:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.points=null,this.tiers=null,this.badges=null}},6483:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.points=null,this.tiers=null,this.badges=null}},4982:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.adContent=null,e}return r(e,t),e}(s(n(194)).default);e.default=a},8587:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.fromDate=null,this.toDate=null,this.matchIds=[]}},9324:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.groupId=null,this.label=null,this.filters=null}},194:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id=null,this.name=null,this.description=null,this.type=null,this.fromDate=null,this.toDate=null,this.markets=[],this.teamIds=[],this.matchIds=[],this.groups=[],this.gameIds=[],this.gameTypes=[],this.competitionIds=[],this.excludedProfileIds=[],this.rules=null,this.labels=null,this.customFields=null,this.branding=null,this.flags=null,this.images=new r.default,this.status=null,this.automaticallyChangeStatus=!0,this.createdAt=null,this.updatedAt=null,this.related=null}},8899:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(3483)),o=s(n(6692)),u=s(n(9012)),l=s(n(4982)),c=s(n(8587)),d=s(n(9324)),h=s(n(194)),f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapResponse=function(t){var n=[];return t.forEach((function(t){var i=new h.default;i.id=t.id,i.name=t.name,i.description=t.description,i.type=t.type,i.fromDate=t.from_date,i.toDate=t.to_date,i.markets=t.markets?t.markets:null,i.teamIds=t.team_ids?t.team_ids:null,i.matchIds=t.match_ids?t.match_ids:null,i.groups=t.groups?e.remapGroups(t.groups):null,i.gameIds=t.game_ids?t.game_ids:null,i.gameTypes=t.game_types?t.game_types:null,i.competitionIds=t.competition_ids?t.competition_ids:null,i.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,i.rules=t.rules?t.rules:null,i.labels=t.labels?t.labels:null,i.customFields=t.custom_fields?t.custom_fields:null,i.branding=t.branding?e.remapBranding(t.branding):null,i.flags=t.flags?t.flags:null,i.images=t.images?t.images:null,i.status=t.status?t.status:null,i.automaticallyChangeStatus=t.automatically_change_status,i.createdAt=t.created_at,i.updatedAt=t.updated_at,i.related=t.related?e.remapRelated(t.related):null,n.push(i)})),n},e.remapResponseId=function(t){var n=new l.default;return n.id=t.id,n.name=t.name,n.description=t.description,n.type=t.type,n.fromDate=t.from_date,n.toDate=t.to_date,n.markets=t.markets?t.markets:null,n.teamIds=t.team_ids?t.team_ids:null,n.matchIds=t.match_ids?t.match_ids:null,n.groups=t.groups?e.remapGroups(t.groups):null,n.gameIds=t.game_ids?t.game_ids:null,n.gameTypes=t.game_types?t.game_types:null,n.competitionIds=t.competition_ids?t.competition_ids:null,n.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,n.rules=t.rules?t.rules:null,n.flags=t.flags?t.flags:null,n.images=t.images?t.images:null,n.status=t.status?t.status:null,n.automaticallyChangeStatus=t.automatically_change_status,n.related=t.related?e.remapRelated(t.related):null,n.labels=t.labels,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapMeta=function(t){var e=new u.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e.filters.flags=t.filters.flags,e.filters.status=t.filters.status,e.filters.type=t.filters.type,e.filters.activeFrom=t.filters.active_from,e.filters.activeTo=t.filters.active_to,e.filters.createdFrom=t.filters.created_from,e.filters.createdTo=t.filters.created_to,e.filters.updatedFrom=t.filters.updated_from,e.filters.updatedTo=t.filters.updated_to,e},e.remapRelated=function(t){return t.map((function(t){var e=new a.default;return e.entityId=t.entity_id,e.entityType=t.entity_type,e}))},e.remapGroups=function(t){return t.map((function(t){var n=new d.default;return n.groupId=t.group_id,n.label=t.label,n.filters=e.remapGroupFilters(t.filters),n}))},e.remapGroupFilters=function(t){var e=new c.default;return e.fromDate=t.from_date,e.toDate=t.to_date,e.matchIds=t.match_ids,e},e}return r(e,t),e}(o.default);e.default=f},3142:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=n(4021),l=n(4904),c=a(n(8097)),d=a(n(2535)),h=n(5318),f=a(n(8900)),p=a(n(8808)),m=a(n(6134)),v=a(n(267)),_=a(n(1550)),y=a(n(6409)),g=a(n(9596)),b=a(n(8687)),w=a(n(3636)),I=a(n(4169)),E=a(n(7910)),M=a(n(4996));e.default=function(t){var e=this;this.idMappingService=null,this.profileNamespace=null,this.footballNamespace=null,this.topXNamespace=null,this.matchQuizNamespace=null,this.miniGamesNamespace=null,this.errorHandlingMode=null,this.remapTemplatesIds=function(t){return i(e,void 0,void 0,(function(){var e,n,i,a,o;return r(this,(function(r){switch(r.label){case 0:return t.length>0?(e=[],n=[],i=[],t.forEach((function(t){t.teamIds&&t.teamIds.length>0&&(e=s(s([],e,!0),t.teamIds,!0)),t.matchIds&&t.matchIds.length>0&&(n=s(s([],n,!0),t.matchIds,!0)),t.competitionIds&&t.competitionIds.length>0&&(i=s(s([],i,!0),t.competitionIds,!0))})),a={team:e,match:n,competition:i},[4,this.idMappingService.idMappingFacade.getEntitiesByIds(a,"native",this.idMappingService.idSchema)]):[3,2];case 1:return o=r.sent(),s([],o.team,!0),s([],o.match,!0),s([],o.competition,!0),t.forEach((function(t){t.teamIds&&t.teamIds.length>0&&(t.teamIds=t.teamIds.map((function(t){return o.team.shift()}))),t.matchIds&&t.matchIds.length>0&&(t.matchIds=t.matchIds.map((function(t){return o.match.shift()}))),t.competitionIds&&t.competitionIds.length>0&&(t.competitionIds=t.competitionIds.map((function(t){return o.competition.shift()})))})),[2,t];case 2:return[2,t]}}))}))},this.remapTemplateGroupMatchIds=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a;return r(this,(function(r){switch(r.label){case 0:if(!(t&&t.length>0))return[3,4];e=0,n=t,r.label=1;case 1:return e<n.length?(i=n[e]).filters.matchIds&&i.filters.matchIds.every((function(t){return t}))&&i.filters.matchIds.length>0?(s={match:Array.from(i.filters.matchIds)},[4,this.idMappingService.idMappingFacade.getEntitiesByIds(s,"native",this.idMappingService.idSchema)]):[3,3]:[3,4];case 2:a=r.sent(),i.filters.matchIds=Array.from(a.match),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},this.addProfileModelToLeaderboard=function(t){return i(e,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return t.length>0?(e=[],(n=t.map((function(t){return t.profileId}))).length?[4,this.profileNamespace.getByIds(n)]:[2,t]):[3,2];case 1:return i=r.sent(),t.forEach((function(t){i.forEach((function(e){e.id===t.profileId&&(delete e.interests,t.profileModel=e)})),t.profileModel||(t.profileModel=null),e.push(t)})),[2,e];case 2:return[2,t]}}))}))},this.buildOldClientBadges=function(t){var n=new b.default;return n.general=e.extractEnabledBadgesId(t.general),n.predictor=e.extractEnabledBadgesId(t.predictor),n.topX=e.extractEnabledBadgesId(t.topX),n.matchQuiz=e.extractEnabledBadgesId(t.matchQuiz),n},this.buildNewClientBadges=function(t){var n=new w.default;return n.predictor=e.extractEnabledBadgesId(t.predictor),n.topX=e.extractEnabledBadgesId(t.topX),n.matchQuiz=e.extractEnabledBadgesId(t.matchQuiz),n.games=e.extractEnabledBadgesId(t.games),n.football=e.extractEnabledBadgesId(t.football),n.classicQuizzes=e.extractEnabledBadgesId(t.classicQuizzes),n.eitherOr=e.extractEnabledBadgesId(t.eitherOr),n.discussions=e.extractEnabledBadgesId(t.discussions),n.potm=e.extractEnabledBadgesId(t.voting.potm),n.poll=e.extractEnabledBadgesId(t.voting.poll),n},this.initFilters=function(t,e){switch(e){case"loyalty":t&&(t=new E.default(t));break;case"rankings":t&&(t=new M.default(t));break;case"league_leaderboard":t&&(t=new I.default(t))}return t},this.addProfileModelToHighestSuccessRate=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=t.map((function(t){return t.profileId}))).length?[4,this.profileNamespace.getByIds(e)]:[2,t];case 1:return n=i.sent(),[2,t.map((function(t){return n.forEach((function(e){e.id===t.profileId&&(delete e.interests,t.profileModel=e)})),t}))]}}))}))},this.extractRankingsIdsMap=function(t){var e=[],n=[],i=[];return t.forEach((function(t){"GAME"===t.rankType&&"TOP_X"===t.gameType?e.push(t.id):"GAME"===t.rankType&&"MATCH_QUIZ"===t.gameType?n.push(t.id):"TEMPLATE"===t.rankType&&i.push(t.id)})),[e,n,i]},this.setModelsForUserRankings=function(t,e,n,i){return i.data.forEach((function(i){"MATCH_QUIZ"===i.gameType&&e?i.model=e.filter((function(t){return t.id===i.id}))[0]:"TOP_X"===i.gameType&&t?i.model=t.filter((function(t){return t.id===i.id}))[0]:"TEMPLATE"===i.rankType&&n&&(i.model=n.filter((function(t){return t.id===i.id}))[0])})),i},this.completeContestWinners=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return t.userList&&t.userList.length?(e=t.userList.map((function(t){return t.profileId})),[4,this.profileNamespace.getByIds(e)]):[3,2];case 1:n=i.sent(),t.userList.forEach((function(t){var e=n.filter((function(e){return e.id===t.profileId}))[0];delete e.interests,t.profileModel=e})),i.label=2;case 2:return[2,t]}}))}))},this.validateEntitiesFollowsFilters=function(t){if(!t||!(t.footballCompetitions&&t.footballCompetitions.length||t.footballTeams&&t.footballTeams.length||t.footballPlayers&&t.footballPlayers.length)){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_FILTERS,h.ErrorMessages.ENTITIES_NEEDED);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_FILTERS,h.ErrorMessages.ENTITIES_NEEDED)}if(t.footballCompetitions&&t.footballCompetitions.length>24||t.footballTeams&&t.footballTeams.length>24||t.footballPlayers&&t.footballPlayers.length>24){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.EXCEEDED_LENGTH,h.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.EXCEEDED_LENGTH,h.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED)}},this.remapEntitiesFollowsFilters=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:return e=JSON.parse(JSON.stringify(t)),n={},i={},e.footballCompetitions&&e.footballCompetitions.length&&(i.competition=e.footballCompetitions),e.footballTeams&&e.footballTeams.length&&(i.team=e.footballTeams),e.footballPlayers&&e.footballPlayers.length&&(i.player=e.footballPlayers),[4,this.idMappingService.idMappingFacade.getEntitiesByIds(i,this.idMappingService.idSchema,o.IdSchemaEnum.NATIVE)];case 1:return s=r.sent(),Object.keys(s).forEach((function(t){"competition"===t?n.footballCompetitions=s[t]:"team"===t?n.footballTeams=s[t]:"player"===t&&(n.footballPlayers=s[t])})),[2,n]}}))}))},this.addModelsToEntitiesFollows=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o,u,l,c;return r(this,(function(r){switch(r.label){case 0:return e=[],n="fb:c:",i=new Map,s=[],a="fb:t:",o=new Map,u=[],l="fb:p:",c=null,t.breakdown.forEach((function(t){t.id.includes(n)?e.push(t.id):t.id.includes(a)?s.push(t.id):t.id.includes(l)&&u.push(t.id)})),e.length?[4,this.footballNamespace.footballFacade.competitionsFacade.getCompetitionsMapWithNativeIds(e)]:[3,2];case 1:i=r.sent(),r.label=2;case 2:return s.length?[4,this.footballNamespace.footballFacade.teamsFacade.getTeamsMapWithNativeIds(s)]:[3,4];case 3:o=r.sent(),r.label=4;case 4:return u.length?[4,this.footballNamespace.footballFacade.playerFacade.getPlayersMapWithNativeIds(u)]:[3,6];case 5:c=r.sent(),r.label=6;case 6:return t.breakdown.forEach((function(t){t.id.includes(n)?(t.model=i.get(t.id),t.id=t.model.id):t.id.includes(a)?(t.model=o.get(t.id),t.id=t.model.id):t.id.includes(l)&&(t.model=c[t.id],t.id=t.model.id)})),[2,t]}}))}))},this.initMatchFiltersForTemplates=function(t,n){var i=[],r=[],s=[],a=e.reformatDate(t.fromDate),o=e.reformatDate(t.toDate,!0);if(t.competitionIds&&t.competitionIds.length>0&&(i=Array.from(t.competitionIds)),t.teamIds&&t.teamIds.length>0&&(r=Array.from(t.teamIds)),t.matchIds&&t.matchIds.length>0&&(s=Array.from(t.matchIds)),n){var f=t.groups.find((function(t){return t.groupId===n}));if(!f){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_ID,h.ErrorMessages.INVALID_TEMPLATE_GROUP_ID);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_ID,h.ErrorMessages.INVALID_TEMPLATE_GROUP_ID)}if(!f.filters){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_FILTERS,h.ErrorMessages.INVALID_TEMPLATE_GROUP_FILTERS);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_FILTERS,h.ErrorMessages.INVALID_TEMPLATE_GROUP_FILTERS)}a=e.reformatDate(f.filters.fromDate),o=e.reformatDate(f.filters.toDate,!0),f.filters.matchIds.every((function(t){return t}))&&(s=Array.from(f.filters.matchIds))}return new m.default({competitionIds:i,teamIds:r,matchIds:s,fromDate:a,toDate:o,limit:500})},this.reformatDate=function(t,e){var n=new Date(t);e&&n.setUTCHours(23,59,59);var i=n.toISOString();return i.slice(0,-5)+"Z"},this.extractEnabledBadgesId=function(t){var e=[];return t.forEach((function(t){t.enabled&&e.push(t.id)})),e},this.addEntityModelToFootballBadges=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o,u,l,c,d,h,f=this;return r(this,(function(r){switch(r.label){case 0:return e=[],n=[],i=[],s=[],t.football&&t.football.length>0&&(e=t.football.filter((function(t){return"competition"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),n=t.football.filter((function(t){return"team"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),i=t.football.filter((function(t){return"player"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),s=t.football.filter((function(t){return"match"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId}))),t.voting&&t.voting.poll&&t.voting.poll.length>0&&(a=this.extractEntityIdsFromBadges(t.voting.poll),u=a[0],l=a[1],c=a[2],d=a[3],e=e.concat(u),e=Array.from(new Set(e)),n=n.concat(l),n=Array.from(new Set(n)),i=i.concat(c),i=Array.from(new Set(i)),s=s.concat(d),s=Array.from(new Set(s))),t.voting&&t.voting.potm&&t.voting.potm.length>0&&(o=this.extractEntityIdsFromBadges(t.voting.potm),u=o[0],l=o[1],c=o[2],d=o[3],e=e.concat(u),e=Array.from(new Set(e)),n=n.concat(l),n=Array.from(new Set(n)),i=i.concat(c),i=Array.from(new Set(i)),s=s.concat(d),s=Array.from(new Set(s))),[4,this.fetchFootballEntities(e,n,i,s)];case 1:return h=r.sent(),t.football&&t.football.length>0&&t.football.forEach((function(t){f.setEntityModelsFromMap(t.requirements,"competition",h.competitions),f.setEntityModelsFromMap(t.requirements,"team",h.teams),f.setEntityModelsFromObject(t.requirements,"player",h.players),f.setEntityModelsFromObject(t.requirements,"match",h.matches)})),t.voting&&t.voting.poll&&t.voting.poll.length>0&&t.voting.poll.forEach((function(t){f.setEntityModelsFromMap(t.requirements,"competition",h.competitions),f.setEntityModelsFromMap(t.requirements,"team",h.teams),f.setEntityModelsFromObject(t.requirements,"player",h.players),f.setEntityModelsFromObject(t.requirements,"match",h.matches)})),t.voting&&t.voting.potm&&t.voting.potm.length>0&&t.voting.potm.forEach((function(t){f.setEntityModelsFromMap(t.requirements,"competition",h.competitions),f.setEntityModelsFromMap(t.requirements,"team",h.teams),f.setEntityModelsFromObject(t.requirements,"player",h.players),f.setEntityModelsFromObject(t.requirements,"match",h.matches)})),[2]}}))}))},this.setEntityModelsFromMap=function(t,e,n){t.entityType===e&&(t.entityModel=n&&n.get(t.entityId)||null,t.entityModel&&(t.entityId=t.entityModel.id))},this.setEntityModelsFromObject=function(t,e,n){t.entityType===e&&(t.entityModel=n[t.entityId]?n[t.entityId]:null,t.entityModel&&(t.entityId=t.entityModel.id))},this.fetchFootballEntities=function(t,n,s,a){return i(e,void 0,void 0,(function(){var e,i,o,u,l;return r(this,(function(r){switch(r.label){case 0:return e={competitions:null,teams:null,players:null,matches:null},t.length?[4,this.footballNamespace.footballFacade.getCompetitionsMapWithNativeIds(t)]:[3,2];case 1:i=r.sent(),e.competitions=i,r.label=2;case 2:return n.length?[4,this.footballNamespace.footballFacade.getTeamsMapWithNativeIds(n)]:[3,4];case 3:o=r.sent(),e.teams=o,r.label=4;case 4:return s.length?[4,this.footballNamespace.footballFacade.getPlayersMapWithNativeIds(s)]:[3,6];case 5:u=r.sent(),e.players=u,r.label=6;case 6:return a.length?[4,this.footballNamespace.footballFacade.getMatchesMapWithNativeIds(a)]:[3,8];case 7:l=r.sent(),e.matches=l,r.label=8;case 8:return[2,e]}}))}))},this.extractEntityIdsFromBadges=function(t){return[t.filter((function(t){return"competition"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),t.filter((function(t){return"team"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),t.filter((function(t){return"player"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),t.filter((function(t){return"match"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId}))]},this.addGameModelToGamesBadges=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a;return r(this,(function(r){switch(r.label){case 0:return t.games&&0!==t.games.length?(e=this.getGameIdsFromGamesBadge(t.games,"top_x"),n=this.getGameIdsFromGamesBadge(t.games,"match_quiz"),i=this.getGameIdsFromGamesBadge(t.games,"classic_quiz"),s=this.getGameIdsFromGamesBadge(t.games,"either_or"),[4,this.fetchGamesEntities(e,n,i,s)]):[2];case 1:return a=r.sent(),t.games.forEach((function(t){t.requirements.specificGames&&t.requirements.specificGames.forEach((function(t){t.gameModel=a.find((function(e){return e.id===t.gameId}))||null}))})),[2]}}))}))},this.getGameIdsFromGamesBadge=function(t,e){var n=t.filter((function(t){return!!t.requirements.specificGames&&t.requirements.specificGames.some((function(t){return t.gameType.toLocaleLowerCase()===e}))})).map((function(t){return t.requirements.specificGames.map((function(t){return t.gameId}))}));return Array.prototype.concat.apply([],n)},this.fetchGamesEntities=function(t,n,a,o){return i(e,void 0,void 0,(function(){var e,i,u,l,c;return r(this,(function(r){switch(r.label){case 0:return e=[],t.length?[4,this.topXNamespace.getGames({gameIds:t})]:[3,2];case 1:i=r.sent(),e=s(s([],e,!0),i.data,!0),r.label=2;case 2:return n.length?[4,this.matchQuizNamespace.getGames({gameIds:n})]:[3,4];case 3:u=r.sent(),e=s(s([],e,!0),u.data,!0),r.label=4;case 4:return a.length?[4,this.miniGamesNamespace.getClassicQuizzes({classicQuizIds:a})]:[3,6];case 5:l=r.sent(),e=s(s([],e,!0),l.data,!0),r.label=6;case 6:return o.length?[4,this.miniGamesNamespace.getEitherOrs({eitherOrIds:o})]:[3,8];case 7:c=r.sent(),e=s(s([],e,!0),c.data,!0),r.label=8;case 8:return[2,e]}}))}))},this.idMappingService=new f.default(t),this.profileNamespace=new y.default(t),this.footballNamespace=new p.default(t),this.topXNamespace=new g.default(t),this.matchQuizNamespace=new v.default(t),this.miniGamesNamespace=new _.default(t),this.errorHandlingMode=t.errorHandlingMode}},1139:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4021),s=n(4904),a=i(n(8097)),o=i(n(2535)),u=n(5318),l=n(7974);e.default=function(){var t=this;this.validate=function(e,n){e.market&&t.validateMarket(e.market,n),e.fromDate&&t.validateDate(e.fromDate,"fromDate",n),e.toDate&&t.validateDate(e.toDate,"toDate",n),e.usersCount&&t.validateNumberFilters(e.usersCount,"usersCount",n),e.minimumPredictions&&t.validateNumberFilters(e.minimumPredictions,"minimumPredictions",n)},this.validateMarket=function(t,e){if(!Object.keys(l.MarketEnum).includes(t)){var n=(0,u.invalidMarketMessage)(t);if("default"===e)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_MARKET,n);throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_MARKET,n)}},this.validateDate=function(t,e,n){if("string"!=typeof t){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"string for ".concat(e," filter"));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"string for ".concat(e," filter"))}if(!/^\d{4}-\d{2}-\d{2}$/.test(t)){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for ".concat(e));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for ".concat(e))}},this.validateNumberFilters=function(t,e,n){var i="usersCount"===e?1:0,l="usersCount"===e?1e3:1e6;if("number"!=typeof t){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"number for ".concat(e," filter"));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"number for ".concat(e," filter"))}if(t<i||t>l){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"between ".concat(i," and ").concat(l));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"between ".concat(i," and ").concat(l))}}}},1859:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4946),c=u(n(1553)),d=s(n(7686)),h=u(n(2793)),f=u(n(8900)),p=u(n(1732)),m=u(n(7782)),v=u(n(5013)),_=n(853),y=u(n(7299)),g=u(n(2310)),b=u(n(4800)),w=u(n(8097)),I=n(4021),E=n(4904),M=n(5318),O=u(n(2535));e.default=function(t){var e=this;this.predictorHttps=null,this.predictorService=null,this.idMapping=null,this.clientHttps=null,this.predictorValidator=null,this.errorHandlingMode=null,this.getConfig=function(){return a(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(d.FeatureConfigType.MATCH_QUIZ)];case 1:return t=e.sent(),this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(t)];case 2:return[2,e.sent()];case 3:return[2,t]}}))}))},this.play=function(t){return a(e,void 0,void 0,(function(){var e,n,i,r,s,a=this;return o(this,(function(o){switch(o.label){case 0:return t=this.predictorValidator.validateBodyFields("MATCH_QUIZ",t),(e=t.fixtures.map((function(t){return a.predictorValidator.validateFixture(t.matchId,t.market,t.prediction.value,t.prediction.playerId)})))&&e.length?this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,4]:(n=[],i=[],e.forEach((function(t){n.push(t.matchId),t instanceof p.default&&t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&i.push(t.prediction.playerId)})),[4,this.predictorService.remapMatchIdToNative(n)]):[3,4];case 1:return r=o.sent(),s={},i&&i.length>0?[4,this.predictorService.remapPlayerIdMapToNative(i)]:[3,3];case 2:s=o.sent(),o.label=3;case 3:e.forEach((function(t,e){t.matchId=r[e],t instanceof p.default&&"OWN_GOAL"!==t.prediction.playerId&&(t.prediction.playerId=s[t.prediction.playerId])})),o.label=4;case 4:return t.fixtures=e,[4,this.predictorHttps.makeFootballPrediction(t)];case 5:return[2,o.sent()]}}))}))},this.delete=function(t){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getGames=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return n=n||!1,e=this.predictorService.initGameFilters("MATCH_QUIZ",t),[4,this.predictorHttps.getGames(e,n)];case 1:return i=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(i)];case 2:return[2,r.sent()]}}))}))},this.getGameById=function(t,n){return a(e,void 0,void 0,(function(){var e;return o(this,(function(i){switch(i.label){case 0:return n=n||!1,[4,this.predictorHttps.getGameById(t,n)];case 1:return e=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(e)];case 2:return[2,i.sent()]}}))}))},this.getGamePredictions=function(t,n,i){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return i=i||!1,n&&(n.type&&delete n.type,n.status&&delete n.status,n=new m.default(n)),[4,this.predictorHttps.getGamePredictions(t,i,n)];case 1:return[2,e.sent()]}}))}))},this.getGameResults=function(t,n,i){return a(e,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return i=i||!1,n&&(n=new b.default(n)),[4,this.predictorHttps.getGameResults(t,i,n)];case 1:return e=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(e)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(t){return a(e,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return t=t||!1,(e=new y.default(null)).status=_.GameStatusEnum.OPEN,e.type="MATCH_QUIZ",[4,this.predictorHttps.getGames(e,t)];case 1:return n=r.sent(),i=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(i,null,t)];case 2:return[2,r.sent().data[0]]}}))}))},this.getMyGameEditions=function(t,n){return a(e,void 0,void 0,(function(){var e,i,r,s,a;return o(this,(function(o){switch(o.label){case 0:return t&&t.limit&&this.validateLimitFilterOnGames(t.limit),n=n||!1,e=this.predictorService.initGameTypePredictions("MATCH_QUIZ",t),i=[],[4,this.predictorHttps.getMyPredictionsNoRemap(e)];case 1:return(r=o.sent()).data.length>0?(r.data.forEach((function(t){t.game_instance_id&&i.push(t.game_instance_id)})),s=this.predictorService.initGameFilters("MATCH_QUIZ",null,i),[4,this.predictorHttps.getUserGameEditions(s,n)]):[3,4];case 2:return a=o.sent(),[4,this.predictorService.addPredictionProp(r,a)];case 3:return[2,o.sent()];case 4:return[2,new c.default]}}))}))},this.getMyGamePrediction=function(t){return a(e,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return e=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return(n=r.sent()).data.length>0?[2,(i=n.data.filter((function(e){return e.gameInstanceId===t}))).length?i[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r,s,a,u;return o(this,(function(o){switch(o.label){case 0:return n&&n.limit&&this.validateLimitFilterOnGames(n.limit),i=i||!1,e=this.predictorService.initGameTypePredictions("MATCH_QUIZ",n),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(t,e)];case 1:return(s=o.sent()).data.length>0?(s.data.forEach((function(t){t.game_instance_id&&r.push(t.game_instance_id)})),a=this.predictorService.initGameFilters("MATCH_QUIZ",null,r),[4,this.predictorHttps.getUserGameEditions(a,i)]):[3,4];case 2:return u=o.sent(),[4,this.predictorService.addPredictionProp(s,u)];case 3:return[2,o.sent()];case 4:return[2,new c.default]}}))}))},this.getUserGamePrediction=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r,s;return o(this,(function(a){switch(a.label){case 0:return i=i||!1,e=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getUserPredictions(t,i,e)];case 1:return(r=a.sent()).data.length>0?[2,(s=r.data.filter((function(t){return t.gameInstanceId===n}))).length?s[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(t,n){return a(e,void 0,void 0,(function(){var e;return o(this,(function(i){switch(i.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(t,n)];case 1:return e=i.sent(),[4,this.predictorService.completeGameMarketResults(e,"MATCH_QUIZ")];case 2:return[2,i.sent()]}}))}))},this.getGameWinners=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(t,n)];case 1:return e=r.sent(),[4,this.getGameById(t)];case 2:return i=r.sent(),e.contestModel=i,[2,this.predictorService.completeContestWinners(e)]}}))}))},this.validateLimitFilterOnGames=function(t){if("default"===e.errorHandlingMode&&t>50)throw new w.default(I.ErrorCodes.BAD_METHOD_CALL,E.ErrorStatuses.EXCEEDED_LENGTH,M.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===e.errorHandlingMode&&t>50)throw new O.default(I.ErrorCodes.BAD_METHOD_CALL,E.ErrorStatuses.EXCEEDED_LENGTH,M.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED)},this.predictorValidator=new g.default(t.errorHandlingMode),this.idMapping=new f.default(t),this.predictorHttps=new h.default(t,this.idMapping),this.predictorService=new v.default(t,this.idMapping),this.clientHttps=new d.default(t),this.errorHandlingMode=t.errorHandlingMode}},267:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(1859));e.default=function(t){var e=this;this.matchQuizFacade=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.play=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.play(t)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getGames=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGames(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGameById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGamePredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGamePredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getGameResults=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGameResults(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getCurrentGameResults=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getCurrentGameResults(t)];case 1:return[2,e.sent()]}}))}))},this.getMyGameEditions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getMyGameEditions(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyGamePrediction=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getMyGamePrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getUserGameEditions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getUserGameEditions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserGamePrediction=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getUserGamePrediction(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getMarketsResultsForGame=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getMarketsResultsForGame(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameWinners=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGameWinners(t,n)];case 1:return[2,e.sent()]}}))}))},this.matchQuizFacade=new a.default(t)}},5765:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.enabled=!1,this.clientId=null,this.defaultMarkets=null,this.competitionsWhitelist=null}},8410:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899)),s=i(n(8042));e.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new s.default}},670:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.gameId=null,this.results=null,this.tieBreakers=null}},7243:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4916));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.images=null,this.scheduleOpenAt=null,this.branding=null}},8042:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null,this.target=null,this.playerId=null,this.playerModel=null,this.result=null}},6390:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=a(n(3022)),l=a(n(8261)),c=a(n(8107)),d=a(n(2261)),h=a(n(3069)),f=a(n(425)),p=a(n(7050)),m=a(n(3404));e.default=function(t){var e=this;this.https=null,this.service=null,this.activityService=null,this.idSchema=null,this.getClassicQuizzes=function(t,n,i){return r(e,void 0,void 0,(function(){var e,r,a,u;return s(this,(function(s){switch(s.label){case 0:return t?(t=new c.default(t),[4,this.service.finalizeMiniGamesFilters(t)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[4,this.https.getClassicQuizzes(t,i)];case 3:return e=s.sent(),n?[4,this.service.setContextTagsModels(e.data)]:[3,5];case 4:return s.sent(),[3,9];case 5:r=0,a=e.data,s.label=6;case 6:return r<a.length?(u=a[r],[4,this.remapTags(u,o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,9];case 7:s.sent(),s.label=8;case 8:return r++,[3,6];case 9:return[2,e]}}))}))},this.getClassicQuizById=function(t,n,i){return r(e,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.https.getClassicQuizById(t,n,i)];case 1:return e=r.sent(),[4,this.service.setContextTagsModels([e])];case 2:return r.sent(),[2,e]}}))}))},this.participateInClassicQuiz=function(t,n,i){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.https.participateInClassicQuiz(t,n,i)];case 1:return[2,e.sent()]}}))}))},this.getMyClassicQuizParticipations=function(t){return r(e,void 0,void 0,(function(){var e,n,r;return s(this,(function(s){switch(s.label){case 0:return t&&(t=new h.default(t)),[4,this.https.getMyClassicQuizParticipations(t)];case 1:return e=s.sent(),n=e.map((function(t){return t.classicQuizId})),[4,this.getClassicQuizzes({classicQuizIds:n})];case 2:return r=s.sent(),[2,e.map((function(t){var e=r.data.find((function(e){return e.id===t.classicQuizId}))||null;return i(i({},t),{classicQuizModel:e})}))]}}))}))},this.getLeaderboardForClassicQuizzes=function(t){return r(e,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return t&&(t=new d.default(t)),[4,this.https.getLeaderboardForClassicQuizzes(t)];case 1:return e=i.sent(),n=e,[4,this.service.setProfileModelsForClassicQuizLeaderboards(e.data)];case 2:return n.data=i.sent(),[2,e]}}))}))},this.getClassicQuizzesUserRanking=function(t,n){return r(e,void 0,void 0,(function(){var e,r,a;return s(this,(function(s){switch(s.label){case 0:return n&&(n=new f.default(n)),[4,this.https.getClassicQuizzesUserRanking(t,n)];case 1:return e=s.sent(),r=e.data.map((function(t){return t.classicQuizId})),[4,this.getClassicQuizzes({classicQuizIds:r})];case 2:return a=s.sent(),e.data=e.data.map((function(t){var e=a.data.find((function(e){return e.id===t.classicQuizId}))||null;return i(i({},t),{classicQuizModel:e})})),[2,e]}}))}))},this.getEitherOrs=function(t,n,i){return r(e,void 0,void 0,(function(){var e,r,a,u;return s(this,(function(s){switch(s.label){case 0:return t?(t=new p.default(t),[4,this.service.finalizeMiniGamesFilters(t)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[4,this.https.getEitherOrs(t,i)];case 3:return e=s.sent(),n?[4,this.service.setContextTagsModels(e.data)]:[3,5];case 4:return s.sent(),[3,9];case 5:r=0,a=e.data,s.label=6;case 6:return r<a.length?(u=a[r],[4,this.remapTags(u,o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,9];case 7:s.sent(),s.label=8;case 8:return r++,[3,6];case 9:return[2,e]}}))}))},this.getEitherOrById=function(t,n){return r(e,void 0,void 0,(function(){var e;return s(this,(function(i){switch(i.label){case 0:return[4,this.https.getEitherOrById(t,n)];case 1:return e=i.sent(),[4,this.service.setContextTagsModels([e])];case 2:return i.sent(),[2,e]}}))}))},this.getMyEitherOrStats=function(t){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.https.getMyEitherOrStats(t)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrResults=function(t,n){return r(e,void 0,void 0,(function(){var e;return s(this,(function(i){switch(i.label){case 0:return[4,this.https.getEitherOrResults(t,n)];case 1:return e=i.sent(),[4,this.service.setProfileModelsForEitherOrStandings(e)];case 2:return[2,i.sent()]}}))}))},this.participateInEitherOr=function(t,n,i){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return i?[3,2]:[4,this.service.defaultEitherOrParticipation(t,n)];case 1:case 3:return[2,e.sent()];case 2:return[4,this.service.handleEitherOrParticipationWithCallback(t,n,i)]}}))}))},this.calculateEitherOrResultPercentile=function(t,n){return r(e,void 0,void 0,(function(){var e,i,r,a,o,u;return s(this,(function(s){switch(s.label){case 0:return null==n||isNaN(n)||n<0?[2,null]:0===n?[2,n]:[4,this.getEitherOrResults(t,!0)];case 1:for(e=s.sent(),i=e.breakdown.reduce((function(t,e){return t+e.totalUsers}),0),r=0,a=0,o=e.breakdown;a<o.length;a++)if(u=o[a],r+=u.totalUsers,n>=u.rangeStartInclusive&&n<=u.rangeEndInclusive)return[2,parseFloat((r/i*100).toFixed(1))];return[2,null]}}))}))},this.remapTags=function(t,n,i){return r(e,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return this.idSchema!=o.IdSchemaEnum.NATIVE&&t.context&&t.context.tags&&t.context.tags.length?(e=JSON.parse(JSON.stringify(t.context.tags)),[4,this.activityService.remapTagsIds(e,n,i)]):[3,2];case 1:r=s.sent(),t.context.tags=r,s.label=2;case 2:return[2]}}))}))},this.https=new u.default(t),this.service=new m.default(t),this.activityService=new l.default(t),this.idSchema=t.idSchema}},1550:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(6390));e.default=function(t){var e=this;this.facade=null,this.getClassicQuizzes=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getClassicQuizzes(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getClassicQuizById=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getClassicQuizById(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.participateInClassicQuiz=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.participateInClassicQuiz(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getMyClassicQuizParticipations=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyClassicQuizParticipations(t)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboardForClassicQuizzes=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getLeaderboardForClassicQuizzes(t)];case 1:return[2,e.sent()]}}))}))},this.getClassicQuizzesUserRanking=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getClassicQuizzesUserRanking(t,n)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrs=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getEitherOrs(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getEitherOrById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyEitherOrStats=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyEitherOrStats(t)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrResults=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getEitherOrResults(t,n)];case 1:return[2,e.sent()]}}))}))},this.participateInEitherOr=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.participateInEitherOr(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.calculateEitherOrResultPercentile=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.calculateEitherOrResultPercentile(t,n)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},5985:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.images=new r.default,this.participationCount=null,this.questionsCount=null,this.status=null,this.flags=null,this.customFields=null,this.labels=null,this.branding=null,this.time=null,this.points=null,this.scored=!1,this.maxAttempts=null,this.averageScore=null,this.perfectScore=null,this.adContent=null,this.context=null,this.createdAt=null,this.updatedAt=null}},8107:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.classicQuizIds=null,n.classicQuizIds=e&&e.classicQuizIds?e.classicQuizIds:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.classicQuizIds&&this.classicQuizIds.length>0&&(e+="&classic_quiz_ids=".concat(this.classicQuizIds.join(","))),e},e}(s(n(4654)).default);e.default=a},6235:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rules=null,e.questions=[],e}return r(e,t),e}(s(n(5985)).default);e.default=a},1154:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.optionId=null,this.option=null,this.images=null,this.correct=null}},8944:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.classicQuizId=null,this.userId=null,this.questions=[],this.correctOptions=null,this.personalBest=null,this.points=null,this.attempts=null}},7763:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.questionId=null,this.optionId=null,this.correct=null,this.correctOptionId=null}},3069:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.classicQuizIds=null,n.classicQuizIds=(null==e?void 0:e.classicQuizIds)||null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.classicQuizIds&&this.classicQuizIds.length>0&&(e+="&classic_quiz_ids=".concat(this.classicQuizIds.join(","))),e},e}(s(n(4800)).default);e.default=a},772:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.questionId=null,this.question=null,this.images=null,this.embedCode=null,this.explanation=null,this.options=[]}},1124:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.classicQuizId=null,this.classicQuizModel=null,this.correct=null,this.classicQuizQuestions=null,this.personalBest=null,this.points=null,this.answers=[]}},9657:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.classicQuizIds=null}},2261:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.classicQuizIds=null,n.classicQuizIds=(null==e?void 0:e.classicQuizIds)||null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.classicQuizIds&&this.classicQuizIds.length>0&&(e+="&classic_quiz_ids=".concat(this.classicQuizIds.join(","))),e},e}(s(n(425)).default);e.default=a},2702:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155)),s=i(n(9657));e.default=function(){this.pagination=new r.default,this.filters=new s.default}},425:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.limit=null,this.page=null,this.limit=(null==t?void 0:t.limit)||null,this.page=(null==t?void 0:t.page)||null}return t.prototype.constructMainFiltersUrl=function(){var t="";return this.limit&&(t+="&limit=".concat(this.limit)),this.page&&(t+="&page=".concat(this.page)),t},t}();e.default=n},5563:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.profileId=null,this.profileModel=null,this.points=null}},8967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.classicQuizId=null,this.classicQuizModel=null,this.points=null}},9619:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id="",this.title="",this.description="",this.images=new r.default,this.flags=[],this.status="",this.winningCondition="",this.lives=0,this.time=0,this.points=[],this.customFields=null,this.branding=null,this.labels=null,this.adContent="",this.context=null,this.type="",this.createdAt="",this.updatedAt=""}},7050:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.eitherOrIds=null,n.eitherOrIds=e&&e.eitherOrIds?e.eitherOrIds:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.eitherOrIds&&this.eitherOrIds.length>0&&(e+="&either_or_ids=".concat(this.eitherOrIds.join(","))),e},e}(s(n(4654)).default);e.default=a},3167:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rules="",e}return r(e,t),e}(s(n(9619)).default);e.default=a},9146:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.correctSteps=0,this.score=0}},5367:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.eitherOrId="",this.personalBest=0}},5021:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.instanceId="",this.eitherOrId="",this.gameStartedAt="",this.currentStep=0,this.currentStreak=0,this.remainingSteps=0,this.currentLives=0,this.currentPoints=0,this.personalBest=0,this.steps=[]}},850:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.expired=!1,e.time=0,e}return r(e,t),e}(s(n(5990)).default);e.default=a},5990:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.pair="",this.answer=""}},2557:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6140));e.default=function(){this.pairId="",this.userSelection="",this.correct=null,this.played=null,this.timestamp="",this.optionOne=new r.default,this.optionTwo=new r.default}},6140:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5253));e.default=function(){this.id="",this.label="",this.images=new r.default,this.value=null}},2699:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.rangeStartInclusive=0,this.rangeEndInclusive=0,this.totalUsers=0}},8590:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.standings=[],this.breakdown=[]}},5289:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.userId="",this.userModel=null,this.personalBest=""}},4654:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.flags=null,n.status=null,n.entityIds=null,n.entityType=null,n.sort=null,n.groupByStatus=null,n.flags=e&&e.flags?e.flags:null,n.status=e&&e.status?e.status:null,n.entityIds=e&&e.entityIds?e.entityIds:null,n.entityType=e&&e.entityType?e.entityType:null,n.sort=e&&e.sort?e.sort:null,n.groupByStatus=e&&void 0!==e.groupByStatus?e.groupByStatus:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.flags&&this.flags.length>0&&(e+="&flags=".concat(this.flags.join(","))),this.status&&(e+="&status=".concat(this.status)),this.entityIds&&this.entityIds.length>0&&(e+="&entity_ids=".concat(this.entityIds)),this.sort&&(e+="&sort=".concat(this.sort)),null!==this.groupByStatus&&(e+="&group_by_status=".concat(this.groupByStatus)),e},e}(s(n(4800)).default);e.default=a},5253:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},6282:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.content=null,this.tags=[],this.campaign=null}},3323:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.model=null,this.source=null,this.type=null}},2239:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8902)),o=s(n(5985)),u=s(n(6235)),l=s(n(772)),c=s(n(1154)),d=s(n(8944)),h=s(n(7763)),f=s(n(1124)),p=s(n(6282)),m=s(n(3323)),v=s(n(6692)),_=s(n(2702)),y=s(n(155)),g=s(n(9657)),b=s(n(5563)),w=s(n(8967)),I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapClassicQuizzes=function(t){return t.meta.pagination=e.remapMetaPagination(t.meta.pagination),t.data=t.data.map((function(t){return e.remapBasicClassicQuiz(t)})),t},e.remapClassicQuizById=function(t){var n=new u.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.participationCount=t.participation_count,n.questionsCount=t.questions_count,n.status=t.status,n.flags=t.flags,n.adContent=t.ad_content,n.rules=t.rules,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.time=t.time,n.points=t.points,n.scored=t.scored,n.maxAttempts=t.max_attempts,n.context=t.context?e.remapContext(t.context):t.context,n.averageScore=t.average_score,n.perfectScore=t.perfect_score,n.questions=t.questions.map((function(t){return e.remapQuestions(t)})),n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapClassicQuizParticipation=function(t){var n=new d.default;return n.classicQuizId=t.classic_quiz_id,n.userId=t.user_id,n.questions=t.questions?t.questions.map((function(t){return e.remapParticipationQuestions(t)})):null,n.correctOptions=t.correct_options,n.personalBest=t.personal_best,n.points=t.points,n.attempts=t.attempts,n},e.remapClassicQuizParticipationBody=function(t){return t.map((function(t){return{question_id:t.questionId,option_id:t.optionId}}))},e.remapUserClassicQuizParticipations=function(t){return t.map((function(t){var n=new f.default;return n.classicQuizId=t.classic_quiz_id,n.correct=t.correct,n.classicQuizQuestions=t.classic_quiz_questions,n.personalBest=t.personal_best,n.points=t.points,n.answers=t.answers?t.answers.map((function(t){return e.remapParticipationQuestions(t)})):t.answers,n}))},e.remapClassicQuizzesLeaderboard=function(t){return t.meta=e.remapClassicQuizLeaderboardMeta(t.meta),t.data=t.data.map((function(t){return e.remapClassicQuizLeaderboard(t)})),t},e.remapClassicQuizUserRankings=function(t){return t.meta.pagination=e.remapMetaPaginationRank(t.meta.pagination),t.data=t.data.map((function(t){return e.remapClassicQuizUserRanking(t)})),t},e.remapMetaPagination=function(t){var e=new a.default;return e.itemsPerPage=t.items_per_page,e.nextPageStartsAfter=t.next_page_starts_after,e},e.remapClassicQuizLeaderboardMeta=function(t){var n=new _.default;return n.pagination=e.remapMetaPaginationRank(t.pagination),n.filters=e.remapLeaderboardMetaFilters(t.filters),n},e.remapMetaPaginationRank=function(t){var e=new y.default;return e.currentPage=t.current_page,e.itemsPerPage=t.items_per_page,e.numberOfPages=t.number_of_pages,e.totalItems=t.total_items,e},e.remapLeaderboardMetaFilters=function(t){var e=new g.default;return e.classicQuizIds=(null==t?void 0:t.classic_quiz_ids)||null,e},e.remapClassicQuizUserRanking=function(t){var e=new w.default;return e.position=t.position,e.classicQuizId=t.classic_quiz_id,e.points=t.points,e},e.remapBasicClassicQuiz=function(t){var n=new o.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.participationCount=t.participation_count,n.questionsCount=t.questions_count,n.status=t.status,n.flags=t.flags,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.time=t.time,n.averageScore=t.average_score,n.perfectScore=t.perfect_score,n.points=t.points,n.scored=t.scored,n.maxAttempts=t.max_attempts,n.context=t.context?e.remapContext(t.context):t.context,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapQuestions=function(t){var n=new l.default;return n.questionId=t.question_id,n.question=t.question,n.images=t.images,n.embedCode=t.embed_code,n.explanation=t.explanation,n.options=t.options.map((function(t){return e.remapOptions(t)})),n},e.remapOptions=function(t){var e=new c.default;return e.optionId=t.option_id,e.option=t.option,e.images=t.images,e.correct=t.correct,e},e.remapParticipationQuestions=function(t){var e=new h.default;return e.questionId=t.question_id,e.optionId=t.option_id,e.correct=t.correct,e.correctOptionId=t.correct_option_id,e},e.remapClassicQuizLeaderboard=function(t){var e=new b.default;return e.position=t.position,e.profileId=t.profile_id,e.points=t.points,e},e.remapContext=function(t){var e=new p.default;return e.content=t.content,e.tags=t.tags?t.tags.map((function(t){var e=new m.default;return e.id=t.id,e.type=t.type,e.source=t.source,e})):null,e.campaign=t.campaign,e},e}return r(e,t),e}(v.default);e.default=I},4688:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8902)),o=s(n(9619)),u=s(n(3167)),l=s(n(9146)),c=s(n(5367)),d=s(n(5021)),h=s(n(2557)),f=s(n(2699)),p=s(n(8590)),m=s(n(5289)),v=s(n(6282)),_=s(n(3323)),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapEitherOrs=function(t){return t.meta.pagination=e.remapMetaPagination(t.meta.pagination),t.data=t.data.map((function(t){return e.remapBasicEitherOr(t)})),t},e.remapEitherOrById=function(t){var n=new u.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.winningCondition=t.winning_condition,n.lives=t.lives,n.flags=t.flags,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.time=t.time,n.context=t.context?e.remapContext(t.context):t.context,n.points=t.points?t.points.map((function(t){return e.remapPoints(t)})):t.points,n.rules=t.rules,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapEitherOrOwnStats=function(t){var e=new c.default;return e.eitherOrId=t.either_or_id,e.personalBest=t.personal_best,e},e.remapEitherOrResults=function(t){var n=new p.default;return n.standings=t.standings?t.standings.map((function(t){return e.remapResultsStandings(t)})):t.standings,n.breakdown=t.breakdown?t.breakdown.map((function(t){return e.remapResultsBreakdown(t)})):t.breakdown,n},e.remapEitherOrParticipation=function(t){var n=new d.default;return n.instanceId=t.instance_id,n.eitherOrId=t.either_or_id,n.gameStartedAt=t.game_started_at,n.currentStep=t.current_step,n.currentStreak=t.current_streak,n.remainingSteps=t.remaining_steps,n.currentLives=t.current_lives,n.currentPoints=t.current_points,n.personalBest=t.personal_best,n.steps=t.steps?t.steps.map((function(t){return e.remapParticipationSteps(t)})):t.steps,n},e.remapBasicEitherOr=function(t){var n=new o.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.winningCondition=t.winning_condition,n.lives=t.lives,n.flags=t.flags,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.adContent=t.ad_content,n.context=t.context?e.remapContext(t.context):t.context,n.time=t.time,n.points=t.points?t.points.map((function(t){return e.remapPoints(t)})):t.points,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapMetaPagination=function(t){var e=new a.default;return e.itemsPerPage=t.items_per_page,e.nextPageStartsAfter=t.next_page_starts_after,e},e.remapPoints=function(t){var e=new l.default;return e.correctSteps=t.correct_steps,e.score=t.score,e},e.remapResultsStandings=function(t){var e=new m.default;return e.userId=t.user_id,e.personalBest=t.personal_best,e},e.remapResultsBreakdown=function(t){var e=new f.default;return e.rangeStartInclusive=t.range_start_inclusive,e.rangeEndInclusive=t.range_end_inclusive,e.totalUsers=t.total_users,e},e.remapParticipationSteps=function(t){var e=new h.default;return e.pairId=t.pair_id,e.userSelection=t.user_selection,e.correct=t.correct,e.played=t.played,e.timestamp=t.timestamp,e.optionOne=t.option_one,e.optionTwo=t.option_two,e},e.remapContext=function(t){var e=new v.default;return e.content=t.content,e.tags=t.tags?t.tags.map((function(t){var e=new _.default;return e.id=t.id,e.type=t.type,e.source=t.source,e})):null,e.campaign=t.campaign,e},e}return r(e,t),e}(s(n(6692)).default);e.default=y},3404:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=a(n(3022)),l=a(n(8900)),c=a(n(8808)),d=a(n(6409)),h=a(n(850)),f=a(n(9685));e.default=function(t){var e=this;this.idSchema=null,this.idMapping=null,this.validator=null,this.https=null,this.entityTypes=["competition","team","player"],this.profile=null,this.football=null,this.eitherOrTime=0,this.participationStartTimestamp=0,this.countdownTimer=0,this.intervalId=null,this.currentPairId="",this.finalizeMiniGamesFilters=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return this.idSchema!==o.IdSchemaEnum.NATIVE&&t.entityIds&&t.entityIds.length>0?(this.validator.validateFilters(t),[4,this.idMapping.getEntityIdsBySchemaId(Array.from(t.entityIds),t.entityType,o.IdSchemaEnum.NATIVE)]):[3,2];case 1:e=n.sent(),t.entityIds=e[t.entityType],n.label=2;case 2:return[2]}}))}))},this.setProfileModelsForEitherOrStandings=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=t.standings.map((function(t){return t.userId}))).length?[4,this.profile.getByIds(e)]:[2,t];case 1:return n=i.sent(),t.standings.forEach((function(t){return t.userModel=n.find((function(e){return e.id===t.userId}))||null})),[2,t]}}))}))},this.setProfileModelsForClassicQuizLeaderboards=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=t.map((function(t){return t.profileId}))).length?[4,this.profile.getByIds(e)]:[2,t];case 1:return n=i.sent(),t.forEach((function(t){return t.profileModel=n.find((function(e){return e.id===t.profileId}))||null})),[2,t]}}))}))},this.defaultEitherOrParticipation=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s,a,o;return r(this,(function(r){switch(r.label){case 0:return this.eitherOrTime||n?[3,3]:[4,this.https.getEitherOrById(t,!0)];case 1:return i=r.sent(),this.eitherOrTime=i.time,[4,this.https.participateInEitherOr(t,null)];case 2:return a=r.sent(),this.participationStartTimestamp=Date.now(),[2,a];case 3:return e=0,this.participationStartTimestamp?[3,6]:this.eitherOrTime?[3,5]:[4,this.https.getEitherOrById(t,!0)];case 4:i=r.sent(),this.eitherOrTime=i.time,r.label=5;case 5:return e=this.eitherOrTime+1,[3,7];case 6:e=(Date.now()-this.participationStartTimestamp)/1e3,r.label=7;case 7:s=this.createNewParticipation(e,n),r.label=8;case 8:return r.trys.push([8,10,,11]),[4,this.https.participateInEitherOr(t,s)];case 9:return(a=r.sent()).currentLives&&a.remainingSteps?this.participationStartTimestamp=Date.now():this.resetDefaultParticipationTimers(),[2,a];case 10:throw o=r.sent(),this.resetDefaultParticipationTimers(),o;case 11:return[2]}}))}))},this.handleEitherOrParticipationWithCallback=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return n?[3,2]:[4,this.initialEitherOrParticipationWithCallback(t,s)];case 1:case 3:return[2,e.sent()];case 2:return[4,this.eitherOrParticipationWithCallback(t,n,s)]}}))}))},this.initialEitherOrParticipationWithCallback=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.https.getEitherOrById(t,!0)];case 1:return e=r.sent(),this.eitherOrTime=e.time,[4,this.https.participateInEitherOr(t,null)];case 2:return i=r.sent(),this.participationStartTimestamp=Date.now(),this.countdownTimer=this.eitherOrTime,this.setCurrentPairId(i),[4,this.handleEitherOrParticipationCallbackInterface(t,n)];case 3:return r.sent(),[2,i]}}))}))},this.eitherOrParticipationWithCallback=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i,a,o,u;return r(this,(function(r){switch(r.label){case 0:return this.intervalId&&clearInterval(this.intervalId),e=0,this.participationStartTimestamp?[3,3]:this.eitherOrTime?[3,2]:[4,this.https.getEitherOrById(t,!0)];case 1:i=r.sent(),this.eitherOrTime=i.time,r.label=2;case 2:return e=this.eitherOrTime+1,[3,4];case 3:e=(Date.now()-this.participationStartTimestamp)/1e3,r.label=4;case 4:a=this.createNewParticipation(e,n),r.label=5;case 5:return r.trys.push([5,10,,11]),[4,this.https.participateInEitherOr(t,a)];case 6:return(o=r.sent()).currentLives&&o.remainingSteps?[3,7]:(this.resetCallbackParticipationTimers(),s.onElapsedResponse(o),clearInterval(this.intervalId),[3,9]);case 7:return this.participationStartTimestamp=Date.now(),this.countdownTimer=this.eitherOrTime,this.setCurrentPairId(o),[4,this.handleEitherOrParticipationCallbackInterface(t,s)];case 8:r.sent(),r.label=9;case 9:return[2,o];case 10:throw u=r.sent(),this.resetCallbackParticipationTimers(),clearInterval(this.intervalId),u;case 11:return[2]}}))}))},this.setCurrentPairId=function(t){e.currentPairId=t.steps.find((function(t){return!t.played})).pairId||""},this.handleEitherOrParticipationCallbackInterface=function(t,n){return i(e,void 0,void 0,(function(){var e=this;return r(this,(function(s){return this.intervalId=setInterval((function(){return i(e,void 0,void 0,(function(){var e,i,s,a;return r(this,(function(r){switch(r.label){case 0:return this.countdownTimer>0?(this.countdownTimer--,n.onTimerTick(this.countdownTimer),[3,3]):[3,1];case 1:return clearInterval(this.intervalId),e=(Date.now()-this.participationStartTimestamp)/1e3,i={pair:this.currentPairId,answer:this.currentPairId.split("_")[0]},s=this.createNewParticipation(e,i),[4,this.eitherOrParticipationWithCallback(t,s,n)];case 2:a=r.sent(),n.onElapsedResponse(a),r.label=3;case 3:return[2]}}))}))}),1e3),[2]}))}))},this.createNewParticipation=function(t,n){var i=new h.default;return i.expired=t>e.eitherOrTime,i.time=Number(t.toFixed(3)),i.pair=n.pair,i.answer=n.answer,i},this.resetCallbackParticipationTimers=function(){e.resetDefaultParticipationTimers(),e.countdownTimer=0,e.currentPairId=""},this.resetDefaultParticipationTimers=function(){e.eitherOrTime=0,e.participationStartTimestamp=0},this.setContextTagsModels=function(t){return i(e,void 0,void 0,(function(){var e,n,i=this;return r(this,(function(r){switch(r.label){case 0:return e={competitions:[],teams:[],players:[]},t.forEach((function(t){t.context&&t.context.tags&&t.context.tags.length>0&&(e.competitions=s(s([],e.competitions,!0),i.extractEntityIdsFromTags(t.context.tags,"competition"),!0),e.competitions=Array.from(new Set(e.competitions)),e.teams=s(s([],e.teams,!0),i.extractEntityIdsFromTags(t.context.tags,"team"),!0),e.teams=Array.from(new Set(e.teams)),e.players=s(s([],e.players,!0),i.extractEntityIdsFromTags(t.context.tags,"player"),!0),e.players=Array.from(new Set(e.players)))})),e.competitions.length?[4,this.football.footballFacade.getCompetitionsMapWithNativeIds(e.competitions)]:[3,2];case 1:n=r.sent(),this.setModelsForContextTags(t,n,"competition"),r.label=2;case 2:return e.teams.length?[4,this.football.footballFacade.getTeamsMapWithNativeIds(e.teams)]:[3,4];case 3:n=r.sent(),this.setModelsForContextTags(t,n,"team"),r.label=4;case 4:return e.players.length?[4,this.football.footballFacade.getPlayersMapWithNativeIds(e.players)]:[3,6];case 5:n=r.sent(),this.setModelsForContextTags(t,n,"player"),r.label=6;case 6:return[2]}}))}))},this.extractEntityIdsFromTags=function(t,e){return t.filter((function(t){return t.type===e})).map((function(t){return t.id}))},this.setModelsForContextTags=function(t,e,n){t.forEach((function(t){t.context&&t.context.tags&&t.context.tags.length>0&&t.context.tags.forEach((function(t){t.type===n&&(t.model="player"===n?e[t.id]:e.get(t.id),t.id=t.model.id)}))}))},this.idSchema=t.idSchema,this.idMapping=new l.default(t),this.validator=new f.default(t),this.profile=new d.default(t),this.football=new c.default(t),this.https=new u.default(t)}},9685:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4021),s=n(4904),a=i(n(8097)),o=i(n(2535)),u=n(5318);e.default=function(t){var e=this;this.errorHandlingModel=null,this.entityTypes=["competition","team","player"],this.validateFilters=function(t){(t.entityIds||t.entityType)&&(t.entityIds&&!t.entityType&&e.throwException(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.FILTER_COMBINATION_ERROR),!t.entityIds&&t.entityType&&e.throwException(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.FILTER_COMBINATION_ERROR),e.entityTypes.includes(t.entityType)||e.throwException(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_ENTITY_TYPE))},this.throwException=function(t,n,i){if("standard"===e.errorHandlingModel)throw new o.default(t,n,i);throw new a.default(t,n,i)},this.errorHandlingModel=t.errorHandlingMode}},7974:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.playerMarketNobodyPrediction=e.endMarkMarkets=e.playerMarkets=e.MarketsOverCorners=e.MarketsOverGoals=e.MarketEnum=void 0,function(t){t.FT_1X2="FT_1X2",t.HT_1X2="HT_1X2",t.BOTH_TEAMS_SCORE="BOTH_TEAMS_SCORE",t.DOUBLE_CHANCE="DOUBLE_CHANCE",t.HT_FT="HT_FT",t.PLAYER_SCORE="PLAYER_SCORE",t.PLAYER_YELLOW_CARD="PLAYER_YELLOW_CARD",t.PLAYER_RED_CARD="PLAYER_RED_CARD",t.RED_CARD_MATCH="RED_CARD_MATCH",t.PENALTY_MATCH="PENALTY_MATCH",t.PLAYER_SCORE_FIRST_GOAL="PLAYER_SCORE_FIRST_GOAL",t.CORNERS_MATCH="CORNERS_MATCH",t.CORRECT_SCORE="CORRECT_SCORE",t.CORRECT_SCORE_ADVANCED="CORRECT_SCORE_ADVANCED",t.CORRECT_SCORE_HT="CORRECT_SCORE_HT",t.PLAYER_SCORE_HATTRICK="PLAYER_SCORE_HATTRICK",t.PLAYER_SCORE_TWICE="PLAYER_SCORE_TWICE",t.OVER_GOALS_0_5="OVER_GOALS_0_5",t.OVER_GOALS_1_5="OVER_GOALS_1_5",t.OVER_GOALS_2_5="OVER_GOALS_2_5",t.OVER_GOALS_3_5="OVER_GOALS_3_5",t.OVER_GOALS_4_5="OVER_GOALS_4_5",t.OVER_GOALS_5_5="OVER_GOALS_5_5",t.OVER_GOALS_6_5="OVER_GOALS_6_5",t.OVER_CORNERS_6_5="OVER_CORNERS_6_5",t.OVER_CORNERS_7_5="OVER_CORNERS_7_5",t.OVER_CORNERS_8_5="OVER_CORNERS_8_5",t.OVER_CORNERS_9_5="OVER_CORNERS_9_5",t.OVER_CORNERS_10_5="OVER_CORNERS_10_5",t.OVER_CORNERS_11_5="OVER_CORNERS_11_5",t.OVER_CORNERS_12_5="OVER_CORNERS_12_5",t.OVER_CORNERS_13_5="OVER_CORNERS_13_5"}(n=e.MarketEnum||(e.MarketEnum={})),e.MarketsOverGoals=[n.OVER_GOALS_0_5,n.OVER_GOALS_1_5,n.OVER_GOALS_2_5,n.OVER_GOALS_3_5,n.OVER_GOALS_4_5,n.OVER_GOALS_5_5,n.OVER_GOALS_6_5],e.MarketsOverCorners=[n.OVER_CORNERS_6_5,n.OVER_CORNERS_7_5,n.OVER_CORNERS_8_5,n.OVER_CORNERS_9_5,n.OVER_CORNERS_10_5,n.OVER_CORNERS_11_5,n.OVER_CORNERS_12_5,n.OVER_CORNERS_13_5],e.playerMarkets=[n.PLAYER_RED_CARD,n.PLAYER_SCORE,n.PLAYER_SCORE_FIRST_GOAL,n.PLAYER_SCORE_HATTRICK,n.PLAYER_SCORE_TWICE,n.PLAYER_YELLOW_CARD],e.endMarkMarkets=[n.FT_1X2,n.HT_1X2,n.HT_FT,n.DOUBLE_CHANCE,n.CORNERS_MATCH,n.CORRECT_SCORE,n.CORRECT_SCORE_HT,n.CORRECT_SCORE_ADVANCED],e.playerMarketNobodyPrediction=n.PLAYER_SCORE_FIRST_GOAL},6147:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.pastStatuses=e.StatusEnum=void 0,function(t){t.ACTIVE="ACTIVE",t.WON="WON",t.LOST="LOST",t.PARTIALLY_WON="PARTIALLY_WON",t.CANCELED="CANCELED"}(n=e.StatusEnum||(e.StatusEnum={})),e.pastStatuses=[n.WON,n.LOST,n.PARTIALLY_WON,n.CANCELED]},1976:(t,e)=>{"use strict";var n,i,r;Object.defineProperty(e,"__esModule",{value:!0}),e.HalfTimeFullTimeEnum=e.DoubleChanceEnum=e.OneXTwoEnum=void 0,(r=e.OneXTwoEnum||(e.OneXTwoEnum={})).ONE="1",r.X="x",r.TWO="2",(i=e.DoubleChanceEnum||(e.DoubleChanceEnum={})).ONE_X="1x",i.X_TWO="x2",i.ONE_TWO="12",(n=e.HalfTimeFullTimeEnum||(e.HalfTimeFullTimeEnum={})).ONE_ONE="1/1",n.ONE_X="1/x",n.ONE_TWO="1/2",n.X_ONE="x/1",n.X_X="x/x",n.X_TWO="x/2",n.TWO_ONE="2/1",n.TWO_X="2/x",n.TWO_TWO="2/2"},2929:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=n(7974),l=n(7686),c=a(n(5013)),d=a(n(3950)),h=a(n(1732)),f=a(n(2310)),p=a(n(8097)),m=n(4021),v=n(4904),_=n(5318),y=a(n(2535));e.default=function(t,e,n,a){var g=this;this.predictorHttps=null,this.clientHttps=null,this.idMapping=null,this.predictorService=null,this.predictorValidator=null,this.errorHandlingMode=null,this.makeFootballPrediction=function(t,e,n,s){return i(g,void 0,void 0,(function(){var i,a,l,c,f,g,b;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorValidator.validateFixture(t,e,n,s),a=new d.default,this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,6]:(l=i.matchId,c="",[4,this.predictorService.remapMatchIdToNative([l])]);case 1:if(f=r.sent(),i.matchId=f[0],"default"===this.errorHandlingMode&&!i.matchId)throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_MATCH_ID).errorMessage();if("standard"===this.errorHandlingMode&&!i.matchId)throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_MATCH_ID);return i instanceof h.default&&"OWN_GOAL"!==i.prediction.playerId?i.prediction.playerId?(c=i.prediction.playerId,g=i.prediction,[4,this.predictorService.remapPlayerIdToNative([c])]):[3,3]:[3,4];case 2:g.playerId=r.sent(),r.label=3;case 3:if("default"===this.errorHandlingMode&&i.market!==u.playerMarketNobodyPrediction&&!i.prediction.playerId)throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_PLAYER_ID).errorMessage();if("standard"===this.errorHandlingMode&&i.market!==u.playerMarketNobodyPrediction&&!i.prediction.playerId)throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_PLAYER_ID);r.label=4;case 4:return a.fixtures=[i],[4,this.predictorHttps.makeFootballPrediction(a)];case 5:return(b=r.sent()).fixtures.forEach((function(t){t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&(t.prediction.playerId=c),t.matchId=l})),[2,b];case 6:return a.fixtures=[i],[4,this.predictorHttps.makeFootballPrediction(a)];case 7:return[2,r.sent()]}}))}))},this.getMatchSummary=function(t,e){return i(g,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return[4,this.getMatchSummaryBase(t,e)];case 1:return n=r.sent(),i=JSON.parse(JSON.stringify(n.predictions)),[4,this.predictorService.remapPlayerIdToIdSchema(i)];case 2:return s=r.sent(),n.predictions=s,[2,n]}}))}))},this.getMarketSummary=function(t,e,n,s){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getMatchSummaryBase(t,s)];case 1:return i=r.sent(),[4,this.predictorService.getMarketSummary(i,e,n)];case 2:return[2,r.sent()];case 3:throw r.sent();case 4:return[2]}}))}))},this.getMatchSummaryBase=function(t,e){return i(g,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapMatchIdToNative([t])];case 1:return n=r.sent(),i=n[0],[4,this.predictorHttps.getMatchSummary(i,e)];case 2:return(s=r.sent()).matchId=t,[2,s];case 3:return[4,this.predictorHttps.getMatchSummary(t,e)];case 4:return[2,r.sent()]}}))}))},this.getConfig=function(){return i(g,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(l.FeatureConfigType.PREDICTOR)];case 1:return t=e.sent(),this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(t)];case 2:return[2,e.sent()];case 3:return[2,t]}}))}))},this.deleteFootballPrediction=function(t){return i(g,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPredictions=function(t){return i(g,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=this.predictorService.initPredictionsFilters(t,"user"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return[2,n.sent()]}}))}))},this.getMyPredictionsForMatches=function(t,e){return i(g,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED);return this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],t,!0))];case 1:t=i.sent(),i.label=2;case 2:return n=this.predictorService.initPredictionsFilters(e,"matches",t),[4,this.predictorHttps.getMyPredictions(n)];case 3:return[2,i.sent()]}}))}))},this.getMyCurrentPredictions=function(t){return i(g,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=this.predictorService.initPredictionsFilters(t,"current"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return[2,n.sent()]}}))}))},this.getMyPastPredictions=function(t){return i(g,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=this.predictorService.initPredictionsFilters(t,"past"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return[2,n.sent()]}}))}))},this.getUserPredictions=function(t,e,n){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorService.initPredictionsFilters(e,"user"),[4,this.predictorHttps.getUserPredictions(t,n,i)];case 1:return[2,r.sent()]}}))}))},this.getUserCurrentPredictions=function(t,e,n){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorService.initPredictionsFilters(e,"current"),[4,this.predictorHttps.getUserPredictions(t,n,i)];case 1:return[2,r.sent()]}}))}))},this.getUserPastPredictions=function(t,e,n){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorService.initPredictionsFilters(e,"past"),[4,this.predictorHttps.getUserPredictions(t,n,i)];case 1:return[2,r.sent()]}}))}))},this.getUserPredictionsForMatches=function(t,e,n,a){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED);return this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],e,!0))];case 1:e=r.sent(),r.label=2;case 2:return i=this.predictorService.initPredictionsFilters(n,"matches",e),[4,this.predictorHttps.getUserPredictions(t,a,i)];case 3:return[2,r.sent()]}}))}))},this.getPredictionById=function(t){return i(g,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.getPredictionById(t)];case 1:return[2,e.sent()]}}))}))},this.getPredictionsByIds=function(t){return i(g,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.getPredictionsByIds(t)];case 1:return[2,e.sent()]}}))}))},this.predictorHttps=e,this.idMapping=a,this.clientHttps=n,this.errorHandlingMode=t.errorHandlingMode,this.predictorValidator=new f.default(t.errorHandlingMode),this.predictorService=new c.default(t,a)}},704:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3949)),s=i(n(8543)),a=i(n(1429)),o=i(n(515)),u=i(n(4187)),l=i(n(4226)),c=i(n(5765)),d=i(n(1180)),h=i(n(8452)),f=i(n(8824)),p=i(n(9750)),m=i(n(5793)),v=i(n(8699)),_=i(n(6268)),y=i(n(3035)),g=i(n(8574)),b=i(n(3101)),w=i(n(4646)),I=i(n(6483)),E=i(n(6866)),M=i(n(8608)),O=i(n(246)),P=i(n(7983)),T=i(n(2354)),S=i(n(516)),A=i(n(1002)),R=i(n(4339));e.default=function(){var t=this;this.remapPredictorConfig=function(e){var n=new h.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.fullCoverageCompetitions=e.full_coverage_competitions,n.markets=e.markets,n.successRateScopes=e.success_rate_scopes,n.userDataConfig=e.user_data_config?t.remapUserDataConfig(e.user_data_config):null,n},this.remapTopXConfig=function(t){var e=new d.default;return e.enabled=t.enabled,e.clientId=t.client_id,e.minFixtures=t.min_fixtures,e.maxFixtures=t.max_fixtures,e.competitionsWhitelist=t.competitions_whitelist,e},this.remapMatchQuizConfig=function(t){var e=new c.default;return e.enabled=t.enabled,e.clientId=t.client_id,e.defaultMarkets=t.default_markets,e.competitionsWhitelist=t.competitions_whitelist,e},this.remapLoyaltyConfig=function(e){var n=new o.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.conditions.list=e.conditions.list,n.actions.value=e.actions.value,n.rewards=t.remapRewards(e.rewards),n},this.remapLoyaltyNewConfig=function(e){var n=new E.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.conditions.list=e.conditions.list,n.actions.value=e.actions.value,n.rewards=t.remapNewRewards(e.rewards),n},this.remapDiscussionsConfig=function(e){var n=new s.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.automaticModeration=e.automatic_moderation?t.remapAutomaticModeration(e.automatic_moderation):null,n},this.remapFantasyConfig=function(e){var n=new S.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.addPointsToProfileTotal=e.add_points_to_profile_total,n.competitionsWhitelist=e.competitions_whitelist,n.players=t.remapFantasyPlayers(e.players),n.coefficients=t.remapFantasyCoefficients(e.coefficients),n},this.remapFantasyPlayers=function(t){var e=new A.default;return e.total=t.total,e.minGoalkeepers=t.min_goalkeepers,e.maxGoalkeepers=t.max_goalkeepers,e.minDefenders=t.min_defenders,e.maxDefenders=t.max_defenders,e.minMidfielders=t.min_midfielders,e.maxMidfielders=t.max_midfielders,e.minStrikers=t.min_strikers,e.maxStrikers=t.max_strikers,e},this.remapFantasyCoefficients=function(t){var e=new R.default;return e.assists=t.assists,e.shots=t.shots,e.offsides=t.offsides,e.tackles=t.tackles,e.saves=t.saves,e.minutesEqualOrOver60=t.minutes_equal_or_over_60,e.minutesUnder60=t.minutes_under_60,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goalsGoalkeeper=t.goals_goalkeeper,e.goalsDefender=t.goals_defender,e.goalsMidfielder=t.goals_midfielder,e.goalsForwards=t.goals_forwards,e.penaltyGoals=t.penalty_goals,e.ownGoals=t.own_goals,e.cleanSheetsGoalkeeper=t.clean_sheets_goalkeeper,e.cleanSheetsDefender=t.clean_sheets_defender,e.cleanSheetsMidfielder=t.clean_sheets_midfielder,e.cleanSheetsForwards=t.clean_sheets_forwards,e.shotsOn=t.shots_on,e.foulsCommitted=t.fouls_committed,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e},this.remapAutomaticModeration=function(t){var e=new r.default;return e.enabled=t.enabled,e.moderateLinks=t.moderate_links,e.linksWhitelist=t.links_whitelist,e.moderatorProfileId=t.moderator_profile_id,e.dictionary=t.dictionary,e},this.remapNewRewards=function(e){var n=new I.default;return n.points=t.remapPoints(e.points),n.tiers=e.tiers,n.badges=t.remapNewBadges(e.badges),n},this.remapRewards=function(e){var n=new l.default;return n.points=t.remapPoints(e.points),n.tiers=e.tiers,n.badges=t.remapBadges(e.badges),n},this.remapPoints=function(t){var e=new u.default;return e.general=t.general,e.discussionPost=t.discussion_post,e.predictor=t.predictor,e.activity=t.activity,e.topX=t.top_x,e.matchQuiz=t.match_quiz,e},this.remapBadges=function(e){var n=new M.default;return n.general=e.general?t.remapGeneralBadgeValues(e.general):[],n.predictor=t.remapBadgeValues(e.predictor),n.topX=t.remapBadgeValues(e.top_x),n.matchQuiz=t.remapBadgeValues(e.match_quiz),n},this.remapNewBadges=function(e){var n=new p.default;return n.predictor=t.remapBadgeValuesPredictor(e.predictor),n.topX=t.remapBadgeValuesGame(e.top_x),n.matchQuiz=t.remapBadgeValuesGame(e.match_quiz),e.games&&(n.games=t.remapBadgeValuesGames(e.games)),e.football&&(n.football=t.remapBadgeValuesFootball(e.football)),e.classic_quizzes&&(n.classicQuizzes=t.remapBadgeValuesMiniGames(e.classic_quizzes)),e.either_or&&(n.eitherOr=t.remapBadgeValuesMiniGames(e.either_or)),e.discussions&&(n.discussions=t.remapBadgeValuesDiscussions(e.discussions)),e.voting&&e.voting.potm&&(n.voting.potm=t.remapBadgeValuesVoting(e.voting.potm)),e.voting&&e.voting.poll&&(n.voting.poll=t.remapBadgeValuesVoting(e.voting.poll)),n},this.remapBadgeValuesPredictor=function(t){return t.map((function(t){var e=new m.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.predictionsNumber=t.requirements.predictions_number,e.requirements.correctPredictions=t.requirements.correct_predictions,e.requirements.points=t.requirements.points,e.requirements.fromDate=t.requirements.from_date,e.requirements.toDate=t.requirements.to_date),e}))},this.remapBadgeValuesGame=function(t){return t.map((function(t){var e=new v.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.participationCount=t.requirements.participation_count,e.requirements.points=t.requirements.points,e.requirements.fromDate=t.requirements.from_date,e.requirements.toDate=t.requirements.to_date),e}))},this.remapBadgeValuesGames=function(e){return e.map((function(e){var n=new _.default;return n.id=e.id,n.enabled=e.enabled,n.label=e.label,n.description=e.description,n.flags=e.flags,e.assets?n.assets.mainImageUrl=e.assets.main_image_url:n.assets=e.assets,e.requirements&&(n.requirements.participationCount=e.requirements.participation_count,n.requirements.points=e.requirements.points,n.requirements.fromDate=e.requirements.from_date,n.requirements.toDate=e.requirements.to_date,n.requirements.specificGames=e.requirements.specific_games?t.remapSpecificGamesRequirement(e.requirements.specific_games):null),n}))},this.remapSpecificGamesRequirement=function(t){return t.map((function(t){return{gameId:t.game_id,gameType:t.game_type,gameModel:null}}))},this.remapBadgeValuesFootball=function(t){return t.map((function(t){var e=new y.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.predictionsNumber=t.requirements.predictions_number,e.requirements.correctPredictions=t.requirements.correct_predictions,e.requirements.points=t.requirements.points,e.requirements.entityId=t.requirements.entity_id,e.requirements.entityType=t.requirements.entity_type),e}))},this.remapBadgeValuesMiniGames=function(t){return t.map((function(t){var e=new g.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.participationCount=t.requirements.participation_count,e.requirements.fromDate=t.requirements.from_date,e.requirements.toDate=t.requirements.to_date),e}))},this.remapBadgeValuesDiscussions=function(t){return t.map((function(t){var e=new b.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.totalDiscussionPoints=t.requirements.total_discussion_points,e.requirements.postsCount=t.requirements.posts_count,e.requirements.postPoints=t.requirements.post_points,e.requirements.reactionsCount=t.requirements.reactions_count),e}))},this.remapBadgeValuesVoting=function(t){return t.map((function(t){var e=new w.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.points=t.requirements.points,e.requirements.voteCount=t.requirements.vote_count,e.requirements.entityId=t.requirements.entity_id,e.requirements.entityType=t.requirements.entity_type),e}))},this.remapBadgeValues=function(e){return e.map((function(e){var n=new O.default;return n.id=e.id,n.label=e.label,n.enabled=e.enabled,e.assets?n.assets.mainImageUrl=e.assets.main_image_url:n.assets=e.assets,n.requirements=t.remapRequirements(e.requirements),n}))},this.remapRequirements=function(t){var e=new a.default;return e.points=t.points,e.gameParticipationCount=t.game_participation_count,e.entityId=t.entity_id,e.entityType=t.entity_type,e.predictionsMade=t.predictions_made,e.correctPredictions=t.correct_predictions,e},this.remapUserDataConfig=function(t){var e=new f.default;return e.storeIp=t.store_ip,e.storeDeviceId=t.store_device_id,e.storeAgent=t.store_agent,e},this.remapGeneralBadgeValues=function(e){return e.map((function(e){var n=new P.default;return n.id=e.id,n.label=e.label,n.enabled=e.enabled,e.assets?n.assets.mainImageUrl=e.assets.main_image_url:n.assets=e.assets,n.requirements=t.remapGeneralRequirements(e.requirements),n}))},this.remapGeneralRequirements=function(t){var e=new T.default;return e.points=t.points,e.gameParticipationCount=t.game_participation_count,e.entityId=t.entity_id,e.entityType=t.entity_type,e.predictionsMade=t.predictions_made,e.correctPredictions=t.correct_predictions,e.postPoints=t.post_points,e.postsCount=t.posts_count,e.reactionsCount=t.reactions_count,e.totalDiscussionPoints=t.total_discussion_points,e}}},8452:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(442));e.default=function(){this.enabled=!1,this.clientId=null,this.fullCoverageCompetitions=null,this.markets=null,this.successRateScopes=new r.default,this.userDataConfig=null}},442:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.competitions=[],this.teams=[],this.markets=[]}},8824:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.storeIp=!1,this.storeDeviceId=!1,this.storeAgent=!1}},6367:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null,this.playerId=null,this.playerModel=null}},1406:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2524)),o=s(n(1732)),u=s(n(4119)),l=s(n(1465)),c=s(n(5132)),d=s(n(7344));e.default=function(t,e,n){var s=this;this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapFixturesRequest=function(t){var e={};if(e.match_id=t.matchId,e.match_type="FOOTBALL",t instanceof o.default)e.market=t.market,e.prediction=t.prediction.value,e.player_id=t.prediction.playerId;else if(t instanceof c.default||t instanceof d.default)e.market=t.market,e.prediction=t.prediction.value;else if(t instanceof l.default){e.market=t.market;var n=t.prediction.value.split(":");e.goals_home=Number(n[0]),e.goals_away=Number(n[1])}else e.market=t.market,e.prediction=t.prediction.value;return e},this.remapFixturesResponse=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s,o,u,l,c,d,h,f,p;return r(this,(function(r){switch(r.label){case 0:for(e="OWN_GOAL",n=[],i=[],s=null,o=[],t.length>1&&t.sort((function(t,e){return t.match_id.localeCompare(e.match_id)})),u=0,l=t;u<l.length;u++)f=l[u],n.push(f.match_id),f.player_id&&!i.includes(f.player_id)&&i.push(f.player_id);return[4,this.matchFacade.getMatchesMapWithNativeIds(n)];case 1:return c=r.sent(),i.sort((function(t,e){return t.localeCompare(e)})),i&&i.length>0&&!i.includes(e)?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,3];case 2:s=r.sent(),r.label=3;case 3:for(d=0,h=t;d<h.length;d++)f=h[d],p=new a.default,f.target?p.market=this.predictorService.convertMarketForResponseModel(f.market,f.target):p.market=f.market,p.matchId=c[f.match_id].id,p.matchType=f.match_type,p.matchModel=c?c[f.match_id]:null,delete p.matchModel.availableMarkets,void 0!==f.goals_home&&void 0!==f.goals_away?p.prediction.value=f.goals_home.toString()+":"+f.goals_away.toString():p.prediction.value=f.prediction,p.prediction.playerId=f.player_id?f.player_id:null,p.prediction.playerId&&p.prediction.playerId!==e&&(p.prediction.playerModel=s[f.player_id],p.prediction.playerId=s[f.player_id].id),p.result=this.remapResult(f.result),o.push(p);return[2,o]}}))}))},this.remapResult=function(t){var e=new u.default;return e.settledAt=t.settled_at,e.resettledAt=t.resettled_at,e.status=t.status,e.outcome=t.outcome,e.points=t.points,e},this.matchFacade=t,this.playerFacade=e,this.predictorService=n}},2524:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6367));e.default=function(){this.market=null,this.matchId=null,this.matchType=null,this.matchModel=null,this.prediction=new r.default,this.result=null}},1206:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(9883));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.BOTH_TEAMS_SCORE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},5274:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(8038));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.CORNERS_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},1465:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3125));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},7535:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(6902));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.DOUBLE_CHANCE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},7307:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(6642));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.HT_FT,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},1718:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2782));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},5132:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9883));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},7344:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9883));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},1855:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(9883));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.PENALTY_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},1732:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7321));e.default=function(t,e,n,i){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n,this.prediction.playerId=i}},5814:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(9883));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.RED_CARD_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},4119:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.settledAt=null,this.resettledAt=null,this.status=null,this.outcome=null,this.points=0}},5908:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.no=0,this.yes=0}},2726:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(1406)),o=s(n(2532)),u=s(n(3792)),l=s(n(595)),c=s(n(4545)),d=s(n(4272)),h=s(n(2524)),f=s(n(5013)),p=s(n(1399));e.default=function(t,e){var n=this;this.fixturesRemapper=null,this.footballHttps=null,this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapRequestBody=function(t){var e={};return e.game_instance_id=t.gameInstanceId,e.fixtures=t.fixtures.map((function(t){return n.fixturesRemapper.remapFixturesRequest(t)})),t instanceof p.default&&t.tiebreaker&&(e.tiebreaker={},e.tiebreaker.golden_goal=t.tiebreaker.goldenGoal?t.tiebreaker.goldenGoal:null),e},this.remapResponseArrayBody=function(t){return i(n,void 0,void 0,(function(){var e,n,i,s,a,u,l=this;return r(this,(function(r){switch(r.label){case 0:return t.length?(e="OWN_GOAL",n=[],i=[],s={},a=[],t.forEach((function(t){t.fixtures.forEach((function(t){n.push(t.match_id),t.player_id&&t.player_id!==e&&i.push(t.player_id)}))})),[4,this.matchFacade.getMatchesMapWithNativeIds(n)]):[3,4];case 1:return u=r.sent(),i.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,3];case 2:s=r.sent(),r.label=3;case 3:return t.forEach((function(t){var n=new o.default,i=[];n.id=t.id,n.gameInstanceId=t.game_instance_id,n.gameType=t.game_type,n.wager=t.wager,n.totalFixtures=t.total_fixtures,n.settledFixtures=t.settled_fixtures,n.userId=t.user_id,t.fixtures.forEach((function(t){var n=new h.default;t.target?n.market=l.predictorService.convertMarketForResponseModel(t.market,t.target):n.market=t.market,n.matchId=u[t.match_id].id,n.matchType=t.match_type,n.matchModel=u[t.match_id],delete n.matchModel.availableMarkets,void 0!==t.goals_home&&void 0!==t.goals_away?n.prediction.value=t.goals_home.toString()+":"+t.goals_away.toString():n.prediction.value=t.prediction,n.prediction.playerId=t.player_id?t.player_id:null,n.prediction.playerId&&n.prediction.playerId!==e&&(n.prediction.playerModel=s[n.prediction.playerId],n.prediction.playerId=s[n.prediction.playerId].id),n.result=l.fixturesRemapper.remapResult(t.result),i.push(n)})),n.fixtures=i,n.status=t.status,t.tiebreaker?n.tiebreaker.goldenGoal=t.tiebreaker.golden_goal:n.tiebreaker=null,n.points=t.points,n.createdAt=t.created_at,n.updatedAt=t.updated_at,a.push(n)})),[2,a];case 4:return[2,t]}}))}))},this.remapResponseObjBody=function(t){return i(n,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=new o.default).id=t.id,e.gameInstanceId=t.game_instance_id,e.gameType=t.game_type,e.wager=t.wager,e.totalFixtures=t.total_fixtures,e.settledFixtures=t.settled_fixtures,e.userId=t.user_id,n=e,[4,this.fixturesRemapper.remapFixturesResponse(t.fixtures)];case 1:return n.fixtures=i.sent(),e.status=t.status,t.tiebreaker?e.tiebreaker.goldenGoal=t.tiebreaker.golden_goal:e.tiebreaker=null,e.points=t.points,e.createdAt=t.created_at,e.updatedAt=t.updated_at,[2,e]}}))}))},this.remapPredictionModel=function(t){var e=new u.default;return e.fullTimeOneXTwo=t.FT_1X2,e.halfTimeOneXTwo=t.HT_1X2,e.bothTeamsScore=t.BOTH_TEAMS_SCORE,e.overZeroPointFiveGoals=t.OVER_GOALS_0_5,e.overOnePointFiveGoals=t.OVER_GOALS_1_5,e.overTwoPointFiveGoals=t.OVER_GOALS_2_5,e.overThreePointFiveGoals=t.OVER_GOALS_3_5,e.overFourPointFiveGoals=t.OVER_GOALS_4_5,e.overFivePointFiveGoals=t.OVER_GOALS_5_5,e.overSixPointFiveGoals=t.OVER_GOALS_6_5,e.overSixPointFiveCorners=t.OVER_CORNERS_6_5,e.overSevenPointFiveCorners=t.OVER_CORNERS_7_5,e.overEightPointFiveCorners=t.OVER_CORNERS_8_5,e.overNinePointFiveCorners=t.OVER_CORNERS_9_5,e.overTenPointFiveCorners=t.OVER_CORNERS_10_5,e.overElevenPointFiveCorners=t.OVER_CORNERS_11_5,e.overTwelvePointFiveCorners=t.OVER_CORNERS_12_5,e.overThirteenPointFiveCorners=t.OVER_CORNERS_13_5,e.doubleChance=t.DOUBLE_CHANCE,e.halfTimeFullTime=t.HT_FT,e.playerScore=t.PLAYER_SCORE,e.playerYellowCard=t.PLAYER_YELLOW_CARD,e.playerRedCard=t.PLAYER_RED_CARD,e.redCardMatch=t.RED_CARD_MATCH,e.penaltyMatch=t.PENALTY_MATCH,e.playerScoreFirstGoal=t.PLAYER_SCORE_FIRST_GOAL,e.cornersMatch=t.CORNERS_MATCH,e.correctScore=t.CORRECT_SCORE,e.correctScoreHalfTime=t.CORRECT_SCORE_HT,e.correctScoreAdvanced=t.CORRECT_SCORE_ADVANCED,e.playerScoreHattrick=t.PLAYER_SCORE_HATTRICK,e.playerScoreTwice=t.PLAYER_SCORE_TWICE,e},this.footballHttps=new l.default(t),this.matchFacade=new c.default(t,this.footballHttps,e),this.playerFacade=new d.default(t,this.footballHttps,e),this.predictorService=new f.default(t,e),this.fixturesRemapper=new a.default(this.matchFacade,this.playerFacade,this.predictorService)}},3950:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.gameInstanceId=null,this.fixtures=null}},2532:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7640));e.default=function(){this.id=null,this.gameInstanceId=null,this.gameType=null,this.wager=null,this.totalFixtures=null,this.settledFixtures=null,this.userId=null,this.fixtures=[],this.status=null,this.tiebreaker=new r.default,this.points=null,this.createdAt=null,this.updatedAt=null}},7782:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6147);e.default=function(t){var e=this;this.limit=null,this.startAfter=null,this.status=null,this.type=null,this.matchIds=null,this.gameIds=null,this.constructFiltersUrl=function(){var t="",n=!1;return e.status&&(n=Object.values(i.StatusEnum).some((function(t){return e.status.includes(t)}))),e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.startAfter&&(t+="&",t+="start_after=".concat(e.startAfter)),e.status&&n&&(t+="&",t+="status=".concat(e.status.join(","))),e.type&&(t+="&",t+="game_types=".concat(e.type)),e.matchIds&&(t+="&",t+="match_ids=".concat(e.matchIds.join(","))),e.gameIds&&(t+="&",t+="game_ids=".concat(e.gameIds.join(","))),t},this.limit=t.limit?t.limit:null,this.startAfter=t.startAfter?t.startAfter:null,this.status=t.status?t.status:null,this.type=t.type?t.type:null,this.matchIds=t.matchIds?t.matchIds:null,this.gameIds=t.gameIds?t.gameIds:null}},3792:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5908));e.default=function(){this.fullTimeOneXTwo={},this.halfTimeOneXTwo={},this.bothTeamsScore=new r.default,this.doubleChance={},this.halfTimeFullTime={},this.playerScore={},this.playerYellowCard={},this.playerRedCard={},this.redCardMatch=new r.default,this.penaltyMatch=new r.default,this.playerScoreFirstGoal={},this.cornersMatch={},this.correctScore={},this.correctScoreHalfTime={},this.correctScoreAdvanced={},this.playerScoreHattrick={},this.playerScoreTwice={},this.overZeroPointFiveGoals=new r.default,this.overOnePointFiveGoals=new r.default,this.overTwoPointFiveGoals=new r.default,this.overThreePointFiveGoals=new r.default,this.overFourPointFiveGoals=new r.default,this.overFivePointFiveGoals=new r.default,this.overSixPointFiveGoals=new r.default,this.overSixPointFiveCorners=new r.default,this.overSevenPointFiveCorners=new r.default,this.overEightPointFiveCorners=new r.default,this.overNinePointFiveCorners=new r.default,this.overTenPointFiveCorners=new r.default,this.overElevenPointFiveCorners=new r.default,this.overTwelvePointFiveCorners=new r.default,this.overThirteenPointFiveCorners=new r.default}},9378:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.matchId=null,this.matchType=null,this.predictions=null}},9679:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2726)),s=i(n(9378));e.default=function(t,e){var n=this;this.remapPredictions=null,this.remapResponse=function(t){var e=new s.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.predictions=n.remapPredictions.remapPredictionModel(t.predictions),e},this.remapPredictions=new r.default(t,e)}},7321:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=!1,this.playerId=null}},9883:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=!1}},8038:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},3125:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},6902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},6642:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},2782:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},1259:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2793)),o=s(n(8900)),u=s(n(2929)),l=s(n(7686));e.default=function(t){var e=this;this.predictorHttps=null,this.clientHttps=null,this.predictorFacade=null,this.idMapping=null,this.makeFootballPrediction=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.makeFootballPrediction(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.getMatchSummary=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMatchSummary(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMarketSummary=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMarketSummary(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.deleteFootballPrediction=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPredictions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyPredictions(t)];case 1:return[2,e.sent()]}}))}))},this.getMyCurrentPredictions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyCurrentPredictions(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPastPredictions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyPastPredictions(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPredictionsForMatches=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyPredictionsForMatches(t,n)];case 1:return[2,e.sent()]}}))}))},this.getUserPredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserPredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserCurrentPredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserCurrentPredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserPastPredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserPastPredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserPredictionsForMatches=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserPredictionsForMatches(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.getPredictionById=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getPredictionById(t)];case 1:return[2,e.sent()]}}))}))},this.getPredictionsByIds=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getPredictionsByIds(t)];case 1:return[2,e.sent()]}}))}))},this.idMapping=new o.default(t),this.predictorHttps=new a.default(t,this.idMapping),this.clientHttps=new l.default(t),this.predictorFacade=new u.default(t,this.predictorHttps,this.clientHttps,this.idMapping)}},5013:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(7974),l=o(n(8452)),c=o(n(5908)),d=o(n(8950)),h=o(n(6890)),f=o(n(595)),p=o(n(4545)),m=o(n(7782)),v=o(n(7299)),_=n(712),y=o(n(4119)),g=o(n(3751)),b=o(n(7243)),w=o(n(4272)),I=o(n(1180)),E=o(n(5765)),M=n(6147),O=n(5318),P=n(4946),T=o(n(6409)),S=n(1260),A=o(n(6247));e.default=function(t,e){var n=this;this.footballHttps=null,this.idMapping=null,this.matchFacade=null,this.playerFacade=null,this.profileNamespace=null,this.remapMatchIdToNative=function(t){return r(n,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(t,"match","native")];case 1:return[2,e.sent().match]}}))}))},this.remapPlayerIdToNative=function(t){return r(n,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(t,"player","native")];case 1:return[2,e.sent().player[0]]}}))}))},this.remapPlayerIdMapToNative=function(t){return r(n,void 0,void 0,(function(){var e,n,i,r;return s(this,(function(s){switch(s.label){case 0:return e={},n=(0,_.transformIdsToBeUnique)(t),[4,this.idMapping.getEntityIdsBySchemaId(n,"player","native")];case 1:return i=s.sent(),r=i.player,n.forEach((function(t,n){return e[t]=r[n]})),[2,e]}}))}))},this.remapPlayerIdToIdSchema=function(t){return r(n,void 0,void 0,(function(){var e,n,i,r,a,o,u,l,c,d,h,f,p,m,v,_,y,g,b;return s(this,(function(s){switch(s.label){case 0:for(e=["playerScore","playerYellowCard","playerRedCard","playerScoreFirstGoal","playerScoreHattrick","playerScoreTwice"],n=[],i=0,r=Object.entries(t);i<r.length;i++)if(a=r[i],o=a[0],u=a[1],e.includes(o))for(l=0,c=Object.keys(u);l<c.length;l++)"NOBODY"!==(d=c[l])&&"OWN_GOAL"!==d&&n.push(d);return n.length?[4,this.playerFacade.getPlayersMapWithNativeIds(n)]:[2,t];case 1:for(h=s.sent(),f=0,p=Object.entries(t);f<p.length;f++)if(m=p[f],v=m[0],_=m[1],e.includes(v))for(y=0,g=Object.keys(_);y<g.length;y++)"NOBODY"!==(b=g[y])&&"OWN_GOAL"!==b&&(_[h[b].id]=_[b],_[h[b].id].model=h[b],this.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&delete _[b]);return[2,t]}}))}))},this.convertMarketForResponseModel=function(t,e){return t+"_"+e.toString()},this.getMarketSummary=function(t,e,i){return r(n,void 0,void 0,(function(){var n,r,a,o,l,d,h,f,p=this;return s(this,(function(s){switch(s.label){case 0:if(n=S.marketToKeySummaryMap.get(e),(r={}).matchId=t.matchId,r.matchType=t.matchType,!Object.keys(t.predictions).includes(n))throw new Error("You have passed invalid market");return r[n]=t.predictions[n],u.playerMarkets.includes(e)&&i?(a="","OWN_GOAL"===i||"NOBODY"===i?[3,2]:[4,this.idMapping.idMappingFacade.getEntitiesByIds({player:[i]},this.idMapping.idSchema,"native")]):[3,6];case 1:o=s.sent(),a=o.player[0],s.label=2;case 2:return a&&r[n][a]?[4,this.playerFacade.getPlayersMapWithNativeIds([a])]:[3,4];case 3:return l=s.sent(),r[n][a].model=l[a],[2,r[n][a]];case 4:return a?(r[n][a]=new c.default,[2,r[n][a]]):[2,r[n][i]];case 5:return[3,10];case 6:return!u.playerMarkets.includes(e)||i?[3,10]:(d=Object.keys(r[n]).filter((function(t){return"NOBODY"!==t&&"OWN_GOAL"!==t}))).length?[4,this.playerFacade.getPlayersMapWithNativeIds(d)]:[3,8];case 7:return f=s.sent(),[3,9];case 8:f={},s.label=9;case 9:h=f,Object.keys(h).length&&Object.keys(r[n]).forEach((function(t){"NOBODY"!==t&&"OWN_GOAL"!==t&&(r[n][h[t].id]=r[n][t],r[n][h[t].id].model=h[t],p.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&delete r[n][t])})),s.label=10;case 10:return[2,r]}}))}))},this.remapCompetitionsFromConfig=function(t){return r(n,void 0,void 0,(function(){var e,n,i,r,a,o,u,c;return s(this,(function(s){switch(s.label){case 0:return t instanceof l.default?(e={competition:t.fullCoverageCompetitions},n={competition:t.successRateScopes.competitions},i={team:t.successRateScopes.teams},[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,"native",this.idMapping.idSchema)]):[3,4];case 1:return r=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(n,"native",this.idMapping.idSchema)];case 2:return a=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(i,"native",this.idMapping.idSchema)];case 3:return o=s.sent(),t.fullCoverageCompetitions=r.competition,t.successRateScopes.competitions=a.competition,t.successRateScopes.teams=o.team,[2,t];case 4:return t instanceof I.default||t instanceof E.default?(u={competition:t.competitionsWhitelist},[4,this.idMapping.idMappingFacade.getEntitiesByIds(u,"native",this.idMapping.idSchema)]):[3,6];case 5:return c=s.sent(),t.competitionsWhitelist=c.competition,[2,t];case 6:return[2]}}))}))},this.remapMatchIdsFixtures=function(t){return r(n,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return Array.isArray(t.data)?t.data.length>0?(e=[],n=[],t.data.forEach((function(t){t instanceof g.default||t instanceof d.default||t instanceof b.default||t instanceof A.default?(t.fixtures.forEach((function(t){return e.push(t.matchId)})),t instanceof b.default&&t.fixtures.forEach((function(t){t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&n.push(t.prediction.playerId)}))):t instanceof h.default&&t.results.forEach((function(t){return e.push(t.matchId)}))})),[4,this.refactorResponseArrModel(t,e,n)]):[3,2]:[3,4];case 1:case 5:return[2,i.sent()];case 2:return[2,t];case 3:return[3,6];case 4:return[4,this.refactorResponseObjModel(t)];case 6:return[2]}}))}))},this.refactorResponseArrModel=function(t,e,i){return r(n,void 0,void 0,(function(){var n,r,a,o=this;return s(this,(function(s){switch(s.label){case 0:return n=[],[4,this.matchFacade.getMatchesMapWithNativeIds(e)];case 1:return r=s.sent(),a={},i.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,3];case 2:a=s.sent(),s.label=3;case 3:return t.data.forEach((function(t){t instanceof g.default||t instanceof d.default||t instanceof b.default?(t.fixtures.forEach((function(e){o.handleMatchModel(r,e),t instanceof b.default&&e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&(e.prediction.playerModel=a[e.prediction.playerId],e.prediction.playerId=a[e.prediction.playerId].id)})),n.push(t)):t instanceof h.default&&(t.results.forEach((function(t){t.matchModel=r[t.matchId],delete t.matchModel.availableMarkets,t.matchId=t.matchModel.id})),n.push(t))})),t.data=n,[2,t]}}))}))},this.refactorResponseObjModel=function(t){return r(n,void 0,void 0,(function(){var e,n,i=this;return s(this,(function(r){switch(r.label){case 0:return e=[],t.fixtures.forEach((function(t){return e.push(t.matchId)})),[4,this.matchFacade.getMatchesMapWithNativeIds(e)];case 1:return n=r.sent(),t.fixtures.forEach((function(t){return i.handleMatchModel(n,t)})),[2,t]}}))}))},this.getCurrentGameId=function(t){var e=new Date;if(t.data.length>1){var n=[];return t.data.forEach((function(t){return n.push(t.predictionsCutoff)})),t.data.sort((function(t,n){var i=[t.predictionsCutoff,n.predictionsCutoff].map((function(t){return Math.abs(new Date(t)-e)}));return i[0]-i[1]}))[0].id}return t.data[0].id},this.initGameTypePredictions=function(t,e){var n={type:t,limit:null,startAfter:null};return e&&(n=i(i({},n),{limit:e.limit,startAfter:e.startAfter})),new m.default(n)},this.initGameFilters=function(t,e,n){if(e&&n)return e.type=t,e.gameIds=n,new v.default(e);if(e&&!n)return e.type=t,new v.default(e);if(!e&&n){var i={type:t,gameIds:n};return new v.default(i)}return i={type:t},new v.default(i)},this.addPredictionProp=function(t,e){return r(n,void 0,void 0,(function(){var n=this;return s(this,(function(i){switch(i.label){case 0:return e.data.forEach((function(e){t.data.forEach((function(t){e.id===t.game_instance_id&&(e.predictionId=t.id,e.outcome=t.status,e.fixtures.forEach((function(e,i){void 0!==t.fixtures[i].goals_home&&void 0!==t.fixtures[i].goals_away?e.prediction.value=t.fixtures[i].goals_home+":"+t.fixtures[i].goals_away:e.prediction.value=t.fixtures[i].prediction,t.fixtures[i].player_id?e.prediction.playerId=t.fixtures[i].player_id:t.fixtures[i].target&&(e.prediction.target=t.fixtures[i].target),e.prediction.result=n.remapResult(t.fixtures[i].result)})),e.predictionsMadeAt=t.created_at,e.points=t.points,e instanceof d.default&&(t.tiebreaker?e.predictionTiebreaker.goldenGoal=t.tiebreaker.golden_goal:e.predictionTiebreaker=t.tiebreaker))}))})),e.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,[4,this.remapMatchIdsFixtures(e)];case 1:return[2,i.sent()]}}))}))},this.remapResult=function(t){var e=new y.default;return e.settledAt=t.settled_at,e.resettledAt=t.resettled_at,e.status=t.status,e.outcome=t.outcome,e.points=t.points,e},this.areIdsExceeded=function(t){return t.length>10},this.initPredictionsFilters=function(t,e,i){switch(e){case"user":t&&(t=new m.default(t));break;case"current":if(t)n.deleteUnexpectedProperties(t),t.status=[M.StatusEnum.ACTIVE],t=new m.default(t);else{var r={status:[M.StatusEnum.ACTIVE]};t=new m.default(r)}break;case"past":t?(n.deleteUnexpectedProperties(t),t.status=M.pastStatuses,t=new m.default(t)):(r={status:M.pastStatuses},t=new m.default(r));break;case"matches":t?(n.deleteUnexpectedProperties(t),t.matchIds=i,t=new m.default(t)):(r={matchIds:i},t=new m.default(r))}return t},this.completeGameMarketResults=function(t,e){return r(n,void 0,void 0,(function(){var n,i,r,o,l,c,d,h,f=this;return s(this,(function(s){switch(s.label){case 0:switch(e){case"MATCH_QUIZ":return[3,1];case"TOP_X":return[3,5]}return[3,9];case 1:return n={},i=t.results[0].matchId,r=t.results.map((function(t){return u.playerMarkets.includes(t.market)&&!t.result.includes("OWN_GOAL")?a([],t.result,!0):[]})).flat(),[4,this.matchFacade.getMatchesMapWithNativeIds([i])];case 2:return o=s.sent(),r.length?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,4];case 3:n=s.sent(),s.label=4;case 4:return t.results=t.results.map((function(t){if(t.matchModel=o[t.matchId]?o[t.matchId]:null,t.playerModels&&Object.keys(n).length&&(e=t.result).forEach((function(e){var i=n[e];t.playerModels.push(i)})),f.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&(f.remapMatchIdForResultsMarkets(o,t),t.playerModels&&Object.keys(n).length)){var e=t.result;t.result=e.map((function(t){return n[t].id}))}return t})),[2,t];case 5:return l=t.results.map((function(t){return t.matchId})),[4,this.matchFacade.getMatchesMapWithNativeIds(l)];case 6:return c=s.sent(),t.results=t.results.map((function(t){return t.matchModel=c[t.matchId]?c[t.matchId]:null,f.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&f.remapMatchIdForResultsMarkets(c,t),t})),t.tieBreakers.goldenGoals.length?(d=t.tieBreakers.goldenGoals.map((function(t){return t.playerId})),[4,this.playerFacade.getPlayersMapWithNativeIds(d)]):[3,8];case 7:h=s.sent(),t.tieBreakers.goldenGoals=t.tieBreakers.goldenGoals.map((function(t){return t.matchModel=c[t.matchId],t.playerModel=h[t.playerId],f.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&(t.matchId=c[t.matchId].id,t.playerId=h[t.playerId].id),t})),s.label=8;case 8:return[2,t];case 9:return[2]}}))}))},this.completeContestWinners=function(t){return r(n,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return t.userList&&t.userList.length?(e=t.userList.map((function(t){return t.profileId})),[4,this.profileNamespace.getByIds(e)]):[3,2];case 1:n=i.sent(),t.userList.forEach((function(t){var e=n.filter((function(e){return e.id===t.profileId}))[0];delete e.interests,t.profileModel=e})),i.label=2;case 2:return[2,t]}}))}))},this.handleMatchModel=function(t,e){t[e.matchId]?(e.matchModel=t[e.matchId],delete e.matchModel.availableMarkets,e.matchId=e.matchModel.id):(e.matchModel=null,n.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&n.idMapping.idMappingFacade.getEntityById(e.matchId,"match","native").then((function(t){e.matchId=t[S.ID_TYPES[n.idMapping.idSchema]]})))},this.remapMatchIdForResultsMarkets=function(t,e){t[e.matchId]?e.matchId=t[e.matchId].id:n.idMapping.idMappingFacade.getEntityById(e.matchId,"match","native").then((function(t){e.matchId=t[S.ID_TYPES[n.idMapping.idSchema]]}))},this.deleteUnexpectedProperties=function(t){return t.status&&(console.warn(O.WarningMessages.UNEXPECTED_STATUS_PROP),delete t.status),t.type&&(console.warn(O.WarningMessages.UNEXPECTED_TYPE_PROP),delete t.type),t},this.footballHttps=new f.default(t),this.idMapping=e,this.matchFacade=new p.default(t,this.footballHttps,e),this.playerFacade=new w.default(t,this.footballHttps,e),this.profileNamespace=new T.default(t)}},2310:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4021),s=n(4904),a=i(n(8097)),o=n(5318),u=n(7974),l=n(1976),c=i(n(1206)),d=i(n(5274)),h=i(n(1465)),f=i(n(7535)),p=i(n(1718)),m=i(n(7307)),v=i(n(5132)),_=i(n(7344)),y=i(n(1855)),g=i(n(1732)),b=i(n(5814)),w=i(n(3950)),I=n(1260),E=i(n(7640)),M=i(n(2535));e.default=function(t){var e=this;this.errorHandlingMode=null,this.validateBodyFields=function(t,n){var i=Object.keys(n),r=Object.keys(new w.default);switch(t){case"MATCH_QUIZ":i.forEach((function(t){r.includes(t)||e.throwInvalidParamException([t])}));break;case"TOP_X":var s=n;s.fixtures.forEach((function(t){return e.validateMarketTopX(t.market)})),i.includes("tiebreaker")&&s.tiebreaker&&e.validateTiebreaker(s.tiebreaker),i.forEach((function(t){"tiebreaker"===t||r.includes(t)||e.throwInvalidParamException([t])}))}var a=r.filter((function(t){return!i.includes(t)}));return a.length&&e.throwMissingFieldsException("game prediction body",a),n.fixtures.forEach((function(t){e.validateFixtureFields(t)})),n},this.validateFixture=function(t,n,i,r){e.validateMarket(n);var s=Object.values(l.OneXTwoEnum),a=Object.values(l.HalfTimeFullTimeEnum),o=Object.values(l.DoubleChanceEnum);if(n===u.MarketEnum.FT_1X2||n===u.MarketEnum.HT_1X2){if(s.includes(i))return new p.default(t,n,i)}else if(n===u.MarketEnum.HT_FT){if(a.includes(i))return new m.default(t,i)}else if(n===u.MarketEnum.DOUBLE_CHANCE){if(o.includes(i))return new f.default(t,i)}else if(n===u.MarketEnum.CORRECT_SCORE||n===u.MarketEnum.CORRECT_SCORE_ADVANCED||n===u.MarketEnum.CORRECT_SCORE_HT){if("string"==typeof i&&/\d+:\d+/.test(i))return new h.default(t,n,i)}else if(n===u.MarketEnum.CORNERS_MATCH){if("number"==typeof i)return new d.default(t,i)}else if(n===u.MarketEnum.BOTH_TEAMS_SCORE){if(e.isPredictionBoolean(i))return new c.default(t,i)}else if(n===u.MarketEnum.RED_CARD_MATCH){if(e.isPredictionBoolean(i))return new b.default(t,i)}else if(n===u.MarketEnum.PENALTY_MATCH){if(e.isPredictionBoolean(i))return new y.default(t,i)}else if(u.playerMarkets.includes(n)){var w="OWN_GOAL";if(e.validatePlayerId(n,r),n===u.playerMarketNobodyPrediction&&e.isPredictionBoolean(i)){var I=r&&r===w?w:r;return new g.default(t,n,i,I)}if(r&&e.isPredictionBoolean(i))return new g.default(t,n,i,r)}else if(u.MarketsOverGoals.includes(n)){if(e.isPredictionBoolean(i))return new _.default(t,n,i)}else if(u.MarketsOverCorners.includes(n)&&e.isPredictionBoolean(i))return new v.default(t,n,i);e.throwInvalidPredictionException(i,n)},this.validateFixtureFields=function(t){var n=Object.keys(t);n.forEach((function(t){I.validFixtureFields.includes(t)||e.throwInvalidParamException([t])}));var i=I.validFixtureFields.filter((function(t){if("matchType"!==t&&!n.includes(t))return t}));i.length&&e.throwMissingFieldsException("fixtures",i),e.validatePredictionKey(t.market,t.prediction)},this.validateTiebreaker=function(t){var n=Object.keys(t);n.length&&"object"==typeof t||e.throwInvalidType("tiebreaker","object");var i=Object.keys(new E.default)[0];n.forEach((function(t){i!==t&&e.throwInvalidParamException([t])})),n.includes(i)||e.throwMissingFieldsException("tiebreaker",[i]),"number"!=typeof t.goldenGoal&&e.throwInvalidType("goldenGoal","number")},this.validatePredictionKey=function(t,n){if("object"==typeof n){var i=Object.keys(n),r=["value"];if(i.length||e.throwMissingFieldsException("prediction",r),1!==i.length||i.includes(r[0])||e.throwInvalidParamException(i),i.length>1){u.playerMarkets.includes(t)&&r.push("playerId");var s=i.filter((function(t){return!r.includes(t)}));s.length&&e.throwInvalidParamException(s)}}else e.throwInvalidType("prediction","object")},this.validatePlayerId=function(t,n){var i="playerId";t!==u.playerMarketNobodyPrediction&&(n||e.throwInvalidParamException([i]),"string"!=typeof n&&e.throwInvalidType(i,"string"))},this.validateMarket=function(t){Object.values(u.MarketEnum).includes(t)||e.throwInvalidMarketException(t)},this.validateMarketTopX=function(t){t!==u.MarketEnum.CORRECT_SCORE&&t!==u.MarketEnum.CORRECT_SCORE_ADVANCED&&e.throwInvalidMarketException(t,"TOP_X")},this.isPredictionBoolean=function(t){return"boolean"==typeof t},this.throwInvalidPredictionException=function(t,n){var i=(0,o.invalidPredictionMessage)(t,n);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_PREDICTION,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.throwInvalidMarketException=function(t,n){var i;if(i=n&&"TOP_X"===n?(0,o.invalidMarketTopXMessage)(t):(0,o.invalidMarketMessage)(t),"default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_MARKET,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.throwInvalidParamException=function(t){var n=(0,o.invalidFieldMessage)(t);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FIELD,n);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,n)},this.throwMissingFieldsException=function(t,n){var i=(0,o.missingFieldsMessage)(t,n);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FIELD,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.throwInvalidType=function(t,n){var i=(0,o.invalidTypeMessage)(t,n);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.errorHandlingMode=t}},4306:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4021),o=n(4904),u=s(n(2535)),l=n(5318),c=s(n(7059)),d=s(n(8863)),h=s(n(5230)),f=s(n(6409)),p=s(n(5955)),m=s(n(3886)),v=s(n(4121)),_=s(n(1461)),y=s(n(9759)),g=s(n(8247)),b=s(n(2590));e.default=function(t){var e=this;this.factory=null,this.privateLeagueHttps=null,this.loyaltyHttps=null,this.profile=null,this.service=null,this.discussionsService=null,this.create=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=this.factory.createRequestBodyFromParam(t,"PRIVATE"),[4,this.privateLeagueHttps.create(e,"PRIVATE_LEAGUE")];case 1:return n=i.sent(),[4,this.service.setTemplateModels(n)];case 2:return i.sent(),[2,n]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.privateLeagueHttps.getById(t,"PRIVATE_LEAGUE",n)];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.getMyLeagues=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return t=new v.default(t),[4,this.privateLeagueHttps.getMyLeagues(t,"PRIVATE_LEAGUE")];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e)];case 2:return n.sent(),[2,e]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return e=this.factory.createUpdateRequestBodyFromParam(n,"PRIVATE"),[4,this.privateLeagueHttps.update(t,e,"PRIVATE_LEAGUE")];case 1:return i=r.sent(),[4,this.service.setTemplateModels(i)];case 2:return r.sent(),[2,i]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.privateLeagueHttps.updateLeagueTemplate(t,n,s,"PRIVATE_LEAGUE")];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.delete(t,"PRIVATE_LEAGUE")];case 1:return[2,e.sent()]}}))}))},this.invite=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.invite(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteInvitation=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.deleteInvitation(t,n)];case 1:return[2,e.sent()]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!0,[4,this.privateLeagueHttps.accept(t,e,"PRIVATE_LEAGUE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!1,[4,this.privateLeagueHttps.accept(t,e,"PRIVATE_LEAGUE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.banUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.ban(t,n)];case 1:return[2,e.sent()]}}))}))},this.unbanUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.unban(t,n)];case 1:return[2,e.sent()]}}))}))},this.join=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.privateLeagueHttps.join(t)];case 1:return e=n.sent(),[4,this.finalizeAcceptModel(e,!0)];case 2:return[2,n.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.leave(t,"PRIVATE_LEAGUE")];case 1:return[2,e.sent()]}}))}))},this.finalizeAcceptModel=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return n?[4,this.getById(t.leagueId)]:[3,2];case 1:e=i.sent(),t.leagueModel=e,i.label=2;case 2:return[4,this.service.setProfileModel(t)];case 3:return i.sent(),[2,t]}}))}))},this.getMyLeaguesStandings=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new _.default(t)),[4,this.profile.getOwn().getInfo()];case 1:return e=r.sent(),[4,this.loyaltyHttps.getUserRankingsForPrivateLeagueAndChallenges(e.id,"PRIVATE_LEAGUE",t)];case 2:n=r.sent(),i=0,s=n.data,r.label=3;case 3:return i<s.length?(a=s[i],[4,this.getById(a.privateLeagueId)]):[3,6];case 4:o=r.sent(),a.privateLeagueModel=o,r.label=5;case 5:return i++,[3,3];case 6:return this.service.setTemplateModelsFromLeagueModels(n.data,"PRIVATE_LEAGUE"),[2,n]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return(t=new m.default(t)).type="PRIVATE",[4,this.privateLeagueHttps.getInvitations("PRIVATE_LEAGUE",t)];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e.data)];case 2:return n.sent(),[2,e]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return n&&(n=new y.default(n)),[4,this.privateLeagueHttps.getReportedPosts(t,n)];case 1:return e=r.sent(),i=e,[4,this.discussionsService.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:if(n){if(n.limit&&n.limit>20)throw new u.default(a.ErrorCodes.BAD_METHOD_CALL,o.ErrorStatuses.INVALID_LIMIT,l.ErrorMessages.INVALID_LIMIT);n=new g.default(n)}return[4,this.privateLeagueHttps.getPredictions(t,n)];case 1:return e=i.sent(),[4,this.service.setModelsForPredictions(e)];case 2:return[2,i.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.factory=new p.default,this.privateLeagueHttps=new d.default(t),this.loyaltyHttps=new c.default(t),this.profile=new f.default(t),this.service=new b.default(t),this.discussionsService=new h.default(t)}},5955:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5124)),s=i(n(1796)),a=i(n(4823)),o=i(n(9845));e.default=function(){this.createRequestBodyFromParam=function(t,e){var n="PRIVATE"===e?new s.default:new r.default;return n.name=t.name,n.description=t.description,n.invitation_code=t.invitationCode,n.template_id=t.templateId,n.users_can_invite_users=t.usersCanInviteUsers,t.administrators?n.administrators=t.administrators:delete n.administrators,t.scoringStartsAt?n.scoring_starts_at=t.scoringStartsAt:delete n.scoring_starts_at,n},this.createUpdateRequestBodyFromParam=function(t,e){var n="PRIVATE"===e?new a.default:new o.default;return n.name=t.name,n.description=t.description,n.invitation_code=t.invitationCode,n.template_id=t.templateId,n.users_can_invite_users=t.usersCanInviteUsers,n.administrators=t.administrators,n.pinned_posts=t.pinnedPosts,n.scoring_starts_at=t.scoringStartsAt,n}}},3958:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.profileId="",this.profileModel=null,this.leagueId="",this.leagueModel=null,this.message=""}},3886:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.type=null,n.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(n);return n.type&&(e+="&type=".concat(n.type)),e},n.type=e&&e.type?e.type:null,n}return r(e,t),e}(s(n(4800)).default);e.default=a},4121:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.type="PRIVATE",this.userRole=null,this.constructFiltersUrl=function(){var t="&type=".concat(e.type);return e.userRole&&(t+="&user_role=".concat(e.userRole)),t},this.userRole=(null==t?void 0:t.userRole)||null}},1461:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=null,this.page=null,this.leagueId=null,this.templateId=null,this.sortOrder=null,this.constructFiltersUrl=function(){var t="";return e.limit&&(t+="&limit=".concat(e.limit)),e.page&&(t+="&page=".concat(e.page)),e.leagueId&&(t+="&league_id=".concat(e.leagueId)),e.templateId&&(t+="&template_id=".concat(e.templateId)),e.sortOrder&&(t+="&sort_order=".concat(e.sortOrder)),t},this.limit=t&&t.limit?t.limit:null,this.page=t&&t.page?t.page:null,this.leagueId=t&&t.leagueId?t.leagueId:null,this.templateId=t&&t.templateId?t.templateId:null,this.sortOrder=t&&t.sortOrder?t.sortOrder:null}},9759:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.reportsCount=null,n.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(n);return n.reportsCount&&(e+="&reports_count=".concat(n.reportsCount)),e},n.reportsCount=e.reportsCount?e.reportsCount:null,n}return r(e,t),e}(s(n(4800)).default);e.default=a},8247:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=null,this.page=null,this.profileIds=null,this.constructFiltersUrl=function(){var t="";return e.limit&&(t+="&limit=".concat(e.limit)),e.page&&(t+="&page=".concat(e.page)),e.profileIds&&(t+="&profile_ids=".concat(e.profileIds.join(","))),t},this.limit=t&&t.limit?t.limit:null,this.page=t&&t.page?t.page:null,this.profileIds=t&&t.profileIds?t.leagueId:null}},8383:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.members=[],e}return r(e,t),e}(s(n(2446)).default);e.default=a},2446:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.name="",this.description="",this.type="",this.banned=[],this.invites=[],this.administrators=[],this.membersCount=0,this.invitationCode="",this.templateId="",this.templateModel=null,this.pastTemplates=[],this.usersCanInviteUsers=!1,this.scoringStartsAt="",this.pinnedPosts=[]}},2663:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.predictionId=null,this.predictionModel=null,this.profileId=null,this.profileModel=null}},9659:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId="",this.templateModel=null,this.privateLeagueId="",this.privateLeagueModel=null,this.position="",this.points=0,this.type="private_league"}},4239:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872)),s=i(n(6085)),a=i(n(3569)),o=i(n(3958)),u=i(n(8383)),l=i(n(2446)),c=i(n(2663));e.default=function(){var t=this;this.remapToPrivateLeagues=function(e){return e.meta=t.remapMetaPrivateLeagues(e.meta.pagination),e.data=e.data.map((function(e){return t.remapToPrivateLeagueById(e)})),e},this.remapMetaPrivateLeagues=function(t){var e=new r.default;return e.pagination.itemsPerPage=t.items_per_page,e.pagination.nextPageStartsAfter=t.next_page_starts_after,e},this.remapToPrivateLeagueById=function(t){var e=new u.default;return e.id=t.id,e.name=t.name,e.description=t.description,e.type=t.type,e.members=t.members,e.administrators=t.administrators,e.banned=t.banned,e.invites=t.invites,e.membersCount=t.members_count,e.usersCanInviteUsers=t.users_can_invite_users,e.invitationCode=t.invitation_code,e.templateId=t.template_id,e.pastTemplates=t.past_templates,e.pinnedPosts=t.pinned_posts,e.scoringStartsAt=t.scoring_starts_at,e},this.remapToMyPrivateLeagues=function(t){var e=new l.default;return e.id=t.id,e.name=t.name,e.description=t.description,e.type=t.type,e.administrators=t.administrators,e.banned=t.banned,e.invites=t.invites,e.membersCount=t.members_count,e.usersCanInviteUsers=t.users_can_invite_users,e.invitationCode=t.invitation_code,e.templateId=t.template_id,e.pastTemplates=t.past_templates,e.pinnedPosts=t.pinned_posts,e.scoringStartsAt=t.scoring_starts_at,e},this.remapToAcceptPrivateLeague=function(t){var e=new o.default;return e.profileId=t.profile_id,e.leagueId=t.league_id,e.message=t.message,e},this.remapToAcceptChallenge=function(t){var e=new s.default;return e.profileId=t.profile_id,e.challengeId=t.league_id,e.message=t.message,e},this.remapPredictions=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapPredictionsData(e.data),e},this.remapMeta=function(t){var e=new a.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.numberOfPages=t.pagination.number_of_pages,e.pagination.totalItems=t.pagination.total_items,e},this.remapPredictionsData=function(t){return t.map((function(t){var e=new c.default;return e.predictionId=t.prediction_id,e.profileId=t.profile_id,e}))}}},2167:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.name="",this.description="",this.invitation_code="",this.template_id="",this.users_can_invite_users=!1,this.administrators=[],this.scoring_starts_at=""}},1796:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="PRIVATE",e}return r(e,t),e}(s(n(2167)).default);e.default=a},4584:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.name="",this.description="",this.invitation_code="",this.template_id="",this.users_can_invite_users=!1,this.administrators=[],this.pinned_posts=[],this.scoring_starts_at=""}},4823:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="PRIVATE",e}return r(e,t),e}(s(n(4584)).default);e.default=a},3281:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4306));e.default=function(t){var e=this;this.privateLeaguesFacade=null,this.create=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.create(t)];case 1:return[2,e.sent()]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.update(t,n)];case 1:return[2,e.sent()]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.updateTemplate(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyLeagues=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getMyLeagues(t)];case 1:return[2,e.sent()]}}))}))},this.invite=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.invite(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteInvitation=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.deleteInvitation(t,n)];case 1:return[2,e.sent()]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.accept(t)];case 1:return[2,e.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.reject(t)];case 1:return[2,e.sent()]}}))}))},this.banUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.banUsers(t,n)];case 1:return[2,e.sent()]}}))}))},this.unbanUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.unbanUsers(t,n)];case 1:return[2,e.sent()]}}))}))},this.join=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.join(t)];case 1:return[2,e.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.leave(t)];case 1:return[2,e.sent()]}}))}))},this.getMyLeaguesStandings=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getMyLeaguesStandings(t)];case 1:return[2,e.sent()]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getInvitations(t)];case 1:return[2,e.sent()]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getReportedPosts(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getPredictions(t,n)];case 1:return[2,e.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.privateLeaguesFacade=new a.default(t)}},2590:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2962)),o=s(n(6409)),u=s(n(1259));e.default=function(t){var e=this;this.loyalty=null,this.profile=null,this.predictor=null,this.setTemplateModels=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.loyalty.getTemplates()];case 1:return e=n.sent(),t.templateModel=e.data.find((function(e){return e.id===t.templateId})),t.pastTemplates&&t.pastTemplates.length>0&&t.pastTemplates.forEach((function(t){t.model=e.data.find((function(e){return e.id===t.id}))})),[2]}}))}))},this.setTemplateModelsInLeagues=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return t.length?[4,this.loyalty.getTemplates()]:[2];case 1:return e=n.sent(),t.forEach((function(t){t.templateModel=e.data.find((function(e){return e.id===t.templateId})),t.pastTemplates&&t.pastTemplates.length>0&&t.pastTemplates.forEach((function(t){t.model=e.data.find((function(e){return e.id===t.id}))}))})),[2]}}))}))},this.setTemplateModelsFromLeagueModels=function(t,e){"PRIVATE_LEAGUE"!==e?t.forEach((function(t){t.templateModel=t.templateId===t.challengeModel.templateId?t.challengeModel.templateModel:t.challengeModel.pastTemplates.find((function(e){return e.id===t.templateId})).model})):t.forEach((function(t){t.templateModel=t.templateId===t.privateLeagueModel.templateId?t.privateLeagueModel.templateModel:t.privateLeagueModel.pastTemplates.find((function(e){return e.id===t.templateId})).model}))},this.setProfileModel=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.profile.getById(t.profileId).getInfo()];case 1:return e=n.sent(),t.profileModel=e,[2]}}))}))},this.setModelsForPredictions=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:return t.data.length?(e=t.data.map((function(t){return t.profileId})),n=t.data.map((function(t){return t.predictionId})),[4,this.getProfileModels(e)]):[3,3];case 1:return i=r.sent(),[4,this.getPredictionModels(n)];case 2:s=r.sent(),t.data.forEach((function(t){t.profileModel=i.find((function(e){return e.id===t.profileId})),t.predictionModel=s.find((function(e){return e.id===t.predictionId}))})),r.label=3;case 3:return[2,t]}}))}))},this.getProfileModels=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profile.getByIds(t)];case 1:return[2,e.sent()]}}))}))},this.getPredictionModels=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictor.getPredictionsByIds(t)];case 1:return[2,e.sent()]}}))}))},this.loyalty=new a.default(t),this.profile=new o.default(t),this.predictor=new u.default(t)}},4831:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=o(n(9072)),l=o(n(7232)),c=o(n(4268)),d=o(n(8097)),h=o(n(2535)),f=n(4021),p=n(4904),m=n(5318);e.default=function(t,e,n,o,v){var _=this;this.idsRemapper=null,this.profileHttps=null,this.profileService=null,this.localCache=null,this.profileFacade=null,this.ownProfile=null,this.modified=!1,this.expireAt=0,this.promises=[],this.isFetching=!1,this.errorHandlingMode=null,this.getOwnProfile=function(){return r(_,void 0,void 0,(function(){var t,e,n;return s(this,(function(i){switch(i.label){case 0:return this.isFetching?(console.log("Another thread is fetching profile..."),[4,this.delay(100)]):[3,2];case 1:return i.sent(),[3,0];case 2:if(this.modified&&this.ownProfile)return console.log("Timestamp is less than 10 minutes OR profile is modifying "),[2,this.ownProfile];if(t=Math.floor(Date.now()/1e3),this.ownProfile&&!(this.expireAt<t))return[3,7];this.isFetching=!0,this.expireAt=Math.floor(Date.now()/1e3)+600,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,this.profileFacade.getOwn()];case 4:return e=i.sent(),this.setOwnProfile(e),[3,6];case 5:throw n=i.sent(),this.isFetching=!1,n;case 6:return this.modified=!1,this.isFetching=!1,[2,this.ownProfile];case 7:return[2,this.ownProfile]}}))}))},this.delay=function(t){return new Promise((function(e){setTimeout(e,t)}))},this.setOwnProfile=function(t){_.ownProfile=t},this.getInfo=function(){return r(_,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),delete(e=JSON.parse(JSON.stringify(t))).interests,[2,e]}}))}))},this.showInterests=function(){return r(_,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.remapInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return r(_,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.showFullInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowers(t)];case 1:return[2,e.sent()]}}))}))},this.getFollowing=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowing(t)];case 1:return[2,e.sent()]}}))}))},this.follow=function(t){return r(_,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return[4,this.profileFacade.follow(t)];case 1:return e=i.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=i.sent(),this.setOwnProfile(n),[2,e]}}))}))},this.unfollow=function(t){return r(_,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return[4,this.profileFacade.unfollow(t)];case 1:return e=i.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=i.sent(),this.setOwnProfile(n),[2,e]}}))}))},this.getStats=function(){return r(_,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getStats()];case 1:return t=e.sent(),[4,this.idsRemapper.remapProfileStats(t)];case 2:return[2,e.sent()]}}))}))},this.getBadges=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getBadges(t)];case 1:return[2,e.sent()]}}))}))},this.addInterestPromise=function(t){return r(_,void 0,void 0,(function(){var e,n,r;return s(this,(function(s){switch(s.label){case 0:return this.modified=!0,e=i({},t),[4,this.getOwnProfile()];case 1:return s.sent(),n=null,"custom"===t.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(e)];case 2:return n=s.sent(),[3,4];case 3:n=e,s.label=4;case 4:return r=this.ownProfile.interests.filter((function(t){return t.id!==n.id||t.type!==n.type||t.source!==n.source})),this.ownProfile.interests=a([],r,!0),this.ownProfile.interests.push(n),[2,this]}}))}))},this.addInterest=function(t){return _.promises.push(_.addInterestPromise(t)),_},this.removeInterestPromise=function(t){return r(_,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return this.modified=!0,e=i({},t),[4,this.getOwnProfile()];case 1:return r.sent(),n=null,"custom"===t.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(e)];case 2:return n=r.sent(),[3,4];case 3:n=e,r.label=4;case 4:return this.ownProfile.interests=this.ownProfile.interests.filter((function(t){return t.id!==n.id||t.type!==n.type||t.source!==n.source})),[2,this]}}))}))},this.removeInterest=function(t){return _.promises.push(_.removeInterestPromise(t)),_},this.setBirthdatePromise=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.birthDate=t||null,[2,this]}}))}))},this.setBirthdate=function(t){return _.promises.push(_.setBirthdatePromise(t)),_},this.setGenderPromise=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.gender="male"===t||"female"===t?t:"unspecified",[2,this]}}))}))},this.setGender=function(t){return _.promises.push(_.setGenderPromise(t)),_},this.setNicknamePromise=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.nickname=t,[2,this]}}))}))},this.setNickname=function(t){return _.promises.push(_.setNicknamePromise(t)),_},this.setNamePromise=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.name=t,[2,this]}}))}))},this.setName=function(t){return _.promises.push(_.setNamePromise(t)),_},this.setCountryPromise=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),t&&!this.ownProfile.country?(this.ownProfile.country=new u.default,this.ownProfile.country.id=t):t&&this.ownProfile.country?this.ownProfile.country.id=t:this.ownProfile.country=null,[2,this]}}))}))},this.setCountry=function(t){return _.promises.push(_.setCountryPromise(t)),_},this.showFullnessProfile=function(){return r(_,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[2,this.profileFacade.showFullnessProfile(e)]}}))}))},this.setAvatarPromise=function(t){return r(_,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:if(e.sent(),this.profileService.isAvatarValidURL(t))this.ownProfile.avatar=t;else{if("default"===this.errorHandlingMode)throw new d.default(f.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,m.ErrorMessages.INVALID_AVATAR);if("standard"===this.errorHandlingMode)throw new h.default(f.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,m.ErrorMessages.INVALID_AVATAR)}return[2,this]}}))}))},this.setAvatar=function(t){return _.promises.push(_.setAvatarPromise(t)),_},this.update=function(){return r(_,void 0,void 0,(function(){var t,e,n,i,r,a;return s(this,(function(s){switch(s.label){case 0:return 0===this.promises.length?[2,this.ownProfile]:[4,Promise.all(this.promises)];case 1:return s.sent(),[4,this.profileFacade.getOwn()];case 2:return t=s.sent(),[4,this.getOwnProfile()];case 3:return e=s.sent(),n=this.profileService.extractUpdatedProps(t,e),this.modified=!1,this.expireAt=0,Object.keys(n).length?[4,this.profileHttps.updateProfile(n)]:[3,5];case 4:return i=s.sent(),r=JSON.parse(JSON.stringify(i)),this.setOwnProfile(r),this.localCache.setOwnProfile(r),delete i.interests,[2,i];case 5:return delete(a=JSON.parse(JSON.stringify(this.ownProfile))).interests,[2,a]}}))}))},this.idsRemapper=t,this.localCache=e,this.profileHttps=n,this.errorHandlingMode=v,this.profileService=new c.default,this.profileFacade=new l.default(e,n,o)}},642:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7232));e.default=function(t,e,n,s){var o=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.profileFacade=null,this.profileId="",this.setId=function(t){return o.profileId=t,o},this.getProfile=function(){return i(o,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getById(this.profileId)];case 1:return[2,t.sent()]}}))}))},this.getInfo=function(){return i(o,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.getProfile()];case 1:return delete(t=e.sent()).interests,[2,t]}}))}))},this.showInterests=function(){return i(o,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.remapInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return i(o,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.showFullInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(t){return i(o,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowers(t,this.profileId)];case 1:return[2,e.sent()]}}))}))},this.getFollowing=function(t){return i(o,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowing(t,this.profileId)];case 1:return[2,e.sent()]}}))}))},this.showFullnessProfile=function(){return i(o,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.getProfile()];case 1:return t=e.sent(),[2,this.profileFacade.showFullnessProfile(t)]}}))}))},this.getStats=function(t){return i(o,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.activityHttps.getStats(this.profileId,t)];case 1:return e=n.sent(),[4,this.idsRemapper.remapProfileStats(e)];case 2:return[2,n.sent()]}}))}))},this.getBadges=function(){return i(o,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.profileHttps.getBadges(this.profileId)];case 1:return[2,t.sent()]}}))}))},this.idsRemapper=t,this.profileHttps=n,this.activityHttps=s,this.profileFacade=new a.default(e,n,s)}},7232:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9037)),o=s(n(9523)),u=s(n(2535)),l=n(4021),c=n(4904),d=n(5318);e.default=function(t,e,n){var s=this;this.profileHttps=null,this.activityHttps=null,this.getOwn=function(){return i(s,void 0,void 0,(function(){var t,e,n;return r(this,(function(i){switch(i.label){case 0:if(t=this.getLocalStorageData("profile"))return[2,JSON.parse(JSON.stringify(t))];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getProfile()];case 2:return e=i.sent(),this.localCache.setOwnProfile(e),[2,e];case 3:throw n=i.sent(),console.warn("There was a problem retrieving your profile: ",n),n;case 4:return[2]}}))}))},this.updateOwnProfile=function(){return i(s,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile()];case 1:return t=n.sent(),this.localCache.setOwnProfile(t),[2,t];case 2:throw e=n.sent(),console.warn("There was a problem retrieving your profile: ",e),e;case 3:return[2]}}))}))},this.getByIds=function(t,e,n){return i(s,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:if(t&&t.length>0&&e||!t&&0===t.length&&!e)throw new u.default(l.ErrorCodes.BAD_METHOD_CALL,c.ErrorStatuses.INVALID_METHOD_CALL,d.ErrorMessages.INVALID_GET_PROFILES_METHOD_CALL);r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.profileHttps.getProfiles(t,e,n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the selected profiles: ".concat(t.join(",")," "),i),i;case 4:return[2]}}))}))},this.getById=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the selected profile: ".concat(t," "),e),e;case 3:return[2]}}))}))},this.getCountries=function(t){return i(s,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:if(t=t||!1,(e=this.localCache.getProfileCountries())&&e.length>0)return[2,e];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.profileHttps.getCountries(t)];case 2:return n=r.sent(),this.localCache.setProfileCountries(n),[2,n];case 3:throw i=r.sent(),console.warn("There was a problem retrieving profile countries: ",i),i;case 4:return[2]}}))}))},this.getFollowers=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,a,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),t&&(t=new o.default(t)),[4,this.profileHttps.getFollowers(t,e)];case 1:return n=r.sent(),(i=n.data.map((function(t){return t.followerId}))).length?[4,this.getByIds(i)]:[3,3];case 2:return s=r.sent(),a=n.data.map((function(t){return s.forEach((function(e){t.followerId===e.id&&(t.name=e.name,t.nickname=e.nickname,t.avatar=e.avatar)})),t})),n.data=a,[2,n];case 3:return[2,n];case 4:throw u=r.sent(),console.warn("There was a problem retrieving your followers: ",u),u;case 5:return[2]}}))}))},this.getFollowing=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,a,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),t&&(t=new o.default(t)),[4,this.profileHttps.getFollowing(t,e)];case 1:return n=r.sent(),(i=n.data.map((function(t){return t.followingId}))).length?[4,this.getByIds(i)]:[3,3];case 2:return s=r.sent(),a=n.data.map((function(t){return s.forEach((function(e){t.followingId===e.id&&(t.name=e.name,t.nickname=e.nickname,t.avatar=e.avatar)})),t})),n.data=a,[2,n];case 3:return[2,n];case 4:throw u=r.sent(),console.warn("There was a problem retrieving your following profiles: ",u),u;case 5:return[2]}}))}))},this.follow=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.follow(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem following profiles: ".concat(t.join(",")," "),e),e;case 3:return[2]}}))}))},this.unfollow=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.unfollow(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem unfollowing profiles: ".concat(t.join(",")," "),e),e;case 3:return[2]}}))}))},this.showFullnessProfile=function(t){var e=new a.default,n=0;return t.avatar&&(e.breakdown.addedAvatar.completed=!0,n+=e.breakdown.addedAvatar.percentage),t.birthDate&&(e.breakdown.addedBirthdate.completed=!0,n+=e.breakdown.addedBirthdate.percentage),t.country&&(e.breakdown.addedCountry.completed=!0,n+=e.breakdown.addedCountry.percentage),t.gender&&(e.breakdown.addedGender.completed=!0,n+=e.breakdown.addedGender.percentage),t.interests&&t.interests.length>0&&(t.interests.find((function(t){return"team"===t.type&&t.favourite}))&&(e.breakdown.teamFavourite.completed=!0,n+=e.breakdown.teamFavourite.percentage),t.interests.find((function(t){return"team"===t.type}))&&(e.breakdown.teamFollowed.completed=!0,n+=e.breakdown.teamFollowed.percentage),t.interests.find((function(t){return"player"===t.type&&t.favourite}))&&(e.breakdown.playerFavourite.completed=!0,n+=e.breakdown.playerFavourite.percentage),t.interests.find((function(t){return"player"===t.type}))&&(e.breakdown.playerFollowed.completed=!0,n+=e.breakdown.playerFollowed.percentage),t.interests.find((function(t){return"competition"===t.type&&t.favourite}))&&(e.breakdown.competitionFavourite.completed=!0,n+=e.breakdown.competitionFavourite.percentage),t.interests.find((function(t){return"competition"===t.type}))&&(e.breakdown.competitionFollowed.completed=!0,n+=e.breakdown.competitionFollowed.percentage)),e.totalPercentage=n,e},this.getStats=function(){return i(s,void 0,void 0,(function(){var t,e,n;return r(this,(function(i){switch(i.label){case 0:if((t=this.getLocalStorageData("statistics"))&&Object.keys(t).length)return[2,JSON.parse(JSON.stringify(t))];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.activityHttps.getStats()];case 2:return e=i.sent(),this.localCache.setProfileStats(e),[2,e];case 3:throw n=i.sent(),console.warn("There was a problem retrieving own profile statistics: ",n),n;case 4:return[2]}}))}))},this.getBadges=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:if(!t)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.profileHttps.getBadges()];case 2:return[2,r.sent()];case 3:throw e=r.sent(),console.warn("There was a problem retrieving own profile badges: ",e),e;case 4:if(n=this.getLocalStorageData("badges"))return[2,n];r.label=5;case 5:return r.trys.push([5,7,,8]),[4,this.profileHttps.getBadges()];case 6:return i=r.sent(),this.localCache.setProfileBadges(i),[2,i];case 7:throw s=r.sent(),console.warn("There was a problem retrieving own profile badges: ",s),s;case 8:return[2]}}))}))},this.getLocalStorageData=function(t){var e=Math.floor(Date.now()/1e3),n=s.localCache.getExpiration("profile",t);switch(t){case"profile":if(n>e)return s.localCache.getOwnProfile();case"statistics":if(n>e)return s.localCache.getProfileStats();case"badges":if(n>e)return s.localCache.getProfileBadges();default:return null}},this.localCache=t,this.profileHttps=e,this.activityHttps=n}},9523:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=0,this.startAfter=null,this.constructFilterUrl=function(){var t="";return e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.startAfter&&(t+="&",t+="start_after=".concat(e.startAfter)),t},this.limit=t.limit?t.limit:20,this.startAfter=t.startAfter?t.startAfter:null}},4782:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.avatar=null,this.followerId=null,this.name=null,this.nickname=null,this.profileId=null}},1712:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.profile_ids=[]}},3106:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.avatar=null,this.followingId=null,this.name=null,this.nickname=null,this.profileId=null}},5156:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.model=null,e}return r(e,t),e}(s(n(5867)).default);e.default=a},6620:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7312));e.default=function(){this.teamFollowed=new r.default(10),this.teamFavourite=new r.default(15),this.playerFollowed=new r.default(10),this.playerFavourite=new r.default(10),this.competitionFollowed=new r.default(10),this.competitionFavourite=new r.default(5),this.addedBirthdate=new r.default(10),this.addedGender=new r.default(10),this.addedCountry=new r.default(10),this.addedAvatar=new r.default(10)}},7312:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.completed=!1,this.percentage=t}},9037:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6620));e.default=function(){this.breakdown=new r.default}},5867:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.source="",this.type="",this.favourite=!1}},9072:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.name=null,this.assets=null}},3546:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.name=null,this.nickname=null,this.avatar=null,this.gender=null,this.country=null,this.birthDate=null,this.verified=!1,this.staffMember=!1,this.interests=[],this.followingCount=0,this.followersCount=0}},6277:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1553)),s=i(n(4782));e.default=function(){var t=this;this.followersFromResponse=function(e){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=e.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=e.meta.pagination.items_per_page,n.data=e.data.map((function(e){return t.remapResponse(e)})),n},this.remapResponse=function(t){var e=new s.default;return e.avatar=t.avatar,e.followerId=t.follower_id,e.name=t.name,e.profileId=t.profile_id,e}}},8673:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1553)),s=i(n(3106));e.default=function(){var t=this;this.followResponse=function(e){return e.map((function(e){return t.remapResponse(e)}))},this.followingFromResponse=function(e){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=e.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=e.meta.pagination.items_per_page,n.data=e.data.map((function(e){return t.remapResponse(e)})),n},this.remapResponse=function(t){var e=new s.default;return e.avatar=t.avatar,e.followingId=t.following_id,e.name=t.name,e.profileId=t.profile_id,e.nickname=t.nickname,e}}},441:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3546));e.default=function(){var t=this;this.profilesFromResponse=function(e){return e?e.map((function(e){return t.fullProfileFromResponse(e)})):null},this.fullProfileFromResponse=function(t){var e=new r.default;return e.id=t.id,e.name=t.name,e.nickname=t.nickname,e.avatar=t.avatar,e.gender=t.gender,e.country=t.country,e.birthDate=t.birth_date,e.verified=t.verified,e.staffMember=t.staff_member,e.interests=t.interests?t.interests:[],e.followingCount=t.following_count,e.followersCount=t.followers_count,e}}},1758:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.achievedAt=""}},6635:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.participationCount=null,this.points=null}},3009:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.totalPoints=null,this.postPoints=null,this.postsMade=null,this.reactionPoints=null,this.reactionCount=null}},7165:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.participationCount=null}},3621:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.participations=0,this.points=0}},5490:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3621)),s=i(n(1342));e.default=function(){this.single=new s.default,this.topX=new r.default,this.matchQuiz=new r.default}},1316:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6635)),s=i(n(3009)),a=i(n(7165)),o=i(n(5490)),u=i(n(5123));e.default=function(){this.successRates=new u.default,this.predictions=new o.default,this.tiers=[],this.badges=[],this.discussions=new s.default,this.classicQuizzes=new r.default,this.eitherOr=new a.default}},3195:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.entityId="",this.entityType="",this.entitySource="",this.model=null,this.predictionsMade=0,this.correct=0,this.points=0}},1342:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3087));e.default=function(){this.predictionsMade=0,this.correct=0,this.points=0,this.breakdown=new r.default}},9826:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.model=null}},5123:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},3087:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.footballCompetitions=[],this.footballTeams=[]}},6409:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4275)),o=s(n(8900)),u=s(n(7232)),l=s(n(4831)),c=s(n(642)),d=s(n(4289)),h=s(n(595)),f=s(n(1022)),p=s(n(4912)),m=s(n(8358));e.default=function(t){var e=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.footballHttps=null,this.footballFacade=null,this.idMapping=null,this.localCache=null,this.profileFacade=null,this.ownProfileBuilder=null,this.profileBuilder=null,this.getOwn=function(){return e.ownProfileBuilder},this.getById=function(t){return e.profileBuilder.setId(t)},this.getCountries=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getCountries(t)];case 1:return[2,e.sent()]}}))}))},this.getByIds=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getByIds(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.profileHttps=new a.default(t),this.activityHttps=new f.default(t),this.footballHttps=new h.default(t),this.idMapping=new o.default(t),this.localCache=(new m.default).createLocalCacheInstance(t.idSchema),this.footballFacade=new d.default(t,this.localCache,this.footballHttps,this.idMapping),this.profileFacade=new u.default(this.localCache,this.profileHttps,this.activityHttps),this.idsRemapper=new p.default(t,this.footballFacade),this.ownProfileBuilder=new l.default(this.idsRemapper,this.localCache,this.profileHttps,this.activityHttps,t.errorHandlingMode),this.profileBuilder=new c.default(this.idsRemapper,this.localCache,this.profileHttps,this.activityHttps)}},4268:function(t,e){"use strict";var n=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){var t=this;this.extractUpdatedProps=function(e,n){var i=["name","nickname","gender","avatar"],r={};return Object.keys(e).forEach((function(s){if(i.includes(s)&&e[s]!==n[s])r[s]=n[s];else if("birthDate"===s)(null===n[s]||null===e[s]&&n[s]||e[s]!==n[s])&&(r.birth_date=n[s]);else if("country"===s)null===n[s]?r.country_id=n[s]:(null===e[s]&&n[s]||e[s].id!==n[s].id)&&(r.country_id=n[s].id);else if("interests"===s){var a=e[s],o=n[s];o.length&&t.isNewInterest(a,o)?r[s]=t.updateInterests(a,o):!o.length&&a.length?r[s]=o:a.length===o.length||t.isNewInterest(a,o)||(r[s]=o)}})),r},this.updateInterests=function(e,i){if(e.length===i.length){var r=t.extractSameAndNewInterests(e,i),s=r[0],a=r[1];return n(n([],a,!0),s,!0)}return i},this.isNewInterest=function(e,n){var i=!1;return t.extractSameAndNewInterests(e,n)[0].length?i=!0:i},this.extractSameAndNewInterests=function(t,e){var n=e.filter((function(e){return t.some((function(t){return e.id===t.id&&e.type===t.type&&e.source===t.source&&e.favourite===t.favourite}))}));return[e.filter((function(e){return!t.some((function(t){return e.id===t.id&&e.type===t.type&&e.source===t.source&&e.favourite===t.favourite}))})),n]},this.isAvatarValidURL=function(t){try{return new URL(t),!0}catch(t){return!1}}}},1267:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){var t=this;this.KEY_PREFIX="fu-progress-",this.get=function(e,n){var i=localStorage.getItem("".concat(t.KEY_PREFIX).concat(e,"-").concat(n));return i?JSON.parse(i):i},this.set=function(e,n,i){return localStorage.setItem("".concat(t.KEY_PREFIX).concat(e,"-").concat(n),JSON.stringify(i)),JSON.stringify(i)},this.delete=function(e,n){localStorage.removeItem("".concat(t.KEY_PREFIX).concat(e,"-").concat(n))}}},853:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GameStatusEnum=void 0,(n=e.GameStatusEnum||(e.GameStatusEnum={})).OPEN="OPEN",n.LIVE="LIVE",n.PENDING="PENDING",n.CANCELED="CANCELED",n.CLOSED="CLOSED",n.SETTLED="SETTLED"},9502:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4946),c=u(n(2793)),d=u(n(5013)),h=n(853),f=u(n(7299)),p=u(n(1553)),m=u(n(1399)),v=u(n(7782)),_=s(n(7686)),y=u(n(2310)),g=u(n(8097)),b=n(4904),w=n(5318),I=n(4021),E=u(n(2535));e.default=function(t,e){var n=this;this.idMapping=null,this.predictorHttps=null,this.predictorService=null,this.predictorValidator=null,this.clientHttps=null,this.errorHandlingMode=null,this.getConfig=function(){return a(n,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(_.FeatureConfigType.TOP_X)];case 1:return t=e.sent(),this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(t)];case 2:return[2,e.sent()];case 3:return[2,t]}}))}))},this.getGames=function(t,e){return a(n,void 0,void 0,(function(){var n,i;return o(this,(function(r){switch(r.label){case 0:return e=e||!1,n=this.predictorService.initGameFilters("TOP_X",t),[4,this.predictorHttps.getGames(n,e)];case 1:return i=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(i)];case 2:return[2,r.sent()]}}))}))},this.getGameById=function(t,e){return a(n,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return e=e||!1,[4,this.predictorHttps.getGameById(t,e)];case 1:return n=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,i.sent()]}}))}))},this.getGamePredictions=function(t,e,i){return a(n,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i=i||!1,e&&(e.type&&delete e.type,e.status&&delete e.status,e=new v.default(e)),[4,this.predictorHttps.getGamePredictions(t,i,e)];case 1:return[2,n.sent()]}}))}))},this.getGameResults=function(t,e,i){return a(n,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return i=i||!1,e&&(e=new f.default(e)),[4,this.predictorHttps.getGameResults(t,i,e)];case 1:return n=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(t){return a(n,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return t=t||!1,(e=new f.default(null)).status=h.GameStatusEnum.OPEN,e.type="TOP_X",[4,this.predictorHttps.getGames(e,t)];case 1:return n=r.sent(),i=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(i,null,t)];case 2:return[2,r.sent().data[0]]}}))}))},this.play=function(t){return a(n,void 0,void 0,(function(){var e,n,i,r,s=this;return o(this,(function(a){switch(a.label){case 0:return e=new m.default(t),(e=this.predictorValidator.validateBodyFields("TOP_X",e)).fixtures=e.fixtures.map((function(t){return s.predictorValidator.validateFixture(t.matchId,t.market,t.prediction.value)})),this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,2]:(n=[],e.fixtures.forEach((function(t){return n.push(t.matchId)})),[4,this.predictorService.remapMatchIdToNative(n)]);case 1:i=a.sent(),e.fixtures.forEach((function(t){return t.matchId=i.shift()})),a.label=2;case 2:return[4,this.predictorHttps.makeFootballPrediction(e)];case 3:return(r=a.sent()).fixtures.forEach((function(t){t.matchId=t.matchModel.id})),[2,r]}}))}))},this.delete=function(t){return a(n,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getMyGameEditions=function(t,e){return a(n,void 0,void 0,(function(){var n,i,r,s,a;return o(this,(function(o){switch(o.label){case 0:return t&&t.limit&&this.validateLimitFilterOnGames(t.limit),e=e||!1,n=this.predictorService.initGameTypePredictions("TOP_X",t),i=[],[4,this.predictorHttps.getMyPredictionsNoRemap(n)];case 1:return(r=o.sent()).data.length>0?(r.data.forEach((function(t){t.game_instance_id&&i.push(t.game_instance_id)})),s=this.predictorService.initGameFilters("TOP_X",null,i),[4,this.predictorHttps.getUserGameEditions(s,e)]):[3,4];case 2:return a=o.sent(),[4,this.predictorService.addPredictionProp(r,a)];case 3:return[2,o.sent()];case 4:return[2,new p.default]}}))}))},this.getMyGamePrediction=function(t){return a(n,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return e=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return(n=r.sent()).data.length>0?[2,(i=n.data.filter((function(e){return e.gameInstanceId===t}))).length?i[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(t,e,i){return a(n,void 0,void 0,(function(){var n,r,s,a,u;return o(this,(function(o){switch(o.label){case 0:return e&&e.limit&&this.validateLimitFilterOnGames(e.limit),i=i||!1,n=this.predictorService.initGameTypePredictions("TOP_X",e),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(t,n)];case 1:return(s=o.sent()).data.length>0?(s.data.forEach((function(t){t.game_instance_id&&r.push(t.game_instance_id)})),a=this.predictorService.initGameFilters("TOP_X",null,r),[4,this.predictorHttps.getUserGameEditions(a,i)]):[3,4];case 2:return u=o.sent(),[4,this.predictorService.addPredictionProp(s,u)];case 3:return[2,o.sent()];case 4:return[2,new p.default]}}))}))},this.getUserGamePrediction=function(t,e,i){return a(n,void 0,void 0,(function(){var n,r,s;return o(this,(function(a){switch(a.label){case 0:return i=i||!1,n=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getUserPredictions(t,i,n)];case 1:return(r=a.sent()).data.length>0?[2,(s=r.data.filter((function(t){return t.gameInstanceId===e}))).length?s[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(t,e){return a(n,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(t,e)];case 1:return n=i.sent(),[4,this.predictorService.completeGameMarketResults(n,"TOP_X")];case 2:return[2,i.sent()]}}))}))},this.getGameWinners=function(t,e){return a(n,void 0,void 0,(function(){var n,i;return o(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(t,e)];case 1:return n=r.sent(),[4,this.getGameById(t)];case 2:return i=r.sent(),n.contestModel=i,[2,this.predictorService.completeContestWinners(n)]}}))}))},this.validateLimitFilterOnGames=function(t){if("default"===n.errorHandlingMode&&t>50)throw new g.default(I.ErrorCodes.BAD_METHOD_CALL,b.ErrorStatuses.EXCEEDED_LENGTH,w.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===n.errorHandlingMode&&t>50)throw new E.default(I.ErrorCodes.BAD_METHOD_CALL,b.ErrorStatuses.EXCEEDED_LENGTH,w.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED)},this.idMapping=e,this.errorHandlingMode=t.errorHandlingMode,this.predictorValidator=new y.default(t.errorHandlingMode),this.predictorHttps=new c.default(t,e),this.predictorService=new d.default(t,e),this.clientHttps=new _.default(t)}},1180:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.enabled=!1,this.clientId=null,this.minFixtures=null,this.maxFixtures=null,this.competitionsWhitelist=null}},7482:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899));e.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default}},5967:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899)),s=i(n(3381));e.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new s.default}},6247:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.adContent=null,e}return r(e,t),e}(s(n(3751)).default);e.default=a},6890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.userId=null,this.points=null,this.results=[],this.tiebreaker=null}},6160:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.matchId=null,this.matchModel=null,this.outcome=null}},7299:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4800)),o=n(853),u=function(t){function e(e){var n=t.call(this,e)||this;return n.status=null,n.type=null,n.gameIds=null,n.sortOrder=null,n.constructFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(n);return n.status&&Object.values(o.GameStatusEnum).includes(n.status)&&(e+="&",e+="status=".concat(n.status)),n.type&&(e+="&",e+="type=".concat(n.type)),n.gameIds&&n.gameIds.length>0&&(e+="&",e+="game_ids=".concat(n.gameIds.join(","))),n.sortOrder&&(e+="&",e+="sort_order=".concat(n.sortOrder)),e},n.status=(null==e?void 0:e.status)||null,n.type=(null==e?void 0:e.type)||null,n.gameIds=(null==e?void 0:e.gameIds)||null,n.sortOrder=(null==e?void 0:e.sortOrder)||null,n}return r(e,t),e}(a.default);e.default=u},3751:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439)),s=i(n(4916));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.scheduleOpenAt=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new s.default,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.labels=null,this.customFields=null,this.branding=null,this.flags=null,this.images=new r.default,this.createdAt=null,this.updatedAt=null}},4780:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7482)),o=s(n(8410)),u=s(n(5967)),l=s(n(6890)),c=s(n(6160)),d=s(n(3751)),h=s(n(7243)),f=s(n(8950)),p=s(n(7640)),m=s(n(1553)),v=s(n(670)),_=n(7974),y=s(n(4916)),g=s(n(3483)),b=s(n(1784)),w=s(n(824)),I=s(n(6899)),E=s(n(6247)),M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapPaginatedGames=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGamesListResponse(t)})),n},e.remapGamesListResponse=function(t){var n=new d.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.labels=t.labels,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapGameByIdResponse=function(t){var n=new E.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.adContent=t.ad_content,n.labels=t.labels,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapFixturesResponse=function(t){var e=new a.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.market=t.market,e.matchStatus.type=t.match_status?t.match_status.type:null,e.matchStatus.subType=t.match_status?t.match_status.sub_type:null,e},e.remapPaginatedUserTopXEditions=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserTopXEditionsResponse(t)})),n},e.remapUserTopXEditionsResponse=function(t){var n=new f.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapTopXFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.branding=t.branding?e.remapBranding(t.branding):null,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapTopXFixturesResponse=function(t){var e=new u.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.market=t.market,e.matchStatus.type=t.match_status?t.match_status.type:null,e.matchStatus.subType=t.match_status?t.match_status.sub_type:null,e},e.remapPaginatedUserMathQuizEditions=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserMatchQuizEditionsResponse(t)})),n},e.remapUserMatchQuizEditionsResponse=function(t){var n=new h.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapMatchQuizFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.branding=t.branding?e.remapBranding(t.branding):null,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapMatchQuizFixturesResponse=function(t){var e=new o.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.market=t.market,e.matchStatus.type=t.match_status?t.match_status.type:null,e.matchStatus.subType=t.match_status?t.match_status.sub_type:null,e},e.remapPaginatedGameResults=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGameResults(t)})),n},e.remapGameResults=function(t){var n=new l.default;return n.userId=t.user_id,n.points=t.points?t.points:0,n.results=t.results.map((function(t){return e.remapResults(t)})),n.tiebreaker=t.tiebreaker?e.remapTiebreaker(t.tiebreaker):null,n},e.remapGameMarketsResults=function(t){var n=new v.default;return n.gameId=t.game_id,n.results=e.remapMarketsResults(t.results),n.tieBreakers=t.tie_breakers?e.remapTieBreakers(t.tie_breakers):null,n},e.remapContestWinners=function(t){var n=new b.default;return n.contestId=t.contest_id,n.contestType=t.contest_type,n.description=t.description,n.userList=t.user_list?t.user_list.map((function(t){return e.remapUserListWinners(t)})):null,n},e.remapUserListWinners=function(t){var e=new w.default;return e.position=t.position,e.profileId=t.profile_id,e.note=t.note,e.tags=t.tags,e},e.remapTieBreakers=function(t){var e={goldenGoals:[]};return e.goldenGoals=t.golden_goals.map((function(t){return{minute:t.minute,matchId:t.match_id,matchModel:null,playerId:t.player_id,playerModel:null,goalType:t.goal_type}})),e},e.remapMarketsResults=function(t){var n=[];return t.forEach((function(t){var i={matchId:t.match_id,market:t.market,result:e.remapMarketResult(t.market,t.result),matchModel:null,playerModels:[],matchStatus:e.remapMarketsResultsMatchStatus(t.match_status)};n.push(e.deleteUnusefulField(i))})),n},e.remapMarketsResultsMatchStatus=function(t){var e=new I.default;return t&&(e.type=t.type,e.subType=t.sub_type),e},e.remapMarketResult=function(t,e){return _.endMarkMarkets.includes(t)?e[0]:_.playerMarkets.includes(t)?e:"true"===e[0]||"false"!==e[0]&&void 0},e.deleteUnusefulField=function(t){return _.playerMarkets.includes(t.market)&&!e.isPlayerMarketWithNoResult(t.market,t.result)||delete t.playerModels,t},e.isPlayerMarketWithNoResult=function(t,e){return _.playerMarkets.includes(t)&&0===e.length},e.remapResults=function(t){var e=new c.default;return e.matchId=t.match_id,e.outcome=t.outcome,e},e.remapTiebreaker=function(t){var e=new p.default;return e.goldenGoal=t.golden_goal,e},e.remapTimeTiebreaker=function(t){var e=new y.default;return e.timeTiebreaker=t,e},e.remapRelated=function(t){return t.map((function(t){var e=new g.default;return e.entityId=t.entity_id,e.entityType=t.entity_type,e}))},e}return r(e,t),e}(s(n(6692)).default);e.default=M},8950:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4916)),s=i(n(7640));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.scheduleOpenAt=null,this.images=null,this.predictionTiebreaker=new s.default,this.branding=null}},7640:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.goldenGoal=null}},4916:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.timeTiebreaker=!1}},1784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.contestId="",this.contestType="GAME",this.contestModel=null,this.description="",this.userList=[]}},824:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position="",this.profileId="",this.profileModel=null,this.note="",this.tags=[]}},3381:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null,this.result=null}},1399:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1465));e.default=function(t){var e=this;this.gameInstanceId=null,this.fixtures=[],this.tiebreaker=null,this.gameInstanceId=t.gameInstanceId,t.fixtures.forEach((function(t){return e.fixtures.push(new r.default(t.matchId,t.market,t.prediction.value))})),this.tiebreaker=t.tiebreaker?t.tiebreaker:null}},9596:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900)),o=s(n(9502));e.default=function(t){var e=this;this.topXFacade=null,this.idMapping=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getGames=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGames(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGameById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGamePredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGamePredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getGameResults=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGameResults(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getCurrentGameResults=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getCurrentGameResults(t)];case 1:return[2,e.sent()]}}))}))},this.play=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.play(t)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getMyGameEditions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getMyGameEditions(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyGamePrediction=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getMyGamePrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getUserGameEditions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getUserGameEditions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserGamePrediction=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getUserGamePrediction(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getMarketsResultsForGame=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getMarketsResultsForGame(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameWinners=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGameWinners(t,n)];case 1:return[2,e.sent()]}}))}))},this.idMapping=new a.default(t),this.topXFacade=new o.default(t,this.idMapping)}},7323:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(4800)),u=s(n(1613)),l=s(n(4790)),c=s(n(4874));e.default=function(t){var e=this;this.https=null,this.service=null,this.idSchema=null,this.getPolls=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s,o;return r(this,(function(r){switch(r.label){case 0:return t?(t=new l.default(t),[4,this.service.finalizePollsFilters(t)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[4,this.https.getPolls(t,n)];case 3:e=r.sent(),i=0,s=e.data,r.label=4;case 4:return i<s.length?(o=s[i],[4,this.service.remapTags(o,a.IdSchemaEnum.NATIVE,this.idSchema)]):[3,7];case 5:r.sent(),r.label=6;case 6:return i++,[3,4];case 7:return[2,e]}}))}))},this.getPollById=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.https.getPollById(t,n)];case 1:return e=i.sent(),[4,this.service.remapTags(e,a.IdSchemaEnum.NATIVE,this.idSchema)];case 2:return i.sent(),[2,e]}}))}))},this.voteForPoll=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.voteForPoll(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteVoteForPoll=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.deleteVoteForPoll(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPollVote=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s;return r(this,(function(r){switch(r.label){case 0:return[4,this.https.getMyPollVote(t)];case 1:return e=r.sent(),n?[4,this.getPolls(new l.default({pollIds:[t]}),!0)]:[3,3];case 2:i=r.sent(),e.pollModel=i.data.find((function(e){return e.id===t}))||null,e.optionModel=(null===(s=i.data.find((function(e){return e.id===t})))||void 0===s?void 0:s.options.find((function(t){return t.id===e.optionId})))||null,r.label=3;case 3:return[2,e]}}))}))},this.getMyPollsVotes=function(t){return i(e,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new o.default(t)),[4,this.https.getMyPollsVotes(t)];case 1:return e=r.sent(),n=e.data.map((function(t){return t.id})),[4,this.getPolls(new l.default({pollIds:n}),!0)];case 2:return i=r.sent(),e.data=e.data.map((function(t){var e;return t.pollModel=i.data.find((function(e){return e.id===t.pollId}))||null,t.optionModel=(null===(e=t.pollModel)||void 0===e?void 0:e.options.find((function(e){return e.id===t.optionId})))||null,t})),[2,e]}}))}))},this.idSchema=t.idSchema,this.https=new u.default(t),this.service=new c.default(t)}},4790:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.flags=null,n.status=null,n.entityIds=null,n.entityType=null,n.pollIds=null,n.sortOrder=null,n.minVotes=null,n.flags=(null==e?void 0:e.flags)||null,n.status=(null==e?void 0:e.status)||null,n.entityIds=(null==e?void 0:e.entityIds)||null,n.entityType=(null==e?void 0:e.entityType)||null,n.pollIds=(null==e?void 0:e.pollIds)||null,n.sortOrder=(null==e?void 0:e.sortOrder)||null,n.minVotes=e&&void 0!==e.minVotes?e.minVotes:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.flags&&this.flags.length>0&&(e+="&flags=".concat(this.flags.join(","))),this.status&&(e+="&status=".concat(this.status)),this.entityIds&&this.entityIds.length>0&&(e+="&entity_ids=".concat(this.entityIds.join(","))),this.pollIds&&this.pollIds.length>0&&(e+="&poll_ids=".concat(this.pollIds.join(","))),this.sortOrder&&(e+="&sort_order=".concat(this.sortOrder)),this.minVotes&&(e+="&min_votes=".concat(this.minVotes)),e},e}(s(n(4800)).default);e.default=a},1770:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.images=new r.default,this.status=null,this.totalVotes=null,this.flags=[],this.customFields=null,this.branding=null,this.embedCode=null,this.labels=null,this.adContent=null,this.context=null,this.options=[],this.createdAt=null,this.updatedAt=null}},1126:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rules=null,e}return r(e,t),e}(s(n(1770)).default);e.default=a},358:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.pollId=null,this.optionId=null,this.userId=null}},5390:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pollModel=null,e.optionModel=null,e}return r(e,t),e}(s(n(358)).default);e.default=a},1812:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},2160:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},6829:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8902)),o=s(n(6692)),u=s(n(2820)),l=s(n(7060)),c=s(n(1770)),d=s(n(1126)),h=s(n(358)),f=s(n(5390)),p=s(n(1812)),m=s(n(2160)),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapPolls=function(t){var n=new p.default;return n.meta.pagination=e.remapMetaPagination(t.meta.pagination),n.data=t.data.map((function(t){return e.remapPoll(t)})),n},e.remapPollById=function(t){var n=new d.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.flags=t.flags,n.totalVotes=t.total_votes,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.embedCode=t.embed_code,n.labels=t.labels,n.rules=t.rules,n.adContent=t.ad_content,n.options=t.options,n.context=t.context?e.remapContext(t.context):t.context,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapUserVote=function(t){var e=new h.default;return e.id=t.id,e.pollId=t.poll_id,e.optionId=t.option_id,e.userId=t.user_id,e},e.remapPollsVotes=function(t){var n=new m.default;return n.meta.pagination=e.remapMetaPagination(t.meta.pagination),n.data=t.data.map((function(t){return e.remapPollVote(t)})),n},e.remapPollVote=function(t){var e=new f.default;return e.id=t.id,e.pollId=t.poll_id,e.optionId=t.option_id,e.userId=t.user_id,e},e.remapMetaPagination=function(t){var e=new a.default;return e.itemsPerPage=t.items_per_page,e.nextPageStartsAfter=t.next_page_starts_after,e},e.remapPoll=function(t){var n=new c.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.flags=t.flags,n.totalVotes=t.total_votes,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.embedCode=t.embed_code,n.labels=t.labels,n.adContent=t.ad_content,n.options=t.options,n.context=t.context?e.remapContext(t.context):t.context,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapContext=function(t){var e=new u.default;return e.content=t.content,e.tags=t.tags?t.tags.map((function(t){var e=new l.default;return e.id=t.id,e.type=t.type,e.source=t.source,e})):null,e.campaign=t.campaign,e},e}return r(e,t),e}(o.default);e.default=v},4874:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(8900)),u=s(n(8261)),l=s(n(9685));e.default=function(t){var e=this;this.idMappingService=null,this.idSchema=null,this.errorHandlingMode=null,this.validator=null,this.activityService=null,this.finalizePollsFilters=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return this.idSchema!==a.IdSchemaEnum.NATIVE&&t.entityIds&&t.entityIds.length>0?(this.validator.validateFilters(t),[4,this.idMappingService.getEntityIdsBySchemaId(Array.from(t.entityIds),t.entityType,a.IdSchemaEnum.NATIVE)]):[3,2];case 1:e=n.sent(),t.entityIds=e[t.entityType],n.label=2;case 2:return[2]}}))}))},this.remapTags=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return this.idSchema!=a.IdSchemaEnum.NATIVE&&t.context&&t.context.tags&&t.context.tags.length?(e=JSON.parse(JSON.stringify(t.context.tags)),[4,this.activityService.remapTagsIds(e,n,s)]):[3,2];case 1:i=r.sent(),t.context.tags=i,r.label=2;case 2:return[2]}}))}))},this.idSchema=t.idSchema,this.errorHandlingMode=t.errorHandlingMode,this.idMappingService=new o.default(t),this.validator=new l.default(t),this.activityService=new u.default(t)}},3112:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7323));e.default=function(t){var e=this;this.facade=null,this.getPolls=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPolls(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPollById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPollById(t,n)];case 1:return[2,e.sent()]}}))}))},this.voteForPoll=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.voteForPoll(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteVoteForPoll=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.deleteVoteForPoll(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPollVote=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyPollVote(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyPollsVotes=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyPollsVotes(t)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},4806:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(4946),l=n(817),c=n(5409),d=o(n(5156));e.default=function(t,e,n){var o=this;this.idMapping=null,this.idSchema=null,this.native=u.IdSchemaEnum.NATIVE,this.footballFacade=null,this.remapProfileStats=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o,u;return s(this,(function(s){switch(s.label){case 0:return t.predictions?(e=t.successRates,n=t.predictions,i={competition:this.getIdsKeys(e.byFootballCompetition,n.single.breakdown.footballCompetitions),team:this.getIdsKeys(e.byFootballTeam,n.single.breakdown.footballTeams)},Object.values(i.competition).length?(r=JSON.parse(JSON.stringify(t.successRates.byFootballCompetition)),[4,this.getEntitiesMap(i.competition,l.EntityTypeEnum.COMPETITION)]):[3,3]):[2,t];case 1:return o=s.sent(),[4,this.setSuccessRatesModels(r,o)];case 2:u=s.sent(),t.successRates.byFootballCompetition=u,n.single.breakdown.footballCompetitions=this.reconstructBreakdown(n.single.breakdown.footballCompetitions,o),s.label=3;case 3:return Object.values(i.team).length?(a=JSON.parse(JSON.stringify(t.successRates.byFootballTeam)),[4,this.getEntitiesMap(i.team,l.EntityTypeEnum.TEAM)]):[3,6];case 4:return o=s.sent(),[4,this.setSuccessRatesModels(a,o)];case 5:u=s.sent(),t.successRates.byFootballTeam=u,n.single.breakdown.footballTeams=this.reconstructBreakdown(n.single.breakdown.footballTeams,o),s.label=6;case 6:return[2,t]}}))}))},this.setSuccessRatesModels=function(t,e){return r(o,void 0,void 0,(function(){return s(this,(function(n){return[2,this.reconstructRecords(t,void 0,e)]}))}))},this.getEntitiesMap=function(t,e){return r(o,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:switch(e){case"competition":return[3,1];case"team":return[3,3]}return[3,5];case 1:return[4,this.footballFacade.getCompetitionsMapWithNativeIds(t)];case 2:case 4:return[2,n.sent()];case 3:return[4,this.footballFacade.getTeamsMapWithNativeIds(t)];case 5:return[2]}}))}))},this.reconstructRecords=function(t,e,n){return t&&Object.keys(t).length?(Object.keys(t).forEach((function(r){var s,a=n.get(r);(e=i(i({},e),((s={})[a.id]=t[r],s)))[a.id].model=a})),e):t},this.reconstructBreakdown=function(t,e){return t.length?t.map((function(t){var n=e.get(t.entityId);return t.entityId=n.id,t.model=n,t})):t},this.getIdsKeys=function(t,e){var n=Object.keys(t);if(e.length){var i=e.map((function(t){return t.entityId}));return Array.from(new Set(a(a([],n,!0),i,!0)))}return n},this.remapInterestsToIdSchema=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o,u,l,d,h,f,p;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native?[3,3]:t&&t.length>0?(e={},n={},i=t.filter((function(t){return t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL})),r=t.filter((function(t){return t.source.toLocaleUpperCase()!==c.SportSourceEnum.FOOTBALL})),i.forEach((function(t){e.hasOwnProperty(t.type)||(e[t.type]=[],n[t.type]=[]),e[t.type].push(t.id),n[t.type].push(t)})),[4,this.remapIdsObj(e,this.native,this.idSchema)]):[3,2];case 1:for(a=s.sent(),o=[],u=function(t,e){e.forEach((function(e,n){e.id=a[t][n],o.push(e)}))},l=0,d=Object.entries(n);l<d.length;l++)h=d[l],f=h[0],p=h[1],u(f,p);return[2,o.concat(r)];case 2:case 3:return[2,t]}}))}))},this.remapInterestToNative=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native||t.source.toLocaleUpperCase()!==c.SportSourceEnum.FOOTBALL?[3,2]:(e={},n=t.id,i=t.type,e[i]=[n],[4,this.remapIdsObj(e,this.idSchema,this.native)]);case 1:return r=s.sent(),t.id=r[i][0],[2,t];case 2:return[2,t]}}))}))},this.inquiryCustomInterests=function(t,e){var n=[];return t&&t.length>0&&(n=t.filter((function(t){return t.source.toLocaleUpperCase()===c.SportSourceEnum.CUSTOM})),e)?n.map((function(t){var e=new d.default;return e.id=t.id,e.type=t.type,e.source=t.source,e.favourite=t.favourite,e})):n},this.remapInterests=function(t){return r(o,void 0,void 0,(function(){var e,n,i;return s(this,(function(r){switch(r.label){case 0:return(e=this.inquiryCustomInterests(t,!1))&&e.length>0?(n=t.filter((function(t){return t.source.toLocaleUpperCase()!==c.SportSourceEnum.CUSTOM})),[4,this.remapInterestsToIdSchema(n)]):[3,2];case 1:return i=r.sent(),e.forEach((function(t){return i.push(t)})),[2,i];case 2:return[4,this.remapInterestsToIdSchema(t)];case 3:return[2,r.sent()]}}))}))},this.showFullInterests=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o,u,d;return s(this,(function(s){switch(s.label){case 0:return e=[],t&&t.length>0?(n=this.inquiryCustomInterests(t,!0),e.push(n),i=t.filter((function(t){return t.source.toLocaleUpperCase()!==c.SportSourceEnum.CUSTOM})),[4,this.getInterestsEntitiesMap(i)]):[3,2];case 1:return r=s.sent(),a=r.competitionsMap,o=r.teamsMap,u=r.playersMap,d=i.map((function(t){var e=null;return t.source.toLocaleUpperCase()!==c.SportSourceEnum.FOOTBALL?(t.model=e,t):t.type===l.EntityTypeEnum.COMPETITION?((e=a.get(t.id))&&(t.id=e.id),t.model=e,t):t.type===l.EntityTypeEnum.TEAM?((e=o.get(t.id))&&(t.id=e.id),t.model=e,t):t.type===l.EntityTypeEnum.PLAYER?(u?(t.model=u[t.id],t.id=u[t.id].id):t.model=e,t):void 0})),e.push(d),[2,e.flat()];case 2:return[2,e]}}))}))},this.getInterestsEntitiesMap=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o;return s(this,(function(s){switch(s.label){case 0:return e=[],n=[],i=[],r=new Map,a=new Map,o=null,t.forEach((function(t){t.type===l.EntityTypeEnum.COMPETITION&&t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL?e.push(t.id):t.type===l.EntityTypeEnum.TEAM&&t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL?n.push(t.id):t.type===l.EntityTypeEnum.PLAYER&&t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL&&i.push(t.id)})),e.length?[4,this.footballFacade.getCompetitionsMapWithNativeIds(e)]:[3,2];case 1:r=s.sent(),s.label=2;case 2:return n.length?[4,this.footballFacade.getTeamsMapWithNativeIds(n)]:[3,4];case 3:a=s.sent(),s.label=4;case 4:return i.length?[4,this.footballFacade.getPlayersMapWithNativeIds(i)]:[3,6];case 5:o=s.sent(),s.label=6;case 6:return[2,{competitionsMap:r,teamsMap:a,playersMap:o}]}}))}))},this.remapIdsObj=function(t,e,n){return r(o,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this.idMapping.idMappingFacade.getEntitiesByIds(t,e,n)];case 1:return[2,i.sent()]}}))}))},this.idMapping=n,this.idSchema=t.idSchema,this.footballFacade=e}},4912:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900)),o=s(n(4806));e.default=function(t,e){var n=this;this.idMapping=null,this.profileOperations=null,this.remapProfileStats=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.remapProfileStats(t)];case 1:return[2,e.sent()]}}))}))},this.remapInterestToNative=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.remapInterestToNative(t)];case 1:return[2,e.sent()]}}))}))},this.remapInterests=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.remapInterests(t)];case 1:return[2,e.sent()]}}))}))},this.showFullInterests=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.showFullInterests(t)];case 1:return[2,e.sent()]}}))}))},this.idMapping=new a.default(t),this.profileOperations=new o.default(t,e,this.idMapping)}},3607:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FansUnitedSDK=void 0;var s=r(n(6409)),a=r(n(6595)),o=r(n(8808)),u=n(4946),l=r(n(1259)),c=r(n(2962)),d=n(9627),h=n(2671),f=n(9377),p=r(n(9596)),m=r(n(267)),v=r(n(7302)),_=n(2141),y=r(n(7070)),g=n(9580),b=r(n(1550)),w=r(n(244)),I=r(n(3281)),E=r(n(4068)),M=r(n(1267)),O=r(n(3112)),P=r(n(6139)),T=null,S=null;e.FansUnitedSDK=function(t){if(A(t)){var e=R(t);if(e.isValid)return T={profile:new s.default(t),football:new o.default(t),predictor:new l.default(t),loyalty:new c.default(t),topX:new p.default(t),matchQuiz:new m.default(t),activity:new v.default(t),miniGames:new b.default(t),discussions:new w.default(t),privateLeagues:new I.default(t),challenges:new E.default(t),progress:new M.default,voting:new O.default(t),fantasy:new P.default(t)},S=i({},t),T;C(e)}return T};var A=function(t){return!T||JSON.stringify(t)!==JSON.stringify(S)||t.authProvider.getIdToken()!==S.authProvider.getIdToken()},R=function(t){var e=(new a.default).validate(t);return e.idSchema.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.idSchema.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.idSchema.message.text),t.idSchema=u.IdSchemaEnum.NATIVE),e.environment.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.environment.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.environment.message.text),t.environment=h.EnvironmentEnum.PROD),e.lang.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.lang.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.lang.message.text),t.lang=f.LangEnum.EN),e.errorHandlingMode.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.errorHandlingMode.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.errorHandlingMode.message.text),t.errorHandlingMode=g.ErrorHandlingModeEnum.DEFAULT),e.authProvider.validation===d.ValidationResponseEnum.INVALID_VALUE&&console.warn(e.authProvider.message.text),e},C=function(t){var e="authProvider",n="isValid";Object.keys(t).forEach((function(i){var r=t[i];if(i!==n&&i!==e){if(r.message.type===_.LogEnum.ERROR)throw new Error(r.message.text)}else i!==n&&i===e&&Object.keys(new y.default).forEach((function(t){if(r[t].message.type===_.LogEnum.ERROR)throw new Error(r[t].message.text)}))}))}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(3607)})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FansUnitedSDK=e():t.FansUnitedSDK=e()}(self,(()=>(()=>{var t={6313:t=>{var e=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,i;try{e=Map}catch(t){e=function(){}}try{n=Set}catch(t){n=function(){}}try{i=Promise}catch(t){i=function(){}}function r(s,o,u,l,c){"object"==typeof o&&(u=o.depth,l=o.prototype,c=o.includeNonEnumerable,o=o.circular);var d=[],h=[],f="undefined"!=typeof Buffer;return void 0===o&&(o=!0),void 0===u&&(u=1/0),function s(u,p){if(null===u)return null;if(0===p)return u;var m,v;if("object"!=typeof u)return u;if(t(u,e))m=new e;else if(t(u,n))m=new n;else if(t(u,i))m=new i((function(t,e){u.then((function(e){t(s(e,p-1))}),(function(t){e(s(t,p-1))}))}));else if(r.__isArray(u))m=[];else if(r.__isRegExp(u))m=new RegExp(u.source,a(u)),u.lastIndex&&(m.lastIndex=u.lastIndex);else if(r.__isDate(u))m=new Date(u.getTime());else{if(f&&Buffer.isBuffer(u))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(m),m;t(u,Error)?m=Object.create(u):void 0===l?(v=Object.getPrototypeOf(u),m=Object.create(v)):(m=Object.create(l),v=l)}if(o){var _=d.indexOf(u);if(-1!=_)return h[_];d.push(u),h.push(m)}for(var y in t(u,e)&&u.forEach((function(t,e){var n=s(e,p-1),i=s(t,p-1);m.set(n,i)})),t(u,n)&&u.forEach((function(t){var e=s(t,p-1);m.add(e)})),u){var g;v&&(g=Object.getOwnPropertyDescriptor(v,y)),g&&null==g.set||(m[y]=s(u[y],p-1))}if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(u);for(y=0;y<b.length;y++){var w=b[y];(!(E=Object.getOwnPropertyDescriptor(u,w))||E.enumerable||c)&&(m[w]=s(u[w],p-1),E.enumerable||Object.defineProperty(m,w,{enumerable:!1}))}}if(c){var I=Object.getOwnPropertyNames(u);for(y=0;y<I.length;y++){var E,M=I[y];(E=Object.getOwnPropertyDescriptor(u,M))&&E.enumerable||(m[M]=s(u[M],p-1),Object.defineProperty(m,M,{enumerable:!1}))}}return m}(s,u)}function s(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return r.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},r.__objToStr=s,r.__isDate=function(t){return"object"==typeof t&&"[object Date]"===s(t)},r.__isArray=function(t){return"object"==typeof t&&"[object Array]"===s(t)},r.__isRegExp=function(t){return"object"==typeof t&&"[object RegExp]"===s(t)},r.__getRegExpFlags=a,r}();t.exports&&(t.exports=e)},7187:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,i){function r(n){t.removeListener(e,s),i(n)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}m(t,e,s,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&m(t,"error",e,{once:!0})}(t,r)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,n,i){var r,s,a,l;if(o(n),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),a=s[e]),void 0===a)a=s[e]=n,++t._eventsCount;else if("function"==typeof a?a=s[e]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=u(t))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,l=c,console&&console.warn&&console.warn(l)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=c.bind(i);return r.listener=n,i.wrapFn=r,r}function h(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(r):p(r,r.length)}function f(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function m(t,e,n,i){if("function"==typeof t.on)i.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(s){i.once&&t.removeEventListener(e,r),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=s[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var l=u.length,c=p(u,l);for(n=0;n<l;++n)i(c[n],this,e)}return!0},s.prototype.addListener=function(t,e){return l(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return l(this,t,e,!0)},s.prototype.once=function(t,e){return o(e),this.on(t,d(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return o(e),this.prependListener(t,d(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,i,r,s,a;if(o(e),void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){a=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,r),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var r,s=Object.keys(n);for(i=0;i<s.length;++i)"removeListener"!==(r=s[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return h(this,t,!0)},s.prototype.rawListeners=function(t){return h(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},6245:(t,e,n)=>{"use strict";function i(t){this.message=t}n.r(e),n.d(e,{InvalidTokenError:()=>a,default:()=>o}),i.prototype=new Error,i.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new i("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,a=0,o="";r=e.charAt(a++);~r&&(n=s%4?64*n+r:r,s++%4)?o+=String.fromCharCode(255&n>>(-2*s&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function s(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(r(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return r(e)}}function a(t){this.message=t}a.prototype=new Error,a.prototype.name="InvalidTokenError";const o=function(t,e){if("string"!=typeof t)throw new a("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(s(t.split(".")[n]))}catch(t){throw new a("Invalid token specified: "+t.message)}}},321:function(t,e,n){(function(){(t.exports=n(5282)).version="5.1.2"}).call(this)},5282:function(t,e,n){(function(){var e,i,r=[].splice,s=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},a=[].indexOf;i=n(6313),e=n(7187).EventEmitter,t.exports=function(){class t extends e{constructor(t={}){super(),this.get=this.get.bind(this),this.mget=this.mget.bind(this),this.set=this.set.bind(this),this.mset=this.mset.bind(this),this.del=this.del.bind(this),this.take=this.take.bind(this),this.ttl=this.ttl.bind(this),this.getTtl=this.getTtl.bind(this),this.keys=this.keys.bind(this),this.has=this.has.bind(this),this.getStats=this.getStats.bind(this),this.flushAll=this.flushAll.bind(this),this.flushStats=this.flushStats.bind(this),this.close=this.close.bind(this),this._checkData=this._checkData.bind(this),this._check=this._check.bind(this),this._isInvalidKey=this._isInvalidKey.bind(this),this._wrap=this._wrap.bind(this),this._getValLength=this._getValLength.bind(this),this._error=this._error.bind(this),this._initErrors=this._initErrors.bind(this),this.options=t,this._initErrors(),this.data={},this.options=Object.assign({forceString:!1,objectValueSize:80,promiseValueSize:80,arrayValueSize:40,stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,enableLegacyCallbacks:!1,maxKeys:-1},this.options),this.options.enableLegacyCallbacks&&(console.warn("WARNING! node-cache legacy callback support will drop in v6.x"),["get","mget","set","del","ttl","getTtl","keys","has"].forEach((t=>{var e;e=this[t],this[t]=function(...t){var n,i;if(i=t,[...t]=i,[n]=r.call(t,-1),"function"!=typeof n)return e(...t,n);try{n(null,e(...t))}catch(t){n(t)}}}))),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.validKeyTypes=["string","number"],this._checkData()}get(e){var n;if(s(this,t),null!=(n=this._isInvalidKey(e)))throw n;return null!=this.data[e]&&this._check(e,this.data[e])?(this.stats.hits++,this._unwrap(this.data[e])):void this.stats.misses++}mget(e){var n,i,r,a,o;if(s(this,t),!Array.isArray(e))throw this._error("EKEYSTYPE");for(o={},i=0,a=e.length;i<a;i++){if(r=e[i],null!=(n=this._isInvalidKey(r)))throw n;null!=this.data[r]&&this._check(r,this.data[r])?(this.stats.hits++,o[r]=this._unwrap(this.data[r])):this.stats.misses++}return o}set(e,n,i){var r,a;if(s(this,t),this.options.maxKeys>-1&&this.stats.keys>=this.options.maxKeys)throw this._error("ECACHEFULL");if(this.options.forceString,null==i&&(i=this.options.stdTTL),null!=(r=this._isInvalidKey(e)))throw r;return a=!1,this.data[e]&&(a=!0,this.stats.vsize-=this._getValLength(this._unwrap(this.data[e],!1))),this.data[e]=this._wrap(n,i),this.stats.vsize+=this._getValLength(n),a||(this.stats.ksize+=this._getKeyLength(e),this.stats.keys++),this.emit("set",e,n),!0}mset(e){var n,i,r,a,o,u,l,c,d;if(s(this,t),this.options.maxKeys>-1&&this.stats.keys+e.length>=this.options.maxKeys)throw this._error("ECACHEFULL");for(i=0,u=e.length;i<u;i++){if(o=e[i],({key:a,val:d,ttl:c}=o),c&&"number"!=typeof c)throw this._error("ETTLTYPE");if(null!=(n=this._isInvalidKey(a)))throw n}for(r=0,l=e.length;r<l;r++)o=e[r],({key:a,val:d,ttl:c}=o),this.set(a,d,c);return!0}del(e){var n,i,r,a,o,u;for(s(this,t),Array.isArray(e)||(e=[e]),n=0,r=0,o=e.length;r<o;r++){if(a=e[r],null!=(i=this._isInvalidKey(a)))throw i;null!=this.data[a]&&(this.stats.vsize-=this._getValLength(this._unwrap(this.data[a],!1)),this.stats.ksize-=this._getKeyLength(a),this.stats.keys--,n++,u=this.data[a],delete this.data[a],this.emit("del",a,u.v))}return n}take(e){var n;return s(this,t),null!=(n=this.get(e))&&this.del(e),n}ttl(e,n){var i;if(s(this,t),n||(n=this.options.stdTTL),!e)return!1;if(null!=(i=this._isInvalidKey(e)))throw i;return!(null==this.data[e]||!this._check(e,this.data[e])||(n>=0?this.data[e]=this._wrap(this.data[e].v,n,!1):this.del(e),0))}getTtl(e){var n;if(s(this,t),e){if(null!=(n=this._isInvalidKey(e)))throw n;return null!=this.data[e]&&this._check(e,this.data[e])?this.data[e].t:void 0}}keys(){return s(this,t),Object.keys(this.data)}has(e){return s(this,t),null!=this.data[e]&&this._check(e,this.data[e])}getStats(){return s(this,t),this.stats}flushAll(e=!0){s(this,t),this.data={},this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this._killCheckPeriod(),this._checkData(e),this.emit("flush")}flushStats(){s(this,t),this.stats={hits:0,misses:0,keys:0,ksize:0,vsize:0},this.emit("flush_stats")}close(){s(this,t),this._killCheckPeriod()}_checkData(e=!0){var n,i,r;for(n in s(this,t),i=this.data)r=i[n],this._check(n,r);e&&this.options.checkperiod>0&&(this.checkTimeout=setTimeout(this._checkData,1e3*this.options.checkperiod,e),null!=this.checkTimeout&&null!=this.checkTimeout.unref&&this.checkTimeout.unref())}_killCheckPeriod(){if(null!=this.checkTimeout)return clearTimeout(this.checkTimeout)}_check(e,n){var i;return s(this,t),i=!0,0!==n.t&&n.t<Date.now()&&(this.options.deleteOnExpire&&(i=!1,this.del(e)),this.emit("expired",e,this._unwrap(n))),i}_isInvalidKey(e){var n;if(s(this,t),n=typeof e,a.call(this.validKeyTypes,n)<0)return this._error("EKEYTYPE",{type:typeof e})}_wrap(e,n,r=!0){var a;return s(this,t),this.options.useClones||(r=!1),a=Date.now(),{t:0===n?0:n?a+1e3*n:0===this.options.stdTTL?this.options.stdTTL:a+1e3*this.options.stdTTL,v:r?i(e):e}}_unwrap(t,e=!0){return this.options.useClones||(e=!1),null!=t.v?e?i(t.v):t.v:null}_getKeyLength(t){return t.toString().length}_getValLength(e){return s(this,t),"string"==typeof e?e.length:this.options.forceString?JSON.stringify(e).length:Array.isArray(e)?this.options.arrayValueSize*e.length:"number"==typeof e?8:"function"==typeof(null!=e?e.then:void 0)?this.options.promiseValueSize:("undefined"!=typeof Buffer&&null!==Buffer?Buffer.isBuffer(e):void 0)?e.length:null!=e&&"object"==typeof e?this.options.objectValueSize*Object.keys(e).length:"boolean"==typeof e?8:0}_error(e,n={}){var i;return s(this,t),(i=new Error).name=e,i.errorcode=e,i.message=null!=this.ERRORS[e]?this.ERRORS[e](n):"-",i.data=n,i}_initErrors(){var e,n,i;for(n in s(this,t),this.ERRORS={},i=this._ERRORS)e=i[n],this.ERRORS[n]=this.createErrorMessage(e)}createErrorMessage(t){return function(e){return t.replace("__key",e.type)}}}return t.prototype._ERRORS={ENOTFOUND:"Key `__key` not found",ECACHEFULL:"Cache max keys amount exceeded",EKEYTYPE:"The key argument has to be of type `string` or `number`. Found: `__key`",EKEYSTYPE:"The keys argument has to be an array.",ETTLTYPE:"The ttl argument has to be a number."},t}.call(this)}).call(this)},6595:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(682),s=n(2141),a=i(n(4241)),o=i(n(6391)),u=i(n(1512)),l=i(n(4392)),c=i(n(320)),d=i(n(7631)),h=i(n(6965)),f=i(n(9158));e.default=function(){var t=this;this.validate=function(e){var n=t.checkFieldsForValues(e);return n.isValid=t.containsErrorMessage(n),n},this.checkFieldsForValues=function(t){for(var e=new d.default,n={apiKey:new u.default,environment:new o.default,idSchema:new l.default,clientId:new h.default,lang:new a.default,errorHandlingMode:new f.default,authProvider:new c.default},i=0,r=Object.entries(e);i<r.length;i++){var s=r[i],p=s[0];s[1],"isValid"!==p&&n[p].validate(t)}return Object.keys(n).forEach((function(i){e[i]=n[i].validate(t)})),e},this.containsErrorMessage=function(t){for(var e=!0,n=0,i=Object.entries(t);n<i.length;n++){var a=i[n],o=a[0],u=a[1];if(o!==r.ConfigFieldEnum.authProvider){if("isValid"!==o&&u.message.type===s.LogEnum.ERROR)return!1;if("isValid"!==o&&u.message.type===s.LogEnum.WARNING)return!0}else if(u.message.type===s.LogEnum.ERROR)return!1}return e}}},682:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigFieldEnum=void 0,(n=e.ConfigFieldEnum||(e.ConfigFieldEnum={})).apiKey="apiKey",n.environment="environment",n.idSchema="idSchema",n.clientId="clientId",n.lang="lang",n.authProvider="authProvider"},2671:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.EnvironmentEnum=void 0,(n=e.EnvironmentEnum||(e.EnvironmentEnum={})).DEV="dev",n.PROD="prod",n.STAGING="staging",n.WATG="watg"},9580:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorHandlingModeEnum=void 0,(n=e.ErrorHandlingModeEnum||(e.ErrorHandlingModeEnum={})).DEFAULT="default",n.STANDARD="standard"},4946:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.IdSchemaEnum=void 0,(n=e.IdSchemaEnum||(e.IdSchemaEnum={})).NATIVE="native",n.ENETPULSE="enetpulse",n.SPORTRADAR="sportradar",n.SPORTAL_365="sportal365",n.API_FOOTBALL="api_football"},9377:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LangEnum=void 0,(n=e.LangEnum||(e.LangEnum={})).EN="en",n.BG="bg",n.RO="ro",n.EL="el",n.SK="sk",n.PT="pt",n.SR="sr",n.HU="hu",n.SV="sv",n.ES="es",n.FR="fr",n.NL="nl",n.DE="de",n.IT="it"},2141:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LogEnum=void 0,(n=e.LogEnum||(e.LogEnum={})).ERROR="error",n.WARNING="warning"},9028:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationMessageEnum=void 0,(n=e.ValidationMessageEnum||(e.ValidationMessageEnum={})).API_KEY="The field apiKey with valid value must be provided to use Fans United JS SDK",n.CLIENT_ID="The field clientId must be provided to use Fans United JS SDK",n.LANG_MISSING="If no lang is passed the default one will be set which is: en",n.LANG_INVALID="This lang value is not supported, the default one will be set which is: en",n.ID_SCHEMA_MISSING="If no idSchema is passed the default one will be set which is: native",n.ID_SCHEMA_INVALID="This idSchema value is not supported, the default one will be set which is: native",n.ENVIRONMENT_MISSING="If no environment is passed the default one will be set which is: prod",n.ENVIRONMENT_INVALID="This environment value is not supported, the default one will be set which is: prod",n.ERROR_HANDLING_MODE_MISSING="If no errorHandlingMode is passed the default one will be set which is: default",n.ERROR_HANDLING_MODE_INVALID="This errorHandlingMode value is not supported, the default one will be set which is: default",n.AUTH_PROVIDER_CONFIG_PROP_MISSING="The following property is missing from the authProvider object:",n.AUTH_PROVIDER_CONFIG_INVALID_PROP="You have passed a property which is not supported for the authentication provider:",n.AUTH_PROVIDER_CONFIG_MISSING="The field authProvider must be provided to use this SDK",n.AUTH_PROVIDER_CONFIG_MISSING_CONFIG="The field authProvider has missing properties"},9627:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationResponseEnum=void 0,(n=e.ValidationResponseEnum||(e.ValidationResponseEnum={})).MISSING_VALUE="missing",n.INVALID_VALUE="invalid",n.VALID_VALUE="valid"},7070:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.getIdToken=null,this.logout=null}},2379:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3220));e.default=function(){this.validation=null,this.message=new r.default,this.getIdToken={validation:null,message:new r.default},this.logout={validation:null,message:new r.default}}},7631:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3074));e.default=function(){this.apiKey=null,this.environment=null,this.idSchema=null,this.clientId=null,this.lang=null,this.errorHandlingMode=null,this.authProvider={getIdToken:new r.default,logout:new r.default},this.isValid=!1}},3220:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.text=null,this.type=null}},3074:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},1512:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=function(){function t(){this.validateField=function(t){return null!=t&&t.length>0?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.ERROR;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.API_KEY),t===i.ValidationResponseEnum.VALID_VALUE&&(n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.apiKey);return{validation:e,message:this.generateMessage(e)}},t}();e.default=a},320:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(9627),s=n(9028),a=n(2141),o=i(n(7070)),u=i(n(2379)),l=function(){function t(){this.validateAuthProvider=function(t){var e=Object.keys(new o.default),n=new u.default;if(t){var i=Object.keys(t).filter((function(t){return!e.includes(t)}));i.length>0?(n.validation=r.ValidationResponseEnum.INVALID_VALUE,n.message.type=a.LogEnum.WARNING,n.message.text="".concat(s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_INVALID_PROP," ").concat(i.join(","))):n.validation=r.ValidationResponseEnum.VALID_VALUE}else n.validation=r.ValidationResponseEnum.MISSING_VALUE,n.message.type=a.LogEnum.ERROR,n.message.text=s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING;return n},this.validateAuthProviderConfigFields=function(t,e){return Object.keys(new o.default).forEach((function(n){t[n]?e[n].validation=r.ValidationResponseEnum.VALID_VALUE:e[n].validation=r.ValidationResponseEnum.MISSING_VALUE})),e},this.generateAuthProviderConfigMessages=function(t){return Object.keys(t).filter((function(t){return"validation"!==t&&"message"!==t})).forEach((function(e){var n=t[e];n.validation===r.ValidationResponseEnum.MISSING_VALUE&&(n.message.text="".concat(s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_PROP_MISSING," ").concat(e),n.message.type=a.LogEnum.ERROR)})),t},this.checkAuthProviderConfigMessagesForErrors=function(t){return Object.keys(t).filter((function(t){return"validation"!==t&&"message"!==t})).forEach((function(e){t[e].validation===r.ValidationResponseEnum.MISSING_VALUE&&t.validation===r.ValidationResponseEnum.VALID_VALUE&&(t.validation=r.ValidationResponseEnum.INVALID_VALUE,t.message.type=a.LogEnum.ERROR,t.message.text=s.ValidationMessageEnum.AUTH_PROVIDER_CONFIG_MISSING_CONFIG)})),t}}return t.prototype.validate=function(t){var e=this.validateAuthProvider(t.authProvider);return e.validation!==r.ValidationResponseEnum.MISSING_VALUE&&(e=this.validateAuthProviderConfigFields(t.authProvider,e),e=this.generateAuthProviderConfigMessages(e),e=this.checkAuthProviderConfigMessagesForErrors(e)),e},t}();e.default=l},6965:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=function(){function t(){this.validateField=function(t){return null!=t&&t.length>0?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.ERROR;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.CLIENT_ID),t===i.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.clientId);return{validation:e,message:this.generateMessage(e)}},t}();e.default=a},6391:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=n(2671),o=function(){function t(){this.validateField=function(t){var e=[a.EnvironmentEnum.DEV,a.EnvironmentEnum.STAGING,a.EnvironmentEnum.PROD,a.EnvironmentEnum.WATG];return null!=t&&t.length>0?e.includes(t)?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.INVALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.WARNING;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.ENVIRONMENT_MISSING),t===i.ValidationResponseEnum.INVALID_VALUE&&(e=r.ValidationMessageEnum.ENVIRONMENT_INVALID),t===i.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.environment);return{validation:e,message:this.generateMessage(e)}},t}();e.default=o},9158:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9580),r=n(2141),s=n(9028),a=n(9627);e.default=function(){var t=this;this.validate=function(e){var n=t.validateField(e.errorHandlingMode);return{validation:n,message:t.generateMessage(n)}},this.validateField=function(t){var e=[i.ErrorHandlingModeEnum.DEFAULT,i.ErrorHandlingModeEnum.STANDARD];return t?e.includes(t)?a.ValidationResponseEnum.VALID_VALUE:a.ValidationResponseEnum.INVALID_VALUE:a.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=r.LogEnum.WARNING;return t===a.ValidationResponseEnum.MISSING_VALUE&&(e=s.ValidationMessageEnum.ERROR_HANDLING_MODE_MISSING),t===a.ValidationResponseEnum.INVALID_VALUE&&(e=s.ValidationMessageEnum.ERROR_HANDLING_MODE_INVALID),t===a.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}},4392:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9627),r=n(9028),s=n(2141),a=n(4946),o=function(){function t(){this.validateField=function(t){var e=Object.values(a.IdSchemaEnum);return null!=t&&t.length>0?e.includes(t)?i.ValidationResponseEnum.VALID_VALUE:i.ValidationResponseEnum.INVALID_VALUE:i.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=s.LogEnum.WARNING;return t===i.ValidationResponseEnum.MISSING_VALUE&&(e=r.ValidationMessageEnum.ID_SCHEMA_MISSING),t===i.ValidationResponseEnum.INVALID_VALUE&&(e=r.ValidationMessageEnum.ID_SCHEMA_INVALID),t===i.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}return t.prototype.validate=function(t){var e=this.validateField(t.idSchema);return{validation:e,message:this.generateMessage(e)}},t}();e.default=o},4241:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9377),r=n(9627),s=n(9028),a=n(2141);e.default=function(){var t=this;this.validate=function(e){var n=t.validateField(e.lang);return{validation:n,message:t.generateMessage(n)}},this.validateField=function(t){var e=Object.values(i.LangEnum);return null!=t&&t.length>0?e.includes(t)?r.ValidationResponseEnum.VALID_VALUE:r.ValidationResponseEnum.INVALID_VALUE:r.ValidationResponseEnum.MISSING_VALUE},this.generateMessage=function(t){var e=null,n=a.LogEnum.WARNING;return t===r.ValidationResponseEnum.MISSING_VALUE&&(e=s.ValidationMessageEnum.LANG_MISSING),t===r.ValidationResponseEnum.INVALID_VALUE&&(e=s.ValidationMessageEnum.LANG_INVALID),t===r.ValidationResponseEnum.VALID_VALUE&&(e=null,n=null),{text:e,type:n}}}},4021:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorCodes=void 0,(n=e.ErrorCodes||(e.ErrorCodes={}))[n.BAD_METHOD_CALL=400]="BAD_METHOD_CALL",n[n.UNAUTHORIZED=401]="UNAUTHORIZED",n[n.NOT_FOUND=404]="NOT_FOUND"},4904:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorStatuses=void 0,(n=e.ErrorStatuses||(e.ErrorStatuses={})).INVALID_TEMPLATE="INVALID_TEMPLATE",n.INVALID_PREDICTION="INVALID_PREDICTION",n.INVALID_MARKET="INVALID_MARKET",n.INVALID_FIELD="INVALID_FIELD",n.INVALID_TYPE="INVALID_TYPE",n.EXCEEDED_LENGTH="EXCEEDED_LENGTH",n.INVALID_TOKEN="invalid_token",n.UNAUTHORIZED="unauthorized",n.INVALID_FILTERS="invalid_filters",n.INVALID_AVATAR="invalid_avatar",n.INVALID_METHOD_CALL="invalid_method_call",n.INVALID_LIMIT="invalid_limit",n.INVALID_TEMPLATE_GROUP_ID="invalid_template_group_id",n.INVALID_TEMPLATE_GROUP_FILTERS="invalid_template_group_filters",n.INVALID_PAGE_NUMBER="invalid_page_number",n.INVALID_DISCUSSION_IDS="invalid_discussion_ids",n.ID_MAPPING_NOT_FOUND="id_mapping_not_found"},8097:function(t,e){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,i){var r=t.call(this)||this;return r.code=0,r.status=null,r.message=null,r.errorMessage=function(){return r.message},r.code=e,r.status=n,r.message=i,r}return i(e,t),e}(Error);e.default=r},8712:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e){var n=this;this.data={error:{code:0,status:"",message:""}},this.status=0,this.statusText="",this.headers=null,this.errorMessage=function(){return n.data.error.message},this.data.error.code=e.code,this.data.error.status=e.status,this.data.error.message=e.message,this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}},2535:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,n){this.error={code:0,status:"",message:""},this.error.code=t,this.error.status=e,this.error.message=n}},1260:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.marketToKeySummaryMap=e.validFixtureFields=e.documentationLinks=e.ID_TYPES=void 0,e.ID_TYPES={native:"id",sportradar:"sportradar_id",sportal365:"sportal365_id",enetpulse:"enetpulse_id",api_football:"api_football_id"},e.documentationLinks={PREDICTOR_USER_RELATED_OPERATION:"https://docs.fansunitedmedia.com/docs/predictor-operations#user-related-operations"},e.validFixtureFields=["matchId","matchType","market","prediction"],e.marketToKeySummaryMap=(new Map).set("FT_1X2","fullTimeOneXTwo").set("HT_1X2","halfTimeOneXTwo").set("BOTH_TEAMS_SCORE","bothTeamsScore").set("DOUBLE_CHANCE","doubleChance").set("HT_FT","halfTimeFullTime").set("PLAYER_SCORE","playerScore").set("PLAYER_YELLOW_CARD","playerYellowCard").set("PLAYER_RED_CARD","playerRedCard").set("RED_CARD_MATCH","redCardMatch").set("PENALTY_MATCH","penaltyMatch").set("PLAYER_SCORE_FIRST_GOAL","playerScoreFirstGoal").set("CORNERS_MATCH","cornersMatch").set("CORRECT_SCORE","correctScore").set("CORRECT_SCORE_ADVANCED","correctScoreAdvanced").set("CORRECT_SCORE_HT","correctScoreHalfTime").set("PLAYER_SCORE_HATTRICK","playerScoreHattrick").set("PLAYER_SCORE_TWICE","playerScoreTwice").set("OVER_GOALS_0_5","overZeroPointFiveGoals").set("OVER_GOALS_1_5","overOnePointFiveGoals").set("OVER_GOALS_2_5","overTwoPointFiveGoals").set("OVER_GOALS_3_5","overThreePointFiveGoals").set("OVER_GOALS_4_5","overFourPointFiveGoals").set("OVER_GOALS_5_5","overFivePointFiveGoals").set("OVER_GOALS_6_5","overSixPointFiveGoals").set("OVER_CORNERS_6_5","overSixPointFiveCorners").set("OVER_CORNERS_7_5","overSevenPointFiveCorners").set("OVER_CORNERS_8_5","overEightPointFiveCorners").set("OVER_CORNERS_9_5","overNinePointFiveCorners").set("OVER_CORNERS_10_5","overTenPointFiveCorners").set("OVER_CORNERS_11_5","overElevenPointFiveCorners").set("OVER_CORNERS_12_5","overTwelvePointFiveCorners").set("OVER_CORNERS_13_5","overThirteenPointFiveCorners")},817:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.EntityTypeEnum=void 0,(n=e.EntityTypeEnum||(e.EntityTypeEnum={})).COMPETITION="competition",n.TEAM="team",n.PLAYER="player"},5409:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SportSourceEnum=void 0,(n=e.SportSourceEnum||(e.SportSourceEnum={})).FOOTBALL="FOOTBALL",n.CUSTOM="CUSTOM"},8358:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5601)),s=i(n(9018));e.default=function(){this.createLocalCacheInstance=function(t){return"undefined"==typeof window?s.default.getInstance(t):r.default.getInstance(t)}}},712:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.constructStringArrayWithProvidedLength=e.sortArrayInAscOrder=e.initDisableCache=e.isDisabledCache=e.transformIdsToBeUnique=e.setBaseUrl=e.limitIds=e.requestChunkBuild=void 0;var i=n(2671);e.requestChunkBuild=function(t){var e=[],n=0;return e[n]=[],t.forEach((function(t){e[n].length<=199?e[n].push(t):(n++,e[n]=[t])})),e},e.limitIds=function(t,e){for(var n=[];t.length>e;){var i=t.splice(0,e);n.push(i)}return n.push(t),n},e.setBaseUrl=function(t,e){return t===i.EnvironmentEnum.PROD?{profile:"https://profile.fansunitedapi.com/v1",football:"https://football.fansunitedapi.com/v1",idMapping:"https://id-mapping.fansunitedapi.com/v1",predictor:"https://prediction.fansunitedapi.com/v1",client:"https://client.fansunitedapi.com/v1",loyalty:"https://loyalty.fansunitedapi.com/v1",miniGames:"https://mini-games.fansunitedapi.com/v1",discussions:"https://discussions.fansunitedapi.com/v1",privateLeagues:"https://private-leagues.fansunitedapi.com/v1",voting:"https://voting.fansunitedapi.com/v1"}[e]:t===i.EnvironmentEnum.DEV?{profile:"http://localhost:8010/v1",football:"http://localhost:8080/v1",idMapping:"http://localhost:8030/v1",predictor:"http://localhost:8040/v1",client:"http://localhost:8070/v1",loyalty:"http://localhost:8060/v1",miniGames:"http://localhost:9040/v1",discussions:"http://localhost:9020/v1",privateLeagues:"http://localhost:9010/v1",voting:"http://localhost:9030/v1"}[e]:t===i.EnvironmentEnum.WATG?{profile:"https://profile.watg.fansunitedapi.com/v1",football:"https://football.watg.fansunitedapi.com/v1",idMapping:"https://id-mapping.watg.fansunitedapi.com/v1",predictor:"https://prediction.watg.fansunitedapi.com/v1",client:"https://client.watg.fansunitedapi.com/v1",loyalty:"https://loyalty.watg.fansunitedapi.com/v1",miniGames:"https://mini-games.watg.fansunitedapi.com/v1",discussions:"https://discussions.watg.fansunitedapi.com/v1",privateLeagues:"https://private-leagues.watg.fansunitedapi.com/v1",voting:"https://voting.watg.fansunitedapi.com/v1"}[e]:{profile:"https://profile.fansunitedstagingapi.com/v1",football:"https://football.fansunitedstagingapi.com/v1",idMapping:"https://id-mapping.fansunitedstagingapi.com/v1",predictor:"https://prediction.fansunitedstagingapi.com/v1",client:"https://client.fansunitedstagingapi.com/v1",loyalty:"https://loyalty.fansunitedstagingapi.com/v1",miniGames:"https://mini-games.fansunitedstagingapi.com/v1",discussions:"https://discussions.fansunitedstagingapi.com/v1",privateLeagues:"https://private-leagues.fansunitedstagingapi.com/v1",voting:"https://voting.fansunitedstagingapi.com/v1"}[e]},e.transformIdsToBeUnique=function(t){return Array.from(new Set(t))},e.isDisabledCache=function(t){return t||!1},e.initDisableCache=function(){return"&disable_cache=".concat(Date.now())},e.sortArrayInAscOrder=function(t){return JSON.parse(JSON.stringify(t.sort((function(t,e){return t.localeCompare(e)}))))},e.constructStringArrayWithProvidedLength=function(t,e){for(var n=[],i=0;i<e;i++)n[i]=t;return n}},5601:function(t,e,n){"use strict";var i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1260),s="FansUnited",a={football:{ids:[],countries:[],competitions:[],expirations:{ids:0}},profile:{info:{},statistics:{},badges:null,countries:[],expirations:{profile:0,statistics:0,badges:0}},client:{features:{},expirations:{features:0}}},o=function(){function t(t){var e=this;this.idSchema="",this.expirationProfileTimeout=600,this.expirationBadgesTimeout=3600,this.expirationClientFeaturesTimeout=14400,this.expirationFootballIdsTimeout=604800,this.clearData=function(){e.setData(a)},this.getEntityById=function(t,n){return void 0===t&&(t=""),void 0===n&&(n=""),e.getData().football.ids.find((function(i){var s=r.ID_TYPES[e.idSchema];return i&&"".concat(i[s])===n&&i.resource===t}))},this.getEntity=function(t,n,i){return Array.isArray(t)?e.getData().football.ids.filter((function(e){var s=r.ID_TYPES[i];return e&&t.includes("".concat(e[s]))&&e.resource===n})):e.getData().football.ids.find((function(e){var s=r.ID_TYPES[i];return e&&"".concat(e[s])===t&&e.resource===n}))},this.getEntityByNativeId=function(t,n){return void 0===t&&(t=""),void 0===n&&(n=""),e.getData().football.ids.find((function(e){return e&&"".concat(e.id)===n&&e.resource===t}))},this.checkForExistingIdObjs=function(t,n){var i=r.ID_TYPES[n],s={};return Object.keys(t).forEach((function(r){var a=t[r],o=e.getEntity(a,r,n).map((function(t){return t[i]})),u=t[r].filter((function(t){return!o.includes(t)}));s[r]=a.map((function(t){return u.includes(t)?{id:t,exists:!1}:{id:t,exists:!0}}))})),s},this.getIdsByType=function(t,n,i){var s=r.ID_TYPES[i],a=r.ID_TYPES[n],o={};return Object.keys(t).forEach((function(n){var i=t[n],r=[];e.getData().football.ids.forEach((function(t){i.forEach((function(e,i){e===t[a]&&n===t.resource&&(r[i]=t[s])}))})),o[n]=r})),o},this.addIdMapping=function(t){var n=e.getData();n.football.ids.push(t),e.setData(n)},this.addIdMappings=function(t){var n=e.getData(),r=n.football.ids;r=i(i([],r,!0),t,!0),n.football.ids=r,e.setData(n)},this.addTopIdMappings=function(t){var n=e.getData();if(n.football.ids.length){var r=JSON.parse(JSON.stringify(n.football.ids));r=r.filter((function(t){return"match"!==t.resource})),t=t.filter((function(t){return"match"===t.resource})),r=i(i([],r,!0),t,!0),n.football.ids=r}else n.football.ids=t;n.football.expirations.ids=Math.floor(Date.now()/1e3)+e.expirationFootballIdsTimeout,e.setData(n)},this.setOwnProfile=function(t){var n=e.getData();n.profile.info=t,n.profile.expirations.profile=Math.floor(Date.now()/1e3)+e.expirationProfileTimeout,e.setData(n)},this.getOwnProfile=function(){return e.getData().profile.info},this.getProfileCountries=function(){return e.getData().profile.countries},this.setProfileCountries=function(t){var n=e.getData();n.profile.countries=t,e.setData(n)},this.getProfileStats=function(){return e.getData().profile.statistics},this.setProfileStats=function(t){var n=e.getData();n.profile.statistics=t,n.profile.expirations.statistics=Math.floor(Date.now()/1e3)+e.expirationProfileTimeout,e.setData(n)},this.getProfileBadges=function(){return e.getData().profile.badges},this.setProfileBadges=function(t){var n=e.getData();n.profile.badges=t,n.profile.expirations.badges=Math.floor(Date.now()/1e3)+e.expirationBadgesTimeout,e.setData(n)},this.getFootballCountries=function(){return e.getData().football.countries},this.setFootballCountries=function(t){var n=e.getData();n.football.countries=t,e.setData(n)},this.getCompetitions=function(t){var n=e.getData();return t?t.competitionSearchFilter(n.football.competitions):n.football.competitions},this.setCompetitions=function(t){var n=e.getData(),r=i([],n.football.competitions,!0);r.push.apply(r,t),n.football.competitions=e.makeCompetitionsUnique(r),e.setData(n)},this.getCompetitionsLength=function(){return e.getData().football.competitions.length},this.getClientFeatures=function(){return e.getData().client.features},this.setClientFeatures=function(t){var n=e.getData(),i=JSON.parse(JSON.stringify(t));n.client.expirations.features=Math.floor(Date.now()/1e3)+e.expirationClientFeaturesTimeout,n.client.features=i,e.setData(n)},this.deleteClientFeatures=function(){var t=e.getData(),n=JSON.parse(JSON.stringify(t));n.client={features:{},expirations:{features:0}},e.setData(n)},this.getExpiration=function(t,n){e.initialNewSchema(t,"expirations");var i=e.getData();switch(n){case"profile":return i.profile.expirations.profile;case"statistics":return i.profile.expirations.statistics;case"badges":return i.profile.expirations.badges;case"features":return i.client.expirations.features;case"ids":return i.football.expirations.ids}},this.makeCompetitionsUnique=function(t){var e=new Set;return t.filter((function(t){var n=!e.has(t.id);return e.add(t.id),n}))},this.getData=function(){return localStorage.getItem(s)||e.setData(a),JSON.parse(localStorage.getItem(s))},this.setData=function(t){localStorage.setItem(s,JSON.stringify(t))},this.initialNewSchema=function(t,n){var i=e.getData();i&&i[t]&&i[t][n]||e.setData(a)},this.idSchema=t}return t.getInstance=function(e){return t.instance||(t.instance=new t(e)),t.instance},t}();e.default=o},5318:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.invalidTypeMessage=e.missingFieldsMessage=e.invalidFieldMessage=e.invalidMarketTopXMessage=e.invalidMarketMessage=e.invalidPredictionMessage=e.WarningMessages=e.ErrorMessages=void 0;var i,r=n(1260);(i=e.ErrorMessages||(e.ErrorMessages={})).INVALID_MATCH_ID="Match id is invalid!",i.INVALID_PLAYER_ID="Player id is invalid!",i.QUERY_PARAM_MATCH_IDS_EXCEEDED="Maximum matchIds in PredictionFilters should be 10 or less.",i.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED="Maximum limit for filtering games is 50 or less.",i.INVALID_PREDICTION_FIELD="Prediction field is invalid. For more information please visit our documentation",i.INVALID_TOKEN="Invalid JWT token is provided",i.EXPIRED_TOKEN="The provided JWT token is expired",i.ENTITIES_NEEDED="At least one of footballCompetitions, footballTeams or footballPlayers properties should be provided for filters.",i.ENTITIES_FOLLOWS_FILTERS_EXCEEDED="Maximum length per entity should be 24 or less.",i.INVALID_TYPE="You have provided invalid type. The valid type is ",i.INVALID_VALUE="You have provided invalid value. The valid value is ",i.INVALID_AVATAR="Invalid URL syntax for avatar image.",i.INVALID_GET_PROFILES_METHOD_CALL="The method 'getByIds' from Profile namespace is not called correctly. You need to provide 'profileIds' OR 'search' parameters to the method, but you can't use both of them or neither of them.",i.INVALID_LIMIT="Invalid limit filter. The maximum limit is 20",i.FILTER_COMBINATION_ERROR="You need to use both 'entityIds' and 'entityType' filters together",i.INVALID_ENTITY_TYPE="Invalid 'entityType' filter. Please use one of the following valid options: competition, team, or player",i.INVALID_TEMPLATE_GROUP_ID="There is no group in this template with the provided groupId",i.INVALID_TEMPLATE_GROUP_FILTERS="The provided template group has no filters",i.INVALID_PAGE_NUMBER="Invalid page number provided. Use number between 1 and max number of pages.",i.INVALID_DISCUSSION_IDS="Invalid discussion ids argument. Please provide at least one discussion id in an array",i.ID_MAPPING_NOT_FOUND="No ID mappings are available for the provided ID. ID argument: ",e.WarningMessages={UNEXPECTED_STATUS_PROP:"Unexpected provided property 'status'. You can NOT use this property for this method. For more information visit our documentation: \n ".concat(r.documentationLinks.PREDICTOR_USER_RELATED_OPERATION),UNEXPECTED_TYPE_PROP:"Unexpected provided property 'type'. You can NOT use this property for this method. For more information visit our documentation: \n ".concat(r.documentationLinks.PREDICTOR_USER_RELATED_OPERATION)},e.invalidPredictionMessage=function(t,e){return"The prediction '".concat(t,"' is invalid for market '").concat(e,"'. Please check again have you passed appropriate prediction model. For more information please visit our documentation: https://docs.fansunitedmedia.com/sdks/js/match.quiz#gamerelatedoperations")},e.invalidMarketMessage=function(t){return"The market '".concat(t,"' is not supported from Fans United. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction")},e.invalidMarketTopXMessage=function(t){return"The market '".concat(t,"' is not valid for Top X game. The only available market is CORRECT_SCORE.")},e.invalidFieldMessage=function(t){return"The field/s '".concat(t.length>1?t.join(", "):t[0],"' is/are invalid. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/javascript-sdk")},e.missingFieldsMessage=function(t,e){return"The following field/s is/are missing from ".concat(t,": '").concat(e.length>1?e.join(", "):e[0],"'. For more information please visit our documentation: https://docs.fansunitedmedia.com/docs/predictor-operations#make-football-prediction")},e.invalidTypeMessage=function(t,e){return"The field ".concat(t," has incorrect type. The correct type is ").concat(e)}},1282:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.primaryColor=null,this.secondaryColor=null,this.contentColor=null,this.backgroundColor=null,this.borderColor=null,this.additionalColor=null}},1997:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.mainLogo=null,this.mobileLogo=null,this.backgroundImage=null,this.mobileBackgroundImage=null,this.additionalImage=null}},6862:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.colors=null,this.urls=null,this.images=null}},2291:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.primaryUrl=null,this.secondaryUrl=null,this.privacyPolicyUrl=null,this.termsAndConditionsUrl=null,this.additionalUrl=null}},4800:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.limit=t&&t.limit?t.limit:null,this.startAfter=t&&t.startAfter?t.startAfter:null}return t.prototype.constructMainFiltersUrl=function(){var t="";return this.limit&&(t+="&",t+="limit=".concat(this.limit)),this.startAfter&&(t+="&",t+="start_after=".concat(this.startAfter)),t},t}();e.default=n},439:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.main=null,this.cover=null,this.mobile=null}},8872:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8902));e.default=function(){this.pagination=new r.default}},8902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.nextPageStartsAfter=null,this.itemsPerPage=null}},1553:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},3623:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.remapMetaData=function(t){var e=new r.default;return e.pagination.nextPageStartsAfter=t.pagination.next_page_starts_after,e.pagination.itemsPerPage=t.pagination.items_per_page,e}}},3483:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.entityId=null,this.entityType=null}},6692:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1282)),s=i(n(1997)),a=i(n(6862)),o=i(n(2291));e.default=function(){this.remapBranding=function(t){var e=new a.default;return t.colors&&(e.colors=new r.default,e.colors.primaryColor=t.colors.primary_color,e.colors.secondaryColor=t.colors.secondary_color,e.colors.contentColor=t.colors.content_color,e.colors.backgroundColor=t.colors.background_color,e.colors.borderColor=t.colors.border_color,e.colors.additionalColor=t.colors.additional_color),t.urls&&(e.urls=new o.default,e.urls.primaryUrl=t.urls.primary_url,e.urls.secondaryUrl=t.urls.secondary_url,e.urls.privacyPolicyUrl=t.urls.privacy_policy_url,e.urls.termsAndConditionsUrl=t.urls.terms_and_conditions_url,e.urls.additionalUrl=t.urls.additional_url),t.images&&(e.images=new s.default,e.images.mainLogo=t.images.main_logo,e.images.mobileLogo=t.images.mobile_logo,e.images.backgroundImage=t.images.background_image,e.images.mobileBackgroundImage=t.images.mobile_background_image,e.images.additionalImage=t.images.additional_image),e}}},9018:function(t,e,n){"use strict";var i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s,a=r(n(321)),o=n(1260);!function(t){t.PROFILE="profile",t.PROFILE_BADGES="profile_badges",t.PROFILE_STATS="profile_stats",t.PROFILE_COUNTRIES="profile_countries",t.IDS="ids",t.CLIENT="client",t.FOOTBALL_COMPETITIONS="football_competitions",t.FOOTBALL_COUNTIRES="football_countries"}(s||(s={}));var u=function(){function t(e){var n=this;this.profileTTL=600,this.clientTTL=14400,this.profileBadgesTTL=3600,this.idMappingsExpiration=0,this.idSchema="",this.clearData=function(){return t.nodeCache.flushAll()},this.getEntityById=function(e,i){var r=t.nodeCache.get(s.IDS);return r?r.find((function(t){var r=o.ID_TYPES[n.idSchema];return t&&"".concat(t[r])===i&&t.resource===e})):null},this.getEntity=function(e,n,i){var r=t.nodeCache.get(s.IDS);return r?Array.isArray(e)?[]:null:Array.isArray(e)?r.filter((function(t){var r=o.ID_TYPES[i];return t&&e.includes("".concat(t[r]))&&t.resource===n})):r.find((function(t){var r=o.ID_TYPES[i];return t&&"".concat(t[r])===e&&t.resource===n}))},this.checkForExistingIdObjs=function(t,e){var i=o.ID_TYPES[e],r={};return Object.keys(t).forEach((function(s){var a=t[s],o=n.getEntity(a,s,e).map((function(t){return t[i]})),u=t[s].filter((function(t){return!o.includes(t)}));r[s]=a.map((function(t){return u.includes(t)?{id:t,exists:!1}:{id:t,exists:!0}}))})),r},this.getIdsByType=function(e,n,i){var r=o.ID_TYPES[i],a=o.ID_TYPES[n],u=t.nodeCache.get(s.IDS),l={};return u?(Object.keys(e).forEach((function(t){var n=e[t],i=[];u.forEach((function(e){n.forEach((function(n,s){n===e[a]&&t===e.resource&&(i[s]=e[r])}))})),l[t]=i})),l):null},this.addIdMapping=function(e){var n=t.nodeCache.get(s.IDS);n.push(e),t.nodeCache.set(s.IDS,n)},this.addIdMappings=function(e){var n=t.nodeCache.get(s.IDS);n=i(i([],n,!0),e,!0),t.nodeCache.set(s.IDS,n)},this.addTopIdMappings=function(e){var r=t.nodeCache.get(s.IDS);if(r){var a=JSON.parse(JSON.stringify(r));a=a.filter((function(t){return"match"!==t.resource})),e=e.filter((function(t){return"match"===t.resource})),a=i(i([],a,!0),e,!0),t.nodeCache.set(s.IDS,a)}else t.nodeCache.set(s.IDS,e);n.idMappingsExpiration=Math.floor(Date.now()/1e3)+604800},this.setOwnProfile=function(e){return t.nodeCache.set(s.PROFILE,e,n.profileTTL)},this.getOwnProfile=function(){return t.nodeCache.get(s.PROFILE)},this.getProfileCountries=function(){return t.nodeCache.get(s.PROFILE_COUNTRIES)},this.setProfileCountries=function(e){return t.nodeCache.set(s.PROFILE_COUNTRIES,e)},this.getProfileStats=function(){return t.nodeCache.get(s.PROFILE_STATS)},this.setProfileStats=function(e){return t.nodeCache.set(s.PROFILE_STATS,e,n.profileTTL)},this.getProfileBadges=function(){return t.nodeCache.get(s.PROFILE_BADGES)},this.setProfileBadges=function(e){t.nodeCache.set(s.PROFILE_BADGES,e,n.profileBadgesTTL)},this.getFootballCountries=function(){return t.nodeCache.get(s.FOOTBALL_COUNTIRES)},this.setFootballCountries=function(e){return t.nodeCache.set(s.FOOTBALL_COUNTIRES,e)},this.getCompetitions=function(e){var n=t.nodeCache.get(s.FOOTBALL_COMPETITIONS);return n?e?e.competitionSearchFilter(n):n:null},this.setCompetitions=function(e){return t.nodeCache.set(s.FOOTBALL_COMPETITIONS,e)},this.getCompetitionsLength=function(){var e=t.nodeCache.get(s.FOOTBALL_COMPETITIONS);return e?e.length:0},this.getClientFeatures=function(){return t.nodeCache.get(s.CLIENT)},this.setClientFeatures=function(e){return t.nodeCache.set(s.CLIENT,e,n.clientTTL)},this.deleteClientFeatures=function(){return t.nodeCache.del(s.CLIENT)},this.getExpiration=function(e,i){var r=n.getKeyFromExpirationType(i);return r===s.IDS?n.idMappingsExpiration:t.nodeCache.getTtl(r)},this.getKeyFromExpirationType=function(t){switch(t){case"profile":return s.PROFILE;case"statistics":return s.PROFILE_STATS;case"badges":return s.PROFILE_BADGES;case"features":return s.CLIENT;case"ids":return s.IDS}}}return t.getInstance=function(e){return t.instance||(t.instance=new t(e),t.nodeCache.options.useClones=!1),t.instance},t.nodeCache=new a.default,t}();e.default=u},1022:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(2453)),c=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"loyalty"))||this;return n.activityRemapper=null,n.createActivity=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/activities".concat(this.apiSignInUrl),[4,this.fetchWithAuth(e,"There was a problem with creating activity","POST",t)];case 1:return n=i.sent(),[2,this.activityRemapper.remapSingleResponse(n)]}}))}))},n.deleteActivity=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/activities/".concat(t).concat(this.apiSignInUrl),n="There was a problem deleting the following activity: ".concat(t),[4,this.fetchWithAuth(e,n,"DELETE")];case 1:return i.sent(),[2,!0]}}))}))},n.getOwnActivities=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/activities".concat(this.apiSignInUrl),i=Date.now(),t&&(n+="".concat(t.constructFilterUrl())),e&&(n+="disable_cache=".concat(i)),[4,this.fetchWithAuth(n,"There was a problem with fetching own activities")];case 1:return r=s.sent(),[2,this.activityRemapper.remapActivitiesResponse(r)]}}))}))},n.getActivitiesForUser=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="/users/".concat(t,"/activities").concat(this.apiSignInUrl),r=Date.now(),s="There was a problem with fetching activities for user: ".concat(t),e&&(n+="".concat(e.constructFilterUrl())),i&&(n+="disable_cache=".concat(r)),[4,this.fetchWithoutAuth(n,s)];case 1:return o=a.sent(),[2,this.activityRemapper.remapActivitiesResponse(o)]}}))}))},n.getStats=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="",i="",r=null,t?(n+=(0,u.isDisabledCache)(e)?"/users/".concat(t,"/statistics").concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/users/".concat(t,"/statistics").concat(this.apiSignInUrl),i="There was a problem fetching statistics for profile: ".concat(t),[4,this.fetchWithoutAuth(n,i)]):[3,2];case 1:return r=s.sent(),[3,4];case 2:return n+="/statistics".concat(this.apiSignInUrl),i="There was a problem fetching profile`s statistics",[4,this.fetchWithAuth(n,i)];case 3:r=s.sent(),s.label=4;case 4:return[2,this.activityRemapper.remapStatsResponse(r.data)]}}))}))},n.activityRemapper=new l.default,n}return r(e,t),e}(o(n(7724)).default);e.default=c},7686:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FeatureConfigType=void 0;var u,l=n(712),c=o(n(704)),d=o(n(7724)),h=o(n(8358));(u=e.FeatureConfigType||(e.FeatureConfigType={})).PREDICTOR="predictor",u.TOP_X="topX",u.MATCH_QUIZ="matchQuiz",u.LOYALTY="loyalty",u.DISCUSSIONS="discussions",u.FANTASY="fantasy";var f=function(t){function e(e){var n=t.call(this,e,(0,l.setBaseUrl)(e.environment,"client"))||this;return n.featureConfigRemapper=null,n.localStorage=null,n.clientId=null,n.getConfig=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r,s;return a(this,(function(a){switch(a.label){case 0:return(e=this.getCachedFeatures())?[3,2]:(n="/clients/".concat(this.clientId,"/features"),i=this.apiSignInUrl.split("&")[0],r=n+i,[4,this.fetchWithoutAuth(r,"There was a problem fetching client features from Client API")]);case 1:s=a.sent(),e=s.data,this.localStorage.setClientFeatures(e),a.label=2;case 2:switch(t){case"predictor":return[2,this.featureConfigRemapper.remapPredictorConfig(e.predictor)];case"topX":return[2,this.featureConfigRemapper.remapTopXConfig(e.top_x)];case"matchQuiz":return[2,this.featureConfigRemapper.remapMatchQuizConfig(e.match_quiz)];case"loyalty":return[2,this.featureConfigRemapper.remapLoyaltyConfig(e.loyalty)];case"discussions":return[2,this.featureConfigRemapper.remapDiscussionsConfig(e.discussions)];case"fantasy":return[2,this.featureConfigRemapper.remapFantasyConfig(e.football_fantasy)]}return[2]}}))}))},n.getNewLoyaltyConfig=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r,s,o;return a(this,(function(a){switch(a.label){case 0:return e="/clients/".concat(this.clientId,"/features"),n=this.apiSignInUrl.split("&")[0],i="There was a problem fetching client features from Client API",t?(s=e+n+(0,l.initDisableCache)(),[4,this.fetchWithoutAuthAdditionalHeaders(s,i,{"x-api-version":"2"})]):[3,2];case 1:o=a.sent(),this.localStorage.setClientFeatures(o.data),a.label=2;case 2:return(r=this.getCachedFeatures())?[3,4]:(s=e+n,[4,this.fetchWithoutAuthAdditionalHeaders(s,i,{"x-api-version":"2"})]);case 3:o=a.sent(),r=o.data,this.localStorage.setClientFeatures(r),a.label=4;case 4:return[2,this.featureConfigRemapper.remapLoyaltyNewConfig(r.loyalty)]}}))}))},n.getCachedFeatures=function(){var t=n.getLocalStorageData();if(t&&Object.keys(t).length)return t.predictor.client_id&&t.predictor.client_id!==n.clientId?(n.localStorage.deleteClientFeatures(),null):t},n.getLocalStorageData=function(){var t=Math.floor(Date.now()/1e3);return n.localStorage.getExpiration("client","features")>t?n.localStorage.getClientFeatures():null},n.clientId=e.clientId,n.localStorage=(new h.default).createLocalCacheInstance(e.idSchema),n.featureConfigRemapper=new c.default,n}return r(e,t),e}(d.default);e.default=f},7945:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(3476)),c=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"discussions"))||this;return n.remapper=null,n.getAll=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions"+this.apiSignInUrl,t&&(n+="".concat(t.constructMainFiltersUrl())),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting discussions")];case 1:return i=r.sent(),[2,this.remapper.remapToDiscussions(i)]}}))}))},n.getById=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/discussions/".concat(t)+this.apiSignInUrl,[4,this.fetchWithoutAuth(e,"There was a problem getting discussion")];case 1:return n=i.sent(),[2,this.remapper.remapToDiscussionById(n.data)]}}))}))},n.createPost=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/".concat(t,"/posts")+this.apiSignInUrl,[4,this.fetchWithAuth(n,"There was a problem creating post in discussion","POST",e)];case 1:return i=r.sent(),[2,this.remapper.remapToPostByIdBasic(i.data)]}}))}))},n.getPostById=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/posts/".concat(t)+this.apiSignInUrl,[4,this.fetchWithoutAuth(e,"There was a problem getting post by ID in discussion")];case 1:return n=i.sent(),[2,this.remapper.remapToPostByIdFull(n.data)]}}))}))},n.updatePost=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/posts/".concat(t)+this.apiSignInUrl,i={content:e},[4,this.fetchWithAuth(n,"There was a problem editing post in discussion","PUT",i)];case 1:return r=s.sent(),[2,this.remapper.remapToPostByIdBasic(r.data)]}}))}))},n.reactToPost=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/posts/".concat(t,"/reaction")+this.apiSignInUrl,i={reaction:e.toLocaleLowerCase()},[4,this.fetchWithAuth(n,"There was a problem reacting to post in discussion","PUT",i)];case 1:return r=s.sent(),[2,this.remapper.remapToPostByIdBasic(r.data)]}}))}))},n.deletePost=function(t){return s(n,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return e="/posts/".concat(t)+this.apiSignInUrl,[4,this.fetchWithAuth(e,"There was a problem deleting post in discussion","DELETE")];case 1:return n.sent(),[2,!0]}}))}))},n.getPosts=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/".concat(t,"/posts")+this.apiSignInUrl,e&&(n+="".concat(e.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(n,"There was a problem getting posts in discussion")];case 1:return i=r.sent(),[2,this.remapper.remapToPostsForDiscussion(i,"full")]}}))}))},n.getPostReplies=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/posts/".concat(t,"/replies")+this.apiSignInUrl,e&&(n+="".concat(e.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(n,"There was a problem getting post's replies in discussion")];case 1:return i=r.sent(),[2,this.remapper.remapToPostsForDiscussion(i,"full")]}}))}))},n.reportPost=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/posts/".concat(t,"/report")+this.apiSignInUrl,r={reason:e.toLocaleUpperCase(),reason_details:i||null},[4,this.fetchWithAuth(n,"There was a problem reporting post in discussion","POST",r)];case 1:return s=a.sent(),[2,this.remapper.remapToPostByIdBasic(s.data)]}}))}))},n.getOwnPosts=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/posts"+this.apiSignInUrl,t&&(e+="".concat(t.constructMainFiltersUrl())),[4,this.fetchWithAuth(e,"There was a problem getting own posts")];case 1:return n=i.sent(),[2,this.remapper.remapToPosts(n)]}}))}))},n.getUserPosts=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/posts/users/".concat(t)+this.apiSignInUrl,e&&(n+="".concat(e.constructMainFiltersUrl())),(0,u.isDisabledCache)(i)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting user's posts")];case 1:return r=s.sent(),[2,this.remapper.remapToPosts(r)]}}))}))},n.getPostsCount=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/posts/count"+this.apiSignInUrl+"&discussion_ids=".concat(t.join(",")),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting posts count for discussions")];case 1:return i=r.sent(),[2,this.remapper.remapToPostCount(i.data)]}}))}))},n.getTopDiscussions=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/discussions/top"+this.apiSignInUrl,t&&(n+="".concat(t.constructMainFiltersUrl())),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem getting top discussions")];case 1:return i=r.sent(),[2,this.remapper.remapToDiscussions(i)]}}))}))},n.remapper=new l.default,n}return r(e,t),e}(o(n(7724)).default);e.default=c},595:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(3430)),c=o(n(7316)),d=o(n(8758)),h=o(n(5827)),f=o(n(7821)),p=o(n(5284)),m=o(n(9330)),v=o(n(4729)),_=o(n(5157)),y=o(n(7943)),g=o(n(7287)),b=o(n(753)),w=o(n(1925)),I=o(n(7724)),E=o(n(9582)),M=o(n(9260)),O=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"football"))||this;return n.limitIds=200,n.countryRemapper=null,n.competitionBasicRemapper=null,n.competitionFullRemapper=null,n.teamBasicRemapper=null,n.teamFullRemapper=null,n.matchBasicRemapper=null,n.matchFullRemapper=null,n.playerBasicRemapper=null,n.playerFullRemapper=null,n.topPlayerRemapper=null,n.searchRemapper=null,n.footballMetaRemapper=null,n.fantasyRemapper=null,n.footballService=null,n.getCountries=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="/countries".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with the football countries request")];case 1:return i=r.sent(),[2,this.countryRemapper.countriesFromResponse(i.data)]}}))}))},n.getCompetitions=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f=this;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),i="There was a problem with football competitions request",e=e||!1,!(t&&t.competitionIds&&t.competitionIds.length>this.limitIds-1))return[3,5];r=[],s=(0,u.limitIds)(t.competitionIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.competitionIds=c,d="/competitions".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),e&&(d+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(d,i)]):[3,4];case 2:h=a.sent(),r.push(h.data.map((function(t){return f.competitionBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return[2,Array.prototype.concat.apply([],r)];case 5:return d="/competitions".concat(this.apiSignInUrl),t&&(d+="".concat(t.constructFilterUrl())),e&&(d+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(d,i)];case 6:return[2,(h=a.sent()).data.map((function(t){return f.competitionBasicRemapper.fromResponse(t)}))]}}))}))},n.getCompetitionById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/competitions/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football competition by ID request")];case 1:return r=s.sent(),[2,this.competitionFullRemapper.fromResponse(r.data)]}}))}))},n.getTopCompetitions=function(t){return s(n,void 0,void 0,(function(){var e,n,i=this;return a(this,(function(r){switch(r.label){case 0:return e="/competitions/top".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with top football competitions request")];case 1:return[2,r.sent().data.map((function(t){return i.competitionBasicRemapper.fromResponse(t)}))]}}))}))},n.getTeams=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f,p=this;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),i="There was a problem with football teams request",!(t&&t.teamIds&&t.teamIds.length>this.limitIds))return[3,5];r=[],s=(0,u.limitIds)(t.teamIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.teamIds=c,h="/teams".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),e&&(h+="disable_cache=".concat(n)),[4,this.fetchWithoutAuth(h,i)]):[3,4];case 2:f=a.sent(),r.push(f.data.map((function(t){return p.teamBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return[2,Array.prototype.concat.apply([],r)];case 5:return d=new b.default,h="/teams".concat(this.apiSignInUrl),t&&(h+="".concat(t.constructFilterUrl())),e&&(h+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(h,i)];case 6:return f=a.sent(),d.meta=this.footballMetaRemapper.remapMetaProp(f.meta),d.data=f.data.map((function(t){return p.teamBasicRemapper.fromResponse(t)})),[2,d]}}))}))},n.getTeamById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/teams/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football team by ID request")];case 1:return r=s.sent(),[2,this.teamFullRemapper.fromResponse(r.data)]}}))}))},n.getTopTeams=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r=this;return a(this,(function(s){switch(s.label){case 0:return e="/teams/top".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="$disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with top football teams request")];case 1:return[2,(i=s.sent()).data?i.data.map((function(t){return r.teamBasicRemapper.fromResponse(t)})):[]]}}))}))},n.getNextMatchForTeam=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/teams/".concat(t,"/next-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with next match for team request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getPrevMatchForTeam=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/teams/".concat(t,"/previous-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with previous match for team request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getPlayers=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f,p,m=this;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),i="There was a problem with football players request",!(t&&t.playerIds&&t.playerIds.length>this.limitIds-1))return[3,5];r=[],s=(0,u.limitIds)(t.playerIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.playerIds=c,f="/players".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),e&&(f+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(f,i)]):[3,4];case 2:p=a.sent(),r.push(p.data.map((function(t){return m.teamBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return d=Array.prototype.concat.apply([],r),(h=new b.default).data=d,[2,h];case 5:return h=new b.default,f="/players".concat(this.apiSignInUrl),t&&(f+="".concat(t.constructFilterUrl())),e&&(f+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(f,i)];case 6:return p=a.sent(),h.meta=this.footballMetaRemapper.remapMetaProp(p.meta),h.data=p.data.map((function(t){return m.playerBasicRemapper.fromResponse(t)})),[2,h]}}))}))},n.getPlayerById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/players/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football player by ID request")];case 1:return r=s.sent(),[2,this.playerFullRemapper.fromResponse(r.data)]}}))}))},n.getTopPlayers=function(t){return s(n,void 0,void 0,(function(){var e,n,i=this;return a(this,(function(r){switch(r.label){case 0:return e="/players/top".concat(this.apiSignInUrl),n=Date.now(),t&&(e+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(e,"There was a problem with top football players request")];case 1:return[2,r.sent().data.map((function(t){return i.topPlayerRemapper.fromResponse(t)}))]}}))}))},n.getNextMatchForPlayer=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/players/".concat(t,"/next-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with next match for player request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getPrevMatchForPlayer=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/players/".concat(t,"/previous-match").concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with previous match for player request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getMatchById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/matches/".concat(t).concat(this.apiSignInUrl),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with match by ID request")];case 1:return r=s.sent(),[2,this.matchFullRemapper.fromResponse(r.data)]}}))}))},n.getMatches=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,l,c,d,h,f,p=this;return a(this,(function(a){switch(a.label){case 0:if(n=new b.default,i="There was a problem with football matches request",!(t&&t.matchIds&&t.matchIds.length>this.limitIds))return[3,5];r=[],s=(0,u.limitIds)(t.matchIds,this.limitIds),o=0,l=s,a.label=1;case 1:return o<l.length?(c=l[o],t.matchIds=c,h="/matches".concat(this.apiSignInUrl).concat(t.constructFilterUrl(!0),"&limit=").concat(c.length),e&&(h+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(h,i)]):[3,4];case 2:f=a.sent(),r.push(f.data.map((function(t){return p.matchBasicRemapper.fromResponse(t)}))),a.label=3;case 3:return o++,[3,1];case 4:return d=Array.prototype.concat.apply([],r),n.meta=this.footballService.setMetaDataBatchRequest(d.length,t.limit||20,t.page||1),n.data=this.footballService.finalizeMatchesDataBatchRequest(d,t),[2,n];case 5:return h="/matches".concat(this.apiSignInUrl),t&&(h+="".concat(t.constructFilterUrl())),e&&(h+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(h,i)];case 6:return f=a.sent(),n.meta=this.footballMetaRemapper.remapMetaProp(f.meta),n.data=f.data.map((function(t){return p.matchBasicRemapper.fromResponse(t)})),[2,n]}}))}))},n.search=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/search".concat(this.apiSignInUrl).concat(t.constructFilterUrl()),i=Date.now(),e&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem with football search request")];case 1:return r=s.sent(),[2,this.searchRemapper.fromResponse(r.data)]}}))}))},n.getPlayersPoints=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/players/points/".concat(t).concat(this.apiSignInUrl),r=Date.now(),e&&(n+="&position=".concat(e.toLocaleLowerCase())),i&&(n+="&disable_cache=".concat(r)),[4,this.fetchWithoutAuth(n,"There was a problem with players points request")];case 1:return s=a.sent(),[2,this.fantasyRemapper.remapPlayersPoints(s)]}}))}))},n.getPlayerDetailedStatistics=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/players/".concat(e,"/points/").concat(t).concat(this.apiSignInUrl),r=Date.now(),i&&(n+="&disable_cache=".concat(r)),[4,this.fetchWithoutAuth(n,"There was a problem with detailed player points request")];case 1:return s=a.sent(),[2,this.fantasyRemapper.remapPlayerDetailedStats(s)]}}))}))},n.apiSignInUrl="en"!==e.lang?n.apiSignInUrl+"&lang=".concat(e.lang):n.apiSignInUrl,n.countryRemapper=new l.default,n.competitionBasicRemapper=new c.default,n.competitionFullRemapper=new d.default,n.teamBasicRemapper=new h.default,n.teamFullRemapper=new f.default,n.matchBasicRemapper=new p.default,n.matchFullRemapper=new m.default,n.playerBasicRemapper=new _.default,n.playerFullRemapper=new y.default,n.topPlayerRemapper=new v.default,n.searchRemapper=new g.default,n.footballMetaRemapper=new w.default,n.footballService=new E.default(e),n.fantasyRemapper=new M.default,n}return r(e,t),e}(I.default);e.default=O},7724:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=a(n(6245)),u=n(4021),l=n(4904),c=n(5318),d=a(n(8712)),h=a(n(2535));e.default=function(t,e){var n=this;this.baseUrl=null,this.apiSignInUrl=null,this.jwtToken=null,this.idSchema=null,this.retryRequest=!1,this.headers=null,this.authHeaders=null,this.errorHandlingMode=null,this.configuration=null,this.getJwtToken=function(){return n.configuration.authProvider.getIdToken()},this.getAuthHeaders=function(){return{"Content-Type":"application/json",Authorization:"Bearer ".concat(n.getJwtToken())}},this.fetchWithoutAuth=function(t,e){return r(n,void 0,void 0,(function(){var n,i,r;return s(this,(function(s){switch(s.label){case 0:return[4,fetch(this.baseUrl+t,{headers:this.headers})];case 1:return[4,(n=s.sent()).json()];case 2:if(i=s.sent(),!n.ok)throw r=this.transformFetchException(n,i),console.warn(e,r),r;return[2,i]}}))}))},this.fetchWithoutAuthAdditionalHeaders=function(t,e,a){return r(n,void 0,void 0,(function(){var n,r,o;return s(this,(function(s){switch(s.label){case 0:return[4,fetch(this.baseUrl+t,{headers:i(i({},this.headers),a)})];case 1:return[4,(n=s.sent()).json()];case 2:if(r=s.sent(),!n.ok)throw o=this.transformFetchException(n,r),console.warn(e,o),o;return[2,r]}}))}))},this.fetchWithAuth=function(t,e,i,a){return r(n,void 0,void 0,(function(){var n,r,o,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this.validateJWTToken(),n=null,r=null,i&&a?[4,fetch(this.baseUrl+t,{method:i,headers:this.getAuthHeaders(),body:JSON.stringify(a)})]:[3,2];case 1:return n=s.sent(),[3,6];case 2:return!i||a?[3,4]:[4,fetch(this.baseUrl+t,{method:i,headers:this.getAuthHeaders()})];case 3:return n=s.sent(),[3,6];case 4:return[4,fetch(this.baseUrl+t,{headers:this.getAuthHeaders()})];case 5:n=s.sent(),s.label=6;case 6:return"DELETE"===i?[3,8]:[4,n.json()];case 7:r=s.sent(),s.label=8;case 8:return n.ok?[3,14]:401!==n.status&&403!==n.status||this.retryRequest?[3,10]:(this.retryRequest=!0,[4,this.fetchWithAuth(t,e,i,a)]);case 9:s.sent(),s.label=10;case 10:return this.retryRequest=!1,u=this.transformFetchException,l=[n],r?(c=r,[3,13]):[3,11];case 11:return[4,n.json()];case 12:c=s.sent(),s.label=13;case 13:throw o=u.apply(this,l.concat([c])),console.warn(e,o),o;case 14:return this.retryRequest=!1,[2,r]}}))}))},this.fetchWithAuthNewBaseURL=function(t,e,i,a,o){return r(n,void 0,void 0,(function(){var n,r,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return this.validateJWTToken(),n=null,r=null,a&&o?[4,fetch(t+e,{method:a,headers:this.getAuthHeaders(),body:JSON.stringify(o)})]:[3,2];case 1:return n=s.sent(),[3,6];case 2:return!a||o?[3,4]:[4,fetch(t+e,{method:a,headers:this.getAuthHeaders()})];case 3:return n=s.sent(),[3,6];case 4:return[4,fetch(t+e,{headers:this.getAuthHeaders()})];case 5:n=s.sent(),s.label=6;case 6:return"DELETE"===a?[3,8]:[4,n.json()];case 7:r=s.sent(),s.label=8;case 8:return n.ok?[3,14]:401!==n.status&&403!==n.status||this.retryRequest?[3,10]:(this.retryRequest=!0,[4,this.fetchWithAuthNewBaseURL(t,e,i,a,o)]);case 9:s.sent(),s.label=10;case 10:return this.retryRequest=!1,l=this.transformFetchException,c=[n],r?(d=r,[3,13]):[3,11];case 11:return[4,n.json()];case 12:d=s.sent(),s.label=13;case 13:throw u=l.apply(this,c.concat([d])),console.warn(i,u),u;case 14:return this.retryRequest=!1,[2,r]}}))}))},this.transformFetchException=function(t,e){if(!e&&t.status===u.ErrorCodes.UNAUTHORIZED){if("standard"===n.errorHandlingMode)return new h.default(u.ErrorCodes.UNAUTHORIZED,l.ErrorStatuses.UNAUTHORIZED,c.ErrorMessages.INVALID_TOKEN);var i={code:u.ErrorCodes.UNAUTHORIZED,status:l.ErrorStatuses.UNAUTHORIZED,message:c.ErrorMessages.INVALID_TOKEN};return new d.default(t,i)}var r=e.error,s=r.code,a=r.status,o=r.message;return"standard"===n.errorHandlingMode?new h.default(s,a,o):new d.default(t,e.error)},this.validateJWTToken=function(){var t=null;try{t=(0,o.default)(n.getJwtToken())}catch(t){if("default"===n.errorHandlingMode){var e={status:u.ErrorCodes.UNAUTHORIZED,statusText:t.message,headers:{}},i={code:u.ErrorCodes.UNAUTHORIZED,status:l.ErrorStatuses.INVALID_TOKEN,message:c.ErrorMessages.INVALID_TOKEN};throw new d.default(e,i)}if("standard"===n.errorHandlingMode)throw new h.default(u.ErrorCodes.UNAUTHORIZED,l.ErrorStatuses.INVALID_TOKEN,c.ErrorMessages.INVALID_TOKEN)}if(Date.now()>1e3*t.exp){if("default"===n.errorHandlingMode)throw e={status:u.ErrorCodes.UNAUTHORIZED,statusText:"",headers:{}},i={code:u.ErrorCodes.UNAUTHORIZED,status:l.ErrorStatuses.INVALID_TOKEN,message:c.ErrorMessages.EXPIRED_TOKEN},new d.default(e,i);if("standard"===n.errorHandlingMode)throw new h.default(u.ErrorCodes.UNAUTHORIZED,l.ErrorStatuses.INVALID_TOKEN,c.ErrorMessages.EXPIRED_TOKEN)}},this.baseUrl=e,this.configuration=t,this.apiSignInUrl="?key=".concat(t.apiKey,"&client_id=").concat(t.clientId),this.errorHandlingMode=t.errorHandlingMode,this.idSchema=t.idSchema,this.headers={"Content-Type":"application/json"}}},8539:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(712),c=u(n(7724)),d={player:"players",team:"teams",homeTeam:"teams",awayTeam:"teams",country:"countries",competition:"competitions",match:"matches"},h=function(t){function e(e){var n=t.call(this,e,(0,l.setBaseUrl)(e.environment,"idMapping"))||this;return n.getEntityById=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/football".concat(this.apiSignInUrl,"&input_provider=").concat(this.idSchema,"&").concat(d[t],"=").concat(e),i="There was a problem with id mapping request for the following id: ".concat(e),[4,this.fetchWithoutAuth(n,i)];case 1:return[2,r.sent()]}}))}))},n.getEntityByIdAndSchema=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/football".concat(this.apiSignInUrl,"&input_provider=").concat(i,"&").concat(d[t],"=").concat(e),r="There was a problem with id mapping request for the following id: ".concat(e),[4,this.fetchWithoutAuth(n,r)];case 1:return[2,s.sent()]}}))}))},n.getEntityIdsByIdsAndSchema=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/football".concat(this.apiSignInUrl,"&input_provider=").concat(i,"&").concat(d[t],"=").concat(e.join(",")),r="There was a problem with id mapping request for the following ids: ".concat(e.join(",")),[4,this.fetchWithoutAuth(n,r)];case 1:return[2,s.sent()]}}))}))},n.getEntitiesByIds=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,u,c,h,f,p;return a(this,(function(a){switch(a.label){case 0:e.sort((function(t,e){return t.localeCompare(e)})),n=(0,l.requestChunkBuild)(e),r=[],s=0,u=n,a.label=1;case 1:return s<u.length?(c=u[s],h="/football".concat(this.apiSignInUrl,"&input_provider=").concat(i,"&").concat(d[t],"=").concat(c.join(",")),f="There was a problem with id mapping request for the following ids :".concat(c.join(",")),[4,this.fetchWithoutAuth(h,f)]):[3,4];case 2:p=a.sent(),r=o(o([],r,!0),p.data,!0),a.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},n.getEntitiesByIdObjs=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o,u,c,h,f,p;return a(this,(function(m){switch(m.label){case 0:n=[],i={},r=[],Object.keys(t).forEach((function(e){n.push.apply(n,t[e])})),s=(0,l.transformIdsToBeUnique)(n),o=(0,l.requestChunkBuild)(s),u=function(n){var s,o,u;return a(this,(function(a){switch(a.label){case 0:return s="",Object.keys(t).forEach((function(e){i[e]=[];var r=n.filter((function(n){return t[e].includes(n)}));r&&r.length>0&&(i[e]=r)})),Object.keys(i).forEach((function(t){i[t].length>0&&(i[t].sort((function(t,e){return t.localeCompare(e)})),s+="&",s+="".concat(d[t],"=").concat(i[t].join(",")))})),s&&s.length>0?(o="/football".concat(c.apiSignInUrl,"&input_provider=").concat(e||"native").concat(s),[4,c.fetchWithoutAuth(o,"There was a problem with id mapping request")]):[3,2];case 1:return u=a.sent(),r.push(u.data),[3,3];case 2:r.push([]),a.label=3;case 3:return[2]}}))},c=this,h=0,f=o,m.label=1;case 1:return h<f.length?(p=f[h],[5,u(p)]):[3,4];case 2:m.sent(),m.label=3;case 3:return h++,[3,1];case 4:return[2,Array.prototype.concat.apply([],r)]}}))}))},n.getTopEntities=function(){return s(n,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:return t="/football/top".concat(this.apiSignInUrl),[4,this.fetchWithoutAuth(t,"There was a problem with top id mappings request")];case 1:return[2,e.sent().data]}}))}))},n}return r(e,t),e}(c.default);e.default=h},7059:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(7419)),c=o(n(4533)),d=o(n(8899)),h=o(n(7746)),f=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"loyalty"))||this;return n.templateRemapper=null,n.leaderboardRemapper=null,n.rankingsRemapper=null,n.highestSuccessRateRemapper=null,n.getTemplates=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=t?"/leaderboard/templates/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()):"/leaderboard/templates/".concat(this.apiSignInUrl),n+=(0,u.isDisabledCache)(e)?(0,u.initDisableCache)():"",[4,this.fetchWithoutAuth(n,"There was a problem fetching the list of templates")];case 1:return i=s.sent(),(r=JSON.parse(JSON.stringify(i))).meta=this.templateRemapper.remapMeta(i.meta),r.data=this.templateRemapper.remapResponse(i.data),[2,r]}}))}))},n.getTemplateById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=(0,u.isDisabledCache)(e)?"/leaderboard/templates/".concat(t).concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/leaderboard/templates/".concat(t).concat(this.apiSignInUrl),i="There was a problem requesting the following template: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.templateRemapper.remapResponseId(r.data)]}}))}))},n.getLeaderboard=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n=(0,u.isDisabledCache)(e)?"/leaderboard/".concat(t).concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/leaderboard/".concat(t).concat(this.apiSignInUrl),r="There was a problem fetching the leaderboard for the following template: ".concat(t),i&&(n+="".concat(i.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),o=JSON.parse(JSON.stringify(s)),[2,this.leaderboardRemapper.remapResponse(o)]}}))}))},n.getLeaderboardForGame=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n=(0,u.isDisabledCache)(e)?"/leaderboard/games/".concat(t).concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/leaderboard/games/".concat(t).concat(this.apiSignInUrl),r="There was a problem fetching the leaderboard for the following game: ".concat(t),i&&(n+="".concat(i.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),o=JSON.parse(JSON.stringify(s)),[2,this.leaderboardRemapper.remapResponse(o)]}}))}))},n.getLeaderboardForLeague=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/private-league/".concat(t).concat(this.apiSignInUrl),i="There was a problem fetching the leaderboard for the following league: ".concat(t),e&&(n+="".concat(e.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.leaderboardRemapper.remapLeagueLeaderboardResponse(r)]}}))}))},n.getUserRankings=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/leaderboard/users/".concat(t,"/rankings").concat(this.apiSignInUrl),r="There was a problem fetching the rankings for the following user: ".concat(t),e&&(n+="".concat(e.constructFiltersUrl())),(0,u.isDisabledCache)(i)&&(n+="".concat((0,u.initDisableCache)())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),[2,this.rankingsRemapper.remapRankings(s)]}}))}))},n.getHighestSuccessRate=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/statistics/top".concat(this.apiSignInUrl),t&&(n+="".concat(t.constructFiltersUrl())),(0,u.isDisabledCache)(e)&&(n+="".concat((0,u.initDisableCache)())),[4,this.fetchWithoutAuth(n,"There was a problem fetching highest success rate")];case 1:return i=r.sent(),[2,this.highestSuccessRateRemapper.remapHighestSuccessRate(i.data)]}}))}))},n.getEntitiesFollows=function(t,e){return s(n,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=(0,u.isDisabledCache)(e)?"/statistics/follows".concat(this.apiSignInUrl).concat((0,u.initDisableCache)()):"/statistics/follows".concat(this.apiSignInUrl),t.footballCompetitions&&(n+="&competitions=".concat(t.footballCompetitions.join(","))),t.footballTeams&&(n+="&teams=".concat(t.footballTeams.join(","))),t.footballPlayers&&(n+="&players=".concat(t.footballPlayers.join(","))),[4,this.fetchWithoutAuth(n,"There was a problem fetching follows for entities")];case 1:return[2,i.sent().data]}}))}))},n.getUserRankingsForPrivateLeagueAndChallenges=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/private-league/users/".concat(t,"/rankings").concat(this.apiSignInUrl,"&private_league_type=").concat("PRIVATE_LEAGUE"===e?"private":"one_vs_one"),r="There was a problem fetching user rankings for ".concat(e),i&&(n+="".concat(i.constructFiltersUrl())),[4,this.fetchWithoutAuth(n,r)];case 1:return s=a.sent(),[2,"PRIVATE_LEAGUE"===e?this.rankingsRemapper.remapRankingsPrivateLeague(s):this.rankingsRemapper.remapRankingsChallenge(s)]}}))}))},n.templateRemapper=new d.default,n.leaderboardRemapper=new l.default,n.rankingsRemapper=new c.default,n.highestSuccessRateRemapper=new h.default,n}return r(e,t),e}(o(n(7724)).default);e.default=f},3022:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(2239)),c=o(n(7724)),d=o(n(4688)),h=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"miniGames"))||this;return n.classicQuizRemapper=null,n.eitherOrRemapper=null,n.getClassicQuizzes=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/classic-quizzes".concat(this.apiSignInUrl),t&&(n+=t.constructMainFiltersUrl()),n+=(0,u.isDisabledCache)(e)?(0,u.initDisableCache)():"",[4,this.fetchWithoutAuth(n,"There was a problem with fetching classic quizzes")];case 1:return i=r.sent(),[2,this.classicQuizRemapper.remapClassicQuizzes(i)]}}))}))},n.getClassicQuizById=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r;return a(this,(function(s){switch(s.label){case 0:return n="/classic-quizzes/".concat(t).concat(this.apiSignInUrl),e&&(n+="&include_correct_options=".concat(e)),(0,u.isDisabledCache)(i)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem with fetching classic quiz by ID")];case 1:return r=s.sent(),[2,this.classicQuizRemapper.remapClassicQuizById(r.data)]}}))}))},n.participateInClassicQuiz=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="/classic-quizzes/".concat(t,"/participate").concat(this.apiSignInUrl),r="There was a problem with participating in the following classic quiz: ".concat(t),s={questions:this.classicQuizRemapper.remapClassicQuizParticipationBody(e),include_correct_options:!!i},[4,this.fetchWithAuth(n,r,"POST",s)];case 1:return o=a.sent(),[2,this.classicQuizRemapper.remapClassicQuizParticipation(o.data)]}}))}))},n.getMyClassicQuizParticipations=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/classic-quizzes/participations".concat(this.apiSignInUrl),t&&(e+="".concat(t.constructMainFiltersUrl())),[4,this.fetchWithAuth(e,"There was a problem with fetching user's own Classic Quiz participations")];case 1:return n=i.sent(),[2,this.classicQuizRemapper.remapUserClassicQuizParticipations(n.data)]}}))}))},n.getLeaderboardForClassicQuizzes=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/classic-quizzes/rank".concat(this.apiSignInUrl),t&&(e+="".concat(t.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(e,"There was a problem with fetching classic quizzes leaderboard")];case 1:return n=i.sent(),[2,this.classicQuizRemapper.remapClassicQuizzesLeaderboard(n)]}}))}))},n.getClassicQuizzesUserRanking=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/classic-quizzes/users/".concat(t,"/rank").concat(this.apiSignInUrl),e&&(n+="".concat(e.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(n,"There was a problem with fetching user's rankings for classic quizzes")];case 1:return i=r.sent(),[2,this.classicQuizRemapper.remapClassicQuizUserRankings(i)]}}))}))},n.getEitherOrs=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or".concat(this.apiSignInUrl),t&&(n+=t.constructMainFiltersUrl()),n+=(0,u.isDisabledCache)(e)?(0,u.initDisableCache)():"",[4,this.fetchWithoutAuth(n,"There was a problem with fetching list of Either/Ors")];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrs(i)]}}))}))},n.getEitherOrById=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or/".concat(t).concat(this.apiSignInUrl),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem with fetching Either/Or by ID")];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrById(i.data)]}}))}))},n.getMyEitherOrStats=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/either-or/".concat(t,"/own-stats").concat(this.apiSignInUrl),[4,this.fetchWithAuth(e,"There was a problem with fetching Either/Or own statistics")];case 1:return n=i.sent(),[2,this.eitherOrRemapper.remapEitherOrOwnStats(n.data)]}}))}))},n.getEitherOrResults=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or/".concat(t,"/results").concat(this.apiSignInUrl).concat((0,u.isDisabledCache)(e)?(0,u.initDisableCache)():""),[4,this.fetchWithoutAuth(n,"There was a problem with fetching Either/Or results")];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrResults(i.data)]}}))}))},n.participateInEitherOr=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/either-or/".concat(t,"/participate").concat(this.apiSignInUrl),[4,this.fetchWithAuth(n,"There was a problem with participating in Either/Or","POST",e)];case 1:return i=r.sent(),[2,this.eitherOrRemapper.remapEitherOrParticipation(i.data)]}}))}))},n.classicQuizRemapper=new l.default,n.eitherOrRemapper=new d.default,n}return r(e,t),e}(c.default);e.default=h},2793:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=o(n(2726)),l=o(n(9679)),c=n(712),d=o(n(4780)),h=o(n(1553)),f=o(n(3623)),p=function(t){function e(e,n){var i=t.call(this,e,(0,c.setBaseUrl)(e.environment,"predictor"))||this;return i.predictionRemapper=null,i.matchSummaryRemapper=null,i.gamesRemapper=null,i.metaRemapper=null,i.makeFootballPrediction=function(t){return s(i,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/predictions".concat(this.apiSignInUrl),[4,this.fetchWithAuth(e,"There was a problem making POST request","POST",this.predictionRemapper.remapRequestBody(t))];case 1:return n=i.sent(),[4,this.predictionRemapper.remapResponseObjBody(n)];case 2:return[2,i.sent()]}}))}))},i.getMatchSummary=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=(0,c.isDisabledCache)(e)?"/predictions/summary/".concat(t).concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/predictions/summary/".concat(t).concat(this.apiSignInUrl),i="There was a problem fetching predictions for match: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.matchSummaryRemapper.remapResponse(r)]}}))}))},i.deleteFootballPrediction=function(t){return s(i,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/predictions/".concat(t).concat(this.apiSignInUrl),n="There was a problem deleting your prediction: ".concat(t),[4,this.fetchWithAuth(e,n,"DELETE")];case 1:return i.sent(),[2,!0]}}))}))},i.getMyPredictions=function(t){return s(i,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(s){switch(s.label){case 0:return e=new h.default,n="/predictions".concat(this.apiSignInUrl),t&&(n+="".concat(t.constructFiltersUrl())),[4,this.fetchWithAuth(n,"There was a problem fetching own predictions")];case 1:return i=s.sent(),e.meta=this.metaRemapper.remapMetaData(i.meta),r=e,[4,this.predictionRemapper.remapResponseArrayBody(i.data)];case 2:return r.data=s.sent(),[2,e]}}))}))},i.getMyPredictionsNoRemap=function(t){return s(i,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return e="/predictions".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()),[4,this.fetchWithAuth(e,"There was a problem fetching own predictions")];case 1:return[2,n.sent()]}}))}))},i.getUserPredictions=function(t,e,n){return s(i,void 0,void 0,(function(){var i,r,s,o,u;return a(this,(function(a){switch(a.label){case 0:return i=new h.default,r=(0,c.isDisabledCache)(e)?"/predictions/users/".concat(t).concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/predictions/users/".concat(t).concat(this.apiSignInUrl),s="There was a problem fetching predictions for user: ".concat(t),n&&(r+="".concat(n.constructFiltersUrl())),[4,this.fetchWithoutAuth(r,s)];case 1:return o=a.sent(),i.meta=this.metaRemapper.remapMetaData(o.meta),u=i,[4,this.predictionRemapper.remapResponseArrayBody(o.data)];case 2:return u.data=a.sent(),[2,i]}}))}))},i.getUserPredictionsNoRemap=function(t,e){return s(i,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/predictions/users/".concat(t).concat(this.apiSignInUrl).concat(e.constructFiltersUrl()),i="There was a problem fetching predictions for user: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return[2,r.sent()]}}))}))},i.getGames=function(t,e){return s(i,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n=(0,c.isDisabledCache)(e)?"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()).concat((0,c.initDisableCache)()):"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()),[4,this.fetchWithoutAuth(n,"There was a problem fetching the games list")];case 1:return i=r.sent(),[2,this.gamesRemapper.remapPaginatedGames(i)]}}))}))},i.getGameById=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n=(0,c.isDisabledCache)(e)?"/games/".concat(t).concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/games/".concat(t).concat(this.apiSignInUrl),i="There was a problem fetching the following game: ".concat(t),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.gamesRemapper.remapGameByIdResponse(r)]}}))}))},i.getGamePredictions=function(t,e,n){return s(i,void 0,void 0,(function(){var i,r,s,o,u;return a(this,(function(a){switch(a.label){case 0:return i=new h.default,r=(0,c.isDisabledCache)(e)?"/games/".concat(t,"/predictions").concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/games/".concat(t,"/predictions").concat(this.apiSignInUrl),s="There was a problem fetching the predictions for game: ".concat(t),n&&(r+="".concat(n.constructFiltersUrl())),[4,this.fetchWithoutAuth(r,s)];case 1:return o=a.sent(),i.meta=this.metaRemapper.remapMetaData(o.meta),u=i,[4,this.predictionRemapper.remapResponseArrayBody(o.data)];case 2:return u.data=a.sent(),[2,i]}}))}))},i.getUserGameEditions=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r,s=this;return a(this,(function(a){switch(a.label){case 0:return n=null,i=(0,c.isDisabledCache)(e)?"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()).concat((0,c.initDisableCache)()):"/games/".concat(this.apiSignInUrl).concat(t.constructFiltersUrl()),[4,this.fetchWithoutAuth(i,"There was a problem fetching the games list")];case 1:return(r=a.sent()).data.forEach((function(t){"TOP_X"===t.type?n=s.gamesRemapper.remapPaginatedUserTopXEditions(r):"MATCH_QUIZ"===t.type&&(n=s.gamesRemapper.remapPaginatedUserMathQuizEditions(r))})),[2,n]}}))}))},i.getGameResults=function(t,e,n){return s(i,void 0,void 0,(function(){var i,r,s;return a(this,(function(a){switch(a.label){case 0:return i=(0,c.isDisabledCache)(e)?"/games/".concat(t,"/results/").concat(this.apiSignInUrl).concat((0,c.initDisableCache)()):"/games/".concat(t,"/results/").concat(this.apiSignInUrl),r="There was a problem fetching the results for the following game: ".concat(t),n&&(i+="".concat(n.constructMainFiltersUrl())),[4,this.fetchWithoutAuth(i,r)];case 1:return s=a.sent(),[2,this.gamesRemapper.remapPaginatedGameResults(s)]}}))}))},i.getMarketResultsForGame=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/games/".concat(t,"/correct-results/").concat(this.apiSignInUrl),i="There was a problem fetching the markets correct results for the following game: ".concat(t),(0,c.isDisabledCache)(e)&&(n+="".concat((0,c.initDisableCache)())),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.gamesRemapper.remapGameMarketsResults(r.data)]}}))}))},i.getContestWinners=function(t,e){return s(i,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/winners/".concat(this.apiSignInUrl,"&contest_id=").concat(t),i="There was a problem fetching winners for the following game: ".concat(t),e&&(n+=(0,c.initDisableCache)()),[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.gamesRemapper.remapContestWinners(r)]}}))}))},i.getPredictionById=function(t){return s(i,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="/predictions/".concat(t).concat(this.apiSignInUrl),n="There was a problem fetching info for the following prediction: ".concat(t),[4,this.fetchWithoutAuth(e,n)];case 1:return i=r.sent(),[4,this.predictionRemapper.remapResponseArrayBody([i.data])];case 2:return[2,r.sent()[0]]}}))}))},i.getPredictionsByIds=function(t){return s(i,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/predictions/by-ids".concat(this.apiSignInUrl,"&prediction_ids=").concat(t.join(",")),[4,this.fetchWithoutAuth(e,"There was a problem fetching predictions")];case 1:return n=i.sent(),[4,this.predictionRemapper.remapResponseArrayBody(n.data)];case 2:return[2,i.sent()]}}))}))},i.predictionRemapper=new u.default(e,n),i.matchSummaryRemapper=new l.default(e,n),i.gamesRemapper=new d.default,i.metaRemapper=new f.default,i}return r(e,t),e}(o(n(7724)).default);e.default=p},8863:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(4239)),c=o(n(7724)),d=o(n(3476)),h=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"privateLeagues"))||this;return n.remapper=null,n.discussionsRemapper=null,n.discussionsBaseURL=null,n.create=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/leagues"+this.apiSignInUrl,i="There was a problem ".concat("PRIVATE_LEAGUE"===e?"creating private league":"issuing challenge"),[4,this.fetchWithAuth(n,i,"POST",t)];case 1:return r=s.sent(),[2,this.remapper.remapToPrivateLeagueById(r.data)]}}))}))},n.update=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/leagues/".concat(t)+this.apiSignInUrl,r="There was a problem updating ".concat("PRIVATE_LEAGUE"===i?"private league":"challenge"),[4,this.fetchWithAuth(n,r,"PUT",e)];case 1:return s=a.sent(),[2,this.remapper.remapToPrivateLeagueById(s.data)]}}))}))},n.updateLeagueTemplate=function(t,e,i,r){return s(n,void 0,void 0,(function(){var n,s,o,u;return a(this,(function(a){switch(a.label){case 0:return n="/leagues/".concat(t,"/template")+this.apiSignInUrl,s="There was a problem updating template for the ".concat("PRIVATE_LEAGUE"===r?"private league":"challenge"),o={new_template_id:e,past_template_name:i},[4,this.fetchWithAuth(n,s,"POST",o)];case 1:return u=a.sent(),[2,this.remapper.remapToPrivateLeagueById(u.data)]}}))}))},n.getById=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/leagues/".concat(t)+this.apiSignInUrl,(0,u.isDisabledCache)(i)&&(n+=(0,u.initDisableCache)()),r="There was a problem getting ".concat("PRIVATE_LEAGUE"===e?"private league":"challenge"),[4,this.fetchWithAuth(n,r)];case 1:return s=a.sent(),[2,this.remapper.remapToPrivateLeagueById(s.data)]}}))}))},n.getMyLeagues=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r=this;return a(this,(function(s){switch(s.label){case 0:return n="/leagues"+this.apiSignInUrl+t.constructFiltersUrl(),i="There was a problem getting user's ".concat("PRIVATE_LEAGUE"===e?"private leagues":"challenges"),[4,this.fetchWithAuth(n,i)];case 1:return[2,s.sent().data.map((function(t){return r.remapper.remapToMyPrivateLeagues(t)}))]}}))}))},n.delete=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/leagues/".concat(t)+this.apiSignInUrl,i="There was a problem deleting ".concat("PRIVATE_LEAGUE"===e?"private league":"challenge"),[4,this.fetchWithAuth(n,i,"DELETE")];case 1:return r.sent(),[2,!0]}}))}))},n.invite=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/invite/".concat(t)+this.apiSignInUrl,i="There was a problem inviting the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"POST",r)];case 1:return[2,s.sent().data]}}))}))},n.deleteInvitation=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/invite/".concat(t)+this.apiSignInUrl,i="There was a problem deleting invitation for the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"DELETE",r)];case 1:return s.sent(),[2,!0]}}))}))},n.accept=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="/membership/accept/".concat(t)+this.apiSignInUrl+"&accept=".concat(e?"ACCEPT":"REJECT"),r="PRIVATE_LEAGUE"===i?"private league":"challenge",s="There was a problem ".concat(e?"accepting":"rejecting"," invitation for ").concat(r,": ").concat(t),[4,this.fetchWithAuth(n,s,"POST")];case 1:return o=a.sent(),[2,"PRIVATE_LEAGUE"===i?this.remapper.remapToAcceptPrivateLeague(o.data):this.remapper.remapToAcceptChallenge(o.data)]}}))}))},n.ban=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/ban/".concat(t)+this.apiSignInUrl,i="There was a problem banning the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"POST",r)];case 1:return[2,s.sent().data]}}))}))},n.unban=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/unban/".concat(t)+this.apiSignInUrl,i="There was a problem unbanning the following users: ".concat(e.join(",")),r={profiles:e},[4,this.fetchWithAuth(n,i,"POST",r)];case 1:return[2,s.sent().data]}}))}))},n.join=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/membership/join"+this.apiSignInUrl+"&invitation_code=".concat(t),[4,this.fetchWithAuth(e,"There was a problem joining league","POST")];case 1:return n=i.sent(),[2,this.remapper.remapToAcceptPrivateLeague(n.data)]}}))}))},n.leave=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/membership/leave/".concat(t)+this.apiSignInUrl,i="There was a problem leaving the following ".concat("PRIVATE_LEAGUE"===e?"league":"challenge",": ").concat(t),[4,this.fetchWithAuth(n,i,"POST")];case 1:return[2,r.sent().data]}}))}))},n.getInvitations=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/membership/invitations"+this.apiSignInUrl+e.constructMainFiltersUrl(),i="There was a problem getting invitations for ".concat("PRIVATE_LEAGUE"===t?"leagues":"challenges"),[4,this.fetchWithAuth(n,i)];case 1:return r=s.sent(),[2,this.remapper.remapToPrivateLeagues(r)]}}))}))},n.getReportedPosts=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/discussions/".concat(t,"/posts/reported").concat(this.apiSignInUrl),i="There was a problem fetching posts for the following: ".concat(t),e&&(n+=e.constructMainFiltersUrl()),[4,this.fetchWithAuthNewBaseURL(this.discussionsBaseURL,n,i)];case 1:return r=s.sent(),[2,this.discussionsRemapper.remapToPostsForDiscussion(r,"full")]}}))}))},n.getPredictions=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/leagues/".concat(t,"/predictions")+this.apiSignInUrl,i="There was a problem getting predictions for private league: ".concat(t),e&&(n+=e.constructFiltersUrl()),[4,this.fetchWithAuth(n,i)];case 1:return r=s.sent(),[2,this.remapper.remapPredictions(r)]}}))}))},n.moderatePost=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/posts/".concat(t,"/admin/moderate").concat(this.apiSignInUrl),i="There was a problem moderating the following post: ".concat(t),r={moderation_reason:e},[4,this.fetchWithAuthNewBaseURL(this.discussionsBaseURL,n,i,"POST",r)];case 1:return s=a.sent(),[2,this.discussionsRemapper.remapToPostByIdBasic(s.data)]}}))}))},n.discussionsBaseURL=(0,u.setBaseUrl)(e.environment,"discussions"),n.remapper=new l.default,n.discussionsRemapper=new d.default,n}return r(e,t),e}(c.default);e.default=h},4275:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(441)),c=o(n(8673)),d=o(n(6277)),h=o(n(1712)),f=o(n(7724)),p="/profile",m="/profiles",v=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"profile"))||this;return n.profileRemapper=null,n.followingRemapper=null,n.followersRemapper=null,n.lang=null,n.limitIds=100,n.getCountries=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="&lang=".concat(this.lang),n="".concat("/countries").concat(this.apiSignInUrl).concat(e),i=Date.now(),t&&(n+="&disable_cache=".concat(i)),[4,this.fetchWithoutAuth(n,"There was a problem fetching profile countries")];case 1:return[2,r.sent().data]}}))}))},n.getProfile=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="".concat(p).concat(this.apiSignInUrl),n="",t?(e="".concat(m,"/").concat(t).concat(this.apiSignInUrl),n="There was a problem fetching the following profile: ".concat(t),[4,this.fetchWithoutAuth(e,n)]):[3,2];case 1:case 3:return i=r.sent(),[2,this.profileRemapper.fullProfileFromResponse(i.data)];case 2:return n="There was a problem fetching your profile from API",[4,this.fetchWithAuth(e,n)]}}))}))},n.getProfiles=function(t,e,i){return s(n,void 0,void 0,(function(){var n,r,s,o,l,c,d,h,f,p,v,_,y;return a(this,(function(a){switch(a.label){case 0:if(n=Date.now(),r="There was a problem fetching the following profiles: ".concat(t.join(",")),!t||!t.length)return[3,7];if(!(t.length>this.limitIds))return[3,5];s=[],o=(0,u.limitIds)(t,this.limitIds),l=0,c=o,a.label=1;case 1:return l<c.length?(d=c[l],h="".concat(m).concat(this.apiSignInUrl,"&profile_ids=").concat(d.join(",")),r="There was a problem fetching the following profiles: ".concat(d.join(",")),i&&(h+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(h,r)]):[3,4];case 2:f=a.sent(),s.push.apply(s,this.profileRemapper.profilesFromResponse(f.data)),a.label=3;case 3:return l++,[3,1];case 4:return[2,s];case 5:return p="".concat(m).concat(this.apiSignInUrl,"&profile_ids=").concat(t.join(",")),i&&(p+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(p,r)];case 6:return v=a.sent(),[2,this.profileRemapper.profilesFromResponse(v.data)];case 7:return _="".concat(m).concat(this.apiSignInUrl,"&search=").concat(e),i&&(_+="&disable_cache=".concat(n)),[4,this.fetchWithoutAuth(_,r)];case 8:return y=a.sent(),[2,this.profileRemapper.profilesFromResponse(y.data)]}}))}))},n.getFollowers=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="".concat(p,"/followers").concat(this.apiSignInUrl),i="There was a problem fetching the followers for own profile",!t||e?[3,2]:(n="".concat(p,"/followers").concat(this.apiSignInUrl).concat(t.constructFilterUrl()),[4,this.fetchWithAuth(n,i)]);case 1:return r=a.sent(),[2,this.followersRemapper.followersFromResponse(r)];case 2:return t||e?[3,4]:[4,this.fetchWithAuth(n,i)];case 3:return s=a.sent(),[2,this.followersRemapper.followersFromResponse(s)];case 4:return t&&e?n="".concat(p,"/").concat(e,"/followers").concat(this.apiSignInUrl).concat(t.constructFilterUrl()):!t&&e&&(n="".concat(p,"/").concat(e,"/followers").concat(this.apiSignInUrl)),i="There was a problem fetching the followers for profile: ".concat(e),[4,this.fetchWithoutAuth(n,i)];case 5:return o=a.sent(),[2,this.followersRemapper.followersFromResponse(o)]}}))}))},n.getFollowing=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s,o;return a(this,(function(a){switch(a.label){case 0:return n="".concat(p,"/following").concat(this.apiSignInUrl),i="There was a problem fetching the followers of own profile",!t||e?[3,2]:(n="".concat(p,"/following").concat(this.apiSignInUrl).concat(t.constructFilterUrl()),[4,this.fetchWithAuth(n,i)]);case 1:return r=a.sent(),[2,this.followingRemapper.followingFromResponse(r)];case 2:return t||e?[3,4]:[4,this.fetchWithAuth(n,i)];case 3:return s=a.sent(),[2,this.followingRemapper.followingFromResponse(s)];case 4:return t&&e?n="".concat(p,"/").concat(e,"/following").concat(this.apiSignInUrl).concat(t.constructFilterUrl()):!t&&e&&(n="".concat(p,"/").concat(e,"/following").concat(this.apiSignInUrl)),i="There was a problem fetching the followers of the following profile: ".concat(e),[4,this.fetchWithoutAuth(n,i)];case 5:return o=a.sent(),[2,this.followingRemapper.followingFromResponse(o)]}}))}))},n.follow=function(t){return s(n,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(s){switch(s.label){case 0:return(e=new h.default).profile_ids=t,n=p+"/follow".concat(this.apiSignInUrl),i="There was a problem with following profiles: ".concat(t.join(",")),[4,this.fetchWithAuth(n,i,"POST",e)];case 1:return r=s.sent(),[2,this.followingRemapper.followResponse(r.data)]}}))}))},n.unfollow=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return(e=new h.default).profile_ids=t,n=p+"/follow".concat(this.apiSignInUrl),i="There was a problem with unfollowing profiles: ".concat(t.join(",")),[4,this.fetchWithAuth(n,i,"DELETE",e)];case 1:return r.sent(),[2,!0]}}))}))},n.getBadges=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="".concat(p,"/badges").concat(this.apiSignInUrl),n="There was a problem with fetching own badges",t?(e="".concat(p,"/").concat(t,"/badges").concat(this.apiSignInUrl),n="There was a problem with fetching the badges",[4,this.fetchWithoutAuth(e,n)]):[3,2];case 1:case 3:return[2,i.sent().data];case 2:return[4,this.fetchWithAuth(e,n)]}}))}))},n.updateProfile=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e=p+this.apiSignInUrl,[4,this.fetchWithAuth(e,"There was a problem updating the own profile","PATCH",t)];case 1:return n=i.sent(),[2,this.profileRemapper.fullProfileFromResponse(n.data)]}}))}))},n.lang=e.lang,n.profileRemapper=new l.default,n.followingRemapper=new c.default,n.followersRemapper=new d.default,n}return r(e,t),e}(f.default);e.default=v},1613:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(712),l=o(n(6829)),c=function(t){function e(e){var n=t.call(this,e,(0,u.setBaseUrl)(e.environment,"voting"))||this;return n.pollRemapper=null,n.getPolls=function(t,e){return s(n,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:return n="/polls".concat(this.apiSignInUrl),t&&(n+=t.constructMainFiltersUrl()),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),[4,this.fetchWithoutAuth(n,"There was a problem fetching polls")];case 1:return i=r.sent(),[2,this.pollRemapper.remapPolls(i)]}}))}))},n.getPollById=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r;return a(this,(function(s){switch(s.label){case 0:return n="/polls/".concat(t).concat(this.apiSignInUrl),(0,u.isDisabledCache)(e)&&(n+=(0,u.initDisableCache)()),i="There was a problem fetching the following poll: "+t,[4,this.fetchWithoutAuth(n,i)];case 1:return r=s.sent(),[2,this.pollRemapper.remapPollById(r.data)]}}))}))},n.voteForPoll=function(t,e){return s(n,void 0,void 0,(function(){var n,i,r,s;return a(this,(function(a){switch(a.label){case 0:return n="/polls/".concat(t,"/votes").concat(this.apiSignInUrl),i={option_id:e},r="There was a problem voting for the following poll: "+t,[4,this.fetchWithAuth(n,r,"PUT",i)];case 1:return s=a.sent(),[2,this.pollRemapper.remapUserVote(s.data)]}}))}))},n.deleteVoteForPoll=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/polls/".concat(t,"/votes").concat(this.apiSignInUrl),n="There was a problem deleting vote for the following poll: "+t,[4,this.fetchWithAuth(e,n,"DELETE")];case 1:return i.sent(),[2,!0]}}))}))},n.getMyPollVote=function(t){return s(n,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){switch(r.label){case 0:return e="/polls/".concat(t,"/votes").concat(this.apiSignInUrl),n="There was a problem fetching user's own vote for the following poll: "+t,[4,this.fetchWithAuth(e,n)];case 1:return i=r.sent(),[2,this.pollRemapper.remapPollVote(i.data)]}}))}))},n.getMyPollsVotes=function(t){return s(n,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return e="/polls/votes".concat(this.apiSignInUrl),t&&(e+=t.constructMainFiltersUrl()),[4,this.fetchWithAuth(e,"There was a problem fetching user's votes for polls")];case 1:return n=i.sent(),[2,this.pollRemapper.remapPollsVotes(n)]}}))}))},n.pollRemapper=new l.default,n}return r(e,t),e}(o(n(7724)).default);e.default=c},5792:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8539)),o=s(n(8358));e.default=function(t){var e=this;this.localCache=null,this.https=null,this.getEntitiesByIds=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i,a,o;return r(this,(function(r){switch(r.label){case 0:return[4,this.setTopIdMappings()];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),e=this.localCache.checkForExistingIdObjs(t,n),i=this.splitForRequestAndExisting(e),[4,this.https.getEntitiesByIdObjs(i.request,n)];case 3:return a=r.sent(),this.localCache.addIdMappings(a),[2,this.localCache.getIdsByType(t,n,s)];case 4:return o=r.sent(),console.warn("There was a problem retrieving the entity ids ",o),[2,Promise.resolve([])];case 5:return[2]}}))}))},this.getEntityById=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return(e=this.localCache.getEntity(t,n,s))?[2,e]:[4,this.requestEntity(t,n,s)];case 1:return i=r.sent(),this.localCache.addIdMappings(i),i&&i.length>0?[2,i[0]]:[2,null]}}))}))},this.splitForRequestAndExisting=function(t){var e={},n={};return Object.keys(t).forEach((function(i){e[i]=t[i].filter((function(t){return!t.exists})).map((function(t){return t.id})),n[i]=t[i].filter((function(t){return t.exists})).map((function(t){return t.id}))})),{existing:n,request:e}},this.requestEntity=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=Array.isArray(t)?t:[t],[4,this.https.getEntitiesByIds(n,t,s)];case 1:return[2,i.sent()];case 2:return e=i.sent(),console.warn("There was a problem retrieving the requested entity: ".concat(e)),[2,null];case 3:return[2]}}))}))},this.setTopIdMappings=function(){return i(e,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return t=Math.floor(Date.now()/1e3),this.localCache.getExpiration("football","ids")>t?[2,Promise.resolve()]:[4,this.https.getTopEntities()];case 1:return e=n.sent(),this.localCache.addTopIdMappings(e),[2]}}))}))},this.localCache=(new o.default).createLocalCacheInstance(t.idSchema),this.https=new a.default(t)}},8900:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(5792)),u=s(n(7611)),l=s(n(9052));e.default=function(t){var e=this;this.idSchema="",this.idMappingFacade=null,this.getEntityIdBySchemaId=function(t,n){return e.idMappingFacade.getEntityById(n,t,e.idSchema)},this.remapEntities=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s;return r(this,(function(r){e=JSON.parse(JSON.stringify(t));try{return this.idSchema!==a.IdSchemaEnum.NATIVE?(i=new u.default,s=i.traverse(e,n),[2,this.idMappingFacade.getEntitiesByIds(s,"native",this.idSchema).then((function(t){return(new l.default).traverse(e,n,t)}))]):[2,t]}catch(t){return console.warn("There was a problem remapping entity: ".concat(n," with inner entity "),t),[2,[]]}return[2]}))}))},this.getEntityIdsBySchemaId=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return(e={})[n]=t,this.idSchema===a.IdSchemaEnum.NATIVE?[3,2]:[4,this.idMappingFacade.getEntitiesByIds(e,this.idSchema,s)];case 1:return[2,i.sent()];case 2:return[2,e]}}))}))},this.idSchema=t.idSchema,this.idMappingFacade=new o.default(t)}},3845:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConvert=void 0,e.typeConvert=function(t){switch(t){case"competitions":return"competition";case"players":case"relatedPlayer":case"squad":return"player";case"teams":case"participants":case"homeTeam":case"awayTeam":case"timeline":case"teamId":return"team";default:return t}}},7611:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3845);e.default=function(){var t=this;this.extractedObjIds={},this.traverse=function(e,n){return n=(0,i.typeConvert)(n),Array.isArray(e)?t.traverseArrExtract(e,n):e&&"object"==typeof e&&t.traverseObjExtract(e,n),t.extractedObjIds},this.traverseArrExtract=function(e,n){e&&e.length>0&&e.forEach((function(e){t.traverseObjExtract(e,n)}))},this.traverseObjExtract=function(e,n){e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(i){var r=e[i];"id"===i||"teamId"===i?(t.extractedObjIds.hasOwnProperty(n)||(t.extractedObjIds[n]=[]),r&&t.extractedObjIds[n].push(r)):e[i]&&t.traverse(e[i],i)}))}}},9052:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3845);e.default=function(){var t=this;this.replaceObjIdsIndex=null,this.remappedIdsObj={},this.traverse=function(e,n,r){return n=(0,i.typeConvert)(n),null===t.replaceObjIdsIndex&&(t.initReplaceObjIdsIndex(r),t.remappedIdsObj=r),Array.isArray(e)?t.traverseArrReplace(e,n):e&&"object"==typeof e&&t.traverseObjReplace(e,n),e},this.initReplaceObjIdsIndex=function(e){t.replaceObjIdsIndex={},Object.keys(e).forEach((function(e){t.replaceObjIdsIndex[e]=0}))},this.traverseArrReplace=function(e,n){e&&e.length>0&&e.forEach((function(e){t.traverseObjReplace(e,n)}))},this.traverseObjReplace=function(e,n){e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(i){"id"===i||"teamId"===i?e[i]&&(e[i]=t.remappedIdsObj[n][t.replaceObjIdsIndex[n]],t.replaceObjIdsIndex[n]=t.replaceObjIdsIndex[n]+1):e[i]&&t.traverse(e[i],i,t.remappedIdsObj)}))}}},7302:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(5936));e.default=function(t){var e=this;this.add=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.add(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.like=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.like(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.dislike=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.dislike(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addPageview=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addPageview(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addContentConsumed=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addContentConsumed(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addShare=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addShare(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addComment=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addComment(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addClickAd=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addClickAd(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.addConversion=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.addConversion(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getOwn=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.getOwn(t,n)];case 1:return[2,e.sent()]}}))}))},this.getForUser=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityFacade.getForUser(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.activityFacade=new a.default(t)}},1491:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.ActionsEnum=void 0,(n=e.ActionsEnum||(e.ActionsEnum={})).LIKE="like",n.DISLIKE="dislike",n.PAGE_VIEW="page_view",n.CONTENT_CONSUMED="content_consumed",n.SHARE="share",n.COMMENT="comment",n.CLICK_AD="click_ad",n.CONVERSION="conversion",n.PREDICTION_MADE="prediction_made",n.CONVERT="convert",n.MANAGE_INTERESTS="manage_interests",n.GAME_PARTICIPATION="game_participation",n.ARTICLE_CONSUMED="article_consumed",n.VIDEO_CONSUMED="video_consumed",n.SHORT_VIDEO_CONSUMED="short_video_consumed",n.LONG_VIDEO_CONSUMED="long_video_consumed",n.AUDIO_CONSUMED="audio_consumed",n.GALLERY_CONSUMED="gallery_consumed",n.IMAGE_CONSUMED="image_consumed",n.POLL_PARTICIPATION="poll_participation"},5936:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=a(n(1022)),l=n(1491),c=a(n(4630)),d=a(n(8261)),h=a(n(629)),f=a(n(8636));e.default=function(t){var e=this;this.add=function(t,n,s,a){return i(e,void 0,void 0,(function(){var e,i,u,l,d;return r(this,(function(r){switch(r.label){case 0:return this.idSchema==o.IdSchemaEnum.NATIVE?[3,3]:(e=JSON.parse(JSON.stringify(n)),[4,this.activityService.remapTagsIds(n,this.idSchema,o.IdSchemaEnum.NATIVE)]);case 1:return i=r.sent(),u=new c.default(t,i,s,a),[4,this.activityHttps.createActivity(u)];case 2:return(l=r.sent()).context.tags=e,[2,l];case 3:return d=new c.default(t,n,s,a),[2,this.activityHttps.createActivity(d)]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.activityHttps.deleteActivity(t)];case 1:return[2,e.sent()]}}))}))},this.like=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.LIKE,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.dislike=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.DISLIKE,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addPageview=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.PAGE_VIEW,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addContentConsumed=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.CONTENT_CONSUMED,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addShare=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.SHARE,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addComment=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.COMMENT,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addClickAd=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.CLICK_AD,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.addConversion=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=l.ActionsEnum.CONVERSION,[4,this.add(e,t,n,s)];case 1:return[2,i.sent()]}}))}))},this.getOwn=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s,a;return r(this,(function(r){switch(r.label){case 0:return n=n||!1,t&&(t=new h.default(t)),this.idSchema==o.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getOwnActivities(t,n)];case 1:e=r.sent(),i=0,s=e.data,r.label=2;case 2:return i<s.length?(a=s[i],[4,this.activityService.remapTagsIds(a.context.tags,o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:r.sent(),r.label=4;case 4:return i++,[3,2];case 5:return[2,e];case 6:return[4,this.activityHttps.getOwnActivities(t,n)];case 7:return[2,r.sent()]}}))}))},this.getForUser=function(t,n,a){return i(e,void 0,void 0,(function(){var e,i,u,l,c;return r(this,(function(r){switch(r.label){case 0:return a=a||!1,n&&(n=new f.default(n)),this.idSchema==o.IdSchemaEnum.NATIVE?[3,6]:[4,this.activityHttps.getActivitiesForUser(t,n,a)];case 1:e=r.sent(),i=JSON.parse(JSON.stringify(e)),u=0,l=i.data,r.label=2;case 2:return u<l.length?(c=l[u],[4,this.activityService.remapTagsIds(s([],c.context.tags,!0),o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:r.sent(),r.label=4;case 4:return u++,[3,2];case 5:return[2,i];case 6:return[4,this.activityHttps.getActivitiesForUser(t,n,a)];case 7:return[2,r.sent()]}}))}))},this.idSchema=t.idSchema,this.activityHttps=new u.default(t),this.activityService=new d.default(t)}},1517:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2820));e.default=function(){this.id=null,this.profileId=null,this.property=null,this.value=null,this.action=null,this.context=new r.default,this.points=0}},2195:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.page=null,this.limit=null,this.page=t.page?t.page:null,this.limit=t.limit?t.limit:null}},629:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.action=null,n.action=e.action?e.action:null,n}return r(e,t),e.prototype.constructFilterUrl=function(){var t="";return this.action&&(t+="&",t+="action=".concat(this.action)),this.page&&(t+="&",t+="page=".concat(this.page)),this.limit&&(t+="&",t+="limit=".concat(this.limit)),t},e}(s(n(2195)).default);e.default=a},8636:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.action=null,n.action=e.action?e.action:null,n}return r(e,t),e.prototype.constructFilterUrl=function(){var t="";return this.action&&(t+="&",t+="action=".concat(this.action)),this.page&&(t+="&",t+="page=".concat(this.page)),this.limit&&(t+="&",t+="limit=".concat(this.limit)),t},e}(s(n(2195)).default);e.default=a},6021:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3569)),s=i(n(1517));e.default=function(){this.meta=new r.default,this.data=[new s.default]}},2820:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.content=null,this.tags=[],this.campaign=null}},7060:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.source=null,this.type=null}},4630:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2820));e.default=function(t,e,n,i){this.action=null,this.context=new r.default,this.action=t,this.context.tags=e,n&&(this.context.content=n),i&&(this.context.campaign=i)}},2453:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(817),a=n(7974),o=r(n(1758)),u=r(n(6635)),l=r(n(3009)),c=r(n(7165)),d=r(n(5490)),h=r(n(1316)),f=r(n(3195)),p=r(n(1342)),m=r(n(9826)),v=r(n(3087)),_=r(n(1517)),y=r(n(6021));e.default=function(){var t=this;this.remapSingleResponse=function(t){var e=new _.default;return e.id=t.id,e.profileId=t.profile_id,e.property=t.property,e.value=t.value,e.action=t.action,e.context.content=t.context.content,e.context.tags=t.context.tags,e.context.campaign=t.context.campaign,e.points=t.points,e},this.remapActivitiesResponse=function(e){var n=new y.default;return n.meta.pagination.currentPage=e.meta.pagination.current_page,n.meta.pagination.itemsPerPage=e.meta.pagination.items_per_page,n.meta.pagination.numberOfPages=e.meta.pagination.number_of_pages,n.meta.pagination.totalItems=e.meta.pagination.total_items,n.data=e.data.map((function(e){return t.remapSingleResponse(e)})),n},this.remapStatsResponse=function(e){var n=new h.default;return n.profileId=e.profile_id,n.tier=e.tier,n.points=e.points,n.predictionsMade=e.predictions_made,n.successRates.overallPercent=e.success_rates.overall_percent,n.successRates.byFootballCompetition=t.constructNewRecord(e.success_rates.by_competition),n.successRates.byFootballTeam=t.constructNewRecord(e.success_rates.by_team),n.successRates.byFootballMarket=t.constructNewRecord(e.success_rates.by_market),n.predictions=e.predictions?t.remapPredictionsStats(e.predictions):null,n.tiers=e.tiers?t.remapAchievementsStats(e.tiers):null,n.badges=e.badges?t.remapAchievementsStats(e.badges):null,n.discussions=e.discussions?t.remapDiscussionStats(e.discussions):null,n.classicQuizzes=e.classic_quizzes?t.remapClassicQuizStats(e.classic_quizzes):null,n.eitherOr=e.either_or?t.remapEitherOrStats(e.either_or):null,n},this.constructNewRecord=function(e){var n;return Object.entries(e).length?(Object.entries(e).forEach((function(e){var r,s=e[0],o=e[1];n=i(i({},n),((r={})[s]=t.remapSuccessRatePercent(o),r)),a.MarketEnum[s]&&delete n[s].model})),n):e},this.remapSuccessRatePercent=function(t){var e=new m.default;return e.successRatePercent=t.success_rate_percent,e},this.remapPredictionsStats=function(e){var n=new d.default;return n.single=t.remapSinglePredictionsStats(e.single),n.topX=e.top_x,n.matchQuiz=e.match_quiz,n},this.remapSinglePredictionsStats=function(e){var n=new p.default;return n.predictionsMade=e.predictions_made,n.correct=e.correct,n.points=e.points,n.breakdown=t.remapBreakdownSinglePredictionsStats(e.breakdown),n},this.remapBreakdownSinglePredictionsStats=function(t){if(t&&Object.keys(t).length){var e=new v.default,n=[],i=[];return Object.keys(t).forEach((function(e){var r=new f.default;r.entityId=e,r.entityType=t[e].entity_type,r.entitySource=t[e].entity_source,r.predictionsMade=t[e].predictions_made,r.correct=t[e].correct,r.points=t[e].points,r.entityType===s.EntityTypeEnum.COMPETITION?n.push(r):r.entityType===s.EntityTypeEnum.TEAM&&i.push(r)})),e.footballCompetitions=n,e.footballTeams=i,e}return new v.default},this.remapAchievementsStats=function(t){return t.map((function(t){var e=new o.default;return e.id=t.id,e.achievedAt=t.achieved_at,e}))},this.remapDiscussionStats=function(t){var e=new l.default;return e.totalPoints=t.total_points,e.postPoints=t.post_points,e.postsMade=t.posts_made,e.reactionPoints=t.reaction_points,e.reactionCount=t.reaction_count,e},this.remapClassicQuizStats=function(t){var e=new u.default;return e.participationCount=t.participation_count,e.points=t.points,e},this.remapEitherOrStats=function(t){var e=new c.default;return e.participationCount=t.participation_count,e}}},8261:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900));e.default=function(t){var e=this;this.remapTagsIds=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i,a,o,u,l,c,d,h,f;return r(this,(function(r){switch(r.label){case 0:return t&&t.length?(e={},i={},a=[],t.forEach((function(t){e.hasOwnProperty(t.type)||(e[t.type]=[],i[t.type]=[]),e[t.type].push(t.id),i[t.type].push(t)})),[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,n,s)]):[2,t];case 1:for(o=r.sent(),u=function(t,e){e.forEach((function(e,n){e.id=o[t][n],a.push(e)}))},l=0,c=Object.entries(i);l<c.length;l++)d=c[l],h=d[0],f=d[1],u(h,f);return[2,a]}}))}))},this.idSchema=t.idSchema,this.idMapping=new a.default(t)}},4068:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(123));e.default=function(t){var e=this;this.facade=null,this.issue=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.issue(t,n)];case 1:return[2,e.sent()]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.update(t,n)];case 1:return[2,e.sent()]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.updateTemplate(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyChallenges=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyChallenges(t)];case 1:return[2,e.sent()]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.accept(t)];case 1:return[2,e.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.reject(t)];case 1:return[2,e.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.leave(t)];case 1:return[2,e.sent()]}}))}))},this.getMyChallengesStandings=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyChallengesStandings(t)];case 1:return[2,e.sent()]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getInvitations(t)];case 1:return[2,e.sent()]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getReportedPosts(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPredictions(t,n)];case 1:return[2,e.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},123:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7059)),o=s(n(8863)),u=s(n(5955)),l=s(n(3886)),c=s(n(9759)),d=n(4021),h=n(4904),f=s(n(2535)),p=n(5318),m=s(n(8247)),v=s(n(2590)),_=s(n(6409)),y=s(n(3820)),g=s(n(5230)),b=s(n(2388));e.default=function(t){var e=this;this.factory=null,this.https=null,this.loyaltyHttps=null,this.profile=null,this.service=null,this.discussionsService=null,this.issue=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s;return r(this,(function(r){switch(r.label){case 0:return e=this.factory.createRequestBodyFromParam(t,"ONE_VS_ONE"),[4,this.https.create(e,"CHALLENGE")];case 1:return i=r.sent(),[4,this.service.setTemplateModels(i)];case 2:return r.sent(),[4,this.https.invite(i.id,[n])];case 3:return s=r.sent(),i.invites=[],i.invites.push(s[0]),[2,i]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return e=this.factory.createUpdateRequestBodyFromParam(n,"ONE_VS_ONE"),[4,this.https.update(t,e,"CHALLENGE")];case 1:return i=r.sent(),[4,this.service.setTemplateModels(i)];case 2:return r.sent(),[2,i]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.https.updateLeagueTemplate(t,n,s,"CHALLENGE")];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.delete(t,"CHALLENGE")];case 1:return[2,e.sent()]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.https.getById(t,"CHALLENGE",n)];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.getMyChallenges=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return t=new b.default(t),[4,this.https.getMyLeagues(t,"CHALLENGE")];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e)];case 2:return n.sent(),[2,e]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!0,[4,this.https.accept(t,e,"CHALLENGE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!1,[4,this.https.accept(t,e,"CHALLENGE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.leave(t,"CHALLENGE")];case 1:return[2,e.sent()]}}))}))},this.finalizeAcceptModel=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return n?[4,this.getById(t.challengeId)]:[3,2];case 1:e=i.sent(),t.challengeModel=e,i.label=2;case 2:return[4,this.service.setProfileModel(t)];case 3:return i.sent(),[2,t]}}))}))},this.getMyChallengesStandings=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new y.default(t)),[4,this.profile.getOwn().getInfo()];case 1:return e=r.sent(),[4,this.loyaltyHttps.getUserRankingsForPrivateLeagueAndChallenges(e.id,"CHALLENGE",t)];case 2:n=r.sent(),i=0,s=n.data,r.label=3;case 3:return i<s.length?(a=s[i],[4,this.getById(a.challengeId)]):[3,6];case 4:o=r.sent(),a.challengeModel=o,r.label=5;case 5:return i++,[3,3];case 6:return this.service.setTemplateModelsFromLeagueModels(n.data,"CHALLENGE"),[2,n]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return(t=new l.default(t)).type="ONE_VS_ONE",[4,this.https.getInvitations("CHALLENGE",t)];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e.data)];case 2:return n.sent(),[2,e]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return n&&(n=new c.default(n)),[4,this.https.getReportedPosts(t,n)];case 1:return e=r.sent(),i=e,[4,this.discussionsService.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:if(n){if(n.limit&&n.limit>20)throw new f.default(d.ErrorCodes.BAD_METHOD_CALL,h.ErrorStatuses.INVALID_LIMIT,p.ErrorMessages.INVALID_LIMIT);n=new m.default(n)}return[4,this.https.getPredictions(t,n)];case 1:return e=i.sent(),[4,this.service.setModelsForPredictions(e)];case 2:return[2,i.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.factory=new u.default,this.https=new o.default(t),this.service=new v.default(t),this.loyaltyHttps=new a.default(t),this.profile=new _.default(t),this.discussionsService=new g.default(t)}},6085:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.profileId="",this.profileModel=null,this.challengeId="",this.challengeModel=null,this.message=""}},5124:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ONE_VS_ONE",e}return r(e,t),e}(s(n(2167)).default);e.default=a},9845:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ONE_VS_ONE",e}return r(e,t),e}(s(n(4584)).default);e.default=a},3820:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=null,this.page=null,this.challengeId=null,this.templateId=null,this.sortOrder=null,this.constructFiltersUrl=function(){var t="";return e.limit&&(t+="&limit=".concat(e.limit)),e.page&&(t+="&page=".concat(e.page)),e.challengeId&&(t+="&league_id=".concat(e.challengeId)),e.templateId&&(t+="&template_id=".concat(e.templateId)),e.sortOrder&&(t+="&sort_order=".concat(e.sortOrder)),t},this.limit=t&&t.limit?t.limit:null,this.page=t&&t.page?t.page:null,this.challengeId=t&&t.challengeId?t.challengeId:null,this.templateId=t&&t.templateId?t.templateId:null,this.sortOrder=t&&t.sortOrder?t.sortOrder:null}},2388:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.type="ONE_VS_ONE",this.userRole=null,this.constructFiltersUrl=function(){var t="&type=".concat(e.type);return e.userRole&&(t+="&user_role=".concat(e.userRole)),t},this.userRole=(null==t?void 0:t.userRole)||null}},1298:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId="",this.templateModel=null,this.challengeId="",this.challengeModel=null,this.position="",this.points=0,this.type="challenge"}},244:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(5645));e.default=function(t){var e=this;this.facade=null,this.getAll=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getAll(t,n)];case 1:return[2,e.sent()]}}))}))},this.getById=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getById(t)];case 1:return[2,e.sent()]}}))}))},this.createPost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.createPost(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPostById=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPostById(t)];case 1:return[2,e.sent()]}}))}))},this.updatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.updatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.deletePost=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.deletePost(t)];case 1:return[2,e.sent()]}}))}))},this.getPosts=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPosts(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPostReplies=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPostReplies(t,n)];case 1:return[2,e.sent()]}}))}))},this.react=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.reactToPost(t,n)];case 1:return[2,e.sent()]}}))}))},this.reportPost=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.reportPost(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getOwnPosts=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getOwnPosts(t)];case 1:return[2,e.sent()]}}))}))},this.getUserPosts=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getUserPosts(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.facade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getPostsCount=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPostsCount(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopDiscussions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getTopDiscussions(t,n)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},5645:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4946),c=n(4021),d=n(4904),h=u(n(8097)),f=u(n(2535)),p=n(5318),m=s(n(7686)),v=u(n(7945)),_=u(n(8261)),y=u(n(5383)),g=u(n(505)),b=u(n(9209)),w=u(n(4804)),I=u(n(5230));e.default=function(t){var e=this;this.idSchema=null,this.errorHandlingMode=null,this.https=null,this.clientHttps=null,this.activityService=null,this.service=null,this.factory=null,this.getAll=function(t,n){return a(e,void 0,void 0,(function(){var e,i,r,s;return o(this,(function(a){switch(a.label){case 0:return t&&(t=new g.default(t)),[4,this.https.getAll(t,n)];case 1:e=a.sent(),i=0,r=e.data,a.label=2;case 2:return i<r.length?(s=r[i],[4,this.remapTags(s,l.IdSchemaEnum.NATIVE,this.idSchema)]):[3,5];case 3:a.sent(),a.label=4;case 4:return i++,[3,2];case 5:return[2,e]}}))}))},this.getById=function(t){return a(e,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.https.getById(t)];case 1:return e=n.sent(),[4,this.remapTags(e,l.IdSchemaEnum.NATIVE,this.idSchema)];case 2:return n.sent(),[2,e]}}))}))},this.createPost=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return e=JSON.parse(JSON.stringify(n)),[4,this.remapTags(e,this.idSchema,l.IdSchemaEnum.NATIVE)];case 1:return r.sent(),i=this.factory.createRequestBodyFromParam(e),[4,this.https.createPost(t,i)];case 2:return[2,r.sent()]}}))}))},this.getPostById=function(t){return a(e,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,this.https.getPostById(t)];case 1:return e=n.sent(),[4,this.service.finalizePostFullModel([e])];case 2:return[2,n.sent()[0]]}}))}))},this.updatePost=function(t,n){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.updatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.deletePost=function(t){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.deletePost(t)];case 1:return[2,e.sent()]}}))}))},this.getPosts=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return n&&(n=new b.default(n)),[4,this.https.getPosts(t,n)];case 1:return e=r.sent(),i=e,[4,this.service.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.getPostReplies=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return n&&(n=new b.default(n)),[4,this.https.getPostReplies(t,n)];case 1:return e=r.sent(),i=e,[4,this.service.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.reactToPost=function(t,n){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.reactToPost(t,n)];case 1:return[2,e.sent()]}}))}))},this.reportPost=function(t,n,i){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.https.reportPost(t,n,i)];case 1:return[2,e.sent()]}}))}))},this.getOwnPosts=function(t){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return t&&(t=new b.default(t)),[4,this.https.getOwnPosts(t)];case 1:return[2,e.sent()]}}))}))},this.getUserPosts=function(t,n,i){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return n&&(n=new b.default(n)),[4,this.https.getUserPosts(t,n,i)];case 1:return[2,e.sent()]}}))}))},this.getConfig=function(){return a(e,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(m.FeatureConfigType.DISCUSSIONS)];case 1:return[2,t.sent()]}}))}))},this.getPostsCount=function(t,n){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if(!t||!Array.isArray(t)||!t.length){if("standard"===this.errorHandlingMode)throw new f.default(c.ErrorCodes.BAD_METHOD_CALL,d.ErrorStatuses.INVALID_DISCUSSION_IDS,p.ErrorMessages.INVALID_DISCUSSION_IDS);throw new h.default(c.ErrorCodes.BAD_METHOD_CALL,d.ErrorStatuses.INVALID_DISCUSSION_IDS,p.ErrorMessages.INVALID_DISCUSSION_IDS)}return[4,this.https.getPostsCount(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopDiscussions=function(t,n){return a(e,void 0,void 0,(function(){var e,i,r,s;return o(this,(function(a){switch(a.label){case 0:return t?(t=new w.default(t),[4,this.service.finalizeTopDiscussionsFilters(t)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[4,this.https.getTopDiscussions(t,n)];case 3:e=a.sent(),i=0,r=e.data,a.label=4;case 4:return i<r.length?(s=r[i],[4,this.remapTags(s,l.IdSchemaEnum.NATIVE,this.idSchema)]):[3,7];case 5:a.sent(),a.label=6;case 6:return i++,[3,4];case 7:return[2,e]}}))}))},this.remapTags=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r;return o(this,(function(s){switch(s.label){case 0:return this.idSchema!=l.IdSchemaEnum.NATIVE&&t.context&&t.context.tags&&t.context.tags.length?(e=JSON.parse(JSON.stringify(t.context.tags)),[4,this.activityService.remapTagsIds(e,n,i)]):[3,2];case 1:r=s.sent(),t.context.tags=r,s.label=2;case 2:return[2]}}))}))},this.idSchema=t.idSchema,this.errorHandlingMode=t.errorHandlingMode,this.https=new v.default(t),this.clientHttps=new m.default(t),this.activityService=new _.default(t),this.service=new I.default(t),this.factory=new y.default}},5383:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5678));e.default=function(){this.createRequestBodyFromParam=function(t){var e=new r.default;return e.content=t.content,e.reply_id=t.replyId,e.anonymous_nickname=t.userNickname,e.context=t.context,e}}},3949:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1079));e.default=function(){this.enabled=!1,this.moderateLinks=!1,this.linksWhitelist=[],this.moderatorProfileId="",this.dictionary=new r.default}},1079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.reason="",this.words=[]}},8543:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3949));e.default=function(){this.enabled=!1,this.clientId=null,this.automaticModeration=new r.default}},7897:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.label="",this.discussionType="LEAGUE",this.moderationType="USER",this.postsCount=0,this.pinnedPosts=[],this.lastPostId="",this.status="",this.deleted=!1,this.deletedAt="",this.deletedBy="",this.customFields=null,this.context=null,this.createdAt="",this.updatedAt=""}},505:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4800)),o=["CREATED_AT_ASC","CREATED_AT_DESC","POSTS_COUNT_ASC","POSTS_COUNT_DESC"],u=["ACTIVE","INACTIVE"],l=function(t){function e(e){var n=t.call(this,e)||this;return n.discussionIds=e&&e.discussionIds?e.discussionIds:null,n.label=e&&e.label?e.label:null,n.fromDate=e&&e.fromDate?e.fromDate:null,n.toDate=e&&e.toDate?e.toDate:null,n.fromCount=e&&e.fromCount?e.fromCount:null,n.toCount=e&&e.toCount?e.toCount:null,n.sort=e&&e.sort?e.sort:null,n.status=(null==e?void 0:e.status)||null,n.skipDeleted=e&&void 0!==e.skipDeleted?e.skipDeleted:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return null!==this.discussionIds&&(e+="&discussion_ids=".concat(this.discussionIds.join(","))),null!==this.label&&(e+="&label=".concat(this.label)),null!==this.fromDate&&(e+="&from_date=".concat(this.fromDate)),null!==this.toDate&&(e+="&to_date=".concat(this.toDate)),null!==this.fromCount&&(e+="&from_count=".concat(this.fromCount)),null!==this.toCount&&(e+="&to_count=".concat(this.toCount)),this.sort&&o.includes(this.sort.toUpperCase())&&(e+="&sort=".concat(this.sort.toUpperCase())),this.status&&u.includes(this.status.toUpperCase())&&(e+="&status=".concat(this.status.toUpperCase())),null!==this.skipDeleted&&(e+="&skip_deleted=".concat(this.skipDeleted)),e},e}(a.default);e.default=l},9209:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.skipDeleted=e&&void 0!==e.skipDeleted?e.skipDeleted:null,n.sort=e&&e.sort?e.sort.toLocaleLowerCase():null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return null!==this.skipDeleted&&(e+="&skip_deleted=".concat(this.skipDeleted)),this.sort&&(e+="&sort=".concat(this.sort)),e},e}(s(n(4800)).default);e.default=a},4804:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.fromDate=(null==e?void 0:e.fromDate)||null,n.toDate=(null==e?void 0:e.toDate)||null,n.entityIds=(null==e?void 0:e.entityIds)||null,n.entityType=(null==e?void 0:e.entityType)||null,n.contentType=(null==e?void 0:e.contentType)||null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return null!==this.fromDate&&(e+="&from_date=".concat(this.fromDate)),null!==this.toDate&&(e+="&to_date=".concat(this.toDate)),null!==this.entityIds&&this.entityIds.length>0&&(e+="&entity_ids=".concat(this.entityIds)),null!==this.contentType&&(e+="&content_type=".concat(this.contentType)),e},e}(s(n(4800)).default);e.default=a},4071:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.userId="",this.discussionId="",this.content="",this.repliesCount=0,this.replyId="",this.anonymousNickname="",this.reactions=[],this.reactionsCount=0,this.reports=[],this.reportsCount=0,this.versions=null,this.privatePost=!1,this.deleted=!1,this.deletedAt="",this.deletedBy="",this.moderated=!1,this.moderatedAt="",this.moderatedBy="",this.moderatedReason="",this.createdAt="",this.updatedAt=""}},2528:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.userModel=null,e}return r(e,t),e}(s(n(4071)).default);e.default=a},5678:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.content="",this.reply_id="",this.anonymous_nickname="",this.context=null}},377:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.postsCount=0}},9331:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9448));e.default=function(){this.meta=new r.default,this.data=[]}},4858:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9448));e.default=function(){this.meta=new r.default,this.data=[]}},9448:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.pagination={totalItems:0,nextPageStartsAfter:"",lastCommentCreateTimestamp:""}}},5831:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},1579:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.type="",this.userIds=[],this.reactionCount=0}},3476:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7897)),s=i(n(9448)),a=i(n(4071)),o=i(n(9331)),u=i(n(1579)),l=i(n(5789)),c=i(n(3687)),d=i(n(2528)),h=i(n(4858)),f=i(n(8872)),p=i(n(5831)),m=i(n(377));e.default=function(){var t=this;this.remapToDiscussions=function(e){return e.meta=t.remapToMeta(e.meta),e.data=e.data.map((function(e){return t.remapToDiscussionById(e)})),e},this.remapToDiscussionById=function(t){var e=new r.default;return e.id=t.id,e.label=t.label,e.status=t.status,e.deleted=t.deleted,e.deletedAt=t.deleted_at,e.deletedBy=t.deleted_by,e.discussionType=t.discussion_type,e.moderationType=t.moderation_type,e.postsCount=t.posts_count,e.pinnedPosts=t.pinned_posts,e.lastPostId=t.last_post_id,e.customFields=t.custom_fields,e.context=t.context,e.createdAt=t.created_at,e.updatedAt=t.updated_at,e},this.remapToPostsForDiscussion=function(e,n){var i=new o.default,r=new h.default;return i.meta=t.remapToPostMeta(e.meta),i.data=e.data.map((function(e){return t.remapToPostByIdBasic(e)})),r.meta=t.remapToPostMeta(e.meta),r.data=e.data.map((function(e){return t.remapToPostByIdFull(e)})),"basic"===n?i:r},this.remapToPosts=function(e){var n=new p.default;return n.meta=t.remapToMeta(e.meta),n.data=e.data.map((function(e){return t.remapToPostByIdBasic(e)})),n},this.remapToPostMeta=function(t){var e=new s.default;return e.pagination.totalItems=t.pagination.total_items,e.pagination.nextPageStartsAfter=t.pagination.next_page_starts_after,e.pagination.lastCommentCreateTimestamp=t.pagination.last_comment_create_timestamp,e},this.remapToMeta=function(t){var e=new f.default;return e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.nextPageStartsAfter=t.pagination.next_page_starts_after,e},this.remapToPostByIdBasic=function(e){var n=new a.default;return n.id=e.id,n.userId=e.user_id,n.discussionId=e.discussion_id,n.content=e.content,n.anonymousNickname=e.anonymous_nickname,n.reactionsCount=e.reactions_count,n.replyId=e.reply_id,n.reactions=e.reactions.length?e.reactions.map((function(e){return t.remapReactionsPost(e)})):e.reactions,n.repliesCount=e.replies_count,n.reports=e.reports.length?e.reports.map((function(e){return t.remapReportPost(e)})):e.reports,n.reportsCount=e.reports_count,n.versions=e.versions.length?e.versions.map((function(e){return t.remapVersionsPost(e)})):e.versions,n.privatePost=e.private_post,n.deleted=e.deleted,n.deletedAt=e.deleted_at,n.deletedBy=e.deleted_by,n.moderated=e.moderated,n.moderatedAt=e.moderated_at,n.moderatedBy=e.moderated_by,n.moderatedReason=e.moderated_reason,n.createdAt=e.created_at,n.updatedAt=e.updated_at,n},this.remapToPostByIdFull=function(e){var n=new d.default;return n.id=e.id,n.userId=e.user_id,n.discussionId=e.discussion_id,n.content=e.content,n.anonymousNickname=e.anonymous_nickname,n.reactionsCount=e.reactions_count,n.replyId=e.reply_id,n.reactions=e.reactions.length?e.reactions.map((function(e){return t.remapReactionsPost(e)})):e.reactions,n.repliesCount=e.replies_count,n.reports=e.reports.length?e.reports.map((function(e){return t.remapReportPost(e)})):e.reports,n.reportsCount=e.reports_count,n.versions=e.versions.length?e.versions.map((function(e){return t.remapVersionsPost(e)})):e.versions,n.privatePost=e.private_post,n.deleted=e.deleted,n.deletedAt=e.deleted_at,n.deletedBy=e.deleted_by,n.moderated=e.moderated,n.moderatedAt=e.moderated_at,n.moderatedBy=e.moderated_by,n.moderatedReason=e.moderated_reason,n.createdAt=e.created_at,n.updatedAt=e.updated_at,n},this.remapToPostCount=function(t){return t.map((function(t){var e=new m.default;return e.id=t.id,e.postsCount=t.posts_count,e}))},this.remapReactionsPost=function(t){var e=new u.default;return e.type=t.type,e.userIds=t.user_ids,e.reactionCount=t.reaction_count,e},this.remapVersionsPost=function(t){var e=new l.default;return e.content=t.content,e.updatedAt=t.updated_at,e},this.remapReportPost=function(t){var e=new c.default;return e.userId=t.user_id,e.reason=t.reason,e.reasonDetails=t.reason_details,e}}},3687:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.userId=null,this.reason="AD",this.reasonDetails=null}},5789:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.updatedAt="",this.content=""}},5230:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(8900)),u=s(n(9685)),l=s(n(6409));e.default=function(t){var e=this;this.idSchema=null,this.profile=null,this.validator=null,this.idMapping=null,this.finalizePostFullModel=function(t){return i(e,void 0,void 0,(function(){var e,n,i=this;return r(this,(function(r){switch(r.label){case 0:return e=t.map((function(t){return t.userId})),[4,this.profile.getByIds(e)];case 1:return n=r.sent(),[2,t.map((function(t){return t.userModel=i.extractModelById(n,t.userId),t}))]}}))}))},this.finalizeTopDiscussionsFilters=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return this.idSchema!==a.IdSchemaEnum.NATIVE&&t.entityIds&&t.entityIds.length>0?(this.validator.validateFilters(t),[4,this.idMapping.getEntityIdsBySchemaId(Array.from(t.entityIds),t.entityType,a.IdSchemaEnum.NATIVE)]):[3,2];case 1:e=n.sent(),t.entityIds=e[t.entityType],n.label=2;case 2:return[2]}}))}))},this.extractModelById=function(t,e){if(t.length){var n=t.find((function(t){return t.id===e}));return n?(delete n.interests,n):null}return null},this.idSchema=t.idSchema,this.profile=new l.default(t),this.validator=new u.default(t),this.idMapping=new o.default(t)}},8263:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var c=n(4946),d=s(n(7686)),h=l(n(595)),f=l(n(946));e.default=function(t){var e=this;this.idSchema=null,this.clientHttps=null,this.footballHttps=null,this.service=null,this.getConfig=function(){return a(e,void 0,void 0,(function(){var t,e;return o(this,(function(n){switch(n.label){case 0:return[4,this.clientHttps.getConfig(d.FeatureConfigType.FANTASY)];case 1:return t=n.sent(),this.idSchema===c.IdSchemaEnum.NATIVE?[3,3]:(e=t,[4,this.service.remapCompetitions(u([],t.competitionsWhitelist,!0))]);case 2:e.competitionsWhitelist=n.sent(),n.label=3;case 3:return[2,t]}}))}))},this.getPlayersPoints=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r;return o(this,(function(s){switch(s.label){case 0:return[4,this.footballHttps.getPlayersPoints(t,n,i)];case 1:return e=s.sent(),r=e,[4,this.service.addPlayerModels(e.data)];case 2:return r.data=s.sent(),[2,e]}}))}))},this.getPlayerDetailedStatistics=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r,s;return o(this,(function(a){switch(a.label){case 0:return e="",this.idSchema===c.IdSchemaEnum.NATIVE?[3,2]:[4,this.service.remapPlayerIdToNative(n)];case 1:e=a.sent(),a.label=2;case 2:return[4,this.footballHttps.getPlayerDetailedStatistics(t,e||n,i)];case 3:return(r=a.sent()).meta.filters.playerId=n,s=r,[4,this.service.addMatchModels(r.data)];case 4:return s.data=a.sent(),[2,r]}}))}))},this.idSchema=t.idSchema,this.clientHttps=new d.default(t),this.footballHttps=new h.default(t),this.service=new f.default(t)}},6139:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8263));e.default=function(t){var e=this;this.facade=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.facade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getPlayersPoints=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPlayersPoints(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getPlayerDetailedStatistics=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPlayerDetailedStatistics(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},4339:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.assists=null,this.shots=null,this.offsides=null,this.tackles=null,this.saves=null,this.minutesEqualOrOver60=null,this.minutesUnder60=null,this.yellowCards=null,this.redCards=null,this.goalsGoalkeeper=null,this.goalsDefender=null,this.goalsMidfielder=null,this.goalsForwards=null,this.penaltyGoals=null,this.ownGoals=null,this.cleanSheetsGoalkeeper=null,this.cleanSheetsDefender=null,this.cleanSheetsMidfielder=null,this.cleanSheetsForwards=null,this.shotsOn=null,this.foulsCommitted=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.concededGoals=null,this.caughtBall=null}},516:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4339)),s=i(n(1002));e.default=function(){this.enabled=!1,this.clientId=null,this.addPointsToProfileTotal=!1,this.coefficients=new r.default,this.players=new s.default,this.competitionsWhitelist=[]}},1002:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.total=null,this.minGoalkeepers=null,this.maxGoalkeepers=null,this.minDefenders=null,this.maxDefenders=null,this.minMidfielders=null,this.maxMidfielders=null,this.minStrikers=null,this.maxStrikers=null}},6808:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3096));e.default=function(){this.meta=new r.default,this.data=[]}},5769:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2158));e.default=function(){this.meta=new r.default,this.data=[]}},3096:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4563));e.default=function(){this.filters=new r.default}},2158:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1890));e.default=function(){this.filters=new r.default}},4563:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId=null,this.playerId=null}},1890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId=null}},6472:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.total=null,this.minutesPlayed=null,this.yellowCards=null,this.redCards=null,this.goals=null,this.penaltyGoals=null,this.ownGoals=null,this.assists=null,this.cleanSheets=null,this.shots=null,this.shotsOn=null,this.offsides=null,this.foulsCommitted=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.tackles=null,this.concededGoals=null,this.caughtBall=null,this.saves=null}},9922:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6472)),s=i(n(3327));e.default=function(){this.matchId=null,this.matchModel=null,this.points=new r.default,this.stats=new s.default}},8571:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.playerId=null,this.playerModel=null,this.points=null,this.rank=null}},3327:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.minutesPlayed=null,this.yellowCards=null,this.redCards=null,this.goals=null,this.penaltyGoals=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.penaltySaved=null,this.penaltyReceived=null,this.ownGoals=null,this.assists=null,this.cleanSheets=null,this.shots=null,this.shotsOn=null,this.shotsBlocked=null,this.offsides=null,this.foulsCommitted=null,this.foulsWon=null,this.tackles=null,this.tacklesBlocks=null,this.tacklesInterceptions=null,this.concededGoals=null,this.caughtBall=null,this.saves=null,this.passes=null,this.crosses=null,this.interceptions=null,this.keyPasses=null,this.passesAccuracy=null,this.duels=null,this.duelsWon=null,this.dribblesAttempts=null,this.dribblesSuccess=null,this.dribblesPast=null}},9260:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6808)),s=i(n(5769)),a=i(n(6472)),o=i(n(9922)),u=i(n(8571)),l=i(n(3327));e.default=function(){var t=this;this.remapPlayersPoints=function(e){var n=new s.default;return n.meta.filters.templateId=e.meta.filters.template_id,n.data=e.data.map((function(e){return t.remapPlayersPointsData(e)})),n},this.remapPlayersPointsData=function(t){var e=new u.default;return e.playerId=t.player_id,e.points=t.points,e.rank=t.rank,e},this.remapPlayerDetailedStats=function(e){var n=new r.default;return n.meta.filters.templateId=e.meta.filters.template_id,n.meta.filters.playerId=e.meta.filters.player_id,n.data=e.data.map((function(e){return t.remapPlayerDetailedData(e)})),n},this.remapPlayerDetailedData=function(e){var n=new o.default;return n.matchId=e.match_id,n.points=e.points?t.remapPlayerDetailedPoints(e.points):null,n.stats=e.stats?t.remapPlayerDetailedStatsData(e.stats):null,n},this.remapPlayerDetailedPoints=function(t){var e=new a.default;return e.total=t.total,e.minutesPlayed=t.minutes_played,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goals=t.goals,e.penaltyGoals=t.penalty_goals,e.ownGoals=t.own_goals,e.assists=t.assists,e.cleanSheets=t.clean_sheets,e.shots=t.shots,e.shotsOn=t.shots_on,e.offsides=t.offsides,e.foulsCommitted=t.fouls_committed,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.tackles=t.tackles,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e.saves=t.saves,e},this.remapPlayerDetailedStatsData=function(t){var e=new l.default;return e.minutesPlayed=t.minutes_played,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goals=t.goals,e.penaltyGoals=t.penalty_goals,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.penaltySaved=t.penalty_saved,e.penaltyReceived=t.penalty_received,e.ownGoals=t.own_goals,e.assists=t.assists,e.cleanSheets=t.clean_sheets,e.shots=t.shots,e.shotsOn=t.shots_on,e.shotsBlocked=t.shots_blocked,e.offsides=t.offsides,e.foulsCommitted=t.fouls_committed,e.foulsWon=t.fouls_won,e.tackles=t.tackles,e.tacklesBlocks=t.tackles_blocks,e.tacklesInterceptions=t.tackles_interceptions,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e.saves=t.saves,e.passes=t.passes,e.crosses=t.crosses,e.interceptions=t.interceptions,e.keyPasses=t.key_passes,e.passesAccuracy=t.passes_accuracy,e.duels=t.duels,e.duelsWon=t.duels_won,e.dribblesAttempts=t.dribbles_attempts,e.dribblesSuccess=t.dribbles_success,e.dribblesPast=t.dribbles_past,e}}},946:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=n(4021),u=n(4904),l=s(n(8097)),c=s(n(2535)),d=n(5318),h=s(n(8900)),f=s(n(8808));e.default=function(t){var e=this;this.idMapping=null,this.idSchema=null,this.errorHandlingModel=null,this.football=null,this.remapCompetitions=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e={competition:t},[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,a.IdSchemaEnum.NATIVE,this.idSchema)];case 1:return[2,n.sent().competition]}}))}))},this.addPlayerModels=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=t.map((function(t){return t.playerId})),[4,this.football.footballFacade.getPlayersMapWithNativeIds(e)];case 1:return n=i.sent(),t.forEach((function(t){var e;t.playerModel=Object.keys(n).length&&n[t.playerId]||null,t.playerId=(null===(e=t.playerModel)||void 0===e?void 0:e.id)||t.playerId})),[2,t]}}))}))},this.remapPlayerIdToNative=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.idMapping.getEntityIdBySchemaId("player",t)];case 1:return(e=n.sent())?[2,e.id]:(this.throwException(o.ErrorCodes.NOT_FOUND,u.ErrorStatuses.ID_MAPPING_NOT_FOUND,d.ErrorMessages.ID_MAPPING_NOT_FOUND+t),[2])}}))}))},this.addMatchModels=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=t.map((function(t){return t.matchId})),[4,this.football.footballFacade.getMatchesMapWithNativeIds(e)];case 1:return n=i.sent(),t.forEach((function(t){var e;t.matchModel=Object.keys(n).length&&n[t.matchId]||null,t.matchId=(null===(e=t.matchModel)||void 0===e?void 0:e.id)||t.matchId})),[2,t]}}))}))},this.throwException=function(t,n,i){if("standard"===e.errorHandlingModel)throw new c.default(t,n,i);throw new l.default(t,n,i)},this.idSchema=t.idSchema,this.errorHandlingModel=t.errorHandlingMode,this.football=new f.default(t),this.idMapping=new h.default(t)}},7e3:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2754)),o=n(712);e.default=function(t,e,n){var s=this;this.localStorage=null,this.https=null,this.idMapping=null,this.getCompetitionsIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,o,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,8,,9]),n=!1,t?(t=new a.default(t)).countryId?[4,this.idMapping.getEntityIdsBySchemaId(["".concat(t.countryId)],"country","native")]:[3,2]:[3,5];case 1:0===(i=r.sent()).country.length&&(n=!0),t.countryId=i.country[0],r.label=2;case 2:return t.competitionIds?[4,this.idMapping.getEntityIdsBySchemaId(t.competitionIds,"competition","native")]:[3,4];case 3:0===(s=r.sent()).competition.length&&(n=!0),t.competitionIds=s.competition,r.label=4;case 4:if(n)return[2,[]];r.label=5;case 5:return[4,this.getCompetitions(t,e)];case 6:return o=r.sent(),[4,this.idMapping.remapEntities(o,"competition")];case 7:return[2,r.sent()];case 8:throw u=r.sent(),console.warn("There was a problem browsing all of the competitions",u),u;case 9:return[2]}}))}))},this.getCompetitionsMapWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s,u,l;return r(this,(function(r){switch(r.label){case 0:return e=new Map,n=t.length,i=new a.default({competitionIds:t,limit:n}),[4,this.getCompetitions(i)];case 1:return(s=r.sent()).sort((function(t,e){return t.id.localeCompare(e.id)})),u=(0,o.sortArrayInAscOrder)(t),[4,this.idMapping.remapEntities(s,"competition")];case 2:return l=r.sent(),u.forEach((function(t,n){return e.set(t,l[n])})),[2,e]}}))}))},this.getCompetitions=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:if(n=null,e=e||!1,this.localStorage.getCompetitionsLength())return[3,5];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.https.getCompetitions()];case 2:return n=r.sent(),[3,4];case 3:throw i=r.sent(),console.warn("There was a problem retrieving all competitions",i),i;case 4:this.localStorage.setCompetitions(n),r.label=5;case 5:return[2,this.localStorage.getCompetitions(t)]}}))}))},this.getCompetitionByIdIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"competition","native")];case 1:return n=r.sent(),i=n.competition[0],[4,this.getCompetitionById(i,e)];case 2:return s=r.sent(),[4,this.idMapping.remapEntities(s,"competition")];case 3:return[2,r.sent()];case 4:throw a=r.sent(),console.warn("There was a problem browsing the following competition:".concat(t),a),a;case 5:return[2]}}))}))},this.getCompetitionById=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getCompetitionById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the competition with the following id: ".concat(t),n),n;case 3:return[2]}}))}))},this.getTopCompetitionsIdMapping=function(t){return i(s,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getTopCompetitions(t)];case 1:return e=i.sent(),[4,this.idMapping.remapEntities(e,"competition")];case 2:return[2,i.sent()];case 3:throw n=i.sent(),console.warn("There was a problem browsing the top competitions",n),n;case 4:return[2]}}))}))},this.getTopCompetitions=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTopCompetitions(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the top competitions",e),e;case 3:return[2]}}))}))},this.localStorage=t,this.idMapping=n,this.https=e}},8350:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}};Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t,e,r){var s=this;this.localCache=null,this.https=null,this.idMapping=null,this.getCountriesWithIdMapping=function(t){return n(s,void 0,void 0,(function(){var e,n;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getCountries(t)];case 1:return e=i.sent(),[2,this.idMapping.remapEntities(e,"country")];case 2:throw n=i.sent(),console.warn("There was a problem browsing countries as football entities",n),n;case 3:return[2]}}))}))},this.getCountries=function(t){return n(s,void 0,void 0,(function(){var e,n,r;return i(this,(function(i){switch(i.label){case 0:if(t=t||!1,(e=this.localCache.getFootballCountries())&&e.length>0)return[2,e];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.https.getCountries(t)];case 2:return n=i.sent(),this.localCache.setFootballCountries(n),[2,n];case 3:throw r=i.sent(),console.warn("There was a problem retrieving countries as football entities",r),r;case 4:return[2]}}))}))},this.localCache=t,this.idMapping=r,this.https=e}},4289:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8350)),o=s(n(7e3)),u=s(n(9693)),l=s(n(4272)),c=s(n(4545)),d=s(n(2140));e.default=function(t,e,n,s){var h=this;this.countriesFacade=null,this.competitionsFacade=null,this.teamsFacade=null,this.playerFacade=null,this.matchFacade=null,this.searchFacade=null,this.getCountries=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.countriesFacade.getCountriesWithIdMapping(t)]}))}))},this.getCompetitions=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.competitionsFacade.getCompetitionsIdMapping(t,e)]}))}))},this.getCompetitionById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.competitionsFacade.getCompetitionByIdIdMapping(t,e)]}))}))},this.getTopCompetitions=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.competitionsFacade.getTopCompetitionsIdMapping(t)]}))}))},this.getCompetitionsMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.competitionsFacade.getCompetitionsMapWithNativeIds(t)];case 1:return[2,e.sent()]}}))}))},this.getTeams=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getTeamsIdMapping(t,e)]}))}))},this.getTeamById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getTeamByIdIdMapping(t,e)]}))}))},this.getTopTeams=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.teamsFacade.getTopTeamsIdMapping(t)]}))}))},this.getNextMatchForTeam=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getNextMatchForTeamIdMapping(t,e)]}))}))},this.getPrevMatchForTeam=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.teamsFacade.getPrevMatchForTeamIdMapping(t,e)]}))}))},this.getTeamsMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.teamsFacade.getTeamsMapWithNativeIds(t)];case 1:return[2,e.sent()]}}))}))},this.getPlayers=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getPlayersIdMapping(t,e)]}))}))},this.getPlayerById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getPlayerIdMapping(t,e)]}))}))},this.getTopPlayers=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.playerFacade.getTopPlayersIdMapping(t)]}))}))},this.getNextMatchForPlayer=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getNextMatchForPlayerIdMapping(t,e)]}))}))},this.getPrevMatchForPlayer=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.playerFacade.getPrevMatchForPlayerIdMapping(t,e)]}))}))},this.getPlayersMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.playerFacade.getPlayersMapWithNativeIds(t)]}))}))},this.getMatches=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.matchFacade.getMatchesIdMapping(t,e)]}))}))},this.getMatchesMapWithNativeIds=function(t){return i(h,void 0,void 0,(function(){return r(this,(function(e){return[2,this.matchFacade.getMatchesMapWithNativeIds(t)]}))}))},this.getMatchById=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.matchFacade.getMatchIdMapping(t,e)]}))}))},this.search=function(t,e){return i(h,void 0,void 0,(function(){return r(this,(function(n){return[2,this.searchFacade.searchIdMapping(t,e)]}))}))},this.countriesFacade=new a.default(e,n,s),this.competitionsFacade=new o.default(e,n,s),this.teamsFacade=new u.default(t,n,s),this.playerFacade=new l.default(t,n,s),this.matchFacade=new c.default(t,n,s),this.searchFacade=new d.default(n,s)}},4545:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(712),u=a(n(6134)),l=a(n(9582));e.default=function(t,e,n){var a=this;this.https=null,this.idMapping=null,this.footballService=null,this.getMatchesIdMapping=function(t,e){return i(a,void 0,void 0,(function(){var n,i,a,o,l,c,d,h;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,12,,13]),t?(t=new u.default(t)).countryIds&&t.countryIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.countryIds,"country","native")]:[3,2]:[3,8];case 1:n=r.sent(),t.countryIds=n.country,r.label=2;case 2:return t.competitionIds&&t.competitionIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.competitionIds,"competition","native")]:[3,4];case 3:i=r.sent(),t.competitionIds=i.competition,r.label=4;case 4:return t.matchIds&&t.matchIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.matchIds,"match","native")]:[3,6];case 5:a=r.sent(),t.matchIds=a.match,r.label=6;case 6:return t.teamIds&&t.teamIds.length>0?[4,this.idMapping.getEntityIdsBySchemaId(t.teamIds,"team","native")]:[3,8];case 7:o=r.sent(),t.teamIds=o.team,r.label=8;case 8:return[4,this.getMatches(t,e)];case 9:return l=r.sent(),c=l,[4,this.footballService.setAvailableMarketsForMatch(s([],l.data,!0))];case 10:return c.data=r.sent(),d=l,[4,this.idMapping.remapEntities(l.data,"match")];case 11:return d.data=r.sent(),[2,l];case 12:throw h=r.sent(),console.warn("There was a problem browsing the matches",h),h;case 13:return[2]}}))}))},this.getMatchesWithNativeIds=function(t){return i(a,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return e=t.length,n=new u.default({matchIds:t,limit:e}),[4,this.getMatches(n)];case 1:return(i=r.sent()).data.sort((function(t,e){return t.id.localeCompare(e.id)})),[4,this.idMapping.remapEntities(i.data,"match")];case 2:return[2,r.sent()]}}))}))},this.getMatchesMapWithNativeIds=function(t){return i(a,void 0,void 0,(function(){var e,n,i,s,a,l;return r(this,(function(r){switch(r.label){case 0:return e={},(n=(0,o.transformIdsToBeUnique)(t)).sort((function(t,e){return t.localeCompare(e)})),[4,this.getMatchesWithNativeIds(Array.from(n))];case 1:return i=r.sent(),n.length===i.length?[3,3]:(s=new u.default({matchIds:n,limit:n.length}),[4,this.getMatches(s)]);case 2:a=r.sent(),l=n.filter((function(t){if(a.data.every((function(e){return e.id!==t})))return t})),n=n.filter((function(t){if(!l.includes(t))return t})),r.label=3;case 3:return n.forEach((function(t,n){return e[t]=i[n]})),[2,e]}}))}))},this.getMatches=function(t,e){return i(a,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getMatches(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the matches",n),n;case 3:return[2]}}))}))},this.getMatchIdMapping=function(t,e){return i(a,void 0,void 0,(function(){var n,i,s,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.idMapping.getEntityIdsBySchemaId([t],"match","native")];case 1:return n=r.sent(),[4,this.getMatchById(n.match[0],e)];case 2:return i=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(i)];case 3:return s=r.sent(),[4,this.idMapping.remapEntities(s,"match")];case 4:return[2,r.sent()];case 5:throw a=r.sent(),console.warn("There was a problem browsing the following match: ".concat(t),a),a;case 6:return[2]}}))}))},this.getMatchById=function(t,e){return i(a,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getMatchById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the following match: ".concat(t),n),n;case 3:return[2]}}))}))},this.https=e,this.idMapping=n,this.footballService=new l.default(t)}},4272:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(6477)),o=n(712),u=s(n(9582));e.default=function(t,e,n){var s=this;this.https=null,this.footballService=null,this.idMapping=null,this.getPlayersIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,o,u,l,c;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,10,,11]),n=!1,t?(t=new a.default(t)).countryId?[4,this.idMapping.getEntityIdsBySchemaId([t.countryId],"country","native")]:[3,2]:[3,7];case 1:0===(i=r.sent()).country.length&&(n=!0),t.countryId=i.country[0],r.label=2;case 2:return t.playerIds?[4,this.idMapping.getEntityIdsBySchemaId(t.playerIds,"player","native")]:[3,4];case 3:0===(s=r.sent()).player.length&&(n=!0),t.playerIds=s.player,r.label=4;case 4:return t.scope?[4,this.idMapping.getEntityIdsBySchemaId(t.scope,"competition","native")]:[3,6];case 5:0===(o=r.sent()).competition.length&&(n=!0),t.scope=o.competition,r.label=6;case 6:if(n)return[2,[]];r.label=7;case 7:return[4,this.getPlayers(t,e)];case 8:return u=r.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"player")];case 9:return l.data=r.sent(),[2,u];case 10:throw c=r.sent(),console.warn("There was a problem browsing the players",c),c;case 11:return[2]}}))}))},this.getPlayersWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return e=t.length,n=new a.default({playerIds:t,limit:e}),[4,this.getPlayers(n)];case 1:return(i=r.sent()).data.sort((function(t,e){return t.id.localeCompare(e.id)})),[4,this.idMapping.remapEntities(i.data,"player")];case 2:return[2,r.sent()]}}))}))},this.getPlayersMapWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return e={},(n=(0,o.transformIdsToBeUnique)(t)).sort((function(t,e){return t.localeCompare(e)})),[4,this.getPlayersWithNativeIds(Array.from(n))];case 1:return i=r.sent(),n.forEach((function(t,n){return e[t]=i[n]})),[2,e]}}))}))},this.getPlayers=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getPlayers(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the players",n),n;case 3:return[2]}}))}))},this.getPlayerIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"player","native")];case 1:return n=r.sent(),[4,this.getPlayerById(n.player[0],e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"player")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the following player:".concat(t),s),s;case 5:return[2]}}))}))},this.getPlayerById=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getPlayerById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the following player: ".concat(t),n),n;case 3:return[2]}}))}))},this.getTopPlayersIdMapping=function(t){return i(s,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getTopPlayers(t)];case 1:return e=i.sent(),[4,this.idMapping.remapEntities(e,"player")];case 2:return[2,i.sent()];case 3:throw n=i.sent(),console.warn("There was a problem browsing the top players",n),n;case 4:return[2]}}))}))},this.getTopPlayers=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTopPlayers(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the top players",e),e;case 3:return[2]}}))}))},this.getNextMatchForPlayerIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"player","native")];case 1:return n=r.sent(),t=n.player[0],[4,this.getNextMatchForPlayer(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the next match for player:".concat(t),s),s;case 5:return[2]}}))}))},this.getNextMatchForPlayer=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getNextMatchForPlayer(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the next match for player: ".concat(t),i),i;case 4:return[2]}}))}))},this.getPrevMatchForPlayerIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"player","native")];case 1:return n=r.sent(),t=n.player[0],[4,this.getPrevMatchForPlayer(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the previous match for player:".concat(t),s),s;case 5:return[2]}}))}))},this.getPrevMatchForPlayer=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getPrevMatchForPlayer(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the previous match for player: ".concat(t),i),i;case 4:return[2]}}))}))},this.idMapping=n,this.https=e,this.footballService=new u.default(t)}},2140:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(604));e.default=function(t,e){var n=this;this.https=null,this.idMapping=null,this.searchIdMapping=function(t,e){return i(n,void 0,void 0,(function(){var n,i,s,o,u,l;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,10,,11]),(t=new a.default(t)).scope?[4,this.idMapping.getEntityIdsBySchemaId(t.scope,"competition","native")]:[3,2];case 1:n=r.sent(),t.scope=n.competition,r.label=2;case 2:return[4,this.search(t,e)];case 3:return(i=r.sent()).teams&&i.teams.length>0?[4,this.idMapping.remapEntities(i.teams,"team")]:[3,5];case 4:s=r.sent(),i.teams=s,r.label=5;case 5:return i.players&&i.players.length>0?[4,this.idMapping.remapEntities(i.players,"player")]:[3,7];case 6:o=r.sent(),i.players=o,r.label=7;case 7:return i.competitions&&i.competitions.length>0?[4,this.idMapping.remapEntities(i.competitions,"competition")]:[3,9];case 8:u=r.sent(),i.competitions=u,r.label=9;case 9:return[2,i];case 10:throw l=r.sent(),console.warn("There was a problem with browsing the search result",l),l;case 11:return[2]}}))}))},this.search=function(t,e){return i(n,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.https.search(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the search response",n),n;case 3:return[2]}}))}))},this.https=t,this.idMapping=e}},9693:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9920)),o=s(n(9582)),u=n(712);e.default=function(t,e,n){var s=this;this.footballService=null,this.https=null,this.idMapping=null,this.getTeamsIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,o,u,l,c;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,9,,10]),n=!1,t?(t=new a.default(t)).countryId?[4,this.idMapping.getEntityIdsBySchemaId(["".concat(t.countryId)],"country","native")]:[3,2]:[3,6];case 1:0===(i=r.sent()).country.length&&(n=!0),t.countryId=i.country[0],r.label=2;case 2:return t.scope?[4,this.idMapping.getEntityIdsBySchemaId(t.scope,"competition","native")]:[3,4];case 3:0===(s=r.sent()).competition.length&&(n=!0),t.scope=s.competition,r.label=4;case 4:return t.teamIds?[4,this.idMapping.getEntityIdsBySchemaId(t.teamIds,"team","native")]:[3,6];case 5:0===(o=r.sent()).team.length&&(n=!0),t.teamIds=o.team,r.label=6;case 6:return n?[2,[]]:[4,this.getTeams(t,e)];case 7:return u=r.sent(),l=u,[4,this.idMapping.remapEntities(u.data,"team")];case 8:return l.data=r.sent(),[2,u];case 9:throw c=r.sent(),console.warn("There was a problem browsing all teams",c),c;case 10:return[2]}}))}))},this.getTeamsMapWithNativeIds=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s,o,l;return r(this,(function(r){switch(r.label){case 0:return e=new Map,n=t.length,i=new a.default({teamIds:t,limit:n}),[4,this.getTeams(i)];case 1:return(s=r.sent().data).sort((function(t,e){return t.id.localeCompare(e.id)})),o=(0,u.sortArrayInAscOrder)(t),[4,this.idMapping.remapEntities(s,"team")];case 2:return l=r.sent(),o.forEach((function(t,n){return e.set(t,l[n])})),[2,e]}}))}))},this.getTeams=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTeams(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving all teams",n),n;case 3:return[2]}}))}))},this.getTeamByIdIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"team","native")];case 1:return n=r.sent(),t=n.team[0],[4,this.getTeamById(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"team")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the following team:".concat(t),s),s;case 5:return[2]}}))}))},this.getTeamById=function(t,e){return i(s,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=e||!1,[4,this.https.getTeamById(t,e)];case 1:return[2,i.sent()];case 2:throw n=i.sent(),console.warn("There was a problem retrieving the following team: ".concat(t),n),n;case 3:return[2]}}))}))},this.getTopTeamsIdMapping=function(t){return i(s,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getTopTeams(t)];case 1:return e=i.sent(),[4,this.idMapping.remapEntities(e,"team")];case 2:return[2,i.sent()];case 3:throw n=i.sent(),console.warn("There was a problem browsing the top teams",n),n;case 4:return[2]}}))}))},this.getTopTeams=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=t||!1,[4,this.https.getTopTeams(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the top teams",e),e;case 3:return[2]}}))}))},this.getNextMatchForTeamIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"team","native")];case 1:return n=r.sent(),t=n.team[0],[4,this.getNextMatchForTeam(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the next match for the following team:".concat(t),s),s;case 5:return[2]}}))}))},this.getNextMatchForTeam=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getNextMatchForTeam(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the next match for the following team: ".concat(t),i),i;case 4:return[2]}}))}))},this.getPrevMatchForTeamIdMapping=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),[4,this.idMapping.getEntityIdsBySchemaId([t],"team","native")];case 1:return n=r.sent(),t=n.team[0],[4,this.getPrevMatchForTeam(t,e)];case 2:return i=r.sent(),[4,this.idMapping.remapEntities(i,"match")];case 3:return[2,r.sent()];case 4:throw s=r.sent(),console.warn("There was a problem browsing the previous match for the following team:".concat(t),s),s;case 5:return[2]}}))}))},this.getPrevMatchForTeam=function(t,e){return i(s,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=e||!1,[4,this.https.getPrevMatchForTeam(t,e)];case 1:return n=r.sent(),[4,this.footballService.setAvailableMarketsForMatch(n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the previous match for the following team: ".concat(t),i),i;case 4:return[2]}}))}))},this.idMapping=n,this.https=e,this.footballService=new o.default(t)}},8808:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900)),o=s(n(595)),u=s(n(4289)),l=s(n(8358));e.default=function(t){var e=this;this.https=null,this.idMapping=null,this.localCache=null,this.footballFacade=null,this.getCountries=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getCountries(t)];case 1:return[2,e.sent()]}}))}))},this.getCompetitions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getCompetitions(t,n)];case 1:return[2,e.sent()]}}))}))},this.getCompetitionById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getCompetitionById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopCompetitions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTopCompetitions(t)];case 1:return[2,e.sent()]}}))}))},this.getTeams=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTeams(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTeamById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTeamById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopTeams=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTopTeams(t)];case 1:return[2,e.sent()]}}))}))},this.getNextMatchForTeam=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getNextMatchForTeam(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPrevMatchForTeam=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPrevMatchForTeam(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPlayers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPlayers(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPlayerById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPlayerById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTopPlayers=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getTopPlayers(t)];case 1:return[2,e.sent()]}}))}))},this.getNextMatchForPlayer=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getNextMatchForPlayer(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPrevMatchForPlayer=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getPrevMatchForPlayer(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMatches=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getMatches(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMatchById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.getMatchById(t,n)];case 1:return[2,e.sent()]}}))}))},this.search=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.footballFacade.search(t,n)];case 1:return[2,e.sent()]}}))}))},this.https=new o.default(t),this.idMapping=new a.default(t),this.localCache=(new l.default).createLocalCacheInstance(t.idSchema),this.footballFacade=new u.default(t,this.localCache,this.https,this.idMapping)}},6975:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name=""}},2754:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.countryId=null,this.name=null,this.gender=null,this.type=null,this.sortField=null,this.sortOrder=null,this.competitionIds=null,this.constructFilterUrl=function(){var t="";return e.countryId&&(t+="&",t+="country_id=".concat(e.countryId)),e.gender&&(t+="&",t+="gender=".concat(e.gender)),e.type&&(t+="&",t+="type=".concat(e.type)),e.sortField&&(t+="&",t+="sort_field=".concat(e.sortField)),e.sortOrder&&(t+="&",t+="sort_order=".concat(e.sortOrder)),e.name&&(t+="&",t+="name=".concat(e.name)),e.competitionIds&&e.competitionIds.length>0&&(t+="&",t+="competition_ids=".concat(e.competitionIds.join(","))),t},this.competitionSearchFilter=function(t){try{var n=e.filter(t);return e.sortField||e.sortOrder?e.sort(n):n}catch(t){return console.warn("There was a problem filtering the local competitions",t),[]}},this.filter=function(t){var n=e.entitiesToSearchWith();return t.filter((function(t){var i=!0;return n.forEach((function(n){"sortOrder"!==n&&"sortField"!==n&&("countryId"===n?i&&(i=t.country.id===e[n]):"name"===n?i&&(i=t.name.toLocaleLowerCase().includes(e[n].toLocaleLowerCase())):"competitionIds"===n?i&&(i=e[n].some((function(e){return t.id===e}))):i&&(i=t[n].toLocaleLowerCase()===e[n].toLocaleLowerCase()))})),i}))},this.entitiesToSearchWith=function(){var t=[];return e.countryId&&t.push("countryId"),e.name&&t.push("name"),e.gender&&t.push("gender"),e.type&&t.push("type"),e.sortField&&t.push("sortField"),e.sortOrder&&t.push("sortOrder"),e.competitionIds&&t.push("competitionIds"),t},this.sort=function(t){var n=[];return"name"===e.sortField?n=t.sort((function(t,n){return e.sortOrder&&"desc"===e.sortOrder?n.name.localeCompare(t.name):t.name.localeCompare(n.name)})):"country"===e.sortField?n=t.sort((function(t,n){return e.sortOrder&&"desc"===e.sortOrder?n.country.name.localeCompare(t.country.name):t.country.name.localeCompare(n.country.name)})):"scope"===e.sortField?t.forEach((function(t){return n[e.competitionIds.indexOf(t.id)]=t})):e.sortField||"desc"!==e.sortOrder||(n=t.sort((function(t,e){return e.id.localeCompare(t.id)}))),n},this.countryId=t.countryId?"".concat(t.countryId):null,this.name=t.name?t.name:null,this.gender=t.gender?t.gender:null,this.type=t.type?t.type:null,this.sortField=t.sortField?"".concat(t.sortField):null,this.sortOrder=t.sortOrder?"".concat(t.sortOrder):null,this.competitionIds=t.competitionIds?t.competitionIds:null}},3321:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.type="",this.name="",this.participants=[]}},7316:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6975)),s=i(n(3430)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new s.default}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.id=t.id,e.country=this.countryRemapper.countryFromResponse(t.country),e.gender=t.gender,e.assets=t.assets,e.type=t.type,e.name=t.name,e}catch(t){throw console.warn("There was a problem remapping the competition response",t),t}},t}();e.default=a},8758:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3321)),s=i(n(3430)),a=i(n(5827)),o=function(){function t(){this.countryRemapper=null,this.teamBasicRemapper=null,this.countryRemapper=new s.default,this.teamBasicRemapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new r.default;return n.id=t.id,n.country=this.countryRemapper.countryFromResponse(t.country),n.gender=t.gender,n.assets=t.assets,n.type=t.type,n.name=t.name,n.participants=t.participants.map((function(t){return e.teamBasicRemapper.fromResponse(t)})),n}catch(t){throw console.warn("There was a problem remapping the competition response",t),t}},t}();e.default=o},4427:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.alias="",this.countryCode="",this.assets=null,this.name=""}},3430:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4427));e.default=function(){var t=this;this.countriesFromResponse=function(e){if(e)return e.map((function(e){return t.countryFromResponse(e)}))},this.countryFromResponse=function(t){try{if(t){var e=new r.default;return e.id=t.id,e.alias=t.alias,e.assets=t.assets,e.countryCode=t.country_code,e.name=t.name,e}}catch(t){throw t}return null}}},8470:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.homeTeam={players:[]},this.awayTeam={players:[]}}},3098:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8470)),s=i(n(3550)),a=function(){function t(){this.playerRemapper=null,this.playerRemapper=new s.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new r.default;return n.homeTeam.players=t.home_team&&t.home_team.players?t.home_team.players.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n.awayTeam.players=t.away_team&&t.away_team.players?t.away_team.players.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping the lineups",t),t}},t}();e.default=a},3572:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.homeTeam=null,this.awayTeam=null,this.isDeleted=!1,this.undecided=!1,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.context={competition:null},this.status={type:null,subType:null}}},6134:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.countryIds=null,this.competitionIds=null,this.matchIds=null,this.status=null,this.teamIds=null,this.fromDate=null,this.toDate=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(t){var n="";return e.countryIds&&(n+="&",n+="countries=".concat(e.countryIds.join(","))),e.competitionIds&&e.competitionIds.length>0&&(n+="&",n+="competitions=".concat(e.competitionIds.join(","))),e.matchIds&&e.matchIds.length>0&&(n+="&",n+="matches=".concat(e.matchIds.join(","))),e.status&&(n+="&",n+="status=".concat(e.status)),e.teamIds&&e.teamIds.length>0&&(n+="&",n+="teams=".concat(e.teamIds.join(","))),e.fromDate&&(n+="&",n+="from_date=".concat(e.fromDate)),e.toDate&&(n+="&",n+="to_date=".concat(e.toDate)),e.limit&&!t&&(n+="&",n+="limit=".concat(e.limit)),e.page&&!t&&(n+="&",n+="page=".concat(e.page)),e.sortField&&(n+="&",n+="sort_field=".concat(e.sortField)),e.sortOrder&&(n+="&",n+="sort_order=".concat(e.sortOrder)),n},this.countryIds=t.countryIds?t.countryIds:null,this.competitionIds=t.competitionIds?t.competitionIds:null,this.matchIds=t.matchIds?t.matchIds:null,this.status=t.status?t.status:null,this.teamIds=t.teamIds?t.teamIds:null,this.fromDate=t.fromDate?t.fromDate:null,this.toDate=t.toDate?t.toDate:null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null,this.sortField=t.sortField?t.sortField:null,this.sortOrder=t.sortOrder?t.sortOrder:null}},9661:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899));e.default=function(){this.id="",this.kickoffAt="",this.finishedAt="",this.updatedAt="",this.availableMarkets=null,this.isDeleted=!1,this.undecided=!1,this.homeTeam=null,this.awayTeam=null,this.lineupsConfirmed=!1,this.startedAt="",this.minute="",this.scores=null,this.stats=null,this.playerStats=[],this.context={competition:null},this.timeline=[],this.status=new r.default,this.lineups=null}},6780:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.playerId=null,this.minutesPlayed=null,this.yellowCards=null,this.redCards=null,this.goals=null,this.penaltyGoals=null,this.penaltyCommitted=null,this.penaltyWon=null,this.penaltyMissed=null,this.penaltySaved=null,this.penaltyReceived=null,this.ownGoals=null,this.assists=null,this.cleanSheets=null,this.shots=null,this.shotsOn=null,this.shotsBlocked=null,this.offsides=null,this.foulsCommitted=null,this.foulsWon=null,this.tackles=null,this.tacklesBlocks=null,this.tacklesInterceptions=null,this.concededGoals=null,this.caughtBall=null,this.saves=null,this.passes=null,this.crosses=null,this.interceptions=null,this.keyPasses=null,this.passesAccuracy=null,this.duels=null,this.duelsWon=null,this.dribblesAttempts=null,this.dribblesSuccess=null,this.dribblesPast=null,this.updatedAt=null}},4976:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6780)),s=function(){function t(){}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.playerId=t.player_id,e.minutesPlayed=t.minutes_played,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goals=t.goals,e.penaltyGoals=t.penalty_goals,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.penaltySaved=t.penalty_saved,e.penaltyReceived=t.penalty_received,e.ownGoals=t.own_goals,e.assists=t.assists,e.cleanSheets=t.clean_sheets,e.shots=t.shots,e.shotsOn=t.shots_on,e.shotsBlocked=t.shots_blocked,e.offsides=t.offsides,e.foulsCommitted=t.fouls_committed,e.foulsWon=t.fouls_won,e.tackles=t.tackles,e.tacklesBlocks=t.tackles_blocks,e.tacklesInterceptions=t.tackles_interceptions,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e.saves=t.saves,e.passes=t.passes,e.crosses=t.crosses,e.interceptions=t.interceptions,e.keyPasses=t.key_passes,e.passesAccuracy=t.passes_accuracy,e.duels=t.duels,e.duelsWon=t.duels_won,e.dribblesAttempts=t.dribbles_attempts,e.dribblesSuccess=t.dribbles_success,e.dribblesPast=t.dribbles_past,e.updatedAt=t.updated_at,e}catch(t){throw console.warn("There was a problem remapping the player stats",t),t}},t}();e.default=s},5284:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3572)),s=i(n(5827)),a=i(n(7316)),o=i(n(1441)),u=function(){function t(){this.teamRemapper=null,this.competitionRemapper=null,this.scoresRemapper=null,this.teamRemapper=new s.default,this.competitionRemapper=new a.default,this.scoresRemapper=new o.default}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.id=t.id,e.kickoffAt=t.kickoff_at,e.finishedAt=t.finished_at,e.updatedAt=t.updated_at,e.isDeleted=t.is_deleted,e.undecided=t.undecided,e.homeTeam=this.teamRemapper.fromResponse(t.home_team),e.awayTeam=this.teamRemapper.fromResponse(t.away_team),e.lineupsConfirmed=t.lineups_confirmed,e.startedAt=t.started_at,e.minute=t.minute,e.scores=this.scoresRemapper.fromResponse(t.scores),e.context={competition:t.context.competition?this.competitionRemapper.fromResponse(t.context.competition):null},e.status={type:t.status.type,subType:t.status.sub_type},e}catch(t){throw console.warn("There was a problem remapping the match response",t),t}},t}();e.default=u},9330:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9661)),s=i(n(5827)),a=i(n(7316)),o=i(n(7122)),u=i(n(1441)),l=i(n(3098)),c=i(n(8470)),d=i(n(92)),h=i(n(4976)),f=function(){function t(){this.teamMapper=null,this.competitionsMapper=null,this.lineupsMapper=null,this.scoresMapper=null,this.statsMapper=null,this.timelineMapper=null,this.playerStatsMapper=null,this.teamMapper=new s.default,this.competitionsMapper=new a.default,this.lineupsMapper=new l.default,this.scoresMapper=new u.default,this.statsMapper=new o.default,this.timelineMapper=new d.default,this.playerStatsMapper=new h.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new r.default;return n.id=t.id,n.kickoffAt=t.kickoff_at,n.finishedAt=t.finished_at,n.updatedAt=t.updated_at,n.isDeleted=t.is_deleted,n.undecided=t.undecided,n.homeTeam=t.home_team?this.teamMapper.fromResponse(t.home_team):null,n.awayTeam=t.away_team?this.teamMapper.fromResponse(t.away_team):null,n.lineupsConfirmed=t.lineups_confirmed,n.startedAt=t.started_at,n.minute=t.minute,n.scores=this.scoresMapper.fromResponse(t.scores),n.stats=this.statsMapper.fromResponse(t.stats),n.playerStats=t.player_stats?t.player_stats.map((function(t){return e.playerStatsMapper.fromResponse(t)})):t.player_stats,n.context={competition:this.competitionsMapper.fromResponse(t.context.competition)},n.timeline=t.timeline?t.timeline.map((function(t){return e.timelineMapper.fromResponse(t)})):[],n.status={type:t.status.type,subType:t.status.sub_type},n.lineups=t.lineups?this.lineupsMapper.fromResponse(t.lineups):new c.default,n}catch(t){throw console.warn("There was a problem remapping the match response",t),t}},t}();e.default=f},4652:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.ftScore=null,this.htScore=null,this.aetScore=null,this.aggScore=null,this.penScore=null}},1441:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4652)),s=function(){function t(){this.statEntityFromResponse=function(t){return{homeGoals:t.home_goals,awayGoals:t.away_goals}}}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.ftScore=this.statEntityFromResponse(t.ft_score),e.htScore=this.statEntityFromResponse(t.ht_score),e.aetScore=this.statEntityFromResponse(t.aet_score),e.aggScore=this.statEntityFromResponse(t.agg_score),e.penScore=this.statEntityFromResponse(t.pen_score),e}catch(t){throw console.warn("There was a problem remapping the scores",t),t}},t}();e.default=s},7950:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.corners=null,this.cornersFirstHalf=null,this.cornersSecondHalf=null,this.cornersExtraTime=null,this.crosses=null,this.crossesFirstHalf=null,this.crossesSecondHalf=null,this.crossesExtraTime=null,this.offside=null,this.offsideFirstHalf=null,this.offsideSecondHalf=null,this.offsideExtraTime=null,this.shotsOn=null,this.shotsOnFirstHalf=null,this.shotsOnSecondHalf=null,this.shotsOnExtraTime=null,this.throwIn=null,this.throwInFirstHalf=null,this.throwInSecondHalf=null,this.throwInExtraTime=null,this.redCards=null,this.redCardsFirstHalf=null,this.redCardsSecondHalf=null,this.redCardsExtraTime=null,this.shotsOff=null,this.shotsOffFirstHalf=null,this.shotsOffSecondHalf=null,this.shotsOffExtraTime=null,this.goalKicks=null,this.goalKicksFirstHalf=null,this.goalKicksSecondHalf=null,this.goalKicksExtraTime=null,this.possession=null,this.possessionFirstHalf=null,this.possessionSecondHalf=null,this.possessionExtraTime=null,this.treatments=null,this.treatmentsFirstHalf=null,this.treatmentsSecondHalf=null,this.treatmentsExtraTime=null,this.yellowCards=null,this.yellowCardsFirstHalf=null,this.yellowCardsSecondHalf=null,this.yellowCardsExtraTime=null,this.shotsBlocked=null,this.shotsBlockedFirstHalf=null,this.shotsBlockedSecondHalf=null,this.shotsBlockedExtraTime=null,this.substitutions=null,this.substitutionsFirstHalf=null,this.substitutionsSecondHalf=null,this.substitutionsExtraTime=null,this.counterAttacks=null,this.counterAttacksFirstHalf=null,this.counterAttacksSecondHalf=null,this.counterAttacksExtraTime=null,this.foulsCommitted=null,this.foulsCommittedFirstHalf=null,this.foulsCommittedSecondHalf=null,this.foulsCommittedExtraTime=null}},7122:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7950)),s=function(){function t(){this.statEntityFromResponse=function(t){return{homeTeam:t?t.home_team:null,awayTeam:t?t.away_team:null}}}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.corners=this.statEntityFromResponse(t.corners),e.cornersFirstHalf=this.statEntityFromResponse(t.corners_1h),e.cornersSecondHalf=this.statEntityFromResponse(t.corners_2h),e.cornersExtraTime=this.statEntityFromResponse(t.corners_et),e.crosses=this.statEntityFromResponse(t.crosses),e.crossesFirstHalf=this.statEntityFromResponse(t.crosses_1h),e.crossesSecondHalf=this.statEntityFromResponse(t.crosses_2h),e.crossesExtraTime=this.statEntityFromResponse(t.crosses_et),e.offside=this.statEntityFromResponse(t.offside),e.offsideFirstHalf=this.statEntityFromResponse(t.offside_1h),e.offsideSecondHalf=this.statEntityFromResponse(t.offside_2h),e.offsideExtraTime=this.statEntityFromResponse(t.offside_et),e.shotsOn=this.statEntityFromResponse(t.shots_on),e.shotsOnFirstHalf=this.statEntityFromResponse(t.shots_on_1h),e.shotsOnSecondHalf=this.statEntityFromResponse(t.shots_on_2h),e.shotsOnExtraTime=this.statEntityFromResponse(t.shots_on_et),e.throwIn=this.statEntityFromResponse(t.throw_in),e.throwInFirstHalf=this.statEntityFromResponse(t.throw_in_1h),e.throwInSecondHalf=this.statEntityFromResponse(t.throw_in_2h),e.throwInExtraTime=this.statEntityFromResponse(t.throw_in_et),e.redCards=this.statEntityFromResponse(t.red_cards),e.redCardsFirstHalf=this.statEntityFromResponse(t.red_cards_1h),e.redCardsSecondHalf=this.statEntityFromResponse(t.red_cards_2h),e.redCardsExtraTime=this.statEntityFromResponse(t.red_cards_et),e.shotsOff=this.statEntityFromResponse(t.shots_off),e.shotsOffFirstHalf=this.statEntityFromResponse(t.shots_off_1h),e.shotsOffSecondHalf=this.statEntityFromResponse(t.shots_off_2h),e.shotsOffExtraTime=this.statEntityFromResponse(t.shots_off_et),e.goalKicks=this.statEntityFromResponse(t.goal_kicks),e.goalKicksFirstHalf=this.statEntityFromResponse(t.goal_kicks_1h),e.goalKicksSecondHalf=this.statEntityFromResponse(t.goal_kicks_2h),e.goalKicksExtraTime=this.statEntityFromResponse(t.goal_kicks_et),e.possession=this.statEntityFromResponse(t.possession),e.possessionFirstHalf=this.statEntityFromResponse(t.possession_1h),e.possessionSecondHalf=this.statEntityFromResponse(t.possession_2h),e.possessionExtraTime=this.statEntityFromResponse(t.possession_et),e.treatments=this.statEntityFromResponse(t.treatments),e.treatmentsFirstHalf=this.statEntityFromResponse(t.treatments_1h),e.treatmentsSecondHalf=this.statEntityFromResponse(t.treatments_2h),e.treatmentsExtraTime=this.statEntityFromResponse(t.treatments_et),e.yellowCards=this.statEntityFromResponse(t.yellow_cards),e.yellowCardsFirstHalf=this.statEntityFromResponse(t.yellow_cards_1h),e.yellowCardsSecondHalf=this.statEntityFromResponse(t.yellow_cards_2h),e.yellowCardsExtraTime=this.statEntityFromResponse(t.yellow_cards_et),e.shotsBlocked=this.statEntityFromResponse(t.shots_blocked),e.shotsBlockedFirstHalf=this.statEntityFromResponse(t.shots_blocked_1h),e.shotsBlockedSecondHalf=this.statEntityFromResponse(t.shots_blocked_2h),e.shotsBlockedExtraTime=this.statEntityFromResponse(t.shots_blocked_et),e.substitutions=this.statEntityFromResponse(t.substitutions),e.substitutionsFirstHalf=this.statEntityFromResponse(t.substitutions_1h),e.substitutionsSecondHalf=this.statEntityFromResponse(t.substitutions_2h),e.substitutionsExtraTime=this.statEntityFromResponse(t.substitutions_et),e.counterAttacks=this.statEntityFromResponse(t.counter_attacks),e.counterAttacksFirstHalf=this.statEntityFromResponse(t.counter_attacks_1h),e.counterAttacksSecondHalf=this.statEntityFromResponse(t.counter_attacks_2h),e.counterAttacksExtraTime=this.statEntityFromResponse(t.counter_attacks_et),e.foulsCommitted=this.statEntityFromResponse(t.fouls_committed),e.foulsCommittedFirstHalf=this.statEntityFromResponse(t.fouls_committed_1h),e.foulsCommittedSecondHalf=this.statEntityFromResponse(t.fouls_committed_2h),e.foulsCommittedExtraTime=this.statEntityFromResponse(t.fouls_committed_et),e}catch(t){throw console.warn("There was a problem remapping the stats",t),t}},t}();e.default=s},6899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.type=null,this.subType=null}},9452:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.minute="",this.type="",this.teamId="",this.player=null,this.relatedPlayer=null,this.updatedAt=""}},92:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9452)),s=i(n(3550)),a=function(){function t(){this.playerRemapper=null,this.playerRemapper=new s.default}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.minute=t.minute,e.type=t.type,e.teamId=t.team_id,e.player=this.playerRemapper.fromResponse(t.player),e.relatedPlayer=t.related_player?this.playerRemapper.fromResponse(t.related_player):null,e.updatedAt=t.updated_at,e}catch(t){throw console.warn("There was a problem remapping timeline",t),t}},t}();e.default=a},753:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3569));e.default=function(){this.meta=new r.default,this.data=[]}},3569:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155));e.default=function(){this.pagination=new r.default}},155:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.currentPage=null,this.itemsPerPage=null,this.totalItems=null,this.numberOfPages=null}},1925:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3569));e.default=function(){this.remapMetaProp=function(t){var e=new r.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e}}},4426:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.teams=[]}},6477:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.countryId=null,this.scope=null,this.name=null,this.playerIds=null,this.limit=null,this.page=null,this.sortField=null,this.sortOrder=null,this.constructFilterUrl=function(){var t="";return e.countryId&&(t+="&",t+="country_id=".concat(e.countryId)),e.scope&&e.scope.length>0&&(t+="&",t+="scope=".concat(e.scope.join(","))),e.name&&(t+="&",t+="name=".concat(e.name)),e.playerIds&&e.playerIds.length>0&&(t+="&",t+="player_ids=".concat(e.playerIds.join(","))),e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.page&&(t+="&",t+="page=".concat(e.page)),e.sortField&&(t+="&",t+="sort_field=".concat(e.sortField)),e.sortOrder&&(t+="&",t+="sort_order=".concat(e.sortOrder)),t},this.countryId=t.countryId?t.countryId:null,this.scope=t.scope?t.scope:null,this.name=t.name?t.name:null,this.playerIds=t.playerIds?t.playerIds:null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null,this.sortField=t.sortField?t.sortField:null,this.sortOrder=t.sortOrder?t.sortOrder:null}},1837:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null,this.isDeleted=!1,this.competitions=[],this.teams=[]}},4803:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.name="",this.position="",this.assets=null,this.type=""}},9071:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.startDate="",this.endDate="",this.loan=!1,this.position="",this.country=null,this.name="",this.assets=null,this.birthDate=""}},5157:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(4426)),a=i(n(5827)),o=function(){function t(){this.countryRemapper=null,this.teamRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new s.default;return n.id=t.id,n.firstName=t.first_name?t.first_name:null,n.lastName=t.last_name?t.last_name:null,n.name=t.name?t.name:null,n.birthDate=t.birth_date,n.country=this.countryRemapper.countryFromResponse(t.country),n.assets=t.assets,n.teams=t.teams?t.teams.map((function(t){return e.teamRemapper.fromResponse(t)})):[],n.position=t.position,n.isDeleted=t.is_deleted,n}catch(t){throw console.warn("There was a problem remapping players response",t),t}},t}();e.default=o},7943:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(1837)),a=i(n(5827)),o=i(n(7316)),u=function(){function t(){this.countryRemapper=null,this.teamRemapper=null,this.competitionRemapper=null,this.countryRemapper=new r.default,this.teamRemapper=new a.default,this.competitionRemapper=new o.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new s.default;return n.id=t.id,n.firstName=t.first_name?t.first_name:null,n.lastName=t.last_name?t.last_name:null,n.name=t.name?t.name:null,n.birthDate=t.birth_date,n.country=this.countryRemapper.countryFromResponse(t.country),n.assets=t.assets,n.teams=t.teams?t.teams.map((function(t){return e.teamRemapper.fromResponse(t)})):[],n.position=t.position,n.isDeleted=t.is_deleted,n.competitions=t.competitions?t.competitions.map((function(t){return e.competitionRemapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping player response",t),t}},t}();e.default=u},3550:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4803)),s=function(){function t(){}return t.prototype.fromResponse=function(t){try{var e=new r.default;return e.id=t.id,e.name=t.name,e.position=t.position,e.shirtNumber=t.shirt_number,e.assets=t.assets,e.type=t.type,e}catch(t){throw console.warn("There was a problem remapping the player from timeline",t),t}},t}();e.default=s},4085:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(9071)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new r.default}return t.prototype.fromResponse=function(t){try{var e=new s.default;return e.id=t.id,e.startDate=t.start_date,e.endDate=t.end_date,e.shirtNumber=t.shirt_number,e.loan=t.loan,e.position=t.position,e.country=this.countryRemapper.countryFromResponse(t.country),e.name=t.name,e.assets=t.assets,e.birthDate=t.birth_date,e}catch(t){throw console.warn("There was a problem remapping the player from squad",t),t}},t}();e.default=a},4729:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(56)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new r.default}return t.prototype.fromResponse=function(t){try{var e=new s.default;return e.id=t.id,e.firstName=t.first_name?t.first_name:null,e.lastName=t.last_name?t.last_name:null,e.name=t.name?t.name:null,e.birthDate=t.birth_date,e.country=this.countryRemapper.countryFromResponse(t.country),e.assets=t.assets,e.position=t.position,e}catch(t){throw console.warn("There was a problem remapping top player response",t),t}},t}();e.default=a},56:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.birthDate="",this.firstName="",this.lastName="",this.name="",this.position="",this.assets=null}},604:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.entities=null,this.query=null,this.scope=null,this.constructFilterUrl=function(){var t="";return e.entities&&(t+="&",t+="entities=".concat(e.entities.join(","))),e.query&&(t+="&",t+="q=".concat(e.query)),e.scope&&(t+="&",t+="scope=".concat(e.scope.join(","))),t},this.entities=t.entities?t.entities:null,this.query=t.query?t.query:null,this.scope=t.scope?t.scope:null}},6967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.teams=null,this.players=null,this.competitions=null}},7287:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5827)),s=i(n(5157)),a=i(n(7316)),o=i(n(6967)),u=function(){function t(){this.teamRemapper=null,this.playerRemapper=null,this.competitionremapper=null,this.teamRemapper=new r.default,this.playerRemapper=new s.default,this.competitionremapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new o.default;return n.teams=t.teams?t.teams.map((function(t){return e.teamRemapper.fromResponse(t)})):[],n.players=t.players?t.players.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n.competitions=t.competitions?t.competitions.map((function(t){return e.competitionremapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping search response",t),t}},t}();e.default=u},5827:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(9314)),a=function(){function t(){this.countryRemapper=null,this.countryRemapper=new r.default}return t.prototype.fromResponse=function(t){try{var e=new s.default;return e.id=t.id,e.country=this.countryRemapper.countryFromResponse(t.country),e.gender=t.gender,e.assets=t.assets,e.code=t.code,e.national=t.national,e.fullName=t.full_name,e.shortName=t.short_name,e.name=t.name,e.isDeleted=t.is_deleted,e.undecided=t.undecided,e}catch(t){throw console.warn("There was a problem remapping teams response",t),t}},t}();e.default=a},7821:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3430)),s=i(n(1986)),a=i(n(4085)),o=i(n(7316)),u=function(){function t(){this.countryRemapper=null,this.competitionRemapper=null,this.playerRemapper=null,this.countryRemapper=new r.default,this.competitionRemapper=new o.default,this.playerRemapper=new a.default}return t.prototype.fromResponse=function(t){var e=this;try{var n=new s.default;return n.id=t.id,n.country=this.countryRemapper.countryFromResponse(t.country),n.gender=t.gender,n.assets=t.assets,n.code=t.code,n.national=t.national,n.fullName=t.full_name,n.shortName=t.short_name,n.name=t.name,n.isDeleted=t.is_deleted,n.undecided=t.undecided,n.competitions=t.competitions?t.competitions.map((function(t){return e.competitionRemapper.fromResponse(t)})):[],n.colors=t.colors?t.colors:n.colors,n.squad=t.squad?t.squad.map((function(t){return e.playerRemapper.fromResponse(t)})):[],n}catch(t){throw console.warn("There was a problem remapping team response",t),t}},t}();e.default=u},9314:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.code="",this.national=!1,this.undecided=!1,this.fullName="",this.shortName="",this.isDeleted=!1}},3773:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.primary=null,this.secondary=null,this.tertiary=null}},9920:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.name=null,this.countryId=null,this.national=!1,this.gender=null,this.limit=null,this.page=null,this.scope=null,this.sortField=null,this.sortOrder=null,this.teamIds=null,this.constructFilterUrl=function(){var t="";return e.name&&(t+="&",t+="name=".concat(e.name)),e.countryId&&(t+="&",t+="country_id=".concat(e.countryId)),e.national&&(t+="&",t+="national=".concat(e.national)),e.gender&&(t+="&",t+="gender=".concat(e.gender)),e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.scope&&e.scope.length>0&&(t+="&",t+="scope=".concat(e.scope.join(","))),e.page&&(t+="&",t+="page=".concat(e.page)),e.sortField&&(t+="&",t+="sort_field=".concat(e.sortField)),e.sortOrder&&(t+="&",t+="sort_order=".concat(e.sortOrder)),e.teamIds&&e.teamIds.length>0&&(t+="&",t+="team_ids=".concat(e.teamIds.join(","))),t},this.name=t.name?t.name:null,this.countryId=t.countryId?"".concat(t.countryId):null,this.national=!!t.national&&t.national,this.gender=t.gender?t.gender:null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null,this.scope=t.scope?t.scope:null,this.sortField=t.sortField?"".concat(t.sortField):null,this.sortOrder=t.sortOrder?"".concat(t.sortOrder):null,this.teamIds=t.teamIds?t.teamIds:null}},1986:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3773));e.default=function(){this.id="",this.country=null,this.gender="",this.assets=null,this.name="",this.competitions=[],this.code="",this.national=!1,this.fullName="",this.shortName="",this.isDeleted=!1,this.undecided=!1,this.colors=new r.default,this.squad=[]}},9582:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4021),c=n(4904),d=u(n(8097)),h=u(n(2535)),f=n(5318),p=s(n(7686)),m=u(n(3569));e.default=function(t){var e=this;this.clientHttps=null,this.errorHandlingMode=null,this.setAvailableMarketsForMatch=function(t){return a(e,void 0,void 0,(function(){var e,n,i,r=this;return o(this,(function(s){switch(s.label){case 0:return[4,this.clientHttps.getConfig(p.FeatureConfigType.PREDICTOR)];case 1:return e=s.sent(),n=e.fullCoverageCompetitions,i=e.markets,Array.isArray(t)?[2,t.map((function(t){return r.setAvailableMarkets(t,n,i)}))]:"object"==typeof t&&Object.keys(t).length?[2,this.setAvailableMarkets(t,n,i)]:[2]}}))}))},this.setAvailableMarkets=function(t,n,i){var r,s=null===(r=t.context.competition)||void 0===r?void 0:r.id;return s&&e.isMatchInCoverageCompetition(s,n)?(t.availableMarkets=i.all,t):(t.availableMarkets=i.main,t)},this.setMetaDataBatchRequest=function(t,n,i){var r=new m.default;if(r.pagination.totalItems=t,r.pagination.itemsPerPage=n,r.pagination.numberOfPages=t?Math.ceil(t/n):0,r.pagination.currentPage=i,r.pagination.numberOfPages>0&&i>r.pagination.numberOfPages){if("standard"===e.errorHandlingMode)throw new h.default(l.ErrorCodes.BAD_METHOD_CALL,c.ErrorStatuses.INVALID_PAGE_NUMBER,f.ErrorMessages.INVALID_PAGE_NUMBER);throw new d.default(l.ErrorCodes.BAD_METHOD_CALL,c.ErrorStatuses.INVALID_PAGE_NUMBER,f.ErrorMessages.INVALID_PAGE_NUMBER)}return r},this.finalizeMatchesDataBatchRequest=function(t,e){t=t.sort((function(t,e){return new Date(t.kickoffAt).getTime()-new Date(e.kickoffAt).getTime()}));var n=e.limit||20;if(e.page){var i=e.page>1?n*(e.page-1):0;t=t.slice(i,i+n)}return!e.page&&t.length>n&&(t=t.slice(0,n)),t},this.isMatchInCoverageCompetition=function(t,e){var n=!1;return e.includes(t)?n=!0:n},this.clientHttps=new p.default(t),this.errorHandlingMode=t.errorHandlingMode}},3822:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=n(7686),l=a(n(3142)),c=a(n(7232)),d=a(n(1139)),h=a(n(9502)),f=a(n(8900)),p=a(n(1859)),m=a(n(2793)),v=a(n(3247)),_=a(n(8061)),y=a(n(8808));e.default=function(t,e,n,a,g){var b=this;this.config=null,this.clientHttps=null,this.loyaltyHttps=null,this.loyaltyService=null,this.profileFacade=null,this.loyaltyValidator=null,this.idMapping=null,this.topXFacade=null,this.matchQuizFacade=null,this.predictorHttps=null,this.errorHandlingMode=null,this.football=null,this.getConfig=function(){return i(b,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.clientHttps.getConfig(u.FeatureConfigType.LOYALTY)];case 1:return[2,t.sent()]}}))}))},this.getConfigV2=function(t){return i(b,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.clientHttps.getNewLoyaltyConfig(t)];case 1:return e=n.sent(),[4,this.loyaltyService.addEntityModelToFootballBadges(e.rewards.badges)];case 2:return n.sent(),[4,this.loyaltyService.addGameModelToGamesBadges(e.rewards.badges)];case 3:return n.sent(),[2,e]}}))}))},this.getClientBadges=function(){return i(b,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.getConfig()];case 1:return t=e.sent(),[2,this.loyaltyService.buildOldClientBadges(t.rewards.badges)]}}))}))},this.getClientBadgesV2=function(t){return i(b,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.clientHttps.getNewLoyaltyConfig(t)];case 1:return e=n.sent(),[2,this.loyaltyService.buildNewClientBadges(e.rewards.badges)]}}))}))},this.getTemplates=function(t,e){return i(b,void 0,void 0,(function(){var n,i,a,u,l;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new _.default(t)),this.config.idSchema!==o.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyHttps.getTemplates(t,e)];case 1:return[2,r.sent()];case 2:return[4,this.loyaltyHttps.getTemplates(t,e)];case 3:return n=r.sent(),i=n,[4,this.loyaltyService.remapTemplatesIds(s([],n.data,!0))];case 4:i.data=r.sent(),a=0,u=n.data,r.label=5;case 5:return a<u.length?(l=u[a],[4,this.loyaltyService.remapTemplateGroupMatchIds(l.groups)]):[3,8];case 6:r.sent(),r.label=7;case 7:return a++,[3,5];case 8:return[2,n]}}))}))},this.getTemplateById=function(t,e){return i(b,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.loyaltyHttps.getTemplateById(t,e)];case 1:return n=r.sent(),this.config.idSchema===o.IdSchemaEnum.NATIVE?[2,n]:[4,this.loyaltyService.remapTemplatesIds([n])];case 2:return i=r.sent(),[4,this.loyaltyService.remapTemplateGroupMatchIds(i[0].groups)];case 3:return r.sent(),[2,i[0]]}}))}))},this.getLeaderboard=function(t,e,n){return i(b,void 0,void 0,(function(){var i,s;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"loyalty"),[4,this.loyaltyHttps.getLeaderboard(t,n,e)];case 1:return i=r.sent(),s=i,[4,this.loyaltyService.addProfileModelToLeaderboard(i.data)];case 2:return s.data=r.sent(),[2,i]}}))}))},this.getLeaderboardForGame=function(t,e,n){return i(b,void 0,void 0,(function(){var i,s;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"loyalty"),[4,this.loyaltyHttps.getLeaderboardForGame(t,n,e)];case 1:return i=r.sent(),s=i,[4,this.loyaltyService.addProfileModelToLeaderboard(i.data)];case 2:return s.data=r.sent(),[2,i]}}))}))},this.getLeaderboardForLeague=function(t,e){return i(b,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"league_leaderboard"),[4,this.loyaltyHttps.getLeaderboardForLeague(t,e)];case 1:return n=r.sent(),i=n,[4,this.loyaltyService.addProfileModelToLeaderboard(n.data)];case 2:return i.data=r.sent(),[2,n]}}))}))},this.getOwnRankings=function(t,e){return i(b,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return[4,this.profileFacade.getOwn()];case 1:return n=i.sent().id,[2,this.getUserRankings(n,t,e)]}}))}))},this.getUserRankings=function(t,e,n){return i(b,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return e=this.loyaltyService.initFilters(e,"rankings"),[4,this.loyaltyHttps.getUserRankings(t,e,n)];case 1:return i=r.sent(),[4,this.getModelsForUserRankings(i)];case 2:return[2,r.sent()]}}))}))},this.getHighestSuccessRate=function(t,e){return i(b,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return t&&(t=new v.default(t),this.loyaltyValidator.validate(t,this.errorHandlingMode)),[4,this.loyaltyHttps.getHighestSuccessRate(t,e)];case 1:return n=i.sent(),[2,this.loyaltyService.addProfileModelToHighestSuccessRate(n)]}}))}))},this.getTemplateWinners=function(t,e){return i(b,void 0,void 0,(function(){var n,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(t,e)];case 1:return n=r.sent(),[4,this.getTemplateById(t)];case 2:return i=r.sent(),n.contestModel=i,[2,this.loyaltyService.completeContestWinners(n)]}}))}))},this.getEntitiesFollows=function(t,e){return i(b,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return this.loyaltyService.validateEntitiesFollowsFilters(t),this.config.idSchema===o.IdSchemaEnum.NATIVE?[3,2]:[4,this.loyaltyService.remapEntitiesFollowsFilters(t)];case 1:t=i.sent(),i.label=2;case 2:return[4,this.loyaltyHttps.getEntitiesFollows(t,e)];case 3:return n=i.sent(),[4,this.loyaltyService.addModelsToEntitiesFollows(n)];case 4:return[2,i.sent()]}}))}))},this.getModelsForUserRankings=function(t){return i(b,void 0,void 0,(function(){var e,n,i,s,a,o,u,l,c,d,h,f;return r(this,(function(r){switch(r.label){case 0:return e=null,n=null,i=null,s=this.loyaltyService.extractRankingsIdsMap(t.data),a=s[0],o=s[1],(u=s[2]).length?[4,this.getTemplates()]:[3,2];case 1:l=r.sent(),e=l.data.filter((function(t){return u.includes(t.id)})),r.label=2;case 2:return a.length?(c={gameIds:a},[4,this.topXFacade.getGames(c)]):[3,4];case 3:d=r.sent(),n=d.data,r.label=4;case 4:return o.length?(h={gameIds:o},[4,this.matchQuizFacade.getGames(h)]):[3,6];case 5:f=r.sent(),i=f.data,r.label=6;case 6:return[2,this.loyaltyService.setModelsForUserRankings(n,i,e,t)]}}))}))},this.getTemplateMatches=function(t,e,n){return i(b,void 0,void 0,(function(){var i,s;return r(this,(function(r){switch(r.label){case 0:return[4,this.getTemplateById(t,n)];case 1:return(i=r.sent()).competitionIds&&0!==i.competitionIds.length||i.teamIds&&0!==i.teamIds.length||i.matchIds&&0!==i.matchIds.length||i.groups&&0!==i.groups.length?(s=this.loyaltyService.initMatchFiltersForTemplates(i,e),[4,this.football.getMatches(s,n)]):[2,[]];case 2:return[2,r.sent().data]}}))}))},this.config=t,this.clientHttps=e,this.loyaltyHttps=n,this.profileFacade=new c.default(g,a),this.loyaltyService=new l.default(this.config),this.loyaltyValidator=new d.default,this.idMapping=new f.default(t),this.topXFacade=new h.default(t,this.idMapping),this.matchQuizFacade=new p.default(t),this.predictorHttps=new m.default(t,this.idMapping),this.errorHandlingMode=t.errorHandlingMode,this.football=new y.default(t)}},2962:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7686)),o=s(n(7059)),u=s(n(3822)),l=s(n(4275)),c=s(n(8358));e.default=function(t){var e=this;this.clientHttps=null,this.profileHttps=null,this.loyaltyHttps=null,this.loyaltyFacade=null,this.localCache=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getConfigV2=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getConfigV2(t)];case 1:return[2,e.sent()]}}))}))},this.getClientBadges=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.loyaltyFacade.getClientBadges()];case 1:return[2,t.sent()]}}))}))},this.getClientBadgesV2=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getClientBadgesV2(t)];case 1:return[2,e.sent()]}}))}))},this.getTemplates=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplates(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTemplateById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplateById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboard=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getLeaderboard(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboardForGame=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getLeaderboardForGame(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboardForLeague=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getLeaderboardForLeague(t,n)];case 1:return[2,e.sent()]}}))}))},this.getOwnRankings=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getOwnRankings(t,n)];case 1:return[2,e.sent()]}}))}))},this.getUserRankings=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getUserRankings(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getHighestSuccessRate=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getHighestSuccessRate(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTemplateWinners=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplateWinners(t,n)];case 1:return[2,e.sent()]}}))}))},this.getEntitiesFollows=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getEntitiesFollows(t,n)];case 1:return[2,e.sent()]}}))}))},this.getTemplateMatches=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.loyaltyFacade.getTemplateMatches(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.clientHttps=new a.default(t),this.profileHttps=new l.default(t),this.loyaltyHttps=new o.default(t),this.localCache=(new c.default).createLocalCacheInstance(t.idSchema),this.loyaltyFacade=new u.default(t,this.clientHttps,this.loyaltyHttps,this.profileHttps,this.localCache)}},8153:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},5111:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8153));e.default=function(){this.value=[new r.default]}},8608:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.general=[],this.predictor=[],this.topX=[],this.matchQuiz=[]}},246:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1429));e.default=function(){this.assets={mainImageUrl:""},this.requirements=new r.default}},8687:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},7983:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2354));e.default=function(){this.assets={mainImageUrl:""},this.requirements=new r.default}},2354:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.postPoints=null,e.postsCount=null,e.reactionsCount=null,e.totalDiscussionPoints=null,e}return r(e,t),e}(s(n(1429)).default);e.default=a},1429:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.points=null,this.gameParticipationCount=null,this.entityId=null,this.entityType=null,this.predictionsMade=null,this.correctPredictions=null}},9750:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7978));e.default=function(){this.predictor=[],this.topX=[],this.matchQuiz=[],this.games=[],this.football=[],this.classicQuizzes=[],this.eitherOr=[],this.discussions=[],this.voting=new r.default}},9805:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.assets={mainImageUrl:""}}},3636:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},75:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},3101:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(75)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},1963:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.entityModel=null}},3035:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(1963)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},4270:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},8699:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(4270)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},3626:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},6268:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(3626)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},5643:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},8574:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(5643)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},3143:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},5793:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(3143)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},4646:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9805)),o=s(n(1821)),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requirements=new o.default,e}return r(e,t),e}(a.default);e.default=u},1821:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},7978:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.potm=[],this.poll=[]}},515:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5111)),s=i(n(4226));e.default=function(){this.enabled=!1,this.clientId=null,this.conditions={list:null},this.actions=new r.default,this.rewards=new s.default}},6866:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5111)),s=i(n(6483));e.default=function(){this.enabled=!1,this.clientId=null,this.conditions={list:null},this.actions=new r.default,this.rewards=new s.default}},3247:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.market=t.market?t.market:null,this.fromDate=t.fromDate?t.fromDate:null,this.toDate=t.toDate?t.toDate:null,this.usersCount=t.usersCount?t.usersCount:null,this.minimumPredictions=t.minimumPredictions?t.minimumPredictions:null}return t.prototype.constructFiltersUrl=function(){var t="";return this.market&&(t+="&",t+="market=".concat(this.market)),this.fromDate&&(t+="&",t+="from_date=".concat(this.fromDate)),this.toDate&&(t+="&",t+="to_date=".concat(this.toDate)),this.usersCount&&(t+="&",t+="users_count=".concat(this.usersCount)),this.minimumPredictions&&(t+="&",t+="minimum_predictions=".concat(this.minimumPredictions)),t},t}();e.default=n},4169:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.templateId=null,n.templateId=(null==e?void 0:e.templateId)||null,n}return r(e,t),e.prototype.constructFiltersUrl=function(){var e=t.prototype.constructFiltersUrl.call(this);return this.templateId&&(e+="&template_id=".concat(this.templateId)),e},e}(s(n(7910)).default);e.default=a},7910:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.limit=null,this.page=null,this.limit=t.limit?t.limit:null,this.page=t.page?t.page:null}return t.prototype.constructFiltersUrl=function(){var t="";return this.limit&&(t+="&",t+="limit=".concat(this.limit)),this.page&&(t+="&",t+="page=".concat(this.page)),t},t}();e.default=n},4996:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.sortOrder=null,n.rankType=null,n.leaderboardIds=null,n.gameType=null,n.constructFiltersUrl=function(){var e=t.prototype.constructFiltersUrl.call(n);return n.sortOrder&&(e+="&",e+="sort_order=".concat(n.sortOrder)),n.rankType&&(e+="&",e+="rank_type=".concat(n.rankType)),n.leaderboardIds&&(e+="&",e+="type_ids=".concat(n.leaderboardIds.join(","))),n.gameType&&(e+="&",e+="game_type=".concat(n.gameType)),e},n.sortOrder=e.sortOrder,n.rankType=e.rankType,n.leaderboardIds=e.leaderboardIds,n.gameType=e.type&&"game"===e.type.toLowerCase()?e.gameType:null,n}return r(e,t),e}(s(n(7910)).default);e.default=a},8061:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.flags=null,this.status=null,this.type=null,this.activeFrom=null,this.activeTo=null,this.createdFrom=null,this.createdTo=null,this.updatedFrom=null,this.updatedTo=null,this.flags=t.flags?t.flags:null,this.status=t.status?t.status:null,this.type=t.type?t.type:null,this.activeFrom=t.activeFrom?t.activeFrom:null,this.activeTo=t.activeTo?t.activeTo:null,this.createdFrom=t.createdFrom?t.createdFrom:null,this.createdTo=t.createdTo?t.createdTo:null,this.updatedFrom=t.updatedFrom?t.updatedFrom:null,this.updatedTo=t.updatedTo?t.updatedTo:null}return t.prototype.constructFiltersUrl=function(){var t="";return this.flags&&this.flags.length>0&&(t+="&",t+="flags=".concat(this.flags.join(","))),this.status&&(t+="&",t+="status=".concat(this.status)),this.type&&(t+="&",t+="type=".concat(this.type)),this.activeFrom&&(t+="&",t+="active_from=".concat(this.activeFrom)),this.activeTo&&(t+="&",t+="active_to=".concat(this.activeTo)),this.createdFrom&&(t+="&",t+="created_from=".concat(this.createdFrom)),this.createdTo&&(t+="&",t+="created_to=".concat(this.createdTo)),this.updatedFrom&&(t+="&",t+="updated_from=".concat(this.updatedFrom)),this.updatedTo&&(t+="&",t+="updated_to=".concat(this.updatedTo)),t},t}();e.default=n},6507:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.points=null,this.predictionsMade=null,this.profileId=null,this.profileModel=null,this.successRatePercent=null}},7746:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6507));e.default=function(){this.remapHighestSuccessRate=function(t){return t.map((function(t){var e=new r.default;return e.position=t.position,e.points=t.points,e.predictionsMade=t.predictions_made,e.profileId=t.profile_id,e.successRatePercent=t.success_rate_percent,e}))}}},9642:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.profileId=null,this.profileModel=null,this.points=null,this.predictionsMade=null}},7419:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8988)),s=i(n(5828)),a=i(n(9642));e.default=function(){var t=this;this.remapResponse=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapData(e.data),e},this.remapLeagueLeaderboardResponse=function(e){return e.meta=t.remapLeagueLeaderboardMeta(e.meta),e.data=t.remapData(e.data),e},this.remapMeta=function(t){var e=new s.default;return e.rankType=t.rank_type,e.fromDate=t.from_date,e.toDate=t.to_date,e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e},this.remapLeagueLeaderboardMeta=function(t){var e=new r.default;return e.templateId=t.template_id,e.privateLeagueId=t.private_league_id,e.fromDate=t.from_date,e.toDate=t.to_date,e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e},this.remapData=function(t){var e=[];return t.forEach((function(t){var n=new a.default;n.position=t.position,n.profileId=t.profile_id,n.points=t.points,n.predictionsMade=t.predictions_made,e.push(n)})),e}}},3409:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.flags="",this.status="",this.type="",this.activeFrom="",this.activeTo="",this.createdFrom="",this.createdTo="",this.updatedFrom="",this.updatedTo=""}},8988:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155));e.default=function(){this.templateId=null,this.privateLeagueId=null,this.fromDate=null,this.toDate=null,this.pagination=new r.default}},5828:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155));e.default=function(){this.rankType=null,this.fromDate=null,this.toDate=null,this.pagination=new r.default}},9012:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155)),s=i(n(3409));e.default=function(){this.pagination=new r.default,this.filters=new s.default}},4187:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.general=null,this.predictor=null,this.activity=null,this.topX=null,this.matchQuiz=null,this.discussionPost=null}},9013:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id=null,e.rankType=null,e.model=null,e.gameType=null,e}return r(e,t),e}(s(n(9642)).default);e.default=a},4533:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1298)),s=i(n(3569)),a=i(n(9659)),o=i(n(9013)),u=function(){function t(){var t=this;this.remapRankings=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapData(e.data),e},this.remapRankingsPrivateLeague=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapDataUserRankingPrivateLeague(e.data),e},this.remapRankingsChallenge=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapDataUserRankingChallenge(e.data),e},this.remapMeta=function(t){var e=new s.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.numberOfPages=t.pagination.number_of_pages,e.pagination.totalItems=t.pagination.total_items,e}}return t.prototype.remapData=function(t){var e=[];return t.forEach((function(t){var n=new o.default;n.id=t.id,n.rankType=t.rank_type,n.position=t.position,n.points=t.points,n.gameType=t.game_type,delete n.profileId,delete n.profileModel,delete n.predictionsMade,e.push(n)})),e},t.prototype.remapDataUserRankingPrivateLeague=function(t){var e=[];return t.forEach((function(t){var n=new a.default;n.templateId=t.template_id,n.privateLeagueId=t.private_league_id,n.position=t.position,n.points=t.points,e.push(n)})),e},t.prototype.remapDataUserRankingChallenge=function(t){var e=[];return t.forEach((function(t){var n=new r.default;n.templateId=t.template_id,n.challengeId=t.private_league_id,n.position=t.position,n.points=t.points,e.push(n)})),e},t}();e.default=u},4226:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.points=null,this.tiers=null,this.badges=null}},6483:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.points=null,this.tiers=null,this.badges=null}},4982:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.adContent=null,e}return r(e,t),e}(s(n(194)).default);e.default=a},8587:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.fromDate=null,this.toDate=null,this.matchIds=[]}},9324:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.groupId=null,this.label=null,this.filters=null}},194:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id=null,this.name=null,this.description=null,this.type=null,this.fromDate=null,this.toDate=null,this.markets=[],this.teamIds=[],this.matchIds=[],this.groups=[],this.gameIds=[],this.gameTypes=[],this.competitionIds=[],this.excludedProfileIds=[],this.rules=null,this.labels=null,this.customFields=null,this.branding=null,this.flags=null,this.images=new r.default,this.status=null,this.automaticallyChangeStatus=!0,this.createdAt=null,this.updatedAt=null,this.related=null}},8899:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(3483)),o=s(n(6692)),u=s(n(9012)),l=s(n(4982)),c=s(n(8587)),d=s(n(9324)),h=s(n(194)),f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapResponse=function(t){var n=[];return t.forEach((function(t){var i=new h.default;i.id=t.id,i.name=t.name,i.description=t.description,i.type=t.type,i.fromDate=t.from_date,i.toDate=t.to_date,i.markets=t.markets?t.markets:null,i.teamIds=t.team_ids?t.team_ids:null,i.matchIds=t.match_ids?t.match_ids:null,i.groups=t.groups?e.remapGroups(t.groups):null,i.gameIds=t.game_ids?t.game_ids:null,i.gameTypes=t.game_types?t.game_types:null,i.competitionIds=t.competition_ids?t.competition_ids:null,i.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,i.rules=t.rules?t.rules:null,i.labels=t.labels?t.labels:null,i.customFields=t.custom_fields?t.custom_fields:null,i.branding=t.branding?e.remapBranding(t.branding):null,i.flags=t.flags?t.flags:null,i.images=t.images?t.images:null,i.status=t.status?t.status:null,i.automaticallyChangeStatus=t.automatically_change_status,i.createdAt=t.created_at,i.updatedAt=t.updated_at,i.related=t.related?e.remapRelated(t.related):null,n.push(i)})),n},e.remapResponseId=function(t){var n=new l.default;return n.id=t.id,n.name=t.name,n.description=t.description,n.type=t.type,n.fromDate=t.from_date,n.toDate=t.to_date,n.markets=t.markets?t.markets:null,n.teamIds=t.team_ids?t.team_ids:null,n.matchIds=t.match_ids?t.match_ids:null,n.groups=t.groups?e.remapGroups(t.groups):null,n.gameIds=t.game_ids?t.game_ids:null,n.gameTypes=t.game_types?t.game_types:null,n.competitionIds=t.competition_ids?t.competition_ids:null,n.excludedProfileIds=t.excluded_profile_ids?t.excluded_profile_ids:null,n.rules=t.rules?t.rules:null,n.flags=t.flags?t.flags:null,n.images=t.images?t.images:null,n.status=t.status?t.status:null,n.automaticallyChangeStatus=t.automatically_change_status,n.related=t.related?e.remapRelated(t.related):null,n.labels=t.labels,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapMeta=function(t){var e=new u.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.totalItems=t.pagination.total_items,e.pagination.numberOfPages=t.pagination.number_of_pages,e.filters.flags=t.filters.flags,e.filters.status=t.filters.status,e.filters.type=t.filters.type,e.filters.activeFrom=t.filters.active_from,e.filters.activeTo=t.filters.active_to,e.filters.createdFrom=t.filters.created_from,e.filters.createdTo=t.filters.created_to,e.filters.updatedFrom=t.filters.updated_from,e.filters.updatedTo=t.filters.updated_to,e},e.remapRelated=function(t){return t.map((function(t){var e=new a.default;return e.entityId=t.entity_id,e.entityType=t.entity_type,e}))},e.remapGroups=function(t){return t.map((function(t){var n=new d.default;return n.groupId=t.group_id,n.label=t.label,n.filters=e.remapGroupFilters(t.filters),n}))},e.remapGroupFilters=function(t){var e=new c.default;return e.fromDate=t.from_date,e.toDate=t.to_date,e.matchIds=t.match_ids,e},e}return r(e,t),e}(o.default);e.default=f},3142:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=n(4021),l=n(4904),c=a(n(8097)),d=a(n(2535)),h=n(5318),f=a(n(8900)),p=a(n(8808)),m=a(n(6134)),v=a(n(267)),_=a(n(1550)),y=a(n(6409)),g=a(n(9596)),b=a(n(8687)),w=a(n(3636)),I=a(n(4169)),E=a(n(7910)),M=a(n(4996));e.default=function(t){var e=this;this.idMappingService=null,this.profileNamespace=null,this.footballNamespace=null,this.topXNamespace=null,this.matchQuizNamespace=null,this.miniGamesNamespace=null,this.errorHandlingMode=null,this.remapTemplatesIds=function(t){return i(e,void 0,void 0,(function(){var e,n,i,a,o;return r(this,(function(r){switch(r.label){case 0:return t.length>0?(e=[],n=[],i=[],t.forEach((function(t){t.teamIds&&t.teamIds.length>0&&(e=s(s([],e,!0),t.teamIds,!0)),t.matchIds&&t.matchIds.length>0&&(n=s(s([],n,!0),t.matchIds,!0)),t.competitionIds&&t.competitionIds.length>0&&(i=s(s([],i,!0),t.competitionIds,!0))})),a={team:e,match:n,competition:i},[4,this.idMappingService.idMappingFacade.getEntitiesByIds(a,"native",this.idMappingService.idSchema)]):[3,2];case 1:return o=r.sent(),s([],o.team,!0),s([],o.match,!0),s([],o.competition,!0),t.forEach((function(t){t.teamIds&&t.teamIds.length>0&&(t.teamIds=t.teamIds.map((function(t){return o.team.shift()}))),t.matchIds&&t.matchIds.length>0&&(t.matchIds=t.matchIds.map((function(t){return o.match.shift()}))),t.competitionIds&&t.competitionIds.length>0&&(t.competitionIds=t.competitionIds.map((function(t){return o.competition.shift()})))})),[2,t];case 2:return[2,t]}}))}))},this.remapTemplateGroupMatchIds=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a;return r(this,(function(r){switch(r.label){case 0:if(!(t&&t.length>0))return[3,4];e=0,n=t,r.label=1;case 1:return e<n.length?(i=n[e]).filters.matchIds&&i.filters.matchIds.every((function(t){return t}))&&i.filters.matchIds.length>0?(s={match:Array.from(i.filters.matchIds)},[4,this.idMappingService.idMappingFacade.getEntitiesByIds(s,"native",this.idMappingService.idSchema)]):[3,3]:[3,4];case 2:a=r.sent(),i.filters.matchIds=Array.from(a.match),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},this.addProfileModelToLeaderboard=function(t){return i(e,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return t.length>0?(e=[],(n=t.map((function(t){return t.profileId}))).length?[4,this.profileNamespace.getByIds(n)]:[2,t]):[3,2];case 1:return i=r.sent(),t.forEach((function(t){i.forEach((function(e){e.id===t.profileId&&(delete e.interests,t.profileModel=e)})),t.profileModel||(t.profileModel=null),e.push(t)})),[2,e];case 2:return[2,t]}}))}))},this.buildOldClientBadges=function(t){var n=new b.default;return n.general=e.extractEnabledBadgesId(t.general),n.predictor=e.extractEnabledBadgesId(t.predictor),n.topX=e.extractEnabledBadgesId(t.topX),n.matchQuiz=e.extractEnabledBadgesId(t.matchQuiz),n},this.buildNewClientBadges=function(t){var n=new w.default;return n.predictor=e.extractEnabledBadgesId(t.predictor),n.topX=e.extractEnabledBadgesId(t.topX),n.matchQuiz=e.extractEnabledBadgesId(t.matchQuiz),n.games=e.extractEnabledBadgesId(t.games),n.football=e.extractEnabledBadgesId(t.football),n.classicQuizzes=e.extractEnabledBadgesId(t.classicQuizzes),n.eitherOr=e.extractEnabledBadgesId(t.eitherOr),n.discussions=e.extractEnabledBadgesId(t.discussions),n.potm=e.extractEnabledBadgesId(t.voting.potm),n.poll=e.extractEnabledBadgesId(t.voting.poll),n},this.initFilters=function(t,e){switch(e){case"loyalty":t&&(t=new E.default(t));break;case"rankings":t&&(t=new M.default(t));break;case"league_leaderboard":t&&(t=new I.default(t))}return t},this.addProfileModelToHighestSuccessRate=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=t.map((function(t){return t.profileId}))).length?[4,this.profileNamespace.getByIds(e)]:[2,t];case 1:return n=i.sent(),[2,t.map((function(t){return n.forEach((function(e){e.id===t.profileId&&(delete e.interests,t.profileModel=e)})),t}))]}}))}))},this.extractRankingsIdsMap=function(t){var e=[],n=[],i=[];return t.forEach((function(t){"GAME"===t.rankType&&"TOP_X"===t.gameType?e.push(t.id):"GAME"===t.rankType&&"MATCH_QUIZ"===t.gameType?n.push(t.id):"TEMPLATE"===t.rankType&&i.push(t.id)})),[e,n,i]},this.setModelsForUserRankings=function(t,e,n,i){return i.data.forEach((function(i){"MATCH_QUIZ"===i.gameType&&e?i.model=e.filter((function(t){return t.id===i.id}))[0]:"TOP_X"===i.gameType&&t?i.model=t.filter((function(t){return t.id===i.id}))[0]:"TEMPLATE"===i.rankType&&n&&(i.model=n.filter((function(t){return t.id===i.id}))[0])})),i},this.completeContestWinners=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return t.userList&&t.userList.length?(e=t.userList.map((function(t){return t.profileId})),[4,this.profileNamespace.getByIds(e)]):[3,2];case 1:n=i.sent(),t.userList.forEach((function(t){var e=n.filter((function(e){return e.id===t.profileId}))[0];delete e.interests,t.profileModel=e})),i.label=2;case 2:return[2,t]}}))}))},this.validateEntitiesFollowsFilters=function(t){if(!t||!(t.footballCompetitions&&t.footballCompetitions.length||t.footballTeams&&t.footballTeams.length||t.footballPlayers&&t.footballPlayers.length)){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_FILTERS,h.ErrorMessages.ENTITIES_NEEDED);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_FILTERS,h.ErrorMessages.ENTITIES_NEEDED)}if(t.footballCompetitions&&t.footballCompetitions.length>24||t.footballTeams&&t.footballTeams.length>24||t.footballPlayers&&t.footballPlayers.length>24){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.EXCEEDED_LENGTH,h.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.EXCEEDED_LENGTH,h.ErrorMessages.ENTITIES_FOLLOWS_FILTERS_EXCEEDED)}},this.remapEntitiesFollowsFilters=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:return e=JSON.parse(JSON.stringify(t)),n={},i={},e.footballCompetitions&&e.footballCompetitions.length&&(i.competition=e.footballCompetitions),e.footballTeams&&e.footballTeams.length&&(i.team=e.footballTeams),e.footballPlayers&&e.footballPlayers.length&&(i.player=e.footballPlayers),[4,this.idMappingService.idMappingFacade.getEntitiesByIds(i,this.idMappingService.idSchema,o.IdSchemaEnum.NATIVE)];case 1:return s=r.sent(),Object.keys(s).forEach((function(t){"competition"===t?n.footballCompetitions=s[t]:"team"===t?n.footballTeams=s[t]:"player"===t&&(n.footballPlayers=s[t])})),[2,n]}}))}))},this.addModelsToEntitiesFollows=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o,u,l,c;return r(this,(function(r){switch(r.label){case 0:return e=[],n="fb:c:",i=new Map,s=[],a="fb:t:",o=new Map,u=[],l="fb:p:",c=null,t.breakdown.forEach((function(t){t.id.includes(n)?e.push(t.id):t.id.includes(a)?s.push(t.id):t.id.includes(l)&&u.push(t.id)})),e.length?[4,this.footballNamespace.footballFacade.competitionsFacade.getCompetitionsMapWithNativeIds(e)]:[3,2];case 1:i=r.sent(),r.label=2;case 2:return s.length?[4,this.footballNamespace.footballFacade.teamsFacade.getTeamsMapWithNativeIds(s)]:[3,4];case 3:o=r.sent(),r.label=4;case 4:return u.length?[4,this.footballNamespace.footballFacade.playerFacade.getPlayersMapWithNativeIds(u)]:[3,6];case 5:c=r.sent(),r.label=6;case 6:return t.breakdown.forEach((function(t){t.id.includes(n)?(t.model=i.get(t.id),t.id=t.model.id):t.id.includes(a)?(t.model=o.get(t.id),t.id=t.model.id):t.id.includes(l)&&(t.model=c[t.id],t.id=t.model.id)})),[2,t]}}))}))},this.initMatchFiltersForTemplates=function(t,n){var i=[],r=[],s=[],a=e.reformatDate(t.fromDate),o=e.reformatDate(t.toDate,!0);if(t.competitionIds&&t.competitionIds.length>0&&(i=Array.from(t.competitionIds)),t.teamIds&&t.teamIds.length>0&&(r=Array.from(t.teamIds)),t.matchIds&&t.matchIds.length>0&&(s=Array.from(t.matchIds)),n){var f=t.groups.find((function(t){return t.groupId===n}));if(!f){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_ID,h.ErrorMessages.INVALID_TEMPLATE_GROUP_ID);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_ID,h.ErrorMessages.INVALID_TEMPLATE_GROUP_ID)}if(!f.filters){if("default"===e.errorHandlingMode)throw new c.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_FILTERS,h.ErrorMessages.INVALID_TEMPLATE_GROUP_FILTERS);throw new d.default(u.ErrorCodes.BAD_METHOD_CALL,l.ErrorStatuses.INVALID_TEMPLATE_GROUP_FILTERS,h.ErrorMessages.INVALID_TEMPLATE_GROUP_FILTERS)}a=e.reformatDate(f.filters.fromDate),o=e.reformatDate(f.filters.toDate,!0),f.filters.matchIds.every((function(t){return t}))&&(s=Array.from(f.filters.matchIds))}return new m.default({competitionIds:i,teamIds:r,matchIds:s,fromDate:a,toDate:o,limit:500})},this.reformatDate=function(t,e){var n=new Date(t);e&&n.setUTCHours(23,59,59);var i=n.toISOString();return i.slice(0,-5)+"Z"},this.extractEnabledBadgesId=function(t){var e=[];return t.forEach((function(t){t.enabled&&e.push(t.id)})),e},this.addEntityModelToFootballBadges=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o,u,l,c,d,h,f=this;return r(this,(function(r){switch(r.label){case 0:return e=[],n=[],i=[],s=[],t.football&&t.football.length>0&&(e=t.football.filter((function(t){return"competition"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),n=t.football.filter((function(t){return"team"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),i=t.football.filter((function(t){return"player"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),s=t.football.filter((function(t){return"match"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId}))),t.voting&&t.voting.poll&&t.voting.poll.length>0&&(a=this.extractEntityIdsFromBadges(t.voting.poll),u=a[0],l=a[1],c=a[2],d=a[3],e=e.concat(u),e=Array.from(new Set(e)),n=n.concat(l),n=Array.from(new Set(n)),i=i.concat(c),i=Array.from(new Set(i)),s=s.concat(d),s=Array.from(new Set(s))),t.voting&&t.voting.potm&&t.voting.potm.length>0&&(o=this.extractEntityIdsFromBadges(t.voting.potm),u=o[0],l=o[1],c=o[2],d=o[3],e=e.concat(u),e=Array.from(new Set(e)),n=n.concat(l),n=Array.from(new Set(n)),i=i.concat(c),i=Array.from(new Set(i)),s=s.concat(d),s=Array.from(new Set(s))),[4,this.fetchFootballEntities(e,n,i,s)];case 1:return h=r.sent(),t.football&&t.football.length>0&&t.football.forEach((function(t){f.setEntityModelsFromMap(t.requirements,"competition",h.competitions),f.setEntityModelsFromMap(t.requirements,"team",h.teams),f.setEntityModelsFromObject(t.requirements,"player",h.players),f.setEntityModelsFromObject(t.requirements,"match",h.matches)})),t.voting&&t.voting.poll&&t.voting.poll.length>0&&t.voting.poll.forEach((function(t){f.setEntityModelsFromMap(t.requirements,"competition",h.competitions),f.setEntityModelsFromMap(t.requirements,"team",h.teams),f.setEntityModelsFromObject(t.requirements,"player",h.players),f.setEntityModelsFromObject(t.requirements,"match",h.matches)})),t.voting&&t.voting.potm&&t.voting.potm.length>0&&t.voting.potm.forEach((function(t){f.setEntityModelsFromMap(t.requirements,"competition",h.competitions),f.setEntityModelsFromMap(t.requirements,"team",h.teams),f.setEntityModelsFromObject(t.requirements,"player",h.players),f.setEntityModelsFromObject(t.requirements,"match",h.matches)})),[2]}}))}))},this.setEntityModelsFromMap=function(t,e,n){t.entityType===e&&(t.entityModel=n&&n.get(t.entityId)||null,t.entityModel&&(t.entityId=t.entityModel.id))},this.setEntityModelsFromObject=function(t,e,n){t.entityType===e&&(t.entityModel=n[t.entityId]?n[t.entityId]:null,t.entityModel&&(t.entityId=t.entityModel.id))},this.fetchFootballEntities=function(t,n,s,a){return i(e,void 0,void 0,(function(){var e,i,o,u,l;return r(this,(function(r){switch(r.label){case 0:return e={competitions:null,teams:null,players:null,matches:null},t.length?[4,this.footballNamespace.footballFacade.getCompetitionsMapWithNativeIds(t)]:[3,2];case 1:i=r.sent(),e.competitions=i,r.label=2;case 2:return n.length?[4,this.footballNamespace.footballFacade.getTeamsMapWithNativeIds(n)]:[3,4];case 3:o=r.sent(),e.teams=o,r.label=4;case 4:return s.length?[4,this.footballNamespace.footballFacade.getPlayersMapWithNativeIds(s)]:[3,6];case 5:u=r.sent(),e.players=u,r.label=6;case 6:return a.length?[4,this.footballNamespace.footballFacade.getMatchesMapWithNativeIds(a)]:[3,8];case 7:l=r.sent(),e.matches=l,r.label=8;case 8:return[2,e]}}))}))},this.extractEntityIdsFromBadges=function(t){return[t.filter((function(t){return t.requirements.entityType&&"competition"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),t.filter((function(t){return t.requirements.entityType&&"team"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),t.filter((function(t){return t.requirements.entityType&&"player"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId})),t.filter((function(t){return t.requirements.entityType&&"match"===t.requirements.entityType.toLocaleLowerCase()})).map((function(t){return t.requirements.entityId}))]},this.addGameModelToGamesBadges=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a;return r(this,(function(r){switch(r.label){case 0:return t.games&&0!==t.games.length?(e=this.getGameIdsFromGamesBadge(t.games,"top_x"),n=this.getGameIdsFromGamesBadge(t.games,"match_quiz"),i=this.getGameIdsFromGamesBadge(t.games,"classic_quiz"),s=this.getGameIdsFromGamesBadge(t.games,"either_or"),[4,this.fetchGamesEntities(e,n,i,s)]):[2];case 1:return a=r.sent(),t.games.forEach((function(t){t.requirements.specificGames&&t.requirements.specificGames.forEach((function(t){t.gameModel=a.find((function(e){return e.id===t.gameId}))||null}))})),[2]}}))}))},this.getGameIdsFromGamesBadge=function(t,e){var n=t.filter((function(t){return!!t.requirements.specificGames&&t.requirements.specificGames.some((function(t){return t.gameType.toLocaleLowerCase()===e}))})).map((function(t){return t.requirements.specificGames.map((function(t){return t.gameId}))}));return Array.prototype.concat.apply([],n)},this.fetchGamesEntities=function(t,n,a,o){return i(e,void 0,void 0,(function(){var e,i,u,l,c;return r(this,(function(r){switch(r.label){case 0:return e=[],t.length?[4,this.topXNamespace.getGames({gameIds:t})]:[3,2];case 1:i=r.sent(),e=s(s([],e,!0),i.data,!0),r.label=2;case 2:return n.length?[4,this.matchQuizNamespace.getGames({gameIds:n})]:[3,4];case 3:u=r.sent(),e=s(s([],e,!0),u.data,!0),r.label=4;case 4:return a.length?[4,this.miniGamesNamespace.getClassicQuizzes({classicQuizIds:a})]:[3,6];case 5:l=r.sent(),e=s(s([],e,!0),l.data,!0),r.label=6;case 6:return o.length?[4,this.miniGamesNamespace.getEitherOrs({eitherOrIds:o})]:[3,8];case 7:c=r.sent(),e=s(s([],e,!0),c.data,!0),r.label=8;case 8:return[2,e]}}))}))},this.idMappingService=new f.default(t),this.profileNamespace=new y.default(t),this.footballNamespace=new p.default(t),this.topXNamespace=new g.default(t),this.matchQuizNamespace=new v.default(t),this.miniGamesNamespace=new _.default(t),this.errorHandlingMode=t.errorHandlingMode}},1139:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4021),s=n(4904),a=i(n(8097)),o=i(n(2535)),u=n(5318),l=n(7974);e.default=function(){var t=this;this.validate=function(e,n){e.market&&t.validateMarket(e.market,n),e.fromDate&&t.validateDate(e.fromDate,"fromDate",n),e.toDate&&t.validateDate(e.toDate,"toDate",n),e.usersCount&&t.validateNumberFilters(e.usersCount,"usersCount",n),e.minimumPredictions&&t.validateNumberFilters(e.minimumPredictions,"minimumPredictions",n)},this.validateMarket=function(t,e){if(!Object.keys(l.MarketEnum).includes(t)){var n=(0,u.invalidMarketMessage)(t);if("default"===e)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_MARKET,n);throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_MARKET,n)}},this.validateDate=function(t,e,n){if("string"!=typeof t){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"string for ".concat(e," filter"));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"string for ".concat(e," filter"))}if(!/^\d{4}-\d{2}-\d{2}$/.test(t)){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for ".concat(e));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"YYYY-MM-DD for ".concat(e))}},this.validateNumberFilters=function(t,e,n){var i="usersCount"===e?1:0,l="usersCount"===e?1e3:1e6;if("number"!=typeof t){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"number for ".concat(e," filter"));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_TYPE+"number for ".concat(e," filter"))}if(t<i||t>l){if("default"===n)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"between ".concat(i," and ").concat(l));throw new o.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_VALUE+"between ".concat(i," and ").concat(l))}}}},1859:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4946),c=u(n(1553)),d=s(n(7686)),h=u(n(2793)),f=u(n(8900)),p=u(n(1732)),m=u(n(7782)),v=u(n(5013)),_=n(853),y=u(n(7299)),g=u(n(2310)),b=u(n(4800)),w=u(n(8097)),I=n(4021),E=n(4904),M=n(5318),O=u(n(2535));e.default=function(t){var e=this;this.predictorHttps=null,this.predictorService=null,this.idMapping=null,this.clientHttps=null,this.predictorValidator=null,this.errorHandlingMode=null,this.getConfig=function(){return a(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(d.FeatureConfigType.MATCH_QUIZ)];case 1:return t=e.sent(),this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(t)];case 2:return[2,e.sent()];case 3:return[2,t]}}))}))},this.play=function(t){return a(e,void 0,void 0,(function(){var e,n,i,r,s,a=this;return o(this,(function(o){switch(o.label){case 0:return t=this.predictorValidator.validateBodyFields("MATCH_QUIZ",t),(e=t.fixtures.map((function(t){return a.predictorValidator.validateFixture(t.matchId,t.market,t.prediction.value,t.prediction.playerId)})))&&e.length?this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,4]:(n=[],i=[],e.forEach((function(t){n.push(t.matchId),t instanceof p.default&&t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&i.push(t.prediction.playerId)})),[4,this.predictorService.remapMatchIdToNative(n)]):[3,4];case 1:return r=o.sent(),s={},i&&i.length>0?[4,this.predictorService.remapPlayerIdMapToNative(i)]:[3,3];case 2:s=o.sent(),o.label=3;case 3:e.forEach((function(t,e){t.matchId=r[e],t instanceof p.default&&"OWN_GOAL"!==t.prediction.playerId&&(t.prediction.playerId=s[t.prediction.playerId])})),o.label=4;case 4:return t.fixtures=e,[4,this.predictorHttps.makeFootballPrediction(t)];case 5:return[2,o.sent()]}}))}))},this.delete=function(t){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getGames=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return n=n||!1,e=this.predictorService.initGameFilters("MATCH_QUIZ",t),[4,this.predictorHttps.getGames(e,n)];case 1:return i=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(i)];case 2:return[2,r.sent()]}}))}))},this.getGameById=function(t,n){return a(e,void 0,void 0,(function(){var e;return o(this,(function(i){switch(i.label){case 0:return n=n||!1,[4,this.predictorHttps.getGameById(t,n)];case 1:return e=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(e)];case 2:return[2,i.sent()]}}))}))},this.getGamePredictions=function(t,n,i){return a(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return i=i||!1,n&&(n.type&&delete n.type,n.status&&delete n.status,n=new m.default(n)),[4,this.predictorHttps.getGamePredictions(t,i,n)];case 1:return[2,e.sent()]}}))}))},this.getGameResults=function(t,n,i){return a(e,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return i=i||!1,n&&(n=new b.default(n)),[4,this.predictorHttps.getGameResults(t,i,n)];case 1:return e=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(e)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(t){return a(e,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return t=t||!1,(e=new y.default(null)).status=_.GameStatusEnum.OPEN,e.type="MATCH_QUIZ",[4,this.predictorHttps.getGames(e,t)];case 1:return n=r.sent(),i=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(i,null,t)];case 2:return[2,r.sent().data[0]]}}))}))},this.getMyGameEditions=function(t,n){return a(e,void 0,void 0,(function(){var e,i,r,s,a;return o(this,(function(o){switch(o.label){case 0:return t&&t.limit&&this.validateLimitFilterOnGames(t.limit),n=n||!1,e=this.predictorService.initGameTypePredictions("MATCH_QUIZ",t),i=[],[4,this.predictorHttps.getMyPredictionsNoRemap(e)];case 1:return(r=o.sent()).data.length>0?(r.data.forEach((function(t){t.game_instance_id&&i.push(t.game_instance_id)})),s=this.predictorService.initGameFilters("MATCH_QUIZ",null,i),[4,this.predictorHttps.getUserGameEditions(s,n)]):[3,4];case 2:return a=o.sent(),[4,this.predictorService.addPredictionProp(r,a)];case 3:return[2,o.sent()];case 4:return[2,new c.default]}}))}))},this.getMyGamePrediction=function(t){return a(e,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return e=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return(n=r.sent()).data.length>0?[2,(i=n.data.filter((function(e){return e.gameInstanceId===t}))).length?i[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r,s,a,u;return o(this,(function(o){switch(o.label){case 0:return n&&n.limit&&this.validateLimitFilterOnGames(n.limit),i=i||!1,e=this.predictorService.initGameTypePredictions("MATCH_QUIZ",n),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(t,e)];case 1:return(s=o.sent()).data.length>0?(s.data.forEach((function(t){t.game_instance_id&&r.push(t.game_instance_id)})),a=this.predictorService.initGameFilters("MATCH_QUIZ",null,r),[4,this.predictorHttps.getUserGameEditions(a,i)]):[3,4];case 2:return u=o.sent(),[4,this.predictorService.addPredictionProp(s,u)];case 3:return[2,o.sent()];case 4:return[2,new c.default]}}))}))},this.getUserGamePrediction=function(t,n,i){return a(e,void 0,void 0,(function(){var e,r,s;return o(this,(function(a){switch(a.label){case 0:return i=i||!1,e=this.predictorService.initGameTypePredictions("MATCH_QUIZ"),[4,this.predictorHttps.getUserPredictions(t,i,e)];case 1:return(r=a.sent()).data.length>0?[2,(s=r.data.filter((function(t){return t.gameInstanceId===n}))).length?s[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(t,n){return a(e,void 0,void 0,(function(){var e;return o(this,(function(i){switch(i.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(t,n)];case 1:return e=i.sent(),[4,this.predictorService.completeGameMarketResults(e,"MATCH_QUIZ")];case 2:return[2,i.sent()]}}))}))},this.getGameWinners=function(t,n){return a(e,void 0,void 0,(function(){var e,i;return o(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(t,n)];case 1:return e=r.sent(),[4,this.getGameById(t)];case 2:return i=r.sent(),e.contestModel=i,[2,this.predictorService.completeContestWinners(e)]}}))}))},this.validateLimitFilterOnGames=function(t){if("default"===e.errorHandlingMode&&t>50)throw new w.default(I.ErrorCodes.BAD_METHOD_CALL,E.ErrorStatuses.EXCEEDED_LENGTH,M.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===e.errorHandlingMode&&t>50)throw new O.default(I.ErrorCodes.BAD_METHOD_CALL,E.ErrorStatuses.EXCEEDED_LENGTH,M.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED)},this.predictorValidator=new g.default(t.errorHandlingMode),this.idMapping=new f.default(t),this.predictorHttps=new h.default(t,this.idMapping),this.predictorService=new v.default(t,this.idMapping),this.clientHttps=new d.default(t),this.errorHandlingMode=t.errorHandlingMode}},267:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(1859));e.default=function(t){var e=this;this.matchQuizFacade=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.matchQuizFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.play=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.play(t)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getGames=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGames(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGameById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGamePredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGamePredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getGameResults=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGameResults(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getCurrentGameResults=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getCurrentGameResults(t)];case 1:return[2,e.sent()]}}))}))},this.getMyGameEditions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getMyGameEditions(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyGamePrediction=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getMyGamePrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getUserGameEditions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getUserGameEditions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserGamePrediction=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getUserGamePrediction(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getMarketsResultsForGame=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getMarketsResultsForGame(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameWinners=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.matchQuizFacade.getGameWinners(t,n)];case 1:return[2,e.sent()]}}))}))},this.matchQuizFacade=new a.default(t)}},5765:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.enabled=!1,this.clientId=null,this.defaultMarkets=null,this.competitionsWhitelist=null}},8410:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899)),s=i(n(8042));e.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new s.default}},670:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.gameId=null,this.results=null,this.tieBreakers=null}},7243:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4916));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.images=null,this.scheduleOpenAt=null,this.branding=null}},8042:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null,this.target=null,this.playerId=null,this.playerModel=null,this.result=null}},6390:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=a(n(3022)),l=a(n(8261)),c=a(n(8107)),d=a(n(2261)),h=a(n(3069)),f=a(n(425)),p=a(n(7050)),m=a(n(3404));e.default=function(t){var e=this;this.https=null,this.service=null,this.activityService=null,this.idSchema=null,this.getClassicQuizzes=function(t,n,i){return r(e,void 0,void 0,(function(){var e,r,a,u;return s(this,(function(s){switch(s.label){case 0:return t?(t=new c.default(t),[4,this.service.finalizeMiniGamesFilters(t)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[4,this.https.getClassicQuizzes(t,i)];case 3:return e=s.sent(),n?[4,this.service.setContextTagsModels(e.data)]:[3,5];case 4:return s.sent(),[3,9];case 5:r=0,a=e.data,s.label=6;case 6:return r<a.length?(u=a[r],[4,this.remapTags(u,o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,9];case 7:s.sent(),s.label=8;case 8:return r++,[3,6];case 9:return[2,e]}}))}))},this.getClassicQuizById=function(t,n,i){return r(e,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,this.https.getClassicQuizById(t,n,i)];case 1:return e=r.sent(),[4,this.service.setContextTagsModels([e])];case 2:return r.sent(),[2,e]}}))}))},this.participateInClassicQuiz=function(t,n,i){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.https.participateInClassicQuiz(t,n,i)];case 1:return[2,e.sent()]}}))}))},this.getMyClassicQuizParticipations=function(t){return r(e,void 0,void 0,(function(){var e,n,r;return s(this,(function(s){switch(s.label){case 0:return t&&(t=new h.default(t)),[4,this.https.getMyClassicQuizParticipations(t)];case 1:return e=s.sent(),n=e.map((function(t){return t.classicQuizId})),[4,this.getClassicQuizzes({classicQuizIds:n})];case 2:return r=s.sent(),[2,e.map((function(t){var e=r.data.find((function(e){return e.id===t.classicQuizId}))||null;return i(i({},t),{classicQuizModel:e})}))]}}))}))},this.getLeaderboardForClassicQuizzes=function(t){return r(e,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return t&&(t=new d.default(t)),[4,this.https.getLeaderboardForClassicQuizzes(t)];case 1:return e=i.sent(),n=e,[4,this.service.setProfileModelsForClassicQuizLeaderboards(e.data)];case 2:return n.data=i.sent(),[2,e]}}))}))},this.getClassicQuizzesUserRanking=function(t,n){return r(e,void 0,void 0,(function(){var e,r,a;return s(this,(function(s){switch(s.label){case 0:return n&&(n=new f.default(n)),[4,this.https.getClassicQuizzesUserRanking(t,n)];case 1:return e=s.sent(),r=e.data.map((function(t){return t.classicQuizId})),[4,this.getClassicQuizzes({classicQuizIds:r})];case 2:return a=s.sent(),e.data=e.data.map((function(t){var e=a.data.find((function(e){return e.id===t.classicQuizId}))||null;return i(i({},t),{classicQuizModel:e})})),[2,e]}}))}))},this.getEitherOrs=function(t,n,i){return r(e,void 0,void 0,(function(){var e,r,a,u;return s(this,(function(s){switch(s.label){case 0:return t?(t=new p.default(t),[4,this.service.finalizeMiniGamesFilters(t)]):[3,2];case 1:s.sent(),s.label=2;case 2:return[4,this.https.getEitherOrs(t,i)];case 3:return e=s.sent(),n?[4,this.service.setContextTagsModels(e.data)]:[3,5];case 4:return s.sent(),[3,9];case 5:r=0,a=e.data,s.label=6;case 6:return r<a.length?(u=a[r],[4,this.remapTags(u,o.IdSchemaEnum.NATIVE,this.idSchema)]):[3,9];case 7:s.sent(),s.label=8;case 8:return r++,[3,6];case 9:return[2,e]}}))}))},this.getEitherOrById=function(t,n){return r(e,void 0,void 0,(function(){var e;return s(this,(function(i){switch(i.label){case 0:return[4,this.https.getEitherOrById(t,n)];case 1:return e=i.sent(),[4,this.service.setContextTagsModels([e])];case 2:return i.sent(),[2,e]}}))}))},this.getMyEitherOrStats=function(t){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.https.getMyEitherOrStats(t)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrResults=function(t,n){return r(e,void 0,void 0,(function(){var e;return s(this,(function(i){switch(i.label){case 0:return[4,this.https.getEitherOrResults(t,n)];case 1:return e=i.sent(),[4,this.service.setProfileModelsForEitherOrStandings(e)];case 2:return[2,i.sent()]}}))}))},this.participateInEitherOr=function(t,n,i){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return i?[3,2]:[4,this.service.defaultEitherOrParticipation(t,n)];case 1:case 3:return[2,e.sent()];case 2:return[4,this.service.handleEitherOrParticipationWithCallback(t,n,i)]}}))}))},this.calculateEitherOrResultPercentile=function(t,n){return r(e,void 0,void 0,(function(){var e,i,r,a,o,u;return s(this,(function(s){switch(s.label){case 0:return null==n||isNaN(n)||n<0?[2,null]:0===n?[2,n]:[4,this.getEitherOrResults(t,!0)];case 1:for(e=s.sent(),i=e.breakdown.reduce((function(t,e){return t+e.totalUsers}),0),r=0,a=0,o=e.breakdown;a<o.length;a++)if(u=o[a],r+=u.totalUsers,n>=u.rangeStartInclusive&&n<=u.rangeEndInclusive)return[2,parseFloat((r/i*100).toFixed(1))];return[2,null]}}))}))},this.remapTags=function(t,n,i){return r(e,void 0,void 0,(function(){var e,r;return s(this,(function(s){switch(s.label){case 0:return this.idSchema!=o.IdSchemaEnum.NATIVE&&t.context&&t.context.tags&&t.context.tags.length?(e=JSON.parse(JSON.stringify(t.context.tags)),[4,this.activityService.remapTagsIds(e,n,i)]):[3,2];case 1:r=s.sent(),t.context.tags=r,s.label=2;case 2:return[2]}}))}))},this.https=new u.default(t),this.service=new m.default(t),this.activityService=new l.default(t),this.idSchema=t.idSchema}},1550:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(6390));e.default=function(t){var e=this;this.facade=null,this.getClassicQuizzes=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getClassicQuizzes(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getClassicQuizById=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getClassicQuizById(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.participateInClassicQuiz=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.participateInClassicQuiz(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getMyClassicQuizParticipations=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyClassicQuizParticipations(t)];case 1:return[2,e.sent()]}}))}))},this.getLeaderboardForClassicQuizzes=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getLeaderboardForClassicQuizzes(t)];case 1:return[2,e.sent()]}}))}))},this.getClassicQuizzesUserRanking=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getClassicQuizzesUserRanking(t,n)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrs=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getEitherOrs(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getEitherOrById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyEitherOrStats=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyEitherOrStats(t)];case 1:return[2,e.sent()]}}))}))},this.getEitherOrResults=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getEitherOrResults(t,n)];case 1:return[2,e.sent()]}}))}))},this.participateInEitherOr=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.participateInEitherOr(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.calculateEitherOrResultPercentile=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.calculateEitherOrResultPercentile(t,n)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},5985:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.images=new r.default,this.participationCount=null,this.questionsCount=null,this.status=null,this.flags=null,this.customFields=null,this.labels=null,this.branding=null,this.time=null,this.points=null,this.scored=!1,this.maxAttempts=null,this.averageScore=null,this.perfectScore=null,this.adContent=null,this.context=null,this.createdAt=null,this.updatedAt=null}},8107:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.classicQuizIds=null,n.classicQuizIds=e&&e.classicQuizIds?e.classicQuizIds:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.classicQuizIds&&this.classicQuizIds.length>0&&(e+="&classic_quiz_ids=".concat(this.classicQuizIds.join(","))),e},e}(s(n(4654)).default);e.default=a},6235:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rules=null,e.questions=[],e}return r(e,t),e}(s(n(5985)).default);e.default=a},1154:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.optionId=null,this.option=null,this.images=null,this.correct=null}},8944:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.classicQuizId=null,this.userId=null,this.questions=[],this.correctOptions=null,this.personalBest=null,this.points=null,this.attempts=null}},7763:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.questionId=null,this.optionId=null,this.correct=null,this.correctOptionId=null}},3069:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.classicQuizIds=null,n.classicQuizIds=(null==e?void 0:e.classicQuizIds)||null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.classicQuizIds&&this.classicQuizIds.length>0&&(e+="&classic_quiz_ids=".concat(this.classicQuizIds.join(","))),e},e}(s(n(4800)).default);e.default=a},772:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.questionId=null,this.question=null,this.images=null,this.embedCode=null,this.explanation=null,this.options=[]}},1124:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.classicQuizId=null,this.classicQuizModel=null,this.correct=null,this.classicQuizQuestions=null,this.personalBest=null,this.points=null,this.answers=[]}},9657:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.classicQuizIds=null}},2261:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.classicQuizIds=null,n.classicQuizIds=(null==e?void 0:e.classicQuizIds)||null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.classicQuizIds&&this.classicQuizIds.length>0&&(e+="&classic_quiz_ids=".concat(this.classicQuizIds.join(","))),e},e}(s(n(425)).default);e.default=a},2702:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(155)),s=i(n(9657));e.default=function(){this.pagination=new r.default,this.filters=new s.default}},425:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.limit=null,this.page=null,this.limit=(null==t?void 0:t.limit)||null,this.page=(null==t?void 0:t.page)||null}return t.prototype.constructMainFiltersUrl=function(){var t="";return this.limit&&(t+="&limit=".concat(this.limit)),this.page&&(t+="&page=".concat(this.page)),t},t}();e.default=n},5563:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.profileId=null,this.profileModel=null,this.points=null}},8967:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position=null,this.classicQuizId=null,this.classicQuizModel=null,this.points=null}},9619:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id="",this.title="",this.description="",this.images=new r.default,this.flags=[],this.status="",this.winningCondition="",this.lives=0,this.time=0,this.points=[],this.customFields=null,this.branding=null,this.labels=null,this.adContent="",this.context=null,this.type="",this.createdAt="",this.updatedAt=""}},7050:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.eitherOrIds=null,n.eitherOrIds=e&&e.eitherOrIds?e.eitherOrIds:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.eitherOrIds&&this.eitherOrIds.length>0&&(e+="&either_or_ids=".concat(this.eitherOrIds.join(","))),e},e}(s(n(4654)).default);e.default=a},3167:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rules="",e}return r(e,t),e}(s(n(9619)).default);e.default=a},9146:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.correctSteps=0,this.score=0}},5367:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.eitherOrId="",this.personalBest=0}},5021:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.instanceId="",this.eitherOrId="",this.gameStartedAt="",this.currentStep=0,this.currentStreak=0,this.remainingSteps=0,this.currentLives=0,this.currentPoints=0,this.personalBest=0,this.steps=[]}},850:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.expired=!1,e.time=0,e}return r(e,t),e}(s(n(5990)).default);e.default=a},5990:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.pair="",this.answer=""}},2557:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6140));e.default=function(){this.pairId="",this.userSelection="",this.correct=null,this.played=null,this.timestamp="",this.optionOne=new r.default,this.optionTwo=new r.default}},6140:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5253));e.default=function(){this.id="",this.label="",this.images=new r.default,this.value=null}},2699:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.rangeStartInclusive=0,this.rangeEndInclusive=0,this.totalUsers=0}},8590:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.standings=[],this.breakdown=[]}},5289:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.userId="",this.userModel=null,this.personalBest=""}},4654:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.flags=null,n.status=null,n.entityIds=null,n.entityType=null,n.sort=null,n.groupByStatus=null,n.flags=e&&e.flags?e.flags:null,n.status=e&&e.status?e.status:null,n.entityIds=e&&e.entityIds?e.entityIds:null,n.entityType=e&&e.entityType?e.entityType:null,n.sort=e&&e.sort?e.sort:null,n.groupByStatus=e&&void 0!==e.groupByStatus?e.groupByStatus:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.flags&&this.flags.length>0&&(e+="&flags=".concat(this.flags.join(","))),this.status&&(e+="&status=".concat(this.status)),this.entityIds&&this.entityIds.length>0&&(e+="&entity_ids=".concat(this.entityIds)),this.sort&&(e+="&sort=".concat(this.sort)),null!==this.groupByStatus&&(e+="&group_by_status=".concat(this.groupByStatus)),e},e}(s(n(4800)).default);e.default=a},5253:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},6282:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.content=null,this.tags=[],this.campaign=null}},3323:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.model=null,this.source=null,this.type=null}},2239:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8902)),o=s(n(5985)),u=s(n(6235)),l=s(n(772)),c=s(n(1154)),d=s(n(8944)),h=s(n(7763)),f=s(n(1124)),p=s(n(6282)),m=s(n(3323)),v=s(n(6692)),_=s(n(2702)),y=s(n(155)),g=s(n(9657)),b=s(n(5563)),w=s(n(8967)),I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapClassicQuizzes=function(t){return t.meta.pagination=e.remapMetaPagination(t.meta.pagination),t.data=t.data.map((function(t){return e.remapBasicClassicQuiz(t)})),t},e.remapClassicQuizById=function(t){var n=new u.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.participationCount=t.participation_count,n.questionsCount=t.questions_count,n.status=t.status,n.flags=t.flags,n.adContent=t.ad_content,n.rules=t.rules,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.time=t.time,n.points=t.points,n.scored=t.scored,n.maxAttempts=t.max_attempts,n.context=t.context?e.remapContext(t.context):t.context,n.averageScore=t.average_score,n.perfectScore=t.perfect_score,n.questions=t.questions.map((function(t){return e.remapQuestions(t)})),n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapClassicQuizParticipation=function(t){var n=new d.default;return n.classicQuizId=t.classic_quiz_id,n.userId=t.user_id,n.questions=t.questions?t.questions.map((function(t){return e.remapParticipationQuestions(t)})):null,n.correctOptions=t.correct_options,n.personalBest=t.personal_best,n.points=t.points,n.attempts=t.attempts,n},e.remapClassicQuizParticipationBody=function(t){return t.map((function(t){return{question_id:t.questionId,option_id:t.optionId}}))},e.remapUserClassicQuizParticipations=function(t){return t.map((function(t){var n=new f.default;return n.classicQuizId=t.classic_quiz_id,n.correct=t.correct,n.classicQuizQuestions=t.classic_quiz_questions,n.personalBest=t.personal_best,n.points=t.points,n.answers=t.answers?t.answers.map((function(t){return e.remapParticipationQuestions(t)})):t.answers,n}))},e.remapClassicQuizzesLeaderboard=function(t){return t.meta=e.remapClassicQuizLeaderboardMeta(t.meta),t.data=t.data.map((function(t){return e.remapClassicQuizLeaderboard(t)})),t},e.remapClassicQuizUserRankings=function(t){return t.meta.pagination=e.remapMetaPaginationRank(t.meta.pagination),t.data=t.data.map((function(t){return e.remapClassicQuizUserRanking(t)})),t},e.remapMetaPagination=function(t){var e=new a.default;return e.itemsPerPage=t.items_per_page,e.nextPageStartsAfter=t.next_page_starts_after,e},e.remapClassicQuizLeaderboardMeta=function(t){var n=new _.default;return n.pagination=e.remapMetaPaginationRank(t.pagination),n.filters=e.remapLeaderboardMetaFilters(t.filters),n},e.remapMetaPaginationRank=function(t){var e=new y.default;return e.currentPage=t.current_page,e.itemsPerPage=t.items_per_page,e.numberOfPages=t.number_of_pages,e.totalItems=t.total_items,e},e.remapLeaderboardMetaFilters=function(t){var e=new g.default;return e.classicQuizIds=(null==t?void 0:t.classic_quiz_ids)||null,e},e.remapClassicQuizUserRanking=function(t){var e=new w.default;return e.position=t.position,e.classicQuizId=t.classic_quiz_id,e.points=t.points,e},e.remapBasicClassicQuiz=function(t){var n=new o.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.participationCount=t.participation_count,n.questionsCount=t.questions_count,n.status=t.status,n.flags=t.flags,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.time=t.time,n.averageScore=t.average_score,n.perfectScore=t.perfect_score,n.points=t.points,n.scored=t.scored,n.maxAttempts=t.max_attempts,n.context=t.context?e.remapContext(t.context):t.context,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapQuestions=function(t){var n=new l.default;return n.questionId=t.question_id,n.question=t.question,n.images=t.images,n.embedCode=t.embed_code,n.explanation=t.explanation,n.options=t.options.map((function(t){return e.remapOptions(t)})),n},e.remapOptions=function(t){var e=new c.default;return e.optionId=t.option_id,e.option=t.option,e.images=t.images,e.correct=t.correct,e},e.remapParticipationQuestions=function(t){var e=new h.default;return e.questionId=t.question_id,e.optionId=t.option_id,e.correct=t.correct,e.correctOptionId=t.correct_option_id,e},e.remapClassicQuizLeaderboard=function(t){var e=new b.default;return e.position=t.position,e.profileId=t.profile_id,e.points=t.points,e},e.remapContext=function(t){var e=new p.default;return e.content=t.content,e.tags=t.tags?t.tags.map((function(t){var e=new m.default;return e.id=t.id,e.type=t.type,e.source=t.source,e})):null,e.campaign=t.campaign,e},e}return r(e,t),e}(v.default);e.default=I},4688:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8902)),o=s(n(9619)),u=s(n(3167)),l=s(n(9146)),c=s(n(5367)),d=s(n(5021)),h=s(n(2557)),f=s(n(2699)),p=s(n(8590)),m=s(n(5289)),v=s(n(6282)),_=s(n(3323)),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapEitherOrs=function(t){return t.meta.pagination=e.remapMetaPagination(t.meta.pagination),t.data=t.data.map((function(t){return e.remapBasicEitherOr(t)})),t},e.remapEitherOrById=function(t){var n=new u.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.winningCondition=t.winning_condition,n.lives=t.lives,n.flags=t.flags,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.time=t.time,n.context=t.context?e.remapContext(t.context):t.context,n.points=t.points?t.points.map((function(t){return e.remapPoints(t)})):t.points,n.rules=t.rules,n.adContent=t.ad_content,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapEitherOrOwnStats=function(t){var e=new c.default;return e.eitherOrId=t.either_or_id,e.personalBest=t.personal_best,e},e.remapEitherOrResults=function(t){var n=new p.default;return n.standings=t.standings?t.standings.map((function(t){return e.remapResultsStandings(t)})):t.standings,n.breakdown=t.breakdown?t.breakdown.map((function(t){return e.remapResultsBreakdown(t)})):t.breakdown,n},e.remapEitherOrParticipation=function(t){var n=new d.default;return n.instanceId=t.instance_id,n.eitherOrId=t.either_or_id,n.gameStartedAt=t.game_started_at,n.currentStep=t.current_step,n.currentStreak=t.current_streak,n.remainingSteps=t.remaining_steps,n.currentLives=t.current_lives,n.currentPoints=t.current_points,n.personalBest=t.personal_best,n.steps=t.steps?t.steps.map((function(t){return e.remapParticipationSteps(t)})):t.steps,n},e.remapBasicEitherOr=function(t){var n=new o.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.winningCondition=t.winning_condition,n.lives=t.lives,n.flags=t.flags,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.labels=t.labels,n.adContent=t.ad_content,n.context=t.context?e.remapContext(t.context):t.context,n.time=t.time,n.points=t.points?t.points.map((function(t){return e.remapPoints(t)})):t.points,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapMetaPagination=function(t){var e=new a.default;return e.itemsPerPage=t.items_per_page,e.nextPageStartsAfter=t.next_page_starts_after,e},e.remapPoints=function(t){var e=new l.default;return e.correctSteps=t.correct_steps,e.score=t.score,e},e.remapResultsStandings=function(t){var e=new m.default;return e.userId=t.user_id,e.personalBest=t.personal_best,e},e.remapResultsBreakdown=function(t){var e=new f.default;return e.rangeStartInclusive=t.range_start_inclusive,e.rangeEndInclusive=t.range_end_inclusive,e.totalUsers=t.total_users,e},e.remapParticipationSteps=function(t){var e=new h.default;return e.pairId=t.pair_id,e.userSelection=t.user_selection,e.correct=t.correct,e.played=t.played,e.timestamp=t.timestamp,e.optionOne=t.option_one,e.optionTwo=t.option_two,e},e.remapContext=function(t){var e=new v.default;return e.content=t.content,e.tags=t.tags?t.tags.map((function(t){var e=new _.default;return e.id=t.id,e.type=t.type,e.source=t.source,e})):null,e.campaign=t.campaign,e},e}return r(e,t),e}(s(n(6692)).default);e.default=y},3404:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=a(n(3022)),l=a(n(8900)),c=a(n(8808)),d=a(n(6409)),h=a(n(850)),f=a(n(9685));e.default=function(t){var e=this;this.idSchema=null,this.idMapping=null,this.validator=null,this.https=null,this.entityTypes=["competition","team","player"],this.profile=null,this.football=null,this.eitherOrTime=0,this.participationStartTimestamp=0,this.countdownTimer=0,this.intervalId=null,this.currentPairId="",this.finalizeMiniGamesFilters=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return this.idSchema!==o.IdSchemaEnum.NATIVE&&t.entityIds&&t.entityIds.length>0?(this.validator.validateFilters(t),[4,this.idMapping.getEntityIdsBySchemaId(Array.from(t.entityIds),t.entityType,o.IdSchemaEnum.NATIVE)]):[3,2];case 1:e=n.sent(),t.entityIds=e[t.entityType],n.label=2;case 2:return[2]}}))}))},this.setProfileModelsForEitherOrStandings=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=t.standings.map((function(t){return t.userId}))).length?[4,this.profile.getByIds(e)]:[2,t];case 1:return n=i.sent(),t.standings.forEach((function(t){return t.userModel=n.find((function(e){return e.id===t.userId}))||null})),[2,t]}}))}))},this.setProfileModelsForClassicQuizLeaderboards=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=t.map((function(t){return t.profileId}))).length?[4,this.profile.getByIds(e)]:[2,t];case 1:return n=i.sent(),t.forEach((function(t){return t.profileModel=n.find((function(e){return e.id===t.profileId}))||null})),[2,t]}}))}))},this.defaultEitherOrParticipation=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s,a,o;return r(this,(function(r){switch(r.label){case 0:return this.eitherOrTime||n?[3,3]:[4,this.https.getEitherOrById(t,!0)];case 1:return i=r.sent(),this.eitherOrTime=i.time,[4,this.https.participateInEitherOr(t,null)];case 2:return a=r.sent(),this.participationStartTimestamp=Date.now(),[2,a];case 3:return e=0,this.participationStartTimestamp?[3,6]:this.eitherOrTime?[3,5]:[4,this.https.getEitherOrById(t,!0)];case 4:i=r.sent(),this.eitherOrTime=i.time,r.label=5;case 5:return e=this.eitherOrTime+1,[3,7];case 6:e=(Date.now()-this.participationStartTimestamp)/1e3,r.label=7;case 7:s=this.createNewParticipation(e,n),r.label=8;case 8:return r.trys.push([8,10,,11]),[4,this.https.participateInEitherOr(t,s)];case 9:return(a=r.sent()).currentLives&&a.remainingSteps?this.participationStartTimestamp=Date.now():this.resetDefaultParticipationTimers(),[2,a];case 10:throw o=r.sent(),this.resetDefaultParticipationTimers(),o;case 11:return[2]}}))}))},this.handleEitherOrParticipationWithCallback=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return n?[3,2]:[4,this.initialEitherOrParticipationWithCallback(t,s)];case 1:case 3:return[2,e.sent()];case 2:return[4,this.eitherOrParticipationWithCallback(t,n,s)]}}))}))},this.initialEitherOrParticipationWithCallback=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return[4,this.https.getEitherOrById(t,!0)];case 1:return e=r.sent(),this.eitherOrTime=e.time,[4,this.https.participateInEitherOr(t,null)];case 2:return i=r.sent(),this.participationStartTimestamp=Date.now(),this.countdownTimer=this.eitherOrTime,this.setCurrentPairId(i),[4,this.handleEitherOrParticipationCallbackInterface(t,n)];case 3:return r.sent(),[2,i]}}))}))},this.eitherOrParticipationWithCallback=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i,a,o,u;return r(this,(function(r){switch(r.label){case 0:return this.intervalId&&clearInterval(this.intervalId),e=0,this.participationStartTimestamp?[3,3]:this.eitherOrTime?[3,2]:[4,this.https.getEitherOrById(t,!0)];case 1:i=r.sent(),this.eitherOrTime=i.time,r.label=2;case 2:return e=this.eitherOrTime+1,[3,4];case 3:e=(Date.now()-this.participationStartTimestamp)/1e3,r.label=4;case 4:a=this.createNewParticipation(e,n),r.label=5;case 5:return r.trys.push([5,10,,11]),[4,this.https.participateInEitherOr(t,a)];case 6:return(o=r.sent()).currentLives&&o.remainingSteps?[3,7]:(this.resetCallbackParticipationTimers(),s.onElapsedResponse(o),clearInterval(this.intervalId),[3,9]);case 7:return this.participationStartTimestamp=Date.now(),this.countdownTimer=this.eitherOrTime,this.setCurrentPairId(o),[4,this.handleEitherOrParticipationCallbackInterface(t,s)];case 8:r.sent(),r.label=9;case 9:return[2,o];case 10:throw u=r.sent(),this.resetCallbackParticipationTimers(),clearInterval(this.intervalId),u;case 11:return[2]}}))}))},this.setCurrentPairId=function(t){e.currentPairId=t.steps.find((function(t){return!t.played})).pairId||""},this.handleEitherOrParticipationCallbackInterface=function(t,n){return i(e,void 0,void 0,(function(){var e=this;return r(this,(function(s){return this.intervalId=setInterval((function(){return i(e,void 0,void 0,(function(){var e,i,s,a;return r(this,(function(r){switch(r.label){case 0:return this.countdownTimer>0?(this.countdownTimer--,n.onTimerTick(this.countdownTimer),[3,3]):[3,1];case 1:return clearInterval(this.intervalId),e=(Date.now()-this.participationStartTimestamp)/1e3,i={pair:this.currentPairId,answer:this.currentPairId.split("_")[0]},s=this.createNewParticipation(e,i),[4,this.eitherOrParticipationWithCallback(t,s,n)];case 2:a=r.sent(),n.onElapsedResponse(a),r.label=3;case 3:return[2]}}))}))}),1e3),[2]}))}))},this.createNewParticipation=function(t,n){var i=new h.default;return i.expired=t>e.eitherOrTime,i.time=Number(t.toFixed(3)),i.pair=n.pair,i.answer=n.answer,i},this.resetCallbackParticipationTimers=function(){e.resetDefaultParticipationTimers(),e.countdownTimer=0,e.currentPairId=""},this.resetDefaultParticipationTimers=function(){e.eitherOrTime=0,e.participationStartTimestamp=0},this.setContextTagsModels=function(t){return i(e,void 0,void 0,(function(){var e,n,i=this;return r(this,(function(r){switch(r.label){case 0:return e={competitions:[],teams:[],players:[]},t.forEach((function(t){t.context&&t.context.tags&&t.context.tags.length>0&&(e.competitions=s(s([],e.competitions,!0),i.extractEntityIdsFromTags(t.context.tags,"competition"),!0),e.competitions=Array.from(new Set(e.competitions)),e.teams=s(s([],e.teams,!0),i.extractEntityIdsFromTags(t.context.tags,"team"),!0),e.teams=Array.from(new Set(e.teams)),e.players=s(s([],e.players,!0),i.extractEntityIdsFromTags(t.context.tags,"player"),!0),e.players=Array.from(new Set(e.players)))})),e.competitions.length?[4,this.football.footballFacade.getCompetitionsMapWithNativeIds(e.competitions)]:[3,2];case 1:n=r.sent(),this.setModelsForContextTags(t,n,"competition"),r.label=2;case 2:return e.teams.length?[4,this.football.footballFacade.getTeamsMapWithNativeIds(e.teams)]:[3,4];case 3:n=r.sent(),this.setModelsForContextTags(t,n,"team"),r.label=4;case 4:return e.players.length?[4,this.football.footballFacade.getPlayersMapWithNativeIds(e.players)]:[3,6];case 5:n=r.sent(),this.setModelsForContextTags(t,n,"player"),r.label=6;case 6:return[2]}}))}))},this.extractEntityIdsFromTags=function(t,e){return t.filter((function(t){return t.type===e})).map((function(t){return t.id}))},this.setModelsForContextTags=function(t,e,n){t.forEach((function(t){t.context&&t.context.tags&&t.context.tags.length>0&&t.context.tags.forEach((function(t){t.type===n&&(t.model="player"===n?e[t.id]:e.get(t.id),t.id=t.model.id)}))}))},this.idSchema=t.idSchema,this.idMapping=new l.default(t),this.validator=new f.default(t),this.profile=new d.default(t),this.football=new c.default(t),this.https=new u.default(t)}},9685:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4021),s=n(4904),a=i(n(8097)),o=i(n(2535)),u=n(5318);e.default=function(t){var e=this;this.errorHandlingModel=null,this.entityTypes=["competition","team","player"],this.validateFilters=function(t){(t.entityIds||t.entityType)&&(t.entityIds&&!t.entityType&&e.throwException(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.FILTER_COMBINATION_ERROR),!t.entityIds&&t.entityType&&e.throwException(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.FILTER_COMBINATION_ERROR),e.entityTypes.includes(t.entityType)||e.throwException(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FILTERS,u.ErrorMessages.INVALID_ENTITY_TYPE))},this.throwException=function(t,n,i){if("standard"===e.errorHandlingModel)throw new o.default(t,n,i);throw new a.default(t,n,i)},this.errorHandlingModel=t.errorHandlingMode}},7974:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.playerMarketNobodyPrediction=e.endMarkMarkets=e.playerMarkets=e.MarketsOverCorners=e.MarketsOverGoals=e.MarketEnum=void 0,function(t){t.FT_1X2="FT_1X2",t.HT_1X2="HT_1X2",t.BOTH_TEAMS_SCORE="BOTH_TEAMS_SCORE",t.DOUBLE_CHANCE="DOUBLE_CHANCE",t.HT_FT="HT_FT",t.PLAYER_SCORE="PLAYER_SCORE",t.PLAYER_YELLOW_CARD="PLAYER_YELLOW_CARD",t.PLAYER_RED_CARD="PLAYER_RED_CARD",t.RED_CARD_MATCH="RED_CARD_MATCH",t.PENALTY_MATCH="PENALTY_MATCH",t.PLAYER_SCORE_FIRST_GOAL="PLAYER_SCORE_FIRST_GOAL",t.CORNERS_MATCH="CORNERS_MATCH",t.CORRECT_SCORE="CORRECT_SCORE",t.CORRECT_SCORE_ADVANCED="CORRECT_SCORE_ADVANCED",t.CORRECT_SCORE_HT="CORRECT_SCORE_HT",t.PLAYER_SCORE_HATTRICK="PLAYER_SCORE_HATTRICK",t.PLAYER_SCORE_TWICE="PLAYER_SCORE_TWICE",t.OVER_GOALS_0_5="OVER_GOALS_0_5",t.OVER_GOALS_1_5="OVER_GOALS_1_5",t.OVER_GOALS_2_5="OVER_GOALS_2_5",t.OVER_GOALS_3_5="OVER_GOALS_3_5",t.OVER_GOALS_4_5="OVER_GOALS_4_5",t.OVER_GOALS_5_5="OVER_GOALS_5_5",t.OVER_GOALS_6_5="OVER_GOALS_6_5",t.OVER_CORNERS_6_5="OVER_CORNERS_6_5",t.OVER_CORNERS_7_5="OVER_CORNERS_7_5",t.OVER_CORNERS_8_5="OVER_CORNERS_8_5",t.OVER_CORNERS_9_5="OVER_CORNERS_9_5",t.OVER_CORNERS_10_5="OVER_CORNERS_10_5",t.OVER_CORNERS_11_5="OVER_CORNERS_11_5",t.OVER_CORNERS_12_5="OVER_CORNERS_12_5",t.OVER_CORNERS_13_5="OVER_CORNERS_13_5"}(n=e.MarketEnum||(e.MarketEnum={})),e.MarketsOverGoals=[n.OVER_GOALS_0_5,n.OVER_GOALS_1_5,n.OVER_GOALS_2_5,n.OVER_GOALS_3_5,n.OVER_GOALS_4_5,n.OVER_GOALS_5_5,n.OVER_GOALS_6_5],e.MarketsOverCorners=[n.OVER_CORNERS_6_5,n.OVER_CORNERS_7_5,n.OVER_CORNERS_8_5,n.OVER_CORNERS_9_5,n.OVER_CORNERS_10_5,n.OVER_CORNERS_11_5,n.OVER_CORNERS_12_5,n.OVER_CORNERS_13_5],e.playerMarkets=[n.PLAYER_RED_CARD,n.PLAYER_SCORE,n.PLAYER_SCORE_FIRST_GOAL,n.PLAYER_SCORE_HATTRICK,n.PLAYER_SCORE_TWICE,n.PLAYER_YELLOW_CARD],e.endMarkMarkets=[n.FT_1X2,n.HT_1X2,n.HT_FT,n.DOUBLE_CHANCE,n.CORNERS_MATCH,n.CORRECT_SCORE,n.CORRECT_SCORE_HT,n.CORRECT_SCORE_ADVANCED],e.playerMarketNobodyPrediction=n.PLAYER_SCORE_FIRST_GOAL},6147:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.pastStatuses=e.StatusEnum=void 0,function(t){t.ACTIVE="ACTIVE",t.WON="WON",t.LOST="LOST",t.PARTIALLY_WON="PARTIALLY_WON",t.CANCELED="CANCELED"}(n=e.StatusEnum||(e.StatusEnum={})),e.pastStatuses=[n.WON,n.LOST,n.PARTIALLY_WON,n.CANCELED]},1976:(t,e)=>{"use strict";var n,i,r;Object.defineProperty(e,"__esModule",{value:!0}),e.HalfTimeFullTimeEnum=e.DoubleChanceEnum=e.OneXTwoEnum=void 0,(r=e.OneXTwoEnum||(e.OneXTwoEnum={})).ONE="1",r.X="x",r.TWO="2",(i=e.DoubleChanceEnum||(e.DoubleChanceEnum={})).ONE_X="1x",i.X_TWO="x2",i.ONE_TWO="12",(n=e.HalfTimeFullTimeEnum||(e.HalfTimeFullTimeEnum={})).ONE_ONE="1/1",n.ONE_X="1/x",n.ONE_TWO="1/2",n.X_ONE="x/1",n.X_X="x/x",n.X_TWO="x/2",n.TWO_ONE="2/1",n.TWO_X="2/x",n.TWO_TWO="2/2"},2929:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(4946),u=n(7974),l=n(7686),c=a(n(5013)),d=a(n(3950)),h=a(n(1732)),f=a(n(2310)),p=a(n(8097)),m=n(4021),v=n(4904),_=n(5318),y=a(n(2535));e.default=function(t,e,n,a){var g=this;this.predictorHttps=null,this.clientHttps=null,this.idMapping=null,this.predictorService=null,this.predictorValidator=null,this.errorHandlingMode=null,this.makeFootballPrediction=function(t,e,n,s){return i(g,void 0,void 0,(function(){var i,a,l,c,f,g,b;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorValidator.validateFixture(t,e,n,s),a=new d.default,this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,6]:(l=i.matchId,c="",[4,this.predictorService.remapMatchIdToNative([l])]);case 1:if(f=r.sent(),i.matchId=f[0],"default"===this.errorHandlingMode&&!i.matchId)throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_MATCH_ID).errorMessage();if("standard"===this.errorHandlingMode&&!i.matchId)throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_MATCH_ID);return i instanceof h.default&&"OWN_GOAL"!==i.prediction.playerId?i.prediction.playerId?(c=i.prediction.playerId,g=i.prediction,[4,this.predictorService.remapPlayerIdToNative([c])]):[3,3]:[3,4];case 2:g.playerId=r.sent(),r.label=3;case 3:if("default"===this.errorHandlingMode&&i.market!==u.playerMarketNobodyPrediction&&!i.prediction.playerId)throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_PLAYER_ID).errorMessage();if("standard"===this.errorHandlingMode&&i.market!==u.playerMarketNobodyPrediction&&!i.prediction.playerId)throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.INVALID_FIELD,_.ErrorMessages.INVALID_PLAYER_ID);r.label=4;case 4:return a.fixtures=[i],[4,this.predictorHttps.makeFootballPrediction(a)];case 5:return(b=r.sent()).fixtures.forEach((function(t){t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&(t.prediction.playerId=c),t.matchId=l})),[2,b];case 6:return a.fixtures=[i],[4,this.predictorHttps.makeFootballPrediction(a)];case 7:return[2,r.sent()]}}))}))},this.getMatchSummary=function(t,e){return i(g,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return[4,this.getMatchSummaryBase(t,e)];case 1:return n=r.sent(),i=JSON.parse(JSON.stringify(n.predictions)),[4,this.predictorService.remapPlayerIdToIdSchema(i)];case 2:return s=r.sent(),n.predictions=s,[2,n]}}))}))},this.getMarketSummary=function(t,e,n,s){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.getMatchSummaryBase(t,s)];case 1:return i=r.sent(),[4,this.predictorService.getMarketSummary(i,e,n)];case 2:return[2,r.sent()];case 3:throw r.sent();case 4:return[2]}}))}))},this.getMatchSummaryBase=function(t,e){return i(g,void 0,void 0,(function(){var n,i,s;return r(this,(function(r){switch(r.label){case 0:return this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapMatchIdToNative([t])];case 1:return n=r.sent(),i=n[0],[4,this.predictorHttps.getMatchSummary(i,e)];case 2:return(s=r.sent()).matchId=t,[2,s];case 3:return[4,this.predictorHttps.getMatchSummary(t,e)];case 4:return[2,r.sent()]}}))}))},this.getConfig=function(){return i(g,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(l.FeatureConfigType.PREDICTOR)];case 1:return t=e.sent(),this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(t)];case 2:return[2,e.sent()];case 3:return[2,t]}}))}))},this.deleteFootballPrediction=function(t){return i(g,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPredictions=function(t){return i(g,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=this.predictorService.initPredictionsFilters(t,"user"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return[2,n.sent()]}}))}))},this.getMyPredictionsForMatches=function(t,e){return i(g,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(t))throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED);return this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],t,!0))];case 1:t=i.sent(),i.label=2;case 2:return n=this.predictorService.initPredictionsFilters(e,"matches",t),[4,this.predictorHttps.getMyPredictions(n)];case 3:return[2,i.sent()]}}))}))},this.getMyCurrentPredictions=function(t){return i(g,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=this.predictorService.initPredictionsFilters(t,"current"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return[2,n.sent()]}}))}))},this.getMyPastPredictions=function(t){return i(g,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=this.predictorService.initPredictionsFilters(t,"past"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return[2,n.sent()]}}))}))},this.getUserPredictions=function(t,e,n){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorService.initPredictionsFilters(e,"user"),[4,this.predictorHttps.getUserPredictions(t,n,i)];case 1:return[2,r.sent()]}}))}))},this.getUserCurrentPredictions=function(t,e,n){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorService.initPredictionsFilters(e,"current"),[4,this.predictorHttps.getUserPredictions(t,n,i)];case 1:return[2,r.sent()]}}))}))},this.getUserPastPredictions=function(t,e,n){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return i=this.predictorService.initPredictionsFilters(e,"past"),[4,this.predictorHttps.getUserPredictions(t,n,i)];case 1:return[2,r.sent()]}}))}))},this.getUserPredictionsForMatches=function(t,e,n,a){return i(g,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:if("default"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new p.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED).errorMessage();if("standard"===this.errorHandlingMode&&this.predictorService.areIdsExceeded(e))throw new y.default(m.ErrorCodes.BAD_METHOD_CALL,v.ErrorStatuses.EXCEEDED_LENGTH,_.ErrorMessages.QUERY_PARAM_MATCH_IDS_EXCEEDED);return this.idMapping.idSchema===o.IdSchemaEnum.NATIVE?[3,2]:[4,this.predictorService.remapMatchIdToNative(s([],e,!0))];case 1:e=r.sent(),r.label=2;case 2:return i=this.predictorService.initPredictionsFilters(n,"matches",e),[4,this.predictorHttps.getUserPredictions(t,a,i)];case 3:return[2,r.sent()]}}))}))},this.getPredictionById=function(t){return i(g,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.getPredictionById(t)];case 1:return[2,e.sent()]}}))}))},this.getPredictionsByIds=function(t){return i(g,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.getPredictionsByIds(t)];case 1:return[2,e.sent()]}}))}))},this.predictorHttps=e,this.idMapping=a,this.clientHttps=n,this.errorHandlingMode=t.errorHandlingMode,this.predictorValidator=new f.default(t.errorHandlingMode),this.predictorService=new c.default(t,a)}},704:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3949)),s=i(n(8543)),a=i(n(1429)),o=i(n(515)),u=i(n(4187)),l=i(n(4226)),c=i(n(5765)),d=i(n(1180)),h=i(n(8452)),f=i(n(8824)),p=i(n(9750)),m=i(n(5793)),v=i(n(8699)),_=i(n(6268)),y=i(n(3035)),g=i(n(8574)),b=i(n(3101)),w=i(n(4646)),I=i(n(6483)),E=i(n(6866)),M=i(n(8608)),O=i(n(246)),P=i(n(7983)),T=i(n(2354)),S=i(n(516)),A=i(n(1002)),C=i(n(4339));e.default=function(){var t=this;this.remapPredictorConfig=function(e){var n=new h.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.fullCoverageCompetitions=e.full_coverage_competitions,n.markets=e.markets,n.successRateScopes=e.success_rate_scopes,n.userDataConfig=e.user_data_config?t.remapUserDataConfig(e.user_data_config):null,n},this.remapTopXConfig=function(t){var e=new d.default;return e.enabled=t.enabled,e.clientId=t.client_id,e.minFixtures=t.min_fixtures,e.maxFixtures=t.max_fixtures,e.competitionsWhitelist=t.competitions_whitelist,e},this.remapMatchQuizConfig=function(t){var e=new c.default;return e.enabled=t.enabled,e.clientId=t.client_id,e.defaultMarkets=t.default_markets,e.competitionsWhitelist=t.competitions_whitelist,e},this.remapLoyaltyConfig=function(e){var n=new o.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.conditions.list=e.conditions.list,n.actions.value=e.actions.value,n.rewards=t.remapRewards(e.rewards),n},this.remapLoyaltyNewConfig=function(e){var n=new E.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.conditions.list=e.conditions.list,n.actions.value=e.actions.value,n.rewards=t.remapNewRewards(e.rewards),n},this.remapDiscussionsConfig=function(e){var n=new s.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.automaticModeration=e.automatic_moderation?t.remapAutomaticModeration(e.automatic_moderation):null,n},this.remapFantasyConfig=function(e){var n=new S.default;return n.enabled=e.enabled,n.clientId=e.client_id,n.addPointsToProfileTotal=e.add_points_to_profile_total,n.competitionsWhitelist=e.competitions_whitelist,n.players=t.remapFantasyPlayers(e.players),n.coefficients=t.remapFantasyCoefficients(e.coefficients),n},this.remapFantasyPlayers=function(t){var e=new A.default;return e.total=t.total,e.minGoalkeepers=t.min_goalkeepers,e.maxGoalkeepers=t.max_goalkeepers,e.minDefenders=t.min_defenders,e.maxDefenders=t.max_defenders,e.minMidfielders=t.min_midfielders,e.maxMidfielders=t.max_midfielders,e.minStrikers=t.min_strikers,e.maxStrikers=t.max_strikers,e},this.remapFantasyCoefficients=function(t){var e=new C.default;return e.assists=t.assists,e.shots=t.shots,e.offsides=t.offsides,e.tackles=t.tackles,e.saves=t.saves,e.minutesEqualOrOver60=t.minutes_equal_or_over_60,e.minutesUnder60=t.minutes_under_60,e.yellowCards=t.yellow_cards,e.redCards=t.red_cards,e.goalsGoalkeeper=t.goals_goalkeeper,e.goalsDefender=t.goals_defender,e.goalsMidfielder=t.goals_midfielder,e.goalsForwards=t.goals_forwards,e.penaltyGoals=t.penalty_goals,e.ownGoals=t.own_goals,e.cleanSheetsGoalkeeper=t.clean_sheets_goalkeeper,e.cleanSheetsDefender=t.clean_sheets_defender,e.cleanSheetsMidfielder=t.clean_sheets_midfielder,e.cleanSheetsForwards=t.clean_sheets_forwards,e.shotsOn=t.shots_on,e.foulsCommitted=t.fouls_committed,e.penaltyCommitted=t.penalty_committed,e.penaltyWon=t.penalty_won,e.penaltyMissed=t.penalty_missed,e.concededGoals=t.conceded_goals,e.caughtBall=t.caught_ball,e},this.remapAutomaticModeration=function(t){var e=new r.default;return e.enabled=t.enabled,e.moderateLinks=t.moderate_links,e.linksWhitelist=t.links_whitelist,e.moderatorProfileId=t.moderator_profile_id,e.dictionary=t.dictionary,e},this.remapNewRewards=function(e){var n=new I.default;return n.points=t.remapPoints(e.points),n.tiers=e.tiers,n.badges=t.remapNewBadges(e.badges),n},this.remapRewards=function(e){var n=new l.default;return n.points=t.remapPoints(e.points),n.tiers=e.tiers,n.badges=t.remapBadges(e.badges),n},this.remapPoints=function(t){var e=new u.default;return e.general=t.general,e.discussionPost=t.discussion_post,e.predictor=t.predictor,e.activity=t.activity,e.topX=t.top_x,e.matchQuiz=t.match_quiz,e},this.remapBadges=function(e){var n=new M.default;return n.general=e.general?t.remapGeneralBadgeValues(e.general):[],n.predictor=t.remapBadgeValues(e.predictor),n.topX=t.remapBadgeValues(e.top_x),n.matchQuiz=t.remapBadgeValues(e.match_quiz),n},this.remapNewBadges=function(e){var n=new p.default;return n.predictor=t.remapBadgeValuesPredictor(e.predictor),n.topX=t.remapBadgeValuesGame(e.top_x),n.matchQuiz=t.remapBadgeValuesGame(e.match_quiz),e.games&&(n.games=t.remapBadgeValuesGames(e.games)),e.football&&(n.football=t.remapBadgeValuesFootball(e.football)),e.classic_quizzes&&(n.classicQuizzes=t.remapBadgeValuesMiniGames(e.classic_quizzes)),e.either_or&&(n.eitherOr=t.remapBadgeValuesMiniGames(e.either_or)),e.discussions&&(n.discussions=t.remapBadgeValuesDiscussions(e.discussions)),e.voting&&e.voting.potm&&(n.voting.potm=t.remapBadgeValuesVoting(e.voting.potm)),e.voting&&e.voting.poll&&(n.voting.poll=t.remapBadgeValuesVoting(e.voting.poll)),n},this.remapBadgeValuesPredictor=function(t){return t.map((function(t){var e=new m.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.predictionsNumber=t.requirements.predictions_number,e.requirements.correctPredictions=t.requirements.correct_predictions,e.requirements.points=t.requirements.points,e.requirements.fromDate=t.requirements.from_date,e.requirements.toDate=t.requirements.to_date),e}))},this.remapBadgeValuesGame=function(t){return t.map((function(t){var e=new v.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.participationCount=t.requirements.participation_count,e.requirements.points=t.requirements.points,e.requirements.fromDate=t.requirements.from_date,e.requirements.toDate=t.requirements.to_date),e}))},this.remapBadgeValuesGames=function(e){return e.map((function(e){var n=new _.default;return n.id=e.id,n.enabled=e.enabled,n.label=e.label,n.description=e.description,n.flags=e.flags,e.assets?n.assets.mainImageUrl=e.assets.main_image_url:n.assets=e.assets,e.requirements&&(n.requirements.participationCount=e.requirements.participation_count,n.requirements.points=e.requirements.points,n.requirements.fromDate=e.requirements.from_date,n.requirements.toDate=e.requirements.to_date,n.requirements.specificGames=e.requirements.specific_games?t.remapSpecificGamesRequirement(e.requirements.specific_games):null),n}))},this.remapSpecificGamesRequirement=function(t){return t.map((function(t){return{gameId:t.game_id,gameType:t.game_type,gameModel:null}}))},this.remapBadgeValuesFootball=function(t){return t.map((function(t){var e=new y.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.predictionsNumber=t.requirements.predictions_number,e.requirements.correctPredictions=t.requirements.correct_predictions,e.requirements.points=t.requirements.points,e.requirements.entityId=t.requirements.entity_id,e.requirements.entityType=t.requirements.entity_type),e}))},this.remapBadgeValuesMiniGames=function(t){return t.map((function(t){var e=new g.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.participationCount=t.requirements.participation_count,e.requirements.fromDate=t.requirements.from_date,e.requirements.toDate=t.requirements.to_date),e}))},this.remapBadgeValuesDiscussions=function(t){return t.map((function(t){var e=new b.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.totalDiscussionPoints=t.requirements.total_discussion_points,e.requirements.postsCount=t.requirements.posts_count,e.requirements.postPoints=t.requirements.post_points,e.requirements.reactionsCount=t.requirements.reactions_count),e}))},this.remapBadgeValuesVoting=function(t){return t.map((function(t){var e=new w.default;return e.id=t.id,e.enabled=t.enabled,e.label=t.label,e.description=t.description,e.flags=t.flags,t.assets?e.assets.mainImageUrl=t.assets.main_image_url:e.assets=t.assets,t.requirements&&(e.requirements.points=t.requirements.points,e.requirements.voteCount=t.requirements.vote_count,e.requirements.entityId=t.requirements.entity_id,e.requirements.entityType=t.requirements.entity_type),e}))},this.remapBadgeValues=function(e){return e.map((function(e){var n=new O.default;return n.id=e.id,n.label=e.label,n.enabled=e.enabled,e.assets?n.assets.mainImageUrl=e.assets.main_image_url:n.assets=e.assets,n.requirements=t.remapRequirements(e.requirements),n}))},this.remapRequirements=function(t){var e=new a.default;return e.points=t.points,e.gameParticipationCount=t.game_participation_count,e.entityId=t.entity_id,e.entityType=t.entity_type,e.predictionsMade=t.predictions_made,e.correctPredictions=t.correct_predictions,e},this.remapUserDataConfig=function(t){var e=new f.default;return e.storeIp=t.store_ip,e.storeDeviceId=t.store_device_id,e.storeAgent=t.store_agent,e},this.remapGeneralBadgeValues=function(e){return e.map((function(e){var n=new P.default;return n.id=e.id,n.label=e.label,n.enabled=e.enabled,e.assets?n.assets.mainImageUrl=e.assets.main_image_url:n.assets=e.assets,n.requirements=t.remapGeneralRequirements(e.requirements),n}))},this.remapGeneralRequirements=function(t){var e=new T.default;return e.points=t.points,e.gameParticipationCount=t.game_participation_count,e.entityId=t.entity_id,e.entityType=t.entity_type,e.predictionsMade=t.predictions_made,e.correctPredictions=t.correct_predictions,e.postPoints=t.post_points,e.postsCount=t.posts_count,e.reactionsCount=t.reactions_count,e.totalDiscussionPoints=t.total_discussion_points,e}}},8452:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(442));e.default=function(){this.enabled=!1,this.clientId=null,this.fullCoverageCompetitions=null,this.markets=null,this.successRateScopes=new r.default,this.userDataConfig=null}},442:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.competitions=[],this.teams=[],this.markets=[]}},8824:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.storeIp=!1,this.storeDeviceId=!1,this.storeAgent=!1}},6367:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null,this.playerId=null,this.playerModel=null}},1406:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2524)),o=s(n(1732)),u=s(n(4119)),l=s(n(1465)),c=s(n(5132)),d=s(n(7344));e.default=function(t,e,n){var s=this;this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapFixturesRequest=function(t){var e={};if(e.match_id=t.matchId,e.match_type="FOOTBALL",t instanceof o.default)e.market=t.market,e.prediction=t.prediction.value,e.player_id=t.prediction.playerId;else if(t instanceof c.default||t instanceof d.default)e.market=t.market,e.prediction=t.prediction.value;else if(t instanceof l.default){e.market=t.market;var n=t.prediction.value.split(":");e.goals_home=Number(n[0]),e.goals_away=Number(n[1])}else e.market=t.market,e.prediction=t.prediction.value;return e},this.remapFixturesResponse=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s,o,u,l,c,d,h,f,p;return r(this,(function(r){switch(r.label){case 0:for(e="OWN_GOAL",n=[],i=[],s=null,o=[],t.length>1&&t.sort((function(t,e){return t.match_id.localeCompare(e.match_id)})),u=0,l=t;u<l.length;u++)f=l[u],n.push(f.match_id),f.player_id&&!i.includes(f.player_id)&&i.push(f.player_id);return[4,this.matchFacade.getMatchesMapWithNativeIds(n)];case 1:return c=r.sent(),i.sort((function(t,e){return t.localeCompare(e)})),i&&i.length>0&&!i.includes(e)?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,3];case 2:s=r.sent(),r.label=3;case 3:for(d=0,h=t;d<h.length;d++)f=h[d],p=new a.default,f.target?p.market=this.predictorService.convertMarketForResponseModel(f.market,f.target):p.market=f.market,p.matchId=c[f.match_id].id,p.matchType=f.match_type,p.matchModel=c?c[f.match_id]:null,delete p.matchModel.availableMarkets,void 0!==f.goals_home&&void 0!==f.goals_away?p.prediction.value=f.goals_home.toString()+":"+f.goals_away.toString():p.prediction.value=f.prediction,p.prediction.playerId=f.player_id?f.player_id:null,p.prediction.playerId&&p.prediction.playerId!==e&&(p.prediction.playerModel=s[f.player_id],p.prediction.playerId=s[f.player_id].id),p.result=this.remapResult(f.result),o.push(p);return[2,o]}}))}))},this.remapResult=function(t){var e=new u.default;return e.settledAt=t.settled_at,e.resettledAt=t.resettled_at,e.status=t.status,e.outcome=t.outcome,e.points=t.points,e},this.matchFacade=t,this.playerFacade=e,this.predictorService=n}},2524:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6367));e.default=function(){this.market=null,this.matchId=null,this.matchType=null,this.matchModel=null,this.prediction=new r.default,this.result=null}},1206:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(9883));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.BOTH_TEAMS_SCORE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},5274:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(8038));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.CORNERS_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},1465:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3125));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},7535:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(6902));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.DOUBLE_CHANCE,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},7307:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(6642));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.HT_FT,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},1718:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2782));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},5132:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9883));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},7344:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(9883));e.default=function(t,e,n){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n}},1855:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(9883));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.PENALTY_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},1732:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7321));e.default=function(t,e,n,i){this.matchId=null,this.market=null,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.market=e,this.prediction=new r.default,this.prediction.value=n,this.prediction.playerId=i}},5814:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(7974),s=i(n(9883));e.default=function(t,e){this.matchId=null,this.market=r.MarketEnum.RED_CARD_MATCH,this.matchType="FOOTBALL",this.prediction=null,this.matchId=t,this.prediction=new s.default,this.prediction.value=e}},4119:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.settledAt=null,this.resettledAt=null,this.status=null,this.outcome=null,this.points=0}},5908:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.no=0,this.yes=0}},2726:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(1406)),o=s(n(2532)),u=s(n(3792)),l=s(n(595)),c=s(n(4545)),d=s(n(4272)),h=s(n(2524)),f=s(n(5013)),p=s(n(1399));e.default=function(t,e){var n=this;this.fixturesRemapper=null,this.footballHttps=null,this.matchFacade=null,this.playerFacade=null,this.predictorService=null,this.remapRequestBody=function(t){var e={};return e.game_instance_id=t.gameInstanceId,e.fixtures=t.fixtures.map((function(t){return n.fixturesRemapper.remapFixturesRequest(t)})),t instanceof p.default&&t.tiebreaker&&(e.tiebreaker={},e.tiebreaker.golden_goal=t.tiebreaker.goldenGoal?t.tiebreaker.goldenGoal:null),e},this.remapResponseArrayBody=function(t){return i(n,void 0,void 0,(function(){var e,n,i,s,a,u,l=this;return r(this,(function(r){switch(r.label){case 0:return t.length?(e="OWN_GOAL",n=[],i=[],s={},a=[],t.forEach((function(t){t.fixtures.forEach((function(t){n.push(t.match_id),t.player_id&&t.player_id!==e&&i.push(t.player_id)}))})),[4,this.matchFacade.getMatchesMapWithNativeIds(n)]):[3,4];case 1:return u=r.sent(),i.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,3];case 2:s=r.sent(),r.label=3;case 3:return t.forEach((function(t){var n=new o.default,i=[];n.id=t.id,n.gameInstanceId=t.game_instance_id,n.gameType=t.game_type,n.wager=t.wager,n.totalFixtures=t.total_fixtures,n.settledFixtures=t.settled_fixtures,n.userId=t.user_id,t.fixtures.forEach((function(t){var n=new h.default;t.target?n.market=l.predictorService.convertMarketForResponseModel(t.market,t.target):n.market=t.market,n.matchId=u[t.match_id].id,n.matchType=t.match_type,n.matchModel=u[t.match_id],delete n.matchModel.availableMarkets,void 0!==t.goals_home&&void 0!==t.goals_away?n.prediction.value=t.goals_home.toString()+":"+t.goals_away.toString():n.prediction.value=t.prediction,n.prediction.playerId=t.player_id?t.player_id:null,n.prediction.playerId&&n.prediction.playerId!==e&&(n.prediction.playerModel=s[n.prediction.playerId],n.prediction.playerId=s[n.prediction.playerId].id),n.result=l.fixturesRemapper.remapResult(t.result),i.push(n)})),n.fixtures=i,n.status=t.status,t.tiebreaker?n.tiebreaker.goldenGoal=t.tiebreaker.golden_goal:n.tiebreaker=null,n.points=t.points,n.createdAt=t.created_at,n.updatedAt=t.updated_at,a.push(n)})),[2,a];case 4:return[2,t]}}))}))},this.remapResponseObjBody=function(t){return i(n,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return(e=new o.default).id=t.id,e.gameInstanceId=t.game_instance_id,e.gameType=t.game_type,e.wager=t.wager,e.totalFixtures=t.total_fixtures,e.settledFixtures=t.settled_fixtures,e.userId=t.user_id,n=e,[4,this.fixturesRemapper.remapFixturesResponse(t.fixtures)];case 1:return n.fixtures=i.sent(),e.status=t.status,t.tiebreaker?e.tiebreaker.goldenGoal=t.tiebreaker.golden_goal:e.tiebreaker=null,e.points=t.points,e.createdAt=t.created_at,e.updatedAt=t.updated_at,[2,e]}}))}))},this.remapPredictionModel=function(t){var e=new u.default;return e.fullTimeOneXTwo=t.FT_1X2,e.halfTimeOneXTwo=t.HT_1X2,e.bothTeamsScore=t.BOTH_TEAMS_SCORE,e.overZeroPointFiveGoals=t.OVER_GOALS_0_5,e.overOnePointFiveGoals=t.OVER_GOALS_1_5,e.overTwoPointFiveGoals=t.OVER_GOALS_2_5,e.overThreePointFiveGoals=t.OVER_GOALS_3_5,e.overFourPointFiveGoals=t.OVER_GOALS_4_5,e.overFivePointFiveGoals=t.OVER_GOALS_5_5,e.overSixPointFiveGoals=t.OVER_GOALS_6_5,e.overSixPointFiveCorners=t.OVER_CORNERS_6_5,e.overSevenPointFiveCorners=t.OVER_CORNERS_7_5,e.overEightPointFiveCorners=t.OVER_CORNERS_8_5,e.overNinePointFiveCorners=t.OVER_CORNERS_9_5,e.overTenPointFiveCorners=t.OVER_CORNERS_10_5,e.overElevenPointFiveCorners=t.OVER_CORNERS_11_5,e.overTwelvePointFiveCorners=t.OVER_CORNERS_12_5,e.overThirteenPointFiveCorners=t.OVER_CORNERS_13_5,e.doubleChance=t.DOUBLE_CHANCE,e.halfTimeFullTime=t.HT_FT,e.playerScore=t.PLAYER_SCORE,e.playerYellowCard=t.PLAYER_YELLOW_CARD,e.playerRedCard=t.PLAYER_RED_CARD,e.redCardMatch=t.RED_CARD_MATCH,e.penaltyMatch=t.PENALTY_MATCH,e.playerScoreFirstGoal=t.PLAYER_SCORE_FIRST_GOAL,e.cornersMatch=t.CORNERS_MATCH,e.correctScore=t.CORRECT_SCORE,e.correctScoreHalfTime=t.CORRECT_SCORE_HT,e.correctScoreAdvanced=t.CORRECT_SCORE_ADVANCED,e.playerScoreHattrick=t.PLAYER_SCORE_HATTRICK,e.playerScoreTwice=t.PLAYER_SCORE_TWICE,e},this.footballHttps=new l.default(t),this.matchFacade=new c.default(t,this.footballHttps,e),this.playerFacade=new d.default(t,this.footballHttps,e),this.predictorService=new f.default(t,e),this.fixturesRemapper=new a.default(this.matchFacade,this.playerFacade,this.predictorService)}},3950:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.gameInstanceId=null,this.fixtures=null}},2532:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7640));e.default=function(){this.id=null,this.gameInstanceId=null,this.gameType=null,this.wager=null,this.totalFixtures=null,this.settledFixtures=null,this.userId=null,this.fixtures=[],this.status=null,this.tiebreaker=new r.default,this.points=null,this.createdAt=null,this.updatedAt=null}},7782:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6147);e.default=function(t){var e=this;this.limit=null,this.startAfter=null,this.status=null,this.type=null,this.matchIds=null,this.gameIds=null,this.constructFiltersUrl=function(){var t="",n=!1;return e.status&&(n=Object.values(i.StatusEnum).some((function(t){return e.status.includes(t)}))),e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.startAfter&&(t+="&",t+="start_after=".concat(e.startAfter)),e.status&&n&&(t+="&",t+="status=".concat(e.status.join(","))),e.type&&(t+="&",t+="game_types=".concat(e.type)),e.matchIds&&(t+="&",t+="match_ids=".concat(e.matchIds.join(","))),e.gameIds&&(t+="&",t+="game_ids=".concat(e.gameIds.join(","))),t},this.limit=t.limit?t.limit:null,this.startAfter=t.startAfter?t.startAfter:null,this.status=t.status?t.status:null,this.type=t.type?t.type:null,this.matchIds=t.matchIds?t.matchIds:null,this.gameIds=t.gameIds?t.gameIds:null}},3792:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5908));e.default=function(){this.fullTimeOneXTwo={},this.halfTimeOneXTwo={},this.bothTeamsScore=new r.default,this.doubleChance={},this.halfTimeFullTime={},this.playerScore={},this.playerYellowCard={},this.playerRedCard={},this.redCardMatch=new r.default,this.penaltyMatch=new r.default,this.playerScoreFirstGoal={},this.cornersMatch={},this.correctScore={},this.correctScoreHalfTime={},this.correctScoreAdvanced={},this.playerScoreHattrick={},this.playerScoreTwice={},this.overZeroPointFiveGoals=new r.default,this.overOnePointFiveGoals=new r.default,this.overTwoPointFiveGoals=new r.default,this.overThreePointFiveGoals=new r.default,this.overFourPointFiveGoals=new r.default,this.overFivePointFiveGoals=new r.default,this.overSixPointFiveGoals=new r.default,this.overSixPointFiveCorners=new r.default,this.overSevenPointFiveCorners=new r.default,this.overEightPointFiveCorners=new r.default,this.overNinePointFiveCorners=new r.default,this.overTenPointFiveCorners=new r.default,this.overElevenPointFiveCorners=new r.default,this.overTwelvePointFiveCorners=new r.default,this.overThirteenPointFiveCorners=new r.default}},9378:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.matchId=null,this.matchType=null,this.predictions=null}},9679:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(2726)),s=i(n(9378));e.default=function(t,e){var n=this;this.remapPredictions=null,this.remapResponse=function(t){var e=new s.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.predictions=n.remapPredictions.remapPredictionModel(t.predictions),e},this.remapPredictions=new r.default(t,e)}},7321:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=!1,this.playerId=null}},9883:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=!1}},8038:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},3125:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},6902:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},6642:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},2782:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null}},1259:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2793)),o=s(n(8900)),u=s(n(2929)),l=s(n(7686));e.default=function(t){var e=this;this.predictorHttps=null,this.clientHttps=null,this.predictorFacade=null,this.idMapping=null,this.makeFootballPrediction=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.makeFootballPrediction(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.getMatchSummary=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMatchSummary(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMarketSummary=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMarketSummary(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.predictorFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.deleteFootballPrediction=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPredictions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyPredictions(t)];case 1:return[2,e.sent()]}}))}))},this.getMyCurrentPredictions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyCurrentPredictions(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPastPredictions=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyPastPredictions(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPredictionsForMatches=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getMyPredictionsForMatches(t,n)];case 1:return[2,e.sent()]}}))}))},this.getUserPredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserPredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserCurrentPredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserCurrentPredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserPastPredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserPastPredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserPredictionsForMatches=function(t,n,s,a){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getUserPredictionsForMatches(t,n,s,a)];case 1:return[2,e.sent()]}}))}))},this.getPredictionById=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getPredictionById(t)];case 1:return[2,e.sent()]}}))}))},this.getPredictionsByIds=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictorFacade.getPredictionsByIds(t)];case 1:return[2,e.sent()]}}))}))},this.idMapping=new o.default(t),this.predictorHttps=new a.default(t,this.idMapping),this.clientHttps=new l.default(t),this.predictorFacade=new u.default(t,this.predictorHttps,this.clientHttps,this.idMapping)}},5013:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(7974),l=o(n(8452)),c=o(n(5908)),d=o(n(8950)),h=o(n(6890)),f=o(n(595)),p=o(n(4545)),m=o(n(7782)),v=o(n(7299)),_=n(712),y=o(n(4119)),g=o(n(3751)),b=o(n(7243)),w=o(n(4272)),I=o(n(1180)),E=o(n(5765)),M=n(6147),O=n(5318),P=n(4946),T=o(n(6409)),S=n(1260),A=o(n(6247));e.default=function(t,e){var n=this;this.footballHttps=null,this.idMapping=null,this.matchFacade=null,this.playerFacade=null,this.profileNamespace=null,this.remapMatchIdToNative=function(t){return r(n,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(t,"match","native")];case 1:return[2,e.sent().match]}}))}))},this.remapPlayerIdToNative=function(t){return r(n,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.idMapping.getEntityIdsBySchemaId(t,"player","native")];case 1:return[2,e.sent().player[0]]}}))}))},this.remapPlayerIdMapToNative=function(t){return r(n,void 0,void 0,(function(){var e,n,i,r;return s(this,(function(s){switch(s.label){case 0:return e={},n=(0,_.transformIdsToBeUnique)(t),[4,this.idMapping.getEntityIdsBySchemaId(n,"player","native")];case 1:return i=s.sent(),r=i.player,n.forEach((function(t,n){return e[t]=r[n]})),[2,e]}}))}))},this.remapPlayerIdToIdSchema=function(t){return r(n,void 0,void 0,(function(){var e,n,i,r,a,o,u,l,c,d,h,f,p,m,v,_,y,g,b;return s(this,(function(s){switch(s.label){case 0:for(e=["playerScore","playerYellowCard","playerRedCard","playerScoreFirstGoal","playerScoreHattrick","playerScoreTwice"],n=[],i=0,r=Object.entries(t);i<r.length;i++)if(a=r[i],o=a[0],u=a[1],e.includes(o))for(l=0,c=Object.keys(u);l<c.length;l++)"NOBODY"!==(d=c[l])&&"OWN_GOAL"!==d&&n.push(d);return n.length?[4,this.playerFacade.getPlayersMapWithNativeIds(n)]:[2,t];case 1:for(h=s.sent(),f=0,p=Object.entries(t);f<p.length;f++)if(m=p[f],v=m[0],_=m[1],e.includes(v))for(y=0,g=Object.keys(_);y<g.length;y++)"NOBODY"!==(b=g[y])&&"OWN_GOAL"!==b&&(_[h[b].id]=_[b],_[h[b].id].model=h[b],this.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&delete _[b]);return[2,t]}}))}))},this.convertMarketForResponseModel=function(t,e){return t+"_"+e.toString()},this.getMarketSummary=function(t,e,i){return r(n,void 0,void 0,(function(){var n,r,a,o,l,d,h,f,p=this;return s(this,(function(s){switch(s.label){case 0:if(n=S.marketToKeySummaryMap.get(e),(r={}).matchId=t.matchId,r.matchType=t.matchType,!Object.keys(t.predictions).includes(n))throw new Error("You have passed invalid market");return r[n]=t.predictions[n],u.playerMarkets.includes(e)&&i?(a="","OWN_GOAL"===i||"NOBODY"===i?[3,2]:[4,this.idMapping.idMappingFacade.getEntitiesByIds({player:[i]},this.idMapping.idSchema,"native")]):[3,6];case 1:o=s.sent(),a=o.player[0],s.label=2;case 2:return a&&r[n][a]?[4,this.playerFacade.getPlayersMapWithNativeIds([a])]:[3,4];case 3:return l=s.sent(),r[n][a].model=l[a],[2,r[n][a]];case 4:return a?(r[n][a]=new c.default,[2,r[n][a]]):[2,r[n][i]];case 5:return[3,10];case 6:return!u.playerMarkets.includes(e)||i?[3,10]:(d=Object.keys(r[n]).filter((function(t){return"NOBODY"!==t&&"OWN_GOAL"!==t}))).length?[4,this.playerFacade.getPlayersMapWithNativeIds(d)]:[3,8];case 7:return f=s.sent(),[3,9];case 8:f={},s.label=9;case 9:h=f,Object.keys(h).length&&Object.keys(r[n]).forEach((function(t){"NOBODY"!==t&&"OWN_GOAL"!==t&&(r[n][h[t].id]=r[n][t],r[n][h[t].id].model=h[t],p.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&delete r[n][t])})),s.label=10;case 10:return[2,r]}}))}))},this.remapCompetitionsFromConfig=function(t){return r(n,void 0,void 0,(function(){var e,n,i,r,a,o,u,c;return s(this,(function(s){switch(s.label){case 0:return t instanceof l.default?(e={competition:t.fullCoverageCompetitions},n={competition:t.successRateScopes.competitions},i={team:t.successRateScopes.teams},[4,this.idMapping.idMappingFacade.getEntitiesByIds(e,"native",this.idMapping.idSchema)]):[3,4];case 1:return r=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(n,"native",this.idMapping.idSchema)];case 2:return a=s.sent(),[4,this.idMapping.idMappingFacade.getEntitiesByIds(i,"native",this.idMapping.idSchema)];case 3:return o=s.sent(),t.fullCoverageCompetitions=r.competition,t.successRateScopes.competitions=a.competition,t.successRateScopes.teams=o.team,[2,t];case 4:return t instanceof I.default||t instanceof E.default?(u={competition:t.competitionsWhitelist},[4,this.idMapping.idMappingFacade.getEntitiesByIds(u,"native",this.idMapping.idSchema)]):[3,6];case 5:return c=s.sent(),t.competitionsWhitelist=c.competition,[2,t];case 6:return[2]}}))}))},this.remapMatchIdsFixtures=function(t){return r(n,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return Array.isArray(t.data)?t.data.length>0?(e=[],n=[],t.data.forEach((function(t){t instanceof g.default||t instanceof d.default||t instanceof b.default||t instanceof A.default?(t.fixtures.forEach((function(t){return e.push(t.matchId)})),t instanceof b.default&&t.fixtures.forEach((function(t){t.prediction.playerId&&"OWN_GOAL"!==t.prediction.playerId&&n.push(t.prediction.playerId)}))):t instanceof h.default&&t.results.forEach((function(t){return e.push(t.matchId)}))})),[4,this.refactorResponseArrModel(t,e,n)]):[3,2]:[3,4];case 1:case 5:return[2,i.sent()];case 2:return[2,t];case 3:return[3,6];case 4:return[4,this.refactorResponseObjModel(t)];case 6:return[2]}}))}))},this.refactorResponseArrModel=function(t,e,i){return r(n,void 0,void 0,(function(){var n,r,a,o=this;return s(this,(function(s){switch(s.label){case 0:return n=[],[4,this.matchFacade.getMatchesMapWithNativeIds(e)];case 1:return r=s.sent(),a={},i.length>0?[4,this.playerFacade.getPlayersMapWithNativeIds(i)]:[3,3];case 2:a=s.sent(),s.label=3;case 3:return t.data.forEach((function(t){t instanceof g.default||t instanceof d.default||t instanceof b.default?(t.fixtures.forEach((function(e){o.handleMatchModel(r,e),t instanceof b.default&&e.prediction.playerId&&"OWN_GOAL"!==e.prediction.playerId&&(e.prediction.playerModel=a[e.prediction.playerId],e.prediction.playerId=a[e.prediction.playerId].id)})),n.push(t)):t instanceof h.default&&(t.results.forEach((function(t){t.matchModel=r[t.matchId],delete t.matchModel.availableMarkets,t.matchId=t.matchModel.id})),n.push(t))})),t.data=n,[2,t]}}))}))},this.refactorResponseObjModel=function(t){return r(n,void 0,void 0,(function(){var e,n,i=this;return s(this,(function(r){switch(r.label){case 0:return e=[],t.fixtures.forEach((function(t){return e.push(t.matchId)})),[4,this.matchFacade.getMatchesMapWithNativeIds(e)];case 1:return n=r.sent(),t.fixtures.forEach((function(t){return i.handleMatchModel(n,t)})),[2,t]}}))}))},this.getCurrentGameId=function(t){var e=new Date;if(t.data.length>1){var n=[];return t.data.forEach((function(t){return n.push(t.predictionsCutoff)})),t.data.sort((function(t,n){var i=[t.predictionsCutoff,n.predictionsCutoff].map((function(t){return Math.abs(new Date(t)-e)}));return i[0]-i[1]}))[0].id}return t.data[0].id},this.initGameTypePredictions=function(t,e){var n={type:t,limit:null,startAfter:null};return e&&(n=i(i({},n),{limit:e.limit,startAfter:e.startAfter})),new m.default(n)},this.initGameFilters=function(t,e,n){if(e&&n)return e.type=t,e.gameIds=n,new v.default(e);if(e&&!n)return e.type=t,new v.default(e);if(!e&&n){var i={type:t,gameIds:n};return new v.default(i)}return i={type:t},new v.default(i)},this.addPredictionProp=function(t,e){return r(n,void 0,void 0,(function(){var n=this;return s(this,(function(i){switch(i.label){case 0:return e.data.forEach((function(e){t.data.forEach((function(t){e.id===t.game_instance_id&&(e.predictionId=t.id,e.outcome=t.status,e.fixtures.forEach((function(e,i){void 0!==t.fixtures[i].goals_home&&void 0!==t.fixtures[i].goals_away?e.prediction.value=t.fixtures[i].goals_home+":"+t.fixtures[i].goals_away:e.prediction.value=t.fixtures[i].prediction,t.fixtures[i].player_id?e.prediction.playerId=t.fixtures[i].player_id:t.fixtures[i].target&&(e.prediction.target=t.fixtures[i].target),e.prediction.result=n.remapResult(t.fixtures[i].result)})),e.predictionsMadeAt=t.created_at,e.points=t.points,e instanceof d.default&&(t.tiebreaker?e.predictionTiebreaker.goldenGoal=t.tiebreaker.golden_goal:e.predictionTiebreaker=t.tiebreaker))}))})),e.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,[4,this.remapMatchIdsFixtures(e)];case 1:return[2,i.sent()]}}))}))},this.remapResult=function(t){var e=new y.default;return e.settledAt=t.settled_at,e.resettledAt=t.resettled_at,e.status=t.status,e.outcome=t.outcome,e.points=t.points,e},this.areIdsExceeded=function(t){return t.length>10},this.initPredictionsFilters=function(t,e,i){switch(e){case"user":t&&(t=new m.default(t));break;case"current":if(t)n.deleteUnexpectedProperties(t),t.status=[M.StatusEnum.ACTIVE],t=new m.default(t);else{var r={status:[M.StatusEnum.ACTIVE]};t=new m.default(r)}break;case"past":t?(n.deleteUnexpectedProperties(t),t.status=M.pastStatuses,t=new m.default(t)):(r={status:M.pastStatuses},t=new m.default(r));break;case"matches":t?(n.deleteUnexpectedProperties(t),t.matchIds=i,t=new m.default(t)):(r={matchIds:i},t=new m.default(r))}return t},this.completeGameMarketResults=function(t,e){return r(n,void 0,void 0,(function(){var n,i,r,o,l,c,d,h,f=this;return s(this,(function(s){switch(s.label){case 0:switch(e){case"MATCH_QUIZ":return[3,1];case"TOP_X":return[3,5]}return[3,9];case 1:return n={},i=t.results[0].matchId,r=t.results.map((function(t){return u.playerMarkets.includes(t.market)&&!t.result.includes("OWN_GOAL")?a([],t.result,!0):[]})).flat(),[4,this.matchFacade.getMatchesMapWithNativeIds([i])];case 2:return o=s.sent(),r.length?[4,this.playerFacade.getPlayersMapWithNativeIds(r)]:[3,4];case 3:n=s.sent(),s.label=4;case 4:return t.results=t.results.map((function(t){if(t.matchModel=o[t.matchId]?o[t.matchId]:null,t.playerModels&&Object.keys(n).length&&(e=t.result).forEach((function(e){var i=n[e];t.playerModels.push(i)})),f.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&(f.remapMatchIdForResultsMarkets(o,t),t.playerModels&&Object.keys(n).length)){var e=t.result;t.result=e.map((function(t){return n[t].id}))}return t})),[2,t];case 5:return l=t.results.map((function(t){return t.matchId})),[4,this.matchFacade.getMatchesMapWithNativeIds(l)];case 6:return c=s.sent(),t.results=t.results.map((function(t){return t.matchModel=c[t.matchId]?c[t.matchId]:null,f.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&f.remapMatchIdForResultsMarkets(c,t),t})),t.tieBreakers.goldenGoals.length?(d=t.tieBreakers.goldenGoals.map((function(t){return t.playerId})),[4,this.playerFacade.getPlayersMapWithNativeIds(d)]):[3,8];case 7:h=s.sent(),t.tieBreakers.goldenGoals=t.tieBreakers.goldenGoals.map((function(t){return t.matchModel=c[t.matchId],t.playerModel=h[t.playerId],f.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&(t.matchId=c[t.matchId].id,t.playerId=h[t.playerId].id),t})),s.label=8;case 8:return[2,t];case 9:return[2]}}))}))},this.completeContestWinners=function(t){return r(n,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return t.userList&&t.userList.length?(e=t.userList.map((function(t){return t.profileId})),[4,this.profileNamespace.getByIds(e)]):[3,2];case 1:n=i.sent(),t.userList.forEach((function(t){var e=n.filter((function(e){return e.id===t.profileId}))[0];delete e.interests,t.profileModel=e})),i.label=2;case 2:return[2,t]}}))}))},this.handleMatchModel=function(t,e){t[e.matchId]?(e.matchModel=t[e.matchId],delete e.matchModel.availableMarkets,e.matchId=e.matchModel.id):(e.matchModel=null,n.idMapping.idSchema!==P.IdSchemaEnum.NATIVE&&n.idMapping.idMappingFacade.getEntityById(e.matchId,"match","native").then((function(t){e.matchId=t[S.ID_TYPES[n.idMapping.idSchema]]})))},this.remapMatchIdForResultsMarkets=function(t,e){t[e.matchId]?e.matchId=t[e.matchId].id:n.idMapping.idMappingFacade.getEntityById(e.matchId,"match","native").then((function(t){e.matchId=t[S.ID_TYPES[n.idMapping.idSchema]]}))},this.deleteUnexpectedProperties=function(t){return t.status&&(console.warn(O.WarningMessages.UNEXPECTED_STATUS_PROP),delete t.status),t.type&&(console.warn(O.WarningMessages.UNEXPECTED_TYPE_PROP),delete t.type),t},this.footballHttps=new f.default(t),this.idMapping=e,this.matchFacade=new p.default(t,this.footballHttps,e),this.playerFacade=new w.default(t,this.footballHttps,e),this.profileNamespace=new T.default(t)}},2310:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(4021),s=n(4904),a=i(n(8097)),o=n(5318),u=n(7974),l=n(1976),c=i(n(1206)),d=i(n(5274)),h=i(n(1465)),f=i(n(7535)),p=i(n(1718)),m=i(n(7307)),v=i(n(5132)),_=i(n(7344)),y=i(n(1855)),g=i(n(1732)),b=i(n(5814)),w=i(n(3950)),I=n(1260),E=i(n(7640)),M=i(n(2535));e.default=function(t){var e=this;this.errorHandlingMode=null,this.validateBodyFields=function(t,n){var i=Object.keys(n),r=Object.keys(new w.default);switch(t){case"MATCH_QUIZ":i.forEach((function(t){r.includes(t)||e.throwInvalidParamException([t])}));break;case"TOP_X":var s=n;s.fixtures.forEach((function(t){return e.validateMarketTopX(t.market)})),i.includes("tiebreaker")&&s.tiebreaker&&e.validateTiebreaker(s.tiebreaker),i.forEach((function(t){"tiebreaker"===t||r.includes(t)||e.throwInvalidParamException([t])}))}var a=r.filter((function(t){return!i.includes(t)}));return a.length&&e.throwMissingFieldsException("game prediction body",a),n.fixtures.forEach((function(t){e.validateFixtureFields(t)})),n},this.validateFixture=function(t,n,i,r){e.validateMarket(n);var s=Object.values(l.OneXTwoEnum),a=Object.values(l.HalfTimeFullTimeEnum),o=Object.values(l.DoubleChanceEnum);if(n===u.MarketEnum.FT_1X2||n===u.MarketEnum.HT_1X2){if(s.includes(i))return new p.default(t,n,i)}else if(n===u.MarketEnum.HT_FT){if(a.includes(i))return new m.default(t,i)}else if(n===u.MarketEnum.DOUBLE_CHANCE){if(o.includes(i))return new f.default(t,i)}else if(n===u.MarketEnum.CORRECT_SCORE||n===u.MarketEnum.CORRECT_SCORE_ADVANCED||n===u.MarketEnum.CORRECT_SCORE_HT){if("string"==typeof i&&/\d+:\d+/.test(i))return new h.default(t,n,i)}else if(n===u.MarketEnum.CORNERS_MATCH){if("number"==typeof i)return new d.default(t,i)}else if(n===u.MarketEnum.BOTH_TEAMS_SCORE){if(e.isPredictionBoolean(i))return new c.default(t,i)}else if(n===u.MarketEnum.RED_CARD_MATCH){if(e.isPredictionBoolean(i))return new b.default(t,i)}else if(n===u.MarketEnum.PENALTY_MATCH){if(e.isPredictionBoolean(i))return new y.default(t,i)}else if(u.playerMarkets.includes(n)){var w="OWN_GOAL";if(e.validatePlayerId(n,r),n===u.playerMarketNobodyPrediction&&e.isPredictionBoolean(i)){var I=r&&r===w?w:r;return new g.default(t,n,i,I)}if(r&&e.isPredictionBoolean(i))return new g.default(t,n,i,r)}else if(u.MarketsOverGoals.includes(n)){if(e.isPredictionBoolean(i))return new _.default(t,n,i)}else if(u.MarketsOverCorners.includes(n)&&e.isPredictionBoolean(i))return new v.default(t,n,i);e.throwInvalidPredictionException(i,n)},this.validateFixtureFields=function(t){var n=Object.keys(t);n.forEach((function(t){I.validFixtureFields.includes(t)||e.throwInvalidParamException([t])}));var i=I.validFixtureFields.filter((function(t){if("matchType"!==t&&!n.includes(t))return t}));i.length&&e.throwMissingFieldsException("fixtures",i),e.validatePredictionKey(t.market,t.prediction)},this.validateTiebreaker=function(t){var n=Object.keys(t);n.length&&"object"==typeof t||e.throwInvalidType("tiebreaker","object");var i=Object.keys(new E.default)[0];n.forEach((function(t){i!==t&&e.throwInvalidParamException([t])})),n.includes(i)||e.throwMissingFieldsException("tiebreaker",[i]),"number"!=typeof t.goldenGoal&&e.throwInvalidType("goldenGoal","number")},this.validatePredictionKey=function(t,n){if("object"==typeof n){var i=Object.keys(n),r=["value"];if(i.length||e.throwMissingFieldsException("prediction",r),1!==i.length||i.includes(r[0])||e.throwInvalidParamException(i),i.length>1){u.playerMarkets.includes(t)&&r.push("playerId");var s=i.filter((function(t){return!r.includes(t)}));s.length&&e.throwInvalidParamException(s)}}else e.throwInvalidType("prediction","object")},this.validatePlayerId=function(t,n){var i="playerId";t!==u.playerMarketNobodyPrediction&&(n||e.throwInvalidParamException([i]),"string"!=typeof n&&e.throwInvalidType(i,"string"))},this.validateMarket=function(t){Object.values(u.MarketEnum).includes(t)||e.throwInvalidMarketException(t)},this.validateMarketTopX=function(t){t!==u.MarketEnum.CORRECT_SCORE&&t!==u.MarketEnum.CORRECT_SCORE_ADVANCED&&e.throwInvalidMarketException(t,"TOP_X")},this.isPredictionBoolean=function(t){return"boolean"==typeof t},this.throwInvalidPredictionException=function(t,n){var i=(0,o.invalidPredictionMessage)(t,n);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_PREDICTION,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.throwInvalidMarketException=function(t,n){var i;if(i=n&&"TOP_X"===n?(0,o.invalidMarketTopXMessage)(t):(0,o.invalidMarketMessage)(t),"default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_MARKET,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.throwInvalidParamException=function(t){var n=(0,o.invalidFieldMessage)(t);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FIELD,n);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,n)},this.throwMissingFieldsException=function(t,n){var i=(0,o.missingFieldsMessage)(t,n);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_FIELD,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.throwInvalidType=function(t,n){var i=(0,o.invalidTypeMessage)(t,n);if("default"===e.errorHandlingMode)throw new a.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i);throw new M.default(r.ErrorCodes.BAD_METHOD_CALL,s.ErrorStatuses.INVALID_TYPE,i)},this.errorHandlingMode=t}},4306:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4021),o=n(4904),u=s(n(2535)),l=n(5318),c=s(n(7059)),d=s(n(8863)),h=s(n(5230)),f=s(n(6409)),p=s(n(5955)),m=s(n(3886)),v=s(n(4121)),_=s(n(1461)),y=s(n(9759)),g=s(n(8247)),b=s(n(2590));e.default=function(t){var e=this;this.factory=null,this.privateLeagueHttps=null,this.loyaltyHttps=null,this.profile=null,this.service=null,this.discussionsService=null,this.create=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=this.factory.createRequestBodyFromParam(t,"PRIVATE"),[4,this.privateLeagueHttps.create(e,"PRIVATE_LEAGUE")];case 1:return n=i.sent(),[4,this.service.setTemplateModels(n)];case 2:return i.sent(),[2,n]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.privateLeagueHttps.getById(t,"PRIVATE_LEAGUE",n)];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.getMyLeagues=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return t=new v.default(t),[4,this.privateLeagueHttps.getMyLeagues(t,"PRIVATE_LEAGUE")];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e)];case 2:return n.sent(),[2,e]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return e=this.factory.createUpdateRequestBodyFromParam(n,"PRIVATE"),[4,this.privateLeagueHttps.update(t,e,"PRIVATE_LEAGUE")];case 1:return i=r.sent(),[4,this.service.setTemplateModels(i)];case 2:return r.sent(),[2,i]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.privateLeagueHttps.updateLeagueTemplate(t,n,s,"PRIVATE_LEAGUE")];case 1:return e=i.sent(),[4,this.service.setTemplateModels(e)];case 2:return i.sent(),[2,e]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.delete(t,"PRIVATE_LEAGUE")];case 1:return[2,e.sent()]}}))}))},this.invite=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.invite(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteInvitation=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.deleteInvitation(t,n)];case 1:return[2,e.sent()]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!0,[4,this.privateLeagueHttps.accept(t,e,"PRIVATE_LEAGUE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return e=!1,[4,this.privateLeagueHttps.accept(t,e,"PRIVATE_LEAGUE")];case 1:return n=i.sent(),[4,this.finalizeAcceptModel(n,e)];case 2:return[2,i.sent()]}}))}))},this.banUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.ban(t,n)];case 1:return[2,e.sent()]}}))}))},this.unbanUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.unban(t,n)];case 1:return[2,e.sent()]}}))}))},this.join=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.privateLeagueHttps.join(t)];case 1:return e=n.sent(),[4,this.finalizeAcceptModel(e,!0)];case 2:return[2,n.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.leave(t,"PRIVATE_LEAGUE")];case 1:return[2,e.sent()]}}))}))},this.finalizeAcceptModel=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return n?[4,this.getById(t.leagueId)]:[3,2];case 1:e=i.sent(),t.leagueModel=e,i.label=2;case 2:return[4,this.service.setProfileModel(t)];case 3:return i.sent(),[2,t]}}))}))},this.getMyLeaguesStandings=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s,a,o;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new _.default(t)),[4,this.profile.getOwn().getInfo()];case 1:return e=r.sent(),[4,this.loyaltyHttps.getUserRankingsForPrivateLeagueAndChallenges(e.id,"PRIVATE_LEAGUE",t)];case 2:n=r.sent(),i=0,s=n.data,r.label=3;case 3:return i<s.length?(a=s[i],[4,this.getById(a.privateLeagueId)]):[3,6];case 4:o=r.sent(),a.privateLeagueModel=o,r.label=5;case 5:return i++,[3,3];case 6:return this.service.setTemplateModelsFromLeagueModels(n.data,"PRIVATE_LEAGUE"),[2,n]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return(t=new m.default(t)).type="PRIVATE",[4,this.privateLeagueHttps.getInvitations("PRIVATE_LEAGUE",t)];case 1:return e=n.sent(),[4,this.service.setTemplateModelsInLeagues(e.data)];case 2:return n.sent(),[2,e]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return n&&(n=new y.default(n)),[4,this.privateLeagueHttps.getReportedPosts(t,n)];case 1:return e=r.sent(),i=e,[4,this.discussionsService.finalizePostFullModel(e.data)];case 2:return i.data=r.sent(),[2,e]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:if(n){if(n.limit&&n.limit>20)throw new u.default(a.ErrorCodes.BAD_METHOD_CALL,o.ErrorStatuses.INVALID_LIMIT,l.ErrorMessages.INVALID_LIMIT);n=new g.default(n)}return[4,this.privateLeagueHttps.getPredictions(t,n)];case 1:return e=i.sent(),[4,this.service.setModelsForPredictions(e)];case 2:return[2,i.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeagueHttps.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.factory=new p.default,this.privateLeagueHttps=new d.default(t),this.loyaltyHttps=new c.default(t),this.profile=new f.default(t),this.service=new b.default(t),this.discussionsService=new h.default(t)}},5955:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(5124)),s=i(n(1796)),a=i(n(4823)),o=i(n(9845));e.default=function(){this.createRequestBodyFromParam=function(t,e){var n="PRIVATE"===e?new s.default:new r.default;return n.name=t.name,n.description=t.description,n.invitation_code=t.invitationCode,n.template_id=t.templateId,n.users_can_invite_users=t.usersCanInviteUsers,t.administrators?n.administrators=t.administrators:delete n.administrators,t.scoringStartsAt?n.scoring_starts_at=t.scoringStartsAt:delete n.scoring_starts_at,n},this.createUpdateRequestBodyFromParam=function(t,e){var n="PRIVATE"===e?new a.default:new o.default;return n.name=t.name,n.description=t.description,n.invitation_code=t.invitationCode,n.template_id=t.templateId,n.users_can_invite_users=t.usersCanInviteUsers,n.administrators=t.administrators,n.pinned_posts=t.pinnedPosts,n.scoring_starts_at=t.scoringStartsAt,n}}},3958:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.profileId="",this.profileModel=null,this.leagueId="",this.leagueModel=null,this.message=""}},3886:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.type=null,n.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(n);return n.type&&(e+="&type=".concat(n.type)),e},n.type=e&&e.type?e.type:null,n}return r(e,t),e}(s(n(4800)).default);e.default=a},4121:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.type="PRIVATE",this.userRole=null,this.constructFiltersUrl=function(){var t="&type=".concat(e.type);return e.userRole&&(t+="&user_role=".concat(e.userRole)),t},this.userRole=(null==t?void 0:t.userRole)||null}},1461:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=null,this.page=null,this.leagueId=null,this.templateId=null,this.sortOrder=null,this.constructFiltersUrl=function(){var t="";return e.limit&&(t+="&limit=".concat(e.limit)),e.page&&(t+="&page=".concat(e.page)),e.leagueId&&(t+="&league_id=".concat(e.leagueId)),e.templateId&&(t+="&template_id=".concat(e.templateId)),e.sortOrder&&(t+="&sort_order=".concat(e.sortOrder)),t},this.limit=t&&t.limit?t.limit:null,this.page=t&&t.page?t.page:null,this.leagueId=t&&t.leagueId?t.leagueId:null,this.templateId=t&&t.templateId?t.templateId:null,this.sortOrder=t&&t.sortOrder?t.sortOrder:null}},9759:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.reportsCount=null,n.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(n);return n.reportsCount&&(e+="&reports_count=".concat(n.reportsCount)),e},n.reportsCount=e.reportsCount?e.reportsCount:null,n}return r(e,t),e}(s(n(4800)).default);e.default=a},8247:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=null,this.page=null,this.profileIds=null,this.constructFiltersUrl=function(){var t="";return e.limit&&(t+="&limit=".concat(e.limit)),e.page&&(t+="&page=".concat(e.page)),e.profileIds&&(t+="&profile_ids=".concat(e.profileIds.join(","))),t},this.limit=t&&t.limit?t.limit:null,this.page=t&&t.page?t.page:null,this.profileIds=t&&t.profileIds?t.leagueId:null}},8383:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.members=[],e}return r(e,t),e}(s(n(2446)).default);e.default=a},2446:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.name="",this.description="",this.type="",this.banned=[],this.invites=[],this.administrators=[],this.membersCount=0,this.invitationCode="",this.templateId="",this.templateModel=null,this.pastTemplates=[],this.usersCanInviteUsers=!1,this.scoringStartsAt="",this.pinnedPosts=[]}},2663:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.predictionId=null,this.predictionModel=null,this.profileId=null,this.profileModel=null}},9659:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.templateId="",this.templateModel=null,this.privateLeagueId="",this.privateLeagueModel=null,this.position="",this.points=0,this.type="private_league"}},4239:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872)),s=i(n(6085)),a=i(n(3569)),o=i(n(3958)),u=i(n(8383)),l=i(n(2446)),c=i(n(2663));e.default=function(){var t=this;this.remapToPrivateLeagues=function(e){return e.meta=t.remapMetaPrivateLeagues(e.meta.pagination),e.data=e.data.map((function(e){return t.remapToPrivateLeagueById(e)})),e},this.remapMetaPrivateLeagues=function(t){var e=new r.default;return e.pagination.itemsPerPage=t.items_per_page,e.pagination.nextPageStartsAfter=t.next_page_starts_after,e},this.remapToPrivateLeagueById=function(t){var e=new u.default;return e.id=t.id,e.name=t.name,e.description=t.description,e.type=t.type,e.members=t.members,e.administrators=t.administrators,e.banned=t.banned,e.invites=t.invites,e.membersCount=t.members_count,e.usersCanInviteUsers=t.users_can_invite_users,e.invitationCode=t.invitation_code,e.templateId=t.template_id,e.pastTemplates=t.past_templates,e.pinnedPosts=t.pinned_posts,e.scoringStartsAt=t.scoring_starts_at,e},this.remapToMyPrivateLeagues=function(t){var e=new l.default;return e.id=t.id,e.name=t.name,e.description=t.description,e.type=t.type,e.administrators=t.administrators,e.banned=t.banned,e.invites=t.invites,e.membersCount=t.members_count,e.usersCanInviteUsers=t.users_can_invite_users,e.invitationCode=t.invitation_code,e.templateId=t.template_id,e.pastTemplates=t.past_templates,e.pinnedPosts=t.pinned_posts,e.scoringStartsAt=t.scoring_starts_at,e},this.remapToAcceptPrivateLeague=function(t){var e=new o.default;return e.profileId=t.profile_id,e.leagueId=t.league_id,e.message=t.message,e},this.remapToAcceptChallenge=function(t){var e=new s.default;return e.profileId=t.profile_id,e.challengeId=t.league_id,e.message=t.message,e},this.remapPredictions=function(e){return e.meta=t.remapMeta(e.meta),e.data=t.remapPredictionsData(e.data),e},this.remapMeta=function(t){var e=new a.default;return e.pagination.currentPage=t.pagination.current_page,e.pagination.itemsPerPage=t.pagination.items_per_page,e.pagination.numberOfPages=t.pagination.number_of_pages,e.pagination.totalItems=t.pagination.total_items,e},this.remapPredictionsData=function(t){return t.map((function(t){var e=new c.default;return e.predictionId=t.prediction_id,e.profileId=t.profile_id,e}))}}},2167:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.name="",this.description="",this.invitation_code="",this.template_id="",this.users_can_invite_users=!1,this.administrators=[],this.scoring_starts_at=""}},1796:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="PRIVATE",e}return r(e,t),e}(s(n(2167)).default);e.default=a},4584:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.name="",this.description="",this.invitation_code="",this.template_id="",this.users_can_invite_users=!1,this.administrators=[],this.pinned_posts=[],this.scoring_starts_at=""}},4823:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="PRIVATE",e}return r(e,t),e}(s(n(4584)).default);e.default=a},3281:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4306));e.default=function(t){var e=this;this.privateLeaguesFacade=null,this.create=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.create(t)];case 1:return[2,e.sent()]}}))}))},this.update=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.update(t,n)];case 1:return[2,e.sent()]}}))}))},this.updateTemplate=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.updateTemplate(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyLeagues=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getMyLeagues(t)];case 1:return[2,e.sent()]}}))}))},this.invite=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.invite(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteInvitation=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.deleteInvitation(t,n)];case 1:return[2,e.sent()]}}))}))},this.accept=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.accept(t)];case 1:return[2,e.sent()]}}))}))},this.reject=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.reject(t)];case 1:return[2,e.sent()]}}))}))},this.banUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.banUsers(t,n)];case 1:return[2,e.sent()]}}))}))},this.unbanUsers=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.unbanUsers(t,n)];case 1:return[2,e.sent()]}}))}))},this.join=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.join(t)];case 1:return[2,e.sent()]}}))}))},this.leave=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.leave(t)];case 1:return[2,e.sent()]}}))}))},this.getMyLeaguesStandings=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getMyLeaguesStandings(t)];case 1:return[2,e.sent()]}}))}))},this.getInvitations=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getInvitations(t)];case 1:return[2,e.sent()]}}))}))},this.getReportedPosts=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getReportedPosts(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPredictions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.getPredictions(t,n)];case 1:return[2,e.sent()]}}))}))},this.moderatePost=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.privateLeaguesFacade.moderatePost(t,n)];case 1:return[2,e.sent()]}}))}))},this.privateLeaguesFacade=new a.default(t)}},2590:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(2962)),o=s(n(6409)),u=s(n(1259));e.default=function(t){var e=this;this.loyalty=null,this.profile=null,this.predictor=null,this.setTemplateModels=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.loyalty.getTemplates()];case 1:return e=n.sent(),t.templateModel=e.data.find((function(e){return e.id===t.templateId})),t.pastTemplates&&t.pastTemplates.length>0&&t.pastTemplates.forEach((function(t){t.model=e.data.find((function(e){return e.id===t.id}))})),[2]}}))}))},this.setTemplateModelsInLeagues=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return t.length?[4,this.loyalty.getTemplates()]:[2];case 1:return e=n.sent(),t.forEach((function(t){t.templateModel=e.data.find((function(e){return e.id===t.templateId})),t.pastTemplates&&t.pastTemplates.length>0&&t.pastTemplates.forEach((function(t){t.model=e.data.find((function(e){return e.id===t.id}))}))})),[2]}}))}))},this.setTemplateModelsFromLeagueModels=function(t,e){"PRIVATE_LEAGUE"!==e?t.forEach((function(t){t.templateModel=t.templateId===t.challengeModel.templateId?t.challengeModel.templateModel:t.challengeModel.pastTemplates.find((function(e){return e.id===t.templateId})).model})):t.forEach((function(t){t.templateModel=t.templateId===t.privateLeagueModel.templateId?t.privateLeagueModel.templateModel:t.privateLeagueModel.pastTemplates.find((function(e){return e.id===t.templateId})).model}))},this.setProfileModel=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.profile.getById(t.profileId).getInfo()];case 1:return e=n.sent(),t.profileModel=e,[2]}}))}))},this.setModelsForPredictions=function(t){return i(e,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:return t.data.length?(e=t.data.map((function(t){return t.profileId})),n=t.data.map((function(t){return t.predictionId})),[4,this.getProfileModels(e)]):[3,3];case 1:return i=r.sent(),[4,this.getPredictionModels(n)];case 2:s=r.sent(),t.data.forEach((function(t){t.profileModel=i.find((function(e){return e.id===t.profileId})),t.predictionModel=s.find((function(e){return e.id===t.predictionId}))})),r.label=3;case 3:return[2,t]}}))}))},this.getProfileModels=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profile.getByIds(t)];case 1:return[2,e.sent()]}}))}))},this.getPredictionModels=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.predictor.getPredictionsByIds(t)];case 1:return[2,e.sent()]}}))}))},this.loyalty=new a.default(t),this.profile=new o.default(t),this.predictor=new u.default(t)}},4831:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=o(n(9072)),l=o(n(7232)),c=o(n(4268)),d=o(n(8097)),h=o(n(2535)),f=n(4021),p=n(4904),m=n(5318),v=o(n(6245));e.default=function(t,e,n,o,_){var y=this;this.idsRemapper=null,this.profileHttps=null,this.profileService=null,this.localCache=null,this.profileFacade=null,this.ownProfile=null,this.modified=!1,this.expireAt=0,this.promises=[],this.isFetching=!1,this.configuration=null,this.getOwnProfile=function(){return r(y,void 0,void 0,(function(){var t,e,n;return s(this,(function(i){switch(i.label){case 0:return this.isFetching?(console.log("Another thread is fetching profile..."),[4,this.delay(100)]):[3,2];case 1:return i.sent(),[3,0];case 2:if(this.modified&&this.ownProfile)return console.log("Timestamp is less than 10 minutes OR profile is modifying "),[2,this.ownProfile];if(t=Math.floor(Date.now()/1e3),this.clearAllProfileData(),this.ownProfile&&!(this.expireAt<t))return[3,7];this.isFetching=!0,this.expireAt=Math.floor(Date.now()/1e3)+600,i.label=3;case 3:return i.trys.push([3,5,,6]),[4,this.profileFacade.getOwn()];case 4:return e=i.sent(),this.setOwnProfile(e),[3,6];case 5:throw n=i.sent(),this.isFetching=!1,n;case 6:return this.modified=!1,this.isFetching=!1,[2,this.ownProfile];case 7:return[2,this.ownProfile]}}))}))},this.delay=function(t){return new Promise((function(e){setTimeout(e,t)}))},this.setOwnProfile=function(t){y.ownProfile=t},this.getInfo=function(){return r(y,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),delete(e=JSON.parse(JSON.stringify(t))).interests,[2,e]}}))}))},this.showInterests=function(){return r(y,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.remapInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return r(y,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.showFullInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowers(t)];case 1:return[2,e.sent()]}}))}))},this.getFollowing=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowing(t)];case 1:return[2,e.sent()]}}))}))},this.follow=function(t){return r(y,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return[4,this.profileFacade.follow(t)];case 1:return e=i.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=i.sent(),this.setOwnProfile(n),[2,e]}}))}))},this.unfollow=function(t){return r(y,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:return[4,this.profileFacade.unfollow(t)];case 1:return e=i.sent(),[4,this.profileFacade.updateOwnProfile()];case 2:return n=i.sent(),this.setOwnProfile(n),[2,e]}}))}))},this.getStats=function(){return r(y,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return this.clearAllProfileData(),[4,this.profileFacade.getStats()];case 1:return t=e.sent(),[4,this.idsRemapper.remapProfileStats(t)];case 2:return[2,e.sent()]}}))}))},this.getBadges=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.clearAllProfileData(),[4,this.profileFacade.getBadges(t)];case 1:return[2,e.sent()]}}))}))},this.addInterestPromise=function(t){return r(y,void 0,void 0,(function(){var e,n,r;return s(this,(function(s){switch(s.label){case 0:return this.modified=!0,e=i({},t),[4,this.getOwnProfile()];case 1:return s.sent(),n=null,"custom"===t.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(e)];case 2:return n=s.sent(),[3,4];case 3:n=e,s.label=4;case 4:return r=this.ownProfile.interests.filter((function(t){return t.id!==n.id||t.type!==n.type||t.source!==n.source})),this.ownProfile.interests=a([],r,!0),this.ownProfile.interests.push(n),[2,this]}}))}))},this.addInterest=function(t){return y.promises.push(y.addInterestPromise(t)),y},this.removeInterestPromise=function(t){return r(y,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:return this.modified=!0,e=i({},t),[4,this.getOwnProfile()];case 1:return r.sent(),n=null,"custom"===t.source?[3,3]:[4,this.idsRemapper.remapInterestToNative(e)];case 2:return n=r.sent(),[3,4];case 3:n=e,r.label=4;case 4:return this.ownProfile.interests=this.ownProfile.interests.filter((function(t){return t.id!==n.id||t.type!==n.type||t.source!==n.source})),[2,this]}}))}))},this.removeInterest=function(t){return y.promises.push(y.removeInterestPromise(t)),y},this.setBirthdatePromise=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.birthDate=t||null,[2,this]}}))}))},this.setBirthdate=function(t){return y.promises.push(y.setBirthdatePromise(t)),y},this.setGenderPromise=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.gender="male"===t||"female"===t?t:"unspecified",[2,this]}}))}))},this.setGender=function(t){return y.promises.push(y.setGenderPromise(t)),y},this.setNicknamePromise=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.nickname=t,[2,this]}}))}))},this.setNickname=function(t){return y.promises.push(y.setNicknamePromise(t)),y},this.setNamePromise=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),this.ownProfile.name=t,[2,this]}}))}))},this.setName=function(t){return y.promises.push(y.setNamePromise(t)),y},this.setCountryPromise=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:return e.sent(),t&&!this.ownProfile.country?(this.ownProfile.country=new u.default,this.ownProfile.country.id=t):t&&this.ownProfile.country?this.ownProfile.country.id=t:this.ownProfile.country=null,[2,this]}}))}))},this.setCountry=function(t){return y.promises.push(y.setCountryPromise(t)),y},this.showFullnessProfile=function(){return r(y,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:return[4,this.getOwnProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[2,this.profileFacade.showFullnessProfile(e)]}}))}))},this.setAvatarPromise=function(t){return r(y,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.modified=!0,[4,this.getOwnProfile()];case 1:if(e.sent(),this.profileService.isAvatarValidURL(t))this.ownProfile.avatar=t;else{if("default"===this.configuration.errorHandlingMode)throw new d.default(f.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,m.ErrorMessages.INVALID_AVATAR);if("standard"===this.configuration.errorHandlingMode)throw new h.default(f.ErrorCodes.BAD_METHOD_CALL,p.ErrorStatuses.INVALID_AVATAR,m.ErrorMessages.INVALID_AVATAR)}return[2,this]}}))}))},this.setAvatar=function(t){return y.promises.push(y.setAvatarPromise(t)),y},this.update=function(){return r(y,void 0,void 0,(function(){var t,e,n,i,r,a;return s(this,(function(s){switch(s.label){case 0:return 0===this.promises.length?[2,this.ownProfile]:[4,Promise.all(this.promises)];case 1:return s.sent(),[4,this.profileFacade.getOwn()];case 2:return t=s.sent(),[4,this.getOwnProfile()];case 3:return e=s.sent(),n=this.profileService.extractUpdatedProps(t,e),this.modified=!1,this.expireAt=0,Object.keys(n).length?[4,this.profileHttps.updateProfile(n)]:[3,5];case 4:return i=s.sent(),r=JSON.parse(JSON.stringify(i)),this.setOwnProfile(r),this.localCache.setOwnProfile(r),delete i.interests,[2,i];case 5:return delete(a=JSON.parse(JSON.stringify(this.ownProfile))).interests,[2,a]}}))}))},this.clearAllProfileData=function(){y.isNewProfileRequested()&&y.profileFacade.clearLocalStorageData()},this.isNewProfileRequested=function(){var t=y.extractUserIdFromToken();if(!t)return!1;if(!y.ownProfile){var e=y.profileFacade.getOwnProfileFromCache();return!(!e||!Object.keys(e).length||e.id===t)}return y.ownProfile.id!==t},this.extractUserIdFromToken=function(){try{var t=(0,v.default)(y.configuration.authProvider.getIdToken());return(null==t?void 0:t.sub)||""}catch(t){return console.error(t),""}},this.configuration=t,this.idsRemapper=e,this.localCache=n,this.profileHttps=o,this.profileService=new c.default,this.profileFacade=new l.default(n,o,_)}},642:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7232));e.default=function(t,e,n,s){var o=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.profileFacade=null,this.profileId="",this.setId=function(t){return o.profileId=t,o},this.getProfile=function(){return i(o,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.profileFacade.getById(this.profileId)];case 1:return[2,t.sent()]}}))}))},this.getInfo=function(){return i(o,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.getProfile()];case 1:return delete(t=e.sent()).interests,[2,t]}}))}))},this.showInterests=function(){return i(o,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.remapInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.showFullInterests=function(){return i(o,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return[4,this.getProfile()];case 1:return t=n.sent(),e=JSON.parse(JSON.stringify(t)),[4,this.idsRemapper.showFullInterests(e.interests)];case 2:return[2,n.sent()]}}))}))},this.getFollowers=function(t){return i(o,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowers(t,this.profileId)];case 1:return[2,e.sent()]}}))}))},this.getFollowing=function(t){return i(o,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getFollowing(t,this.profileId)];case 1:return[2,e.sent()]}}))}))},this.showFullnessProfile=function(){return i(o,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return[4,this.getProfile()];case 1:return t=e.sent(),[2,this.profileFacade.showFullnessProfile(t)]}}))}))},this.getStats=function(t){return i(o,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return[4,this.activityHttps.getStats(this.profileId,t)];case 1:return e=n.sent(),[4,this.idsRemapper.remapProfileStats(e)];case 2:return[2,n.sent()]}}))}))},this.getBadges=function(){return i(o,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.profileHttps.getBadges(this.profileId)];case 1:return[2,t.sent()]}}))}))},this.idsRemapper=t,this.profileHttps=n,this.activityHttps=s,this.profileFacade=new a.default(e,n,s)}},7232:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(9037)),o=s(n(9523)),u=s(n(2535)),l=n(4021),c=n(4904),d=n(5318);e.default=function(t,e,n){var s=this;this.profileHttps=null,this.activityHttps=null,this.getOwn=function(){return i(s,void 0,void 0,(function(){var t,e,n;return r(this,(function(i){switch(i.label){case 0:if((t=this.getLocalStorageData("profile"))&&Object.keys(t).length)return[2,JSON.parse(JSON.stringify(t))];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.profileHttps.getProfile()];case 2:return e=i.sent(),this.localCache.setOwnProfile(e),[2,e];case 3:throw n=i.sent(),console.warn("There was a problem retrieving your profile: ",n),n;case 4:return[2]}}))}))},this.getOwnProfileFromCache=function(){return s.localCache.getOwnProfile()},this.updateOwnProfile=function(){return i(s,void 0,void 0,(function(){var t,e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile()];case 1:return t=n.sent(),this.localCache.setOwnProfile(t),[2,t];case 2:throw e=n.sent(),console.warn("There was a problem retrieving your profile: ",e),e;case 3:return[2]}}))}))},this.getByIds=function(t,e,n){return i(s,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:if(t&&t.length>0&&e||!t&&0===t.length&&!e)throw new u.default(l.ErrorCodes.BAD_METHOD_CALL,c.ErrorStatuses.INVALID_METHOD_CALL,d.ErrorMessages.INVALID_GET_PROFILES_METHOD_CALL);r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.profileHttps.getProfiles(t,e,n)];case 2:return[2,r.sent()];case 3:throw i=r.sent(),console.warn("There was a problem retrieving the selected profiles: ".concat(t.join(",")," "),i),i;case 4:return[2]}}))}))},this.getById=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.getProfile(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem retrieving the selected profile: ".concat(t," "),e),e;case 3:return[2]}}))}))},this.getCountries=function(t){return i(s,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:if(t=t||!1,(e=this.localCache.getProfileCountries())&&e.length>0)return[2,e];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.profileHttps.getCountries(t)];case 2:return n=r.sent(),this.localCache.setProfileCountries(n),[2,n];case 3:throw i=r.sent(),console.warn("There was a problem retrieving profile countries: ",i),i;case 4:return[2]}}))}))},this.getFollowers=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,a,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),t&&(t=new o.default(t)),[4,this.profileHttps.getFollowers(t,e)];case 1:return n=r.sent(),(i=n.data.map((function(t){return t.followerId}))).length?[4,this.getByIds(i)]:[3,3];case 2:return s=r.sent(),a=n.data.map((function(t){return s.forEach((function(e){t.followerId===e.id&&(t.name=e.name,t.nickname=e.nickname,t.avatar=e.avatar)})),t})),n.data=a,[2,n];case 3:return[2,n];case 4:throw u=r.sent(),console.warn("There was a problem retrieving your followers: ",u),u;case 5:return[2]}}))}))},this.getFollowing=function(t,e){return i(s,void 0,void 0,(function(){var n,i,s,a,u;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),t&&(t=new o.default(t)),[4,this.profileHttps.getFollowing(t,e)];case 1:return n=r.sent(),(i=n.data.map((function(t){return t.followingId}))).length?[4,this.getByIds(i)]:[3,3];case 2:return s=r.sent(),a=n.data.map((function(t){return s.forEach((function(e){t.followingId===e.id&&(t.name=e.name,t.nickname=e.nickname,t.avatar=e.avatar)})),t})),n.data=a,[2,n];case 3:return[2,n];case 4:throw u=r.sent(),console.warn("There was a problem retrieving your following profiles: ",u),u;case 5:return[2]}}))}))},this.follow=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.follow(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem following profiles: ".concat(t.join(",")," "),e),e;case 3:return[2]}}))}))},this.unfollow=function(t){return i(s,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.profileHttps.unfollow(t)];case 1:return[2,n.sent()];case 2:throw e=n.sent(),console.warn("There was a problem unfollowing profiles: ".concat(t.join(",")," "),e),e;case 3:return[2]}}))}))},this.showFullnessProfile=function(t){var e=new a.default,n=0;return t.avatar&&(e.breakdown.addedAvatar.completed=!0,n+=e.breakdown.addedAvatar.percentage),t.birthDate&&(e.breakdown.addedBirthdate.completed=!0,n+=e.breakdown.addedBirthdate.percentage),t.country&&(e.breakdown.addedCountry.completed=!0,n+=e.breakdown.addedCountry.percentage),t.gender&&(e.breakdown.addedGender.completed=!0,n+=e.breakdown.addedGender.percentage),t.interests&&t.interests.length>0&&(t.interests.find((function(t){return"team"===t.type&&t.favourite}))&&(e.breakdown.teamFavourite.completed=!0,n+=e.breakdown.teamFavourite.percentage),t.interests.find((function(t){return"team"===t.type}))&&(e.breakdown.teamFollowed.completed=!0,n+=e.breakdown.teamFollowed.percentage),t.interests.find((function(t){return"player"===t.type&&t.favourite}))&&(e.breakdown.playerFavourite.completed=!0,n+=e.breakdown.playerFavourite.percentage),t.interests.find((function(t){return"player"===t.type}))&&(e.breakdown.playerFollowed.completed=!0,n+=e.breakdown.playerFollowed.percentage),t.interests.find((function(t){return"competition"===t.type&&t.favourite}))&&(e.breakdown.competitionFavourite.completed=!0,n+=e.breakdown.competitionFavourite.percentage),t.interests.find((function(t){return"competition"===t.type}))&&(e.breakdown.competitionFollowed.completed=!0,n+=e.breakdown.competitionFollowed.percentage)),e.totalPercentage=n,e},this.getStats=function(){return i(s,void 0,void 0,(function(){var t,e,n;return r(this,(function(i){switch(i.label){case 0:if((t=this.getLocalStorageData("statistics"))&&Object.keys(t).length)return[2,JSON.parse(JSON.stringify(t))];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.activityHttps.getStats()];case 2:return e=i.sent(),this.localCache.setProfileStats(e),[2,e];case 3:throw n=i.sent(),console.warn("There was a problem retrieving own profile statistics: ",n),n;case 4:return[2]}}))}))},this.getBadges=function(t){return i(s,void 0,void 0,(function(){var e,n,i,s;return r(this,(function(r){switch(r.label){case 0:if(!t)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.profileHttps.getBadges()];case 2:return[2,r.sent()];case 3:throw e=r.sent(),console.warn("There was a problem retrieving own profile badges: ",e),e;case 4:if(n=this.getLocalStorageData("badges"))return[2,n];r.label=5;case 5:return r.trys.push([5,7,,8]),[4,this.profileHttps.getBadges()];case 6:return i=r.sent(),this.localCache.setProfileBadges(i),[2,i];case 7:throw s=r.sent(),console.warn("There was a problem retrieving own profile badges: ",s),s;case 8:return[2]}}))}))},this.clearLocalStorageData=function(){s.localCache.setOwnProfile({}),s.localCache.setProfileStats({}),s.localCache.setProfileBadges(null)},this.getLocalStorageData=function(t){var e=Math.floor(Date.now()/1e3),n=s.localCache.getExpiration("profile",t);switch(t){case"profile":if(n>e)return s.localCache.getOwnProfile();case"statistics":if(n>e)return s.localCache.getProfileStats();case"badges":if(n>e)return s.localCache.getProfileBadges();default:return null}},this.localCache=t,this.profileHttps=e,this.activityHttps=n}},9523:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=this;this.limit=0,this.startAfter=null,this.constructFilterUrl=function(){var t="";return e.limit&&(t+="&",t+="limit=".concat(e.limit)),e.startAfter&&(t+="&",t+="start_after=".concat(e.startAfter)),t},this.limit=t.limit?t.limit:20,this.startAfter=t.startAfter?t.startAfter:null}},4782:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.avatar=null,this.followerId=null,this.name=null,this.nickname=null,this.profileId=null}},1712:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.profile_ids=[]}},3106:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.avatar=null,this.followingId=null,this.name=null,this.nickname=null,this.profileId=null}},5156:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.model=null,e}return r(e,t),e}(s(n(5867)).default);e.default=a},6620:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(7312));e.default=function(){this.teamFollowed=new r.default(10),this.teamFavourite=new r.default(15),this.playerFollowed=new r.default(10),this.playerFavourite=new r.default(10),this.competitionFollowed=new r.default(10),this.competitionFavourite=new r.default(5),this.addedBirthdate=new r.default(10),this.addedGender=new r.default(10),this.addedCountry=new r.default(10),this.addedAvatar=new r.default(10)}},7312:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){this.completed=!1,this.percentage=t}},9037:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6620));e.default=function(){this.breakdown=new r.default}},5867:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.source="",this.type="",this.favourite=!1}},9072:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.name=null,this.assets=null}},3546:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.name=null,this.nickname=null,this.avatar=null,this.gender=null,this.country=null,this.birthDate=null,this.verified=!1,this.staffMember=!1,this.interests=[],this.followingCount=0,this.followersCount=0}},6277:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1553)),s=i(n(4782));e.default=function(){var t=this;this.followersFromResponse=function(e){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=e.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=e.meta.pagination.items_per_page,n.data=e.data.map((function(e){return t.remapResponse(e)})),n},this.remapResponse=function(t){var e=new s.default;return e.avatar=t.avatar,e.followerId=t.follower_id,e.name=t.name,e.profileId=t.profile_id,e}}},8673:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1553)),s=i(n(3106));e.default=function(){var t=this;this.followResponse=function(e){return e.map((function(e){return t.remapResponse(e)}))},this.followingFromResponse=function(e){var n=new r.default;return n.meta.pagination.nextPageStartsAfter=e.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=e.meta.pagination.items_per_page,n.data=e.data.map((function(e){return t.remapResponse(e)})),n},this.remapResponse=function(t){var e=new s.default;return e.avatar=t.avatar,e.followingId=t.following_id,e.name=t.name,e.profileId=t.profile_id,e.nickname=t.nickname,e}}},441:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3546));e.default=function(){var t=this;this.profilesFromResponse=function(e){return e?e.map((function(e){return t.fullProfileFromResponse(e)})):null},this.fullProfileFromResponse=function(t){var e=new r.default;return e.id=t.id,e.name=t.name,e.nickname=t.nickname,e.avatar=t.avatar,e.gender=t.gender,e.country=t.country,e.birthDate=t.birth_date,e.verified=t.verified,e.staffMember=t.staff_member,e.interests=t.interests?t.interests:[],e.followingCount=t.following_count,e.followersCount=t.followers_count,e}}},1758:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id="",this.achievedAt=""}},6635:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.participationCount=null,this.points=null}},3009:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.totalPoints=null,this.postPoints=null,this.postsMade=null,this.reactionPoints=null,this.reactionCount=null}},7165:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.participationCount=null}},3621:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.participations=0,this.points=0}},5490:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3621)),s=i(n(1342));e.default=function(){this.single=new s.default,this.topX=new r.default,this.matchQuiz=new r.default}},1316:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6635)),s=i(n(3009)),a=i(n(7165)),o=i(n(5490)),u=i(n(5123));e.default=function(){this.successRates=new u.default,this.predictions=new o.default,this.tiers=[],this.badges=[],this.discussions=new s.default,this.classicQuizzes=new r.default,this.eitherOr=new a.default}},3195:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.entityId="",this.entityType="",this.entitySource="",this.model=null,this.predictionsMade=0,this.correct=0,this.points=0}},1342:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(3087));e.default=function(){this.predictionsMade=0,this.correct=0,this.points=0,this.breakdown=new r.default}},9826:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.model=null}},5123:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){}},3087:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.footballCompetitions=[],this.footballTeams=[]}},6409:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4275)),o=s(n(8900)),u=s(n(7232)),l=s(n(4831)),c=s(n(642)),d=s(n(4289)),h=s(n(595)),f=s(n(1022)),p=s(n(4912)),m=s(n(8358));e.default=function(t){var e=this;this.idsRemapper=null,this.profileHttps=null,this.activityHttps=null,this.footballHttps=null,this.footballFacade=null,this.idMapping=null,this.localCache=null,this.profileFacade=null,this.ownProfileBuilder=null,this.profileBuilder=null,this.getOwn=function(){return e.ownProfileBuilder},this.getById=function(t){return e.profileBuilder.setId(t)},this.getCountries=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getCountries(t)];case 1:return[2,e.sent()]}}))}))},this.getByIds=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileFacade.getByIds(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.profileHttps=new a.default(t),this.activityHttps=new f.default(t),this.footballHttps=new h.default(t),this.idMapping=new o.default(t),this.localCache=(new m.default).createLocalCacheInstance(t.idSchema),this.footballFacade=new d.default(t,this.localCache,this.footballHttps,this.idMapping),this.profileFacade=new u.default(this.localCache,this.profileHttps,this.activityHttps),this.idsRemapper=new p.default(t,this.footballFacade),this.ownProfileBuilder=new l.default(t,this.idsRemapper,this.localCache,this.profileHttps,this.activityHttps),this.profileBuilder=new c.default(this.idsRemapper,this.localCache,this.profileHttps,this.activityHttps)}},4268:function(t,e){"use strict";var n=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){var t=this;this.extractUpdatedProps=function(e,n){var i=["name","nickname","gender","avatar"],r={};return Object.keys(e).forEach((function(s){if(i.includes(s)&&e[s]!==n[s])r[s]=n[s];else if("birthDate"===s)(null===n[s]||null===e[s]&&n[s]||e[s]!==n[s])&&(r.birth_date=n[s]);else if("country"===s)null===n[s]?r.country_id=n[s]:(null===e[s]&&n[s]||e[s].id!==n[s].id)&&(r.country_id=n[s].id);else if("interests"===s){var a=e[s],o=n[s];o.length&&t.isNewInterest(a,o)?r[s]=t.updateInterests(a,o):!o.length&&a.length?r[s]=o:a.length===o.length||t.isNewInterest(a,o)||(r[s]=o)}})),r},this.updateInterests=function(e,i){if(e.length===i.length){var r=t.extractSameAndNewInterests(e,i),s=r[0],a=r[1];return n(n([],a,!0),s,!0)}return i},this.isNewInterest=function(e,n){var i=!1;return t.extractSameAndNewInterests(e,n)[0].length?i=!0:i},this.extractSameAndNewInterests=function(t,e){var n=e.filter((function(e){return t.some((function(t){return e.id===t.id&&e.type===t.type&&e.source===t.source&&e.favourite===t.favourite}))}));return[e.filter((function(e){return!t.some((function(t){return e.id===t.id&&e.type===t.type&&e.source===t.source&&e.favourite===t.favourite}))})),n]},this.isAvatarValidURL=function(t){try{return new URL(t),!0}catch(t){return!1}}}},1267:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){var t=this;this.KEY_PREFIX="fu-progress-",this.get=function(e,n){var i=localStorage.getItem("".concat(t.KEY_PREFIX).concat(e,"-").concat(n));return i?JSON.parse(i):i},this.set=function(e,n,i){return localStorage.setItem("".concat(t.KEY_PREFIX).concat(e,"-").concat(n),JSON.stringify(i)),JSON.stringify(i)},this.delete=function(e,n){localStorage.removeItem("".concat(t.KEY_PREFIX).concat(e,"-").concat(n))}}},853:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GameStatusEnum=void 0,(n=e.GameStatusEnum||(e.GameStatusEnum={})).OPEN="OPEN",n.LIVE="LIVE",n.PENDING="PENDING",n.CANCELED="CANCELED",n.CLOSED="CLOSED",n.SETTLED="SETTLED"},9502:function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(4946),c=u(n(2793)),d=u(n(5013)),h=n(853),f=u(n(7299)),p=u(n(1553)),m=u(n(1399)),v=u(n(7782)),_=s(n(7686)),y=u(n(2310)),g=u(n(8097)),b=n(4904),w=n(5318),I=n(4021),E=u(n(2535));e.default=function(t,e){var n=this;this.idMapping=null,this.predictorHttps=null,this.predictorService=null,this.predictorValidator=null,this.clientHttps=null,this.errorHandlingMode=null,this.getConfig=function(){return a(n,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.clientHttps.getConfig(_.FeatureConfigType.TOP_X)];case 1:return t=e.sent(),this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,3]:[4,this.predictorService.remapCompetitionsFromConfig(t)];case 2:return[2,e.sent()];case 3:return[2,t]}}))}))},this.getGames=function(t,e){return a(n,void 0,void 0,(function(){var n,i;return o(this,(function(r){switch(r.label){case 0:return e=e||!1,n=this.predictorService.initGameFilters("TOP_X",t),[4,this.predictorHttps.getGames(n,e)];case 1:return i=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(i)];case 2:return[2,r.sent()]}}))}))},this.getGameById=function(t,e){return a(n,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return e=e||!1,[4,this.predictorHttps.getGameById(t,e)];case 1:return n=i.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,i.sent()]}}))}))},this.getGamePredictions=function(t,e,i){return a(n,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i=i||!1,e&&(e.type&&delete e.type,e.status&&delete e.status,e=new v.default(e)),[4,this.predictorHttps.getGamePredictions(t,i,e)];case 1:return[2,n.sent()]}}))}))},this.getGameResults=function(t,e,i){return a(n,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return i=i||!1,e&&(e=new f.default(e)),[4,this.predictorHttps.getGameResults(t,i,e)];case 1:return n=r.sent(),[4,this.predictorService.remapMatchIdsFixtures(n)];case 2:return[2,r.sent()]}}))}))},this.getCurrentGameResults=function(t){return a(n,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return t=t||!1,(e=new f.default(null)).status=h.GameStatusEnum.OPEN,e.type="TOP_X",[4,this.predictorHttps.getGames(e,t)];case 1:return n=r.sent(),i=this.predictorService.getCurrentGameId(n),[4,this.getGameResults(i,null,t)];case 2:return[2,r.sent().data[0]]}}))}))},this.play=function(t){return a(n,void 0,void 0,(function(){var e,n,i,r,s=this;return o(this,(function(a){switch(a.label){case 0:return e=new m.default(t),(e=this.predictorValidator.validateBodyFields("TOP_X",e)).fixtures=e.fixtures.map((function(t){return s.predictorValidator.validateFixture(t.matchId,t.market,t.prediction.value)})),this.idMapping.idSchema===l.IdSchemaEnum.NATIVE?[3,2]:(n=[],e.fixtures.forEach((function(t){return n.push(t.matchId)})),[4,this.predictorService.remapMatchIdToNative(n)]);case 1:i=a.sent(),e.fixtures.forEach((function(t){return t.matchId=i.shift()})),a.label=2;case 2:return[4,this.predictorHttps.makeFootballPrediction(e)];case 3:return(r=a.sent()).fixtures.forEach((function(t){t.matchId=t.matchModel.id})),[2,r]}}))}))},this.delete=function(t){return a(n,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.predictorHttps.deleteFootballPrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getMyGameEditions=function(t,e){return a(n,void 0,void 0,(function(){var n,i,r,s,a;return o(this,(function(o){switch(o.label){case 0:return t&&t.limit&&this.validateLimitFilterOnGames(t.limit),e=e||!1,n=this.predictorService.initGameTypePredictions("TOP_X",t),i=[],[4,this.predictorHttps.getMyPredictionsNoRemap(n)];case 1:return(r=o.sent()).data.length>0?(r.data.forEach((function(t){t.game_instance_id&&i.push(t.game_instance_id)})),s=this.predictorService.initGameFilters("TOP_X",null,i),[4,this.predictorHttps.getUserGameEditions(s,e)]):[3,4];case 2:return a=o.sent(),[4,this.predictorService.addPredictionProp(r,a)];case 3:return[2,o.sent()];case 4:return[2,new p.default]}}))}))},this.getMyGamePrediction=function(t){return a(n,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){switch(r.label){case 0:return e=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getMyPredictions(e)];case 1:return(n=r.sent()).data.length>0?[2,(i=n.data.filter((function(e){return e.gameInstanceId===t}))).length?i[0]:null]:[2,null]}}))}))},this.getUserGameEditions=function(t,e,i){return a(n,void 0,void 0,(function(){var n,r,s,a,u;return o(this,(function(o){switch(o.label){case 0:return e&&e.limit&&this.validateLimitFilterOnGames(e.limit),i=i||!1,n=this.predictorService.initGameTypePredictions("TOP_X",e),r=[],[4,this.predictorHttps.getUserPredictionsNoRemap(t,n)];case 1:return(s=o.sent()).data.length>0?(s.data.forEach((function(t){t.game_instance_id&&r.push(t.game_instance_id)})),a=this.predictorService.initGameFilters("TOP_X",null,r),[4,this.predictorHttps.getUserGameEditions(a,i)]):[3,4];case 2:return u=o.sent(),[4,this.predictorService.addPredictionProp(s,u)];case 3:return[2,o.sent()];case 4:return[2,new p.default]}}))}))},this.getUserGamePrediction=function(t,e,i){return a(n,void 0,void 0,(function(){var n,r,s;return o(this,(function(a){switch(a.label){case 0:return i=i||!1,n=this.predictorService.initGameTypePredictions("TOP_X"),[4,this.predictorHttps.getUserPredictions(t,i,n)];case 1:return(r=a.sent()).data.length>0?[2,(s=r.data.filter((function(t){return t.gameInstanceId===e}))).length?s[0]:null]:[2,null]}}))}))},this.getMarketsResultsForGame=function(t,e){return a(n,void 0,void 0,(function(){var n;return o(this,(function(i){switch(i.label){case 0:return[4,this.predictorHttps.getMarketResultsForGame(t,e)];case 1:return n=i.sent(),[4,this.predictorService.completeGameMarketResults(n,"TOP_X")];case 2:return[2,i.sent()]}}))}))},this.getGameWinners=function(t,e){return a(n,void 0,void 0,(function(){var n,i;return o(this,(function(r){switch(r.label){case 0:return[4,this.predictorHttps.getContestWinners(t,e)];case 1:return n=r.sent(),[4,this.getGameById(t)];case 2:return i=r.sent(),n.contestModel=i,[2,this.predictorService.completeContestWinners(n)]}}))}))},this.validateLimitFilterOnGames=function(t){if("default"===n.errorHandlingMode&&t>50)throw new g.default(I.ErrorCodes.BAD_METHOD_CALL,b.ErrorStatuses.EXCEEDED_LENGTH,w.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED);if("standard"===n.errorHandlingMode&&t>50)throw new E.default(I.ErrorCodes.BAD_METHOD_CALL,b.ErrorStatuses.EXCEEDED_LENGTH,w.ErrorMessages.QUERY_PARAM_FILTERS_LIMIT_EXCEEDED)},this.idMapping=e,this.errorHandlingMode=t.errorHandlingMode,this.predictorValidator=new y.default(t.errorHandlingMode),this.predictorHttps=new c.default(t,e),this.predictorService=new d.default(t,e),this.clientHttps=new _.default(t)}},1180:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.enabled=!1,this.clientId=null,this.minFixtures=null,this.maxFixtures=null,this.competitionsWhitelist=null}},7482:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899));e.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default}},5967:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(6899)),s=i(n(3381));e.default=function(){this.matchId=null,this.matchType=null,this.market=null,this.matchModel=null,this.matchStatus=new r.default,this.prediction=new s.default}},6247:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.adContent=null,e}return r(e,t),e}(s(n(3751)).default);e.default=a},6890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.userId=null,this.points=null,this.results=[],this.tiebreaker=null}},6160:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.matchId=null,this.matchModel=null,this.outcome=null}},7299:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(4800)),o=n(853),u=function(t){function e(e){var n=t.call(this,e)||this;return n.status=null,n.type=null,n.gameIds=null,n.sortOrder=null,n.constructFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(n);return n.status&&Object.values(o.GameStatusEnum).includes(n.status)&&(e+="&",e+="status=".concat(n.status)),n.type&&(e+="&",e+="type=".concat(n.type)),n.gameIds&&n.gameIds.length>0&&(e+="&",e+="game_ids=".concat(n.gameIds.join(","))),n.sortOrder&&(e+="&",e+="sort_order=".concat(n.sortOrder)),e},n.status=(null==e?void 0:e.status)||null,n.type=(null==e?void 0:e.type)||null,n.gameIds=(null==e?void 0:e.gameIds)||null,n.sortOrder=(null==e?void 0:e.sortOrder)||null,n}return r(e,t),e}(a.default);e.default=u},3751:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439)),s=i(n(4916));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.scheduleOpenAt=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new s.default,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.labels=null,this.customFields=null,this.branding=null,this.flags=null,this.images=new r.default,this.createdAt=null,this.updatedAt=null}},4780:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7482)),o=s(n(8410)),u=s(n(5967)),l=s(n(6890)),c=s(n(6160)),d=s(n(3751)),h=s(n(7243)),f=s(n(8950)),p=s(n(7640)),m=s(n(1553)),v=s(n(670)),_=n(7974),y=s(n(4916)),g=s(n(3483)),b=s(n(1784)),w=s(n(824)),I=s(n(6899)),E=s(n(6247)),M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapPaginatedGames=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGamesListResponse(t)})),n},e.remapGamesListResponse=function(t){var n=new d.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.labels=t.labels,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.flags=t.flags,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapGameByIdResponse=function(t){var n=new E.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.scheduleOpenAt=t.schedule_open_at,n.predictionsCutoff=t.predictions_cutoff,n.fixtures=t.fixtures.map((function(t){return e.remapFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.adContent=t.ad_content,n.labels=t.labels,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.images=t.images,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapFixturesResponse=function(t){var e=new a.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.market=t.market,e.matchStatus.type=t.match_status?t.match_status.type:null,e.matchStatus.subType=t.match_status?t.match_status.sub_type:null,e},e.remapPaginatedUserTopXEditions=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserTopXEditionsResponse(t)})),n},e.remapUserTopXEditionsResponse=function(t){var n=new f.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapTopXFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.branding=t.branding?e.remapBranding(t.branding):null,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapTopXFixturesResponse=function(t){var e=new u.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.market=t.market,e.matchStatus.type=t.match_status?t.match_status.type:null,e.matchStatus.subType=t.match_status?t.match_status.sub_type:null,e},e.remapPaginatedUserMathQuizEditions=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapUserMatchQuizEditionsResponse(t)})),n},e.remapUserMatchQuizEditionsResponse=function(t){var n=new h.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.status=t.status,n.predictionsCutoff=t.predictions_cutoff,n.scheduleOpenAt=t.schedule_open_at,n.fixtures=t.fixtures.map((function(t){return e.remapMatchQuizFixturesResponse(t)})),n.tiebreaker=t.tiebreaker?e.remapTimeTiebreaker(t.tiebreaker.time_tiebreaker):null,n.participantsCount=t.participants_count,n.related=t.related?e.remapRelated(t.related):null,n.excludedProfileIds=t.excluded_profile_ids,n.rules=t.rules,n.flags=t.flags,n.images=t.images,n.branding=t.branding?e.remapBranding(t.branding):null,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapMatchQuizFixturesResponse=function(t){var e=new o.default;return e.matchId=t.match_id,e.matchType=t.match_type,e.market=t.market,e.matchStatus.type=t.match_status?t.match_status.type:null,e.matchStatus.subType=t.match_status?t.match_status.sub_type:null,e},e.remapPaginatedGameResults=function(t){var n=new m.default;return n.meta.pagination.nextPageStartsAfter=t.meta.pagination.next_page_starts_after,n.meta.pagination.itemsPerPage=t.meta.pagination.items_per_page,n.data=t.data.map((function(t){return e.remapGameResults(t)})),n},e.remapGameResults=function(t){var n=new l.default;return n.userId=t.user_id,n.points=t.points?t.points:0,n.results=t.results.map((function(t){return e.remapResults(t)})),n.tiebreaker=t.tiebreaker?e.remapTiebreaker(t.tiebreaker):null,n},e.remapGameMarketsResults=function(t){var n=new v.default;return n.gameId=t.game_id,n.results=e.remapMarketsResults(t.results),n.tieBreakers=t.tie_breakers?e.remapTieBreakers(t.tie_breakers):null,n},e.remapContestWinners=function(t){var n=new b.default;return n.contestId=t.contest_id,n.contestType=t.contest_type,n.description=t.description,n.userList=t.user_list?t.user_list.map((function(t){return e.remapUserListWinners(t)})):null,n},e.remapUserListWinners=function(t){var e=new w.default;return e.position=t.position,e.profileId=t.profile_id,e.note=t.note,e.tags=t.tags,e},e.remapTieBreakers=function(t){var e={goldenGoals:[]};return e.goldenGoals=t.golden_goals.map((function(t){return{minute:t.minute,matchId:t.match_id,matchModel:null,playerId:t.player_id,playerModel:null,goalType:t.goal_type}})),e},e.remapMarketsResults=function(t){var n=[];return t.forEach((function(t){var i={matchId:t.match_id,market:t.market,result:e.remapMarketResult(t.market,t.result),matchModel:null,playerModels:[],matchStatus:e.remapMarketsResultsMatchStatus(t.match_status)};n.push(e.deleteUnusefulField(i))})),n},e.remapMarketsResultsMatchStatus=function(t){var e=new I.default;return t&&(e.type=t.type,e.subType=t.sub_type),e},e.remapMarketResult=function(t,e){return _.endMarkMarkets.includes(t)?e[0]:_.playerMarkets.includes(t)?e:"true"===e[0]||"false"!==e[0]&&void 0},e.deleteUnusefulField=function(t){return _.playerMarkets.includes(t.market)&&!e.isPlayerMarketWithNoResult(t.market,t.result)||delete t.playerModels,t},e.isPlayerMarketWithNoResult=function(t,e){return _.playerMarkets.includes(t)&&0===e.length},e.remapResults=function(t){var e=new c.default;return e.matchId=t.match_id,e.outcome=t.outcome,e},e.remapTiebreaker=function(t){var e=new p.default;return e.goldenGoal=t.golden_goal,e},e.remapTimeTiebreaker=function(t){var e=new y.default;return e.timeTiebreaker=t,e},e.remapRelated=function(t){return t.map((function(t){var e=new g.default;return e.entityId=t.entity_id,e.entityType=t.entity_type,e}))},e}return r(e,t),e}(s(n(6692)).default);e.default=M},8950:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(4916)),s=i(n(7640));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.status=null,this.outcome=null,this.predictionsCutoff=null,this.fixtures=[],this.tiebreaker=new r.default,this.predictionId=null,this.participantsCount=0,this.related=null,this.excludedProfileIds=null,this.rules=null,this.flags=null,this.points=null,this.createdAt=null,this.updatedAt=null,this.predictionsMadeAt=null,this.scheduleOpenAt=null,this.images=null,this.predictionTiebreaker=new s.default,this.branding=null}},7640:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.goldenGoal=null}},4916:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.timeTiebreaker=!1}},1784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.contestId="",this.contestType="GAME",this.contestModel=null,this.description="",this.userList=[]}},824:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.position="",this.profileId="",this.profileModel=null,this.note="",this.tags=[]}},3381:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.value=null,this.result=null}},1399:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(1465));e.default=function(t){var e=this;this.gameInstanceId=null,this.fixtures=[],this.tiebreaker=null,this.gameInstanceId=t.gameInstanceId,t.fixtures.forEach((function(t){return e.fixtures.push(new r.default(t.matchId,t.market,t.prediction.value))})),this.tiebreaker=t.tiebreaker?t.tiebreaker:null}},9596:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900)),o=s(n(9502));e.default=function(t){var e=this;this.topXFacade=null,this.idMapping=null,this.getConfig=function(){return i(e,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.topXFacade.getConfig()];case 1:return[2,t.sent()]}}))}))},this.getGames=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGames(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGameById(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGamePredictions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGamePredictions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getGameResults=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGameResults(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getCurrentGameResults=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getCurrentGameResults(t)];case 1:return[2,e.sent()]}}))}))},this.play=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.play(t)];case 1:return[2,e.sent()]}}))}))},this.delete=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.delete(t)];case 1:return[2,e.sent()]}}))}))},this.getMyGameEditions=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getMyGameEditions(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyGamePrediction=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getMyGamePrediction(t)];case 1:return[2,e.sent()]}}))}))},this.getUserGameEditions=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getUserGameEditions(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getUserGamePrediction=function(t,n,s){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getUserGamePrediction(t,n,s)];case 1:return[2,e.sent()]}}))}))},this.getMarketsResultsForGame=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getMarketsResultsForGame(t,n)];case 1:return[2,e.sent()]}}))}))},this.getGameWinners=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.topXFacade.getGameWinners(t,n)];case 1:return[2,e.sent()]}}))}))},this.idMapping=new a.default(t),this.topXFacade=new o.default(t,this.idMapping)}},7323:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(4800)),u=s(n(1613)),l=s(n(4790)),c=s(n(4874));e.default=function(t){var e=this;this.https=null,this.service=null,this.idSchema=null,this.getPolls=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s,o;return r(this,(function(r){switch(r.label){case 0:return t?(t=new l.default(t),[4,this.service.finalizePollsFilters(t)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[4,this.https.getPolls(t,n)];case 3:e=r.sent(),i=0,s=e.data,r.label=4;case 4:return i<s.length?(o=s[i],[4,this.service.remapTags(o,a.IdSchemaEnum.NATIVE,this.idSchema)]):[3,7];case 5:r.sent(),r.label=6;case 6:return i++,[3,4];case 7:return[2,e]}}))}))},this.getPollById=function(t,n){return i(e,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return[4,this.https.getPollById(t,n)];case 1:return e=i.sent(),[4,this.service.remapTags(e,a.IdSchemaEnum.NATIVE,this.idSchema)];case 2:return i.sent(),[2,e]}}))}))},this.voteForPoll=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.voteForPoll(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteVoteForPoll=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.https.deleteVoteForPoll(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPollVote=function(t,n){return i(e,void 0,void 0,(function(){var e,i,s;return r(this,(function(r){switch(r.label){case 0:return[4,this.https.getMyPollVote(t)];case 1:return e=r.sent(),n?[4,this.getPolls(new l.default({pollIds:[t]}),!0)]:[3,3];case 2:i=r.sent(),e.pollModel=i.data.find((function(e){return e.id===t}))||null,e.optionModel=(null===(s=i.data.find((function(e){return e.id===t})))||void 0===s?void 0:s.options.find((function(t){return t.id===e.optionId})))||null,r.label=3;case 3:return[2,e]}}))}))},this.getMyPollsVotes=function(t){return i(e,void 0,void 0,(function(){var e,n,i;return r(this,(function(r){switch(r.label){case 0:return t&&(t=new o.default(t)),[4,this.https.getMyPollsVotes(t)];case 1:return e=r.sent(),n=e.data.map((function(t){return t.id})),[4,this.getPolls(new l.default({pollIds:n}),!0)];case 2:return i=r.sent(),e.data=e.data.map((function(t){var e;return t.pollModel=i.data.find((function(e){return e.id===t.pollId}))||null,t.optionModel=(null===(e=t.pollModel)||void 0===e?void 0:e.options.find((function(e){return e.id===t.optionId})))||null,t})),[2,e]}}))}))},this.idSchema=t.idSchema,this.https=new u.default(t),this.service=new c.default(t)}},4790:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e){var n=t.call(this,e)||this;return n.flags=null,n.status=null,n.entityIds=null,n.entityType=null,n.pollIds=null,n.sortOrder=null,n.minVotes=null,n.flags=(null==e?void 0:e.flags)||null,n.status=(null==e?void 0:e.status)||null,n.entityIds=(null==e?void 0:e.entityIds)||null,n.entityType=(null==e?void 0:e.entityType)||null,n.pollIds=(null==e?void 0:e.pollIds)||null,n.sortOrder=(null==e?void 0:e.sortOrder)||null,n.minVotes=e&&void 0!==e.minVotes?e.minVotes:null,n}return r(e,t),e.prototype.constructMainFiltersUrl=function(){var e=t.prototype.constructMainFiltersUrl.call(this);return this.flags&&this.flags.length>0&&(e+="&flags=".concat(this.flags.join(","))),this.status&&(e+="&status=".concat(this.status)),this.entityIds&&this.entityIds.length>0&&(e+="&entity_ids=".concat(this.entityIds.join(","))),this.pollIds&&this.pollIds.length>0&&(e+="&poll_ids=".concat(this.pollIds.join(","))),this.sortOrder&&(e+="&sort_order=".concat(this.sortOrder)),this.minVotes&&(e+="&min_votes=".concat(this.minVotes)),e},e}(s(n(4800)).default);e.default=a},1770:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(439));e.default=function(){this.id=null,this.title=null,this.description=null,this.type=null,this.images=new r.default,this.status=null,this.totalVotes=null,this.flags=[],this.customFields=null,this.branding=null,this.embedCode=null,this.labels=null,this.adContent=null,this.context=null,this.options=[],this.createdAt=null,this.updatedAt=null}},1126:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rules=null,e}return r(e,t),e}(s(n(1770)).default);e.default=a},358:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){this.id=null,this.pollId=null,this.optionId=null,this.userId=null}},5390:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pollModel=null,e.optionModel=null,e}return r(e,t),e}(s(n(358)).default);e.default=a},1812:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},2160:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=i(n(8872));e.default=function(){this.meta=new r.default,this.data=[]}},6829:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8902)),o=s(n(6692)),u=s(n(2820)),l=s(n(7060)),c=s(n(1770)),d=s(n(1126)),h=s(n(358)),f=s(n(5390)),p=s(n(1812)),m=s(n(2160)),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.remapPolls=function(t){var n=new p.default;return n.meta.pagination=e.remapMetaPagination(t.meta.pagination),n.data=t.data.map((function(t){return e.remapPoll(t)})),n},e.remapPollById=function(t){var n=new d.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.flags=t.flags,n.totalVotes=t.total_votes,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.embedCode=t.embed_code,n.labels=t.labels,n.rules=t.rules,n.adContent=t.ad_content,n.options=t.options,n.context=t.context?e.remapContext(t.context):t.context,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapUserVote=function(t){var e=new h.default;return e.id=t.id,e.pollId=t.poll_id,e.optionId=t.option_id,e.userId=t.user_id,e},e.remapPollsVotes=function(t){var n=new m.default;return n.meta.pagination=e.remapMetaPagination(t.meta.pagination),n.data=t.data.map((function(t){return e.remapPollVote(t)})),n},e.remapPollVote=function(t){var e=new f.default;return e.id=t.id,e.pollId=t.poll_id,e.optionId=t.option_id,e.userId=t.user_id,e},e.remapMetaPagination=function(t){var e=new a.default;return e.itemsPerPage=t.items_per_page,e.nextPageStartsAfter=t.next_page_starts_after,e},e.remapPoll=function(t){var n=new c.default;return n.id=t.id,n.title=t.title,n.description=t.description,n.type=t.type,n.images=t.images,n.status=t.status,n.flags=t.flags,n.totalVotes=t.total_votes,n.customFields=t.custom_fields,n.branding=t.branding?e.remapBranding(t.branding):null,n.embedCode=t.embed_code,n.labels=t.labels,n.adContent=t.ad_content,n.options=t.options,n.context=t.context?e.remapContext(t.context):t.context,n.createdAt=t.created_at,n.updatedAt=t.updated_at,n},e.remapContext=function(t){var e=new u.default;return e.content=t.content,e.tags=t.tags?t.tags.map((function(t){var e=new l.default;return e.id=t.id,e.type=t.type,e.source=t.source,e})):null,e.campaign=t.campaign,e},e}return r(e,t),e}(o.default);e.default=v},4874:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(4946),o=s(n(8900)),u=s(n(8261)),l=s(n(9685));e.default=function(t){var e=this;this.idMappingService=null,this.idSchema=null,this.errorHandlingMode=null,this.validator=null,this.activityService=null,this.finalizePollsFilters=function(t){return i(e,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return this.idSchema!==a.IdSchemaEnum.NATIVE&&t.entityIds&&t.entityIds.length>0?(this.validator.validateFilters(t),[4,this.idMappingService.getEntityIdsBySchemaId(Array.from(t.entityIds),t.entityType,a.IdSchemaEnum.NATIVE)]):[3,2];case 1:e=n.sent(),t.entityIds=e[t.entityType],n.label=2;case 2:return[2]}}))}))},this.remapTags=function(t,n,s){return i(e,void 0,void 0,(function(){var e,i;return r(this,(function(r){switch(r.label){case 0:return this.idSchema!=a.IdSchemaEnum.NATIVE&&t.context&&t.context.tags&&t.context.tags.length?(e=JSON.parse(JSON.stringify(t.context.tags)),[4,this.activityService.remapTagsIds(e,n,s)]):[3,2];case 1:i=r.sent(),t.context.tags=i,r.label=2;case 2:return[2]}}))}))},this.idSchema=t.idSchema,this.errorHandlingMode=t.errorHandlingMode,this.idMappingService=new o.default(t),this.validator=new l.default(t),this.activityService=new u.default(t)}},3112:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(7323));e.default=function(t){var e=this;this.facade=null,this.getPolls=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPolls(t,n)];case 1:return[2,e.sent()]}}))}))},this.getPollById=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getPollById(t,n)];case 1:return[2,e.sent()]}}))}))},this.voteForPoll=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.voteForPoll(t,n)];case 1:return[2,e.sent()]}}))}))},this.deleteVoteForPoll=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.deleteVoteForPoll(t)];case 1:return[2,e.sent()]}}))}))},this.getMyPollVote=function(t,n){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyPollVote(t,n)];case 1:return[2,e.sent()]}}))}))},this.getMyPollsVotes=function(t){return i(e,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.facade.getMyPollsVotes(t)];case 1:return[2,e.sent()]}}))}))},this.facade=new a.default(t)}},4806:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},a=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(4946),l=n(817),c=n(5409),d=o(n(5156));e.default=function(t,e,n){var o=this;this.idMapping=null,this.idSchema=null,this.native=u.IdSchemaEnum.NATIVE,this.footballFacade=null,this.remapProfileStats=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o,u;return s(this,(function(s){switch(s.label){case 0:return t.predictions?(e=t.successRates,n=t.predictions,i={competition:this.getIdsKeys(e.byFootballCompetition,n.single.breakdown.footballCompetitions),team:this.getIdsKeys(e.byFootballTeam,n.single.breakdown.footballTeams)},Object.values(i.competition).length?(r=JSON.parse(JSON.stringify(t.successRates.byFootballCompetition)),[4,this.getEntitiesMap(i.competition,l.EntityTypeEnum.COMPETITION)]):[3,3]):[2,t];case 1:return o=s.sent(),[4,this.setSuccessRatesModels(r,o)];case 2:u=s.sent(),t.successRates.byFootballCompetition=u,n.single.breakdown.footballCompetitions=this.reconstructBreakdown(n.single.breakdown.footballCompetitions,o),s.label=3;case 3:return Object.values(i.team).length?(a=JSON.parse(JSON.stringify(t.successRates.byFootballTeam)),[4,this.getEntitiesMap(i.team,l.EntityTypeEnum.TEAM)]):[3,6];case 4:return o=s.sent(),[4,this.setSuccessRatesModels(a,o)];case 5:u=s.sent(),t.successRates.byFootballTeam=u,n.single.breakdown.footballTeams=this.reconstructBreakdown(n.single.breakdown.footballTeams,o),s.label=6;case 6:return[2,t]}}))}))},this.setSuccessRatesModels=function(t,e){return r(o,void 0,void 0,(function(){return s(this,(function(n){return[2,this.reconstructRecords(t,void 0,e)]}))}))},this.getEntitiesMap=function(t,e){return r(o,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:switch(e){case"competition":return[3,1];case"team":return[3,3]}return[3,5];case 1:return[4,this.footballFacade.getCompetitionsMapWithNativeIds(t)];case 2:case 4:return[2,n.sent()];case 3:return[4,this.footballFacade.getTeamsMapWithNativeIds(t)];case 5:return[2]}}))}))},this.reconstructRecords=function(t,e,n){return t&&Object.keys(t).length?(Object.keys(t).forEach((function(r){var s,a=n.get(r);(e=i(i({},e),((s={})[a.id]=t[r],s)))[a.id].model=a})),e):t},this.reconstructBreakdown=function(t,e){return t.length?t.map((function(t){var n=e.get(t.entityId);return t.entityId=n.id,t.model=n,t})):t},this.getIdsKeys=function(t,e){var n=Object.keys(t);if(e.length){var i=e.map((function(t){return t.entityId}));return Array.from(new Set(a(a([],n,!0),i,!0)))}return n},this.remapInterestsToIdSchema=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o,u,l,d,h,f,p;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native?[3,3]:t&&t.length>0?(e={},n={},i=t.filter((function(t){return t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL})),r=t.filter((function(t){return t.source.toLocaleUpperCase()!==c.SportSourceEnum.FOOTBALL})),i.forEach((function(t){e.hasOwnProperty(t.type)||(e[t.type]=[],n[t.type]=[]),e[t.type].push(t.id),n[t.type].push(t)})),[4,this.remapIdsObj(e,this.native,this.idSchema)]):[3,2];case 1:for(a=s.sent(),o=[],u=function(t,e){e.forEach((function(e,n){e.id=a[t][n],o.push(e)}))},l=0,d=Object.entries(n);l<d.length;l++)h=d[l],f=h[0],p=h[1],u(f,p);return[2,o.concat(r)];case 2:case 3:return[2,t]}}))}))},this.remapInterestToNative=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r;return s(this,(function(s){switch(s.label){case 0:return this.idSchema===this.native||t.source.toLocaleUpperCase()!==c.SportSourceEnum.FOOTBALL?[3,2]:(e={},n=t.id,i=t.type,e[i]=[n],[4,this.remapIdsObj(e,this.idSchema,this.native)]);case 1:return r=s.sent(),t.id=r[i][0],[2,t];case 2:return[2,t]}}))}))},this.inquiryCustomInterests=function(t,e){var n=[];return t&&t.length>0&&(n=t.filter((function(t){return t.source.toLocaleUpperCase()===c.SportSourceEnum.CUSTOM})),e)?n.map((function(t){var e=new d.default;return e.id=t.id,e.type=t.type,e.source=t.source,e.favourite=t.favourite,e})):n},this.remapInterests=function(t){return r(o,void 0,void 0,(function(){var e,n,i;return s(this,(function(r){switch(r.label){case 0:return(e=this.inquiryCustomInterests(t,!1))&&e.length>0?(n=t.filter((function(t){return t.source.toLocaleUpperCase()!==c.SportSourceEnum.CUSTOM})),[4,this.remapInterestsToIdSchema(n)]):[3,2];case 1:return i=r.sent(),e.forEach((function(t){return i.push(t)})),[2,i];case 2:return[4,this.remapInterestsToIdSchema(t)];case 3:return[2,r.sent()]}}))}))},this.showFullInterests=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o,u,d;return s(this,(function(s){switch(s.label){case 0:return e=[],t&&t.length>0?(n=this.inquiryCustomInterests(t,!0),e.push(n),i=t.filter((function(t){return t.source.toLocaleUpperCase()!==c.SportSourceEnum.CUSTOM})),[4,this.getInterestsEntitiesMap(i)]):[3,2];case 1:return r=s.sent(),a=r.competitionsMap,o=r.teamsMap,u=r.playersMap,d=i.map((function(t){var e=null;return t.source.toLocaleUpperCase()!==c.SportSourceEnum.FOOTBALL?(t.model=e,t):t.type===l.EntityTypeEnum.COMPETITION?((e=a.get(t.id))&&(t.id=e.id),t.model=e,t):t.type===l.EntityTypeEnum.TEAM?((e=o.get(t.id))&&(t.id=e.id),t.model=e,t):t.type===l.EntityTypeEnum.PLAYER?(u?(t.model=u[t.id],t.id=u[t.id].id):t.model=e,t):void 0})),e.push(d),[2,e.flat()];case 2:return[2,e]}}))}))},this.getInterestsEntitiesMap=function(t){return r(o,void 0,void 0,(function(){var e,n,i,r,a,o;return s(this,(function(s){switch(s.label){case 0:return e=[],n=[],i=[],r=new Map,a=new Map,o=null,t.forEach((function(t){t.type===l.EntityTypeEnum.COMPETITION&&t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL?e.push(t.id):t.type===l.EntityTypeEnum.TEAM&&t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL?n.push(t.id):t.type===l.EntityTypeEnum.PLAYER&&t.source.toLocaleUpperCase()===c.SportSourceEnum.FOOTBALL&&i.push(t.id)})),e.length?[4,this.footballFacade.getCompetitionsMapWithNativeIds(e)]:[3,2];case 1:r=s.sent(),s.label=2;case 2:return n.length?[4,this.footballFacade.getTeamsMapWithNativeIds(n)]:[3,4];case 3:a=s.sent(),s.label=4;case 4:return i.length?[4,this.footballFacade.getPlayersMapWithNativeIds(i)]:[3,6];case 5:o=s.sent(),s.label=6;case 6:return[2,{competitionsMap:r,teamsMap:a,playersMap:o}]}}))}))},this.remapIdsObj=function(t,e,n){return r(o,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this.idMapping.idMappingFacade.getEntitiesByIds(t,e,n)];case 1:return[2,i.sent()]}}))}))},this.idMapping=n,this.idSchema=t.idSchema,this.footballFacade=e}},4912:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{u(i.next(t))}catch(t){s(t)}}function o(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(n(8900)),o=s(n(4806));e.default=function(t,e){var n=this;this.idMapping=null,this.profileOperations=null,this.remapProfileStats=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.remapProfileStats(t)];case 1:return[2,e.sent()]}}))}))},this.remapInterestToNative=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.remapInterestToNative(t)];case 1:return[2,e.sent()]}}))}))},this.remapInterests=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.remapInterests(t)];case 1:return[2,e.sent()]}}))}))},this.showFullInterests=function(t){return i(n,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.profileOperations.showFullInterests(t)];case 1:return[2,e.sent()]}}))}))},this.idMapping=new a.default(t),this.profileOperations=new o.default(t,e,this.idMapping)}},3607:function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FansUnitedSDK=void 0;var s=r(n(6409)),a=r(n(6595)),o=r(n(8808)),u=n(4946),l=r(n(1259)),c=r(n(2962)),d=n(9627),h=n(2671),f=n(9377),p=r(n(9596)),m=r(n(267)),v=r(n(7302)),_=n(2141),y=r(n(7070)),g=n(9580),b=r(n(1550)),w=r(n(244)),I=r(n(3281)),E=r(n(4068)),M=r(n(1267)),O=r(n(3112)),P=r(n(6139)),T=null,S=null;e.FansUnitedSDK=function(t){if(A(t)){var e=C(t);if(e.isValid)return T={profile:new s.default(t),football:new o.default(t),predictor:new l.default(t),loyalty:new c.default(t),topX:new p.default(t),matchQuiz:new m.default(t),activity:new v.default(t),miniGames:new b.default(t),discussions:new w.default(t),privateLeagues:new I.default(t),challenges:new E.default(t),progress:new M.default,voting:new O.default(t),fantasy:new P.default(t)},S=i({},t),T;R(e)}return T};var A=function(t){return!T||JSON.stringify(t)!==JSON.stringify(S)||t.authProvider.getIdToken()!==S.authProvider.getIdToken()},C=function(t){var e=(new a.default).validate(t);return e.idSchema.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.idSchema.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.idSchema.message.text),t.idSchema=u.IdSchemaEnum.NATIVE),e.environment.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.environment.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.environment.message.text),t.environment=h.EnvironmentEnum.PROD),e.lang.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.lang.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.lang.message.text),t.lang=f.LangEnum.EN),e.errorHandlingMode.validation!==d.ValidationResponseEnum.MISSING_VALUE&&e.errorHandlingMode.validation!==d.ValidationResponseEnum.INVALID_VALUE||(console.warn(e.errorHandlingMode.message.text),t.errorHandlingMode=g.ErrorHandlingModeEnum.DEFAULT),e.authProvider.validation===d.ValidationResponseEnum.INVALID_VALUE&&console.warn(e.authProvider.message.text),e},R=function(t){var e="authProvider",n="isValid";Object.keys(t).forEach((function(i){var r=t[i];if(i!==n&&i!==e){if(r.message.type===_.LogEnum.ERROR)throw new Error(r.message.text)}else i!==n&&i===e&&Object.keys(new y.default).forEach((function(t){if(r[t].message.type===_.LogEnum.ERROR)throw new Error(r[t].message.text)}))}))}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}return n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(3607)})()));
2
2
  //# sourceMappingURL=index.js.map