@everymatrix/player-account-balance-modal-nd 1.83.10 → 1.83.11

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.
@@ -5265,7 +5265,7 @@ function ca(e) {
5265
5265
  function ha(e, t, r) {
5266
5266
  let n;
5267
5267
  Hn(e, $o, (c) => r(7, n = c));
5268
- let { userid: i = "" } = t, { session: o = "" } = t, { endpoint: s = "" } = t, { lang: a = "en" } = t, { mbsource: l } = t, { clientstyling: u = "" } = t, { clientstylingurl: f = "" } = t, { translationurl: m = "" } = t, { gmversion: p = "gm16" } = t, { displaybalanceoption: w = "All" } = t, { totalcalculationmode: _ = "totalCashAmount" } = t, { balancelimitsbutton: S = "false" } = t, { hideproducttype: I } = t, { currencylocale: re = "en" } = t, { currencydisplay: ie = "symbol" } = t, { maximumfractiondigits: R = "2" } = t, { minimumfractiondigits: k = "0" } = t, { customdisplayformat: q = "" } = t, Z, ne = !0, le = !1, j = !1, $ = !1, N = !1, Y = window.navigator.userAgent, U, ce = "", be = [], Se;
5268
+ let { userid: i = "" } = t, { session: o = "" } = t, { endpoint: s = "" } = t, { lang: a = "en" } = t, { mbsource: l = "" } = t, { clientstyling: u = "" } = t, { clientstylingurl: f = "" } = t, { translationurl: m = "" } = t, { gmversion: p = "gm16" } = t, { displaybalanceoption: w = "All" } = t, { totalcalculationmode: _ = "totalCashAmount" } = t, { balancelimitsbutton: S = "false" } = t, { hideproducttype: I = "" } = t, { currencylocale: re = "en" } = t, { currencydisplay: ie = "symbol" } = t, { maximumfractiondigits: R = "2" } = t, { minimumfractiondigits: k = "0" } = t, { customdisplayformat: q = "" } = t, Z, ne = !0, le = !1, j = !1, $ = !1, N = !1, Y = window.navigator.userAgent, U, ce = "", be = [], Se;
5269
5269
  const E = {}, de = ["totalCashAmount", "totalRealAmount"], Pe = () => {
5270
5270
  fetch(m).then((c) => c.json()).then((c) => Object.keys(c).forEach((g) => Cr(g, c[g]))).catch((c) => console.log(c));
5271
5271
  };
@@ -5431,7 +5431,7 @@ function ha(e, t, r) {
5431
5431
  De();
5432
5432
  for (const [H, F] of Object.entries(E))
5433
5433
  F.length < 1 && delete E[H];
5434
- r(3, ne = !1);
5434
+ window.postMessage({ type: "playerBalanceInfo", balance: d }, window.location.href), r(3, ne = !1);
5435
5435
  }).catch((d) => {
5436
5436
  throw r(3, ne = !1), console.log("Balance fetch error", d), new Error("Failed to fetch balance data!");
5437
5437
  });
@@ -5302,7 +5302,7 @@ function xa(e) {
5302
5302
  function wa(e, t, n) {
5303
5303
  let r;
5304
5304
  jr(e, ta, (c) => n(7, r = c));
5305
- let { userid: i = "" } = t, { session: o = "" } = t, { endpoint: a = "" } = t, { lang: s = "en" } = t, { mbsource: l } = t, { clientstyling: u = "" } = t, { clientstylingurl: f = "" } = t, { translationurl: m = "" } = t, { gmversion: p = "gm16" } = t, { displaybalanceoption: w = "All" } = t, { totalcalculationmode: _ = "totalCashAmount" } = t, { balancelimitsbutton: S = "false" } = t, { hideproducttype: D } = t, { currencylocale: ne = "en" } = t, { currencydisplay: ie = "symbol" } = t, { maximumfractiondigits: N = "2" } = t, { minimumfractiondigits: j = "0" } = t, { customdisplayformat: q = "" } = t, Z, re = !0, le = !1, k = !1, $ = !1, I = !1, Y = window.navigator.userAgent, U, ce = "", ge = [], Be;
5305
+ let { userid: i = "" } = t, { session: o = "" } = t, { endpoint: a = "" } = t, { lang: s = "en" } = t, { mbsource: l = "" } = t, { clientstyling: u = "" } = t, { clientstylingurl: f = "" } = t, { translationurl: m = "" } = t, { gmversion: p = "gm16" } = t, { displaybalanceoption: w = "All" } = t, { totalcalculationmode: _ = "totalCashAmount" } = t, { balancelimitsbutton: S = "false" } = t, { hideproducttype: D = "" } = t, { currencylocale: ne = "en" } = t, { currencydisplay: ie = "symbol" } = t, { maximumfractiondigits: N = "2" } = t, { minimumfractiondigits: j = "0" } = t, { customdisplayformat: q = "" } = t, Z, re = !0, le = !1, k = !1, $ = !1, I = !1, Y = window.navigator.userAgent, U, ce = "", ge = [], Be;
5306
5306
  const E = {}, de = ["totalCashAmount", "totalRealAmount"], Pe = () => {
5307
5307
  fetch(m).then((c) => c.json()).then((c) => Object.keys(c).forEach((g) => In(g, c[g]))).catch((c) => console.log(c));
5308
5308
  };
@@ -5469,7 +5469,7 @@ function wa(e, t, n) {
5469
5469
  Ue();
5470
5470
  for (const [T, F] of Object.entries(E))
5471
5471
  F.length < 1 && delete E[T];
5472
- n(3, re = !1);
5472
+ window.postMessage({ type: "playerBalanceInfo", balance: d }, window.location.href), n(3, re = !1);
5473
5473
  }).catch((d) => {
5474
5474
  throw n(3, re = !1), console.log("Balance fetch error", d), new Error("Failed to fetch balance data!");
5475
5475
  });
@@ -21,4 +21,4 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
21
  PERFORMANCE OF THIS SOFTWARE.
22
22
  ***************************************************************************** */var ln=function(e,t){return ln=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},ln(e,t)};function lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ln(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function cn(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function fn(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||t)}function Oe(e){return typeof e=="function"}function Ar(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Zt=Ar(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
23
23
  `+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
24
- `):"",this.name="UnsubscriptionError",this.errors=n}});function dn(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ct=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=cn(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(S){t={error:S}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var f=this.initialTeardown;if(Oe(f))try{f()}catch(S){o=S instanceof Zt?S.errors:[S]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var p=cn(m),w=p.next();!w.done;w=p.next()){var _=w.value;try{Un(_)}catch(S){o=o!=null?o:[],S instanceof Zt?o=fn(fn([],hn(o)),hn(S.errors)):o.push(S)}}}catch(S){r={error:S}}finally{try{w&&!w.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}if(o)throw new Zt(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Un(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&dn(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&dn(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Cr=Ct.EMPTY;function Hr(e){return e instanceof Ct||e&&"closed"in e&&Oe(e.remove)&&Oe(e.add)&&Oe(e.unsubscribe)}function Un(e){Oe(e)?e():e.unsubscribe()}var oa={Promise:void 0},aa={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,fn([e,t],hn(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function sa(e){aa.setTimeout(function(){throw e})}function Fn(){}function yt(e){e()}var Or=function(e){lt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Hr(n)&&n.add(r)):r.destination=ca,r}return t.create=function(n,r,i){return new pn(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ct),ua=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){pt(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){pt(r)}else pt(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){pt(n)}},e}(),pn=function(e){lt(t,e);function t(n,r,i){var o=e.call(this)||this,a;return Oe(n)||!n?a={next:n!=null?n:void 0,error:r!=null?r:void 0,complete:i!=null?i:void 0}:a=n,o.destination=new ua(a),o}return t}(Or);function pt(e){sa(e)}function la(e){throw e}var ca={closed:!0,next:Fn,error:la,complete:Fn},ha=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function fa(e){return e}function da(e){return e.length===0?fa:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var Gn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=ma(t)?t:new pn(t,n,r);return yt(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=jn(n),new n(function(i,o){var a=new pn({next:function(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[ha]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return da(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=jn(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function jn(e){var t;return(t=e!=null?e:oa.Promise)!==null&&t!==void 0?t:Promise}function pa(e){return e&&Oe(e.next)&&Oe(e.error)&&Oe(e.complete)}function ma(e){return e&&e instanceof Or||pa(e)&&Hr(e)}var ba=Ar(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Lr=function(e){lt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new kn(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new ba},t.prototype.next=function(n){var r=this;yt(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=cn(r.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;yt(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;yt(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Cr:(this.currentObservers=null,s.push(n),new Ct(function(){r.currentObservers=null,dn(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new Gn;return n.source=this,n},t.create=function(n,r){return new kn(n,r)},t}(Gn),kn=function(e){lt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Cr},t}(Lr),Mr={now:function(){return(Mr.delegate||Date).now()},delegate:void 0},ga=function(e){lt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Mr);var o=e.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},t.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var l=i.now(),u=0,f=1;f<o.length&&o[f]<=l;f+=2)u=f;u&&o.splice(0,u+1)}},t}(Lr);const $n=[],Vn={},ya=(e,t=0)=>{if($n.indexOf(e)==-1){const n=new ga(t);Vn[e]=n,$n.push(e)}return Vn[e]};window.emWidgets={topic:ya};const va=e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));function _a(e){$r(e,"svelte-15fwckg",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}@keyframes growWidthPercent{from{height:0}to{height:100%}}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;background:transparent;border:none;font:inherit;color:inherit;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px;fill:black}.ShowBalance .BalanceValue span{padding-left:5px}.ShowBalance .BalanceValue .TriangleActive,.ShowBalance .BalanceValue .TriangleInactive{display:block;margin:0 3px;transition:all 0.2s}.ShowBalance .BalanceValue .TriangleActive:hover,.ShowBalance .BalanceValue .TriangleInactive:hover{transform:scale(1.2)}.ShowBalance .BalanceValue .TriangleActive svg,.ShowBalance .BalanceValue .TriangleInactive svg{margin:2px 0px}.ShowBalance .BalanceValue .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px)}.ShowBalance .BalanceValue .TriangleActive:hover{transform:scale(1.1) rotateX(180deg) translateY(3px)}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);position:absolute;top:40px;padding:10px;transform:translateX(-45%);box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919;transition:all 0.2s ease-in;opacity:0}.BalanceModalWrapper:before{content:"";background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:50%;width:25px;height:10px;z-index:1}.BalanceModalWrapper.Open{opacity:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;transition:all 0.3s ease;background:transparent;border:none;font:inherit;opacity:0}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModalClose:hover{transform:scale(1.1)}.BalanceModalClose.Open{opacity:1}.BalanceModal{transition:all 0.2s ease-in;width:270px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, white));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px;gap:5px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--color-primary);font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:30px;border:none;padding:10px 0;cursor:pointer;transition:all 0.2s ease-in;box-shadow:0px 3px 7px 0px rgba(0, 0, 0, 0.2)}.BalanceModalFooter .BalanceModalAction:hover{background:rgba(255, 255, 255, 0.1);color:var(--emw--color-primary);box-shadow:0px 0px 0px 2px inset var(--emw--color-primary);font-size:14px}.BalanceModalFooter .BalanceModalAction:active{background:rgba(255, 255, 255, 0.5)}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16;opacity:0;transition:all 0.2s linear}.ShowBalanceModalOverlay.Open{opacity:1}')}function Xn(e,t,n){const r=e.slice();return r[58]=t[n],r}function zn(e,t,n){const r=e.slice();return r[61]=t[n],r}function Ea(e){let t,n,r=(e[2].Total?e[9](e[2].Total[0].amount):"0")+"",i,o,a,s,l,u,f,m,p,w,_=e[5]&&Wn(e);return{c(){t=X("button"),n=X("p"),i=Se(r),o=we(),a=X("span"),s=En("svg"),l=En("path"),f=we(),_&&_.c(),m=zr(),L(l,"id","arrow"),L(l,"d","M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z"),L(l,"transform","translate(-274.511 -441.088)"),L(l,"fill","#d1d1d1"),L(s,"xmlns","http://www.w3.org/2000/svg"),L(s,"width","14"),L(s,"height","6.835"),L(s,"viewBox","0 0 14 6.835"),L(a,"class",u=e[4]?"TriangleActive":"TriangleInactive"),L(t,"class","BalanceValue")},m(S,D){ye(S,t,D),R(t,n),R(n,i),R(t,o),R(t,a),R(a,s),R(s,l),ye(S,f,D),_&&_.m(S,D),ye(S,m,D),p||(w=it(t,"click",e[29]),p=!0)},p(S,D){D[0]&4&&r!==(r=(S[2].Total?S[9](S[2].Total[0].amount):"0")+"")&&Pe(i,r),D[0]&16&&u!==(u=S[4]?"TriangleActive":"TriangleInactive")&&L(a,"class",u),S[5]?_?_.p(S,D):(_=Wn(S),_.c(),_.m(m.parentNode,m)):_&&(_.d(1),_=null)},d(S){S&&(be(t),be(f),be(m)),_&&_.d(S),p=!1,w()}}}function xa(e){let t,n=e[7]("Loading")+"",r;return{c(){t=X("p"),r=Se(n),L(t,"class","Loading")},m(i,o){ye(i,t,o),R(t,r)},p(i,o){o[0]&128&&n!==(n=i[7]("Loading")+"")&&Pe(r,n)},d(i){i&&be(t)}}}function Wn(e){let t,n,r,i,o,a,s,l,u=e[7]("Title")+"",f,m,p,w,_,S,D=e[7]("DepositButton")+"",ne,ie,N,j,q,Z,re,le=vt(Object.keys(e[2])),k=[];for(let I=0;I<le.length;I+=1)k[I]=qn(Xn(e,le,I));let $=e[0]==="true"&&Yn(e);return{c(){t=X("div"),n=X("button"),i=we(),o=X("div"),a=X("div"),s=X("div"),l=X("p"),f=Se(u),m=we(),p=X("div");for(let I=0;I<k.length;I+=1)k[I].c();w=we(),_=X("div"),S=X("button"),ne=Se(D),ie=we(),$&&$.c(),L(n,"class",r="BalanceModalClose "+(e[4]?"Open":"")),L(l,"class","BalanceModalTitle"),L(s,"class","BalanceModalHeader"),L(p,"class","BalanceModalBody"),L(S,"class","BalanceModalAction DepositButton"),L(_,"class","BalanceModalFooter"),L(a,"class",N="ModalContent "+(e[4]?"Open":"")),L(o,"class",j="BalanceModal "+(e[4]?"Open":"")),L(t,"class",q="BalanceModalWrapper "+(e[4]?"Open":""))},m(I,Y){ye(I,t,Y),R(t,n),R(t,i),R(t,o),R(o,a),R(a,s),R(s,l),R(l,f),R(a,m),R(a,p);for(let U=0;U<k.length;U+=1)k[U]&&k[U].m(p,null);R(a,w),R(a,_),R(_,S),R(S,ne),R(_,ie),$&&$.m(_,null),Z||(re=[it(n,"click",e[30]),it(S,"click",e[31])],Z=!0)},p(I,Y){if(Y[0]&16&&r!==(r="BalanceModalClose "+(I[4]?"Open":""))&&L(n,"class",r),Y[0]&128&&u!==(u=I[7]("Title")+"")&&Pe(f,u),Y[0]&2692){le=vt(Object.keys(I[2]));let U;for(U=0;U<le.length;U+=1){const ce=Xn(I,le,U);k[U]?k[U].p(ce,Y):(k[U]=qn(ce),k[U].c(),k[U].m(p,null))}for(;U<k.length;U+=1)k[U].d(1);k.length=le.length}Y[0]&128&&D!==(D=I[7]("DepositButton")+"")&&Pe(ne,D),I[0]==="true"?$?$.p(I,Y):($=Yn(I),$.c(),$.m(_,null)):$&&($.d(1),$=null),Y[0]&16&&N!==(N="ModalContent "+(I[4]?"Open":""))&&L(a,"class",N),Y[0]&16&&j!==(j="BalanceModal "+(I[4]?"Open":""))&&L(o,"class",j),Y[0]&16&&q!==(q="BalanceModalWrapper "+(I[4]?"Open":""))&&L(t,"class",q)},d(I){I&&be(t),tr(k,I),$&&$.d(),Z=!1,Ze(re)}}}function Zn(e){let t,n,r=e[7](e[58])+"",i,o,a=e[11](e[61])+"",s,l,u,f,m=e[9](e[61].amount)+"",p;return{c(){t=X("div"),n=X("p"),i=Se(r),o=we(),s=Se(a),l=we(),u=X("p"),f=X("span"),p=Se(m),L(n,"class","BalanceModalText"),L(f,"class","BalanceModalAmount"),L(u,"class","BalanceModalValue"),L(t,"class","BalanceModalRowLine")},m(w,_){ye(w,t,_),R(t,n),R(n,i),R(n,o),R(n,s),R(t,l),R(t,u),R(u,f),R(f,p)},p(w,_){_[0]&132&&r!==(r=w[7](w[58])+"")&&Pe(i,r),_[0]&4&&a!==(a=w[11](w[61])+"")&&Pe(s,a),_[0]&4&&m!==(m=w[9](w[61].amount)+"")&&Pe(p,m)},d(w){w&&be(t)}}}function qn(e){let t,n,r=vt(e[2][e[58]]),i=[];for(let o=0;o<r.length;o+=1)i[o]=Zn(zn(e,r,o));return{c(){t=X("div");for(let o=0;o<i.length;o+=1)i[o].c();n=we(),L(t,"class","BalanceModalRowBoth")},m(o,a){ye(o,t,a);for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(t,null);R(t,n)},p(o,a){if(a[0]&2692){r=vt(o[2][o[58]]);let s;for(s=0;s<r.length;s+=1){const l=zn(o,r,s);i[s]?i[s].p(l,a):(i[s]=Zn(l),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(o){o&&be(t),tr(i,o)}}}function Yn(e){let t,n=e[7]("LimitsButton")+"",r,i,o;return{c(){t=X("button"),r=Se(n),L(t,"class","BalanceModalAction LimitsButton")},m(a,s){ye(a,t,s),R(t,r),i||(o=it(t,"click",e[32]),i=!0)},p(a,s){s[0]&128&&n!==(n=a[7]("LimitsButton")+"")&&Pe(r,n)},d(a){a&&be(t),i=!1,o()}}}function Qn(e){let t,n,r;return{c(){t=X("button"),L(t,"class","ShowBalanceModalOverlay")},m(i,o){ye(i,t,o),n||(r=it(t,"click",e[33]),n=!0)},p:me,d(i){i&&be(t),n=!1,r()}}}function wa(e){let t,n,r,i;function o(u,f){return u[3]?xa:Ea}let a=o(e),s=a(e),l=e[5]&&Qn(e);return{c(){t=X("div"),n=X("div"),s.c(),i=we(),l&&l.c(),L(n,"class",r="ShowBalance "+(e[6]?"Mobile":""))},m(u,f){ye(u,t,f),R(t,n),s.m(n,null),R(t,i),l&&l.m(t,null),e[34](t)},p(u,f){a===(a=o(u))&&s?s.p(u,f):(s.d(1),s=a(u),s&&(s.c(),s.m(n,null))),f[0]&64&&r!==(r="ShowBalance "+(u[6]?"Mobile":""))&&L(n,"class",r),u[5]?l?l.p(u,f):(l=Qn(u),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i:me,o:me,d(u){u&&be(t),s.d(),l&&l.d(),e[34](null)}}}function Sa(e,t,n){let r;kr(e,na,c=>n(7,r=c));let{userid:i=""}=t,{session:o=""}=t,{endpoint:a=""}=t,{lang:s="en"}=t,{mbsource:l}=t,{clientstyling:u=""}=t,{clientstylingurl:f=""}=t,{translationurl:m=""}=t,{gmversion:p="gm16"}=t,{displaybalanceoption:w="All"}=t,{totalcalculationmode:_="totalCashAmount"}=t,{balancelimitsbutton:S="false"}=t,{hideproducttype:D}=t,{currencylocale:ne="en"}=t,{currencydisplay:ie="symbol"}=t,{maximumfractiondigits:N="2"}=t,{minimumfractiondigits:j="0"}=t,{customdisplayformat:q=""}=t,Z,re=!0,le=!1,k=!1,$=!1,I=!1,Y=window.navigator.userAgent,U,ce="",ge=[],Be;const E={},de=["totalCashAmount","totalRealAmount"],Re=()=>{fetch(m).then(c=>c.json()).then(c=>Object.keys(c).forEach(g=>In(g,c[g]))).catch(c=>console.log(c))};Object.keys(Dn).forEach(c=>In(c,Dn[c]));const ve=c=>{switch(c){case"balance":window.postMessage({type:"BalanceModalStatus",status:"open"},window.location.href),n(5,$=!0),setTimeout(()=>n(4,le=!0),150);break;case"closebalance":n(4,le=!1),window.postMessage({type:"BalanceModalStatus",status:"close"},window.location.href),setTimeout(()=>{n(5,$=!1)},150);break}},_e=c=>{if(q)return Je(c);const g=ne||s,v={style:"currency",currency:ce,useGrouping:!0,currencyDisplay:ie||"code",maximumFractionDigits:N===""||isNaN(Number(N))?2:Number(N),minimumFractionDigits:j===""||isNaN(Number(j))?0:Number(j)};return new Intl.NumberFormat(g,v).format(c)},Je=c=>{const g=[];let v="";for(const d of q)switch(d){default:v+=d;break;case"{":v&&g.push(v),v="";break;case"}":const[A,M]=v.split("|");if(v="",A.toLowerCase()==="currency")v=ce;else if(A.toLowerCase()==="amount"){let T=",",F=".",z=2;M&&(M[0]!==" "&&(T=M[0]),M[1]!==" "&&(F=M[1]),M[2]!==" "&&!isNaN(Number(M[2]))&&(z=Number(M[2])));let[ee,Te]=String(Math.floor(c*Dt(10,z))/Dt(10,z)).split(".");v+=ee[0];for(let Ee=1;Ee<ee.length;++Ee)(ee.length-Ee)%3===0?v+=T+ee[Ee]:v+=ee[Ee];Te&&(v+=F+Te)}v&&g.push(v),v="";break}return g.push(v),g.join("")},ct=()=>Gt(this,null,function*(){var g,v,d;n(3,re=!0);const c=new URL(`${a}/v1/player/${i}/account`);try{const A=yield fetch(c,{method:"GET",headers:{"X-SessionID":o}}),M=yield A.json();if(A.ok)window.postMessage({type:"BalancedFetched"},window.location.href),ge=M.items,ce=(g=ge.find(T=>T.displayName==="Casino"))==null?void 0:g.currency,n(2,E.Total=[{amount:M.totalAmount[ce]}],E),n(2,E.Real=[{amount:(v=ge.find(T=>T.displayName==="Casino"))==null?void 0:v.balanceAmount}],E),n(2,E.Bonus=[{amount:(d=ge.find(T=>T.displayName==="UBS"))==null?void 0:d.balanceAmount}],E);else throw new Error("Failed to fetch balance data !")}catch(A){console.log("Balance error: ",A)}finally{n(3,re=!1)}}),Ht=()=>{n(3,re=!0);const c=new URL(`${a}/v2/player/${i}/balance`),g=new Headers;g.append("X-SessionID",o),fetch(c,{method:"GET",headers:g}).then(d=>d.json()).then(d=>{d[_]||n(12,_=de[0]);const A=d.items.find(T=>T.type==="Real"&&T.walletAccountType==="Ordinary");if(ce=A.currency,k=!!A.productType,n(2,E.Total=[{amount:0}],E),n(2,E.Real=[],E),n(2,E.Bonus=[],E),n(2,E.Credit=[],E),!k){Be={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},n(2,E.Total[0].amount=d[_][ce],E);for(const T of d.items)switch(T.type){case"Bonus":E.Bonus.length===0?E.Bonus.push({amount:T.amount}):n(2,E.Bonus[0].amount+=T.amount,E);break;case"Real":if(T.creditLine&&E.Credit.length===0&&E.Credit.push({amount:T.creditLine}),_==="totalRealAmount")continue;E.Real.length===0?E.Real.push({amount:T.amount}):n(2,E.Real[0].amount+=T.amount,E);break}for(const[T,F]of Object.entries(E))F.length<1&&delete E[T];n(3,re=!1);return}Be={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let M=d.items;w&&w!=="All"&&(M=d.items.filter(T=>T.productType===w));for(const T of M){let F;switch(T.type){case"Bonus":F=E.Bonus.findIndex(z=>z.productType===T.productType),F>0?n(2,E.Bonus[F].amount+=T.amount,E):E.Bonus.push({amount:T.amount,productType:T.productType});break;case"Real":T.creditLine&&E.Credit.push({amount:T.creditLine,productType:T.productType}),F=E.Real.findIndex(z=>z.productType===T.productType),F>0?n(2,E.Real[F].amount+=T.amount,E):E.Real.push({amount:T.amount,productType:T.productType});break}}Ue();for(const[T,F]of Object.entries(E))F.length<1&&delete E[T];n(3,re=!1)}).catch(d=>{throw n(3,re=!1),console.log("Balance fetch error",d),new Error("Failed to fetch balance data!")})},Ke=()=>{if(U&&U.close(),o.length<1)return;let c,g;switch(p){case"gm16":c=new URL(`${a}/v2/player/${i}/information/updates`),g=A=>Le(A);break;case"gmcore":c=new URL(`${a}/v1/player/${i}/balance/updates`),g=A=>Ot(A);break}const v={accept:"text/event-stream","X-SessionId":o},d=new ia.EventSourcePolyfill(c,{headers:v});U=d,d.addEventListener("message",g)},ht=c=>{let g;try{g=JSON.parse(c)}catch(v){console.log("Balance stream failed: ",v);return}return g},Ot=c=>{var A,M;const g=ht(c.data);if(!g){Ke();return}let v="0";const d=g.balanceChange;ge=ge.map(T=>(d&&d[T.id]&&(T=Ft(Ut({},T),{balanceAmount:d[T.id].afterAmount})),v=(parseFloat(T==null?void 0:T.balanceAmount)+parseFloat(v)).toString(),T)),n(2,E.Real=[{amount:(A=ge[0])==null?void 0:A.balanceAmount}],E),n(2,E.Bonus=[{amount:(M=ge[1])==null?void 0:M.balanceAmount}],E),n(2,E.Total=[{amount:Number(v)}],E)},Ne=(c,g,v)=>{let d=null;switch(v.walletAccountType){case"Ordinary":(v.afterAmount!==v.affectedAmount||g.lastOrdinaryAfterAmount===0)&&(g.lastOrdinaryAfterAmount=v.afterAmount,g.showCreditLineAfterAmount||(d=v.afterAmount));break;case"CreditLine":v.afterAmount!==0?(d=v.afterAmount,g.showCreditLineAfterAmount=!0):(d=g.lastOrdinaryAfterAmount,g.showCreditLineAfterAmount=!1);break;default:d=v.afterAmount}return d===null?c:d},Ue=()=>{switch(_){case"totalCashAmount":let c=0;for(const v of["Real","Bonus"])for(const d of E[v])c+=Math.max(d.amount,0);n(2,E.Total[0].amount=c,E);break;case"totalRealAmount":if(!k)return;let g=0;for(const v of E.Real)g+=v.amount;n(2,E.Total[0].amount=g,E)}},Le=c=>{const g=ht(c.data);if(!g){Ke();return}if(Lt(g==null?void 0:g.type)||g.type!=="BALANCE_UPDATE_V2")return;const v=g.body.balanceChange;for(const[d,A]of Object.entries(v))if(_==="totalRealAmount"&&d==="Real"&&!k&&n(2,E.Total[0].amount=Ne(E.Total[0].amount,Be,A),E),!!E[d])for(const M of E[d]){if(!k){M.amount=d==="Real"?Ne(M.amount,Be,A):A.afterAmount;continue}A.productType===M.productType&&(M.amount=d==="Real"?Ne(M.amount,Be[M.productType],A):A.afterAmount)}Ue()},oe=c=>{switch(ve("closebalance"),c){case"deposit":window.postMessage({type:"GoToDeposit"},window.location.href);break;case"limits":window.postMessage({type:"GoToLimits"},window.location.href);break}typeof gtag=="function"&&gtag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},Lt=c=>c==="SESSION_EXPIRATION"?(window.postMessage({type:"SessionExpiration"},window.location.href),!0):!1,Mt=()=>{de.includes(_)||(console.error(`Unsupported value ('${_}') for totalcalculationmode parameter. Only the following values are supported ${de}. Using default value ('${de[0]}').`),n(12,_=de[0]))},Pt=()=>{switch(ra(s),Mt(),p){case"gmcore":ct();break;case"gm16":Ht();break;default:throw Error(`Invalid apiversion attribute: ${p}`)}},et=c=>{const{data:{type:g}={}}=c||{};switch(g){case"LogoutSuccessfull":U.close();break;case"CloseBalance":ve("closebalance");break}},h=()=>{window.postMessage({type:"UpdateBalanceBackground"},window.location.href)},y=c=>{const g=D.split(",").map(v=>v.trim());return!c.productType||g.includes(c.productType)?"":r(c.productType)};Yr(()=>(window.addEventListener("message",et,!1),n(6,I=va(Y)),()=>{window.removeEventListener("message",et),U&&U.close()}));const x=()=>ve("balance"),b=()=>ve("closebalance"),C=()=>oe("deposit"),B=()=>oe("limits"),H=()=>ve("closebalance");function G(c){qt[c?"unshift":"push"](()=>{Z=c,n(1,Z)})}return e.$$set=c=>{"userid"in c&&n(13,i=c.userid),"session"in c&&n(14,o=c.session),"endpoint"in c&&n(15,a=c.endpoint),"lang"in c&&n(16,s=c.lang),"mbsource"in c&&n(17,l=c.mbsource),"clientstyling"in c&&n(18,u=c.clientstyling),"clientstylingurl"in c&&n(19,f=c.clientstylingurl),"translationurl"in c&&n(20,m=c.translationurl),"gmversion"in c&&n(21,p=c.gmversion),"displaybalanceoption"in c&&n(22,w=c.displaybalanceoption),"totalcalculationmode"in c&&n(12,_=c.totalcalculationmode),"balancelimitsbutton"in c&&n(0,S=c.balancelimitsbutton),"hideproducttype"in c&&n(23,D=c.hideproducttype),"currencylocale"in c&&n(24,ne=c.currencylocale),"currencydisplay"in c&&n(25,ie=c.currencydisplay),"maximumfractiondigits"in c&&n(26,N=c.maximumfractiondigits),"minimumfractiondigits"in c&&n(27,j=c.minimumfractiondigits),"customdisplayformat"in c&&n(28,q=c.customdisplayformat)},e.$$.update=()=>{e.$$.dirty[0]&6414336&&a&&i&&o&&s&&p&&w&&Pt(),e.$$.dirty[0]&2154496&&a&&i&&o&&p&&Ke(),e.$$.dirty[0]&1048576&&m&&Re(),e.$$.dirty[0]&4&&E.Total&&h(),e.$$.dirty[0]&262146&&u&&Z&&ci(Z,u),e.$$.dirty[0]&524290&&f&&Z&&hi(Z,f),e.$$.dirty[0]&131074&&l&&Z&&fi(Z,`${l}.Style`)},[S,Z,E,re,le,$,I,r,ve,_e,oe,y,_,i,o,a,s,l,u,f,m,p,w,D,ne,ie,N,j,q,x,b,C,B,H,G]}class Pr extends ui{constructor(t){super(),ai(this,t,Sa,wa,Kn,{userid:13,session:14,endpoint:15,lang:16,mbsource:17,clientstyling:18,clientstylingurl:19,translationurl:20,gmversion:21,displaybalanceoption:22,totalcalculationmode:12,balancelimitsbutton:0,hideproducttype:23,currencylocale:24,currencydisplay:25,maximumfractiondigits:26,minimumfractiondigits:27,customdisplayformat:28},_a,[-1,-1,-1])}get userid(){return this.$$.ctx[13]}set userid(t){this.$$set({userid:t}),Q()}get session(){return this.$$.ctx[14]}set session(t){this.$$set({session:t}),Q()}get endpoint(){return this.$$.ctx[15]}set endpoint(t){this.$$set({endpoint:t}),Q()}get lang(){return this.$$.ctx[16]}set lang(t){this.$$set({lang:t}),Q()}get mbsource(){return this.$$.ctx[17]}set mbsource(t){this.$$set({mbsource:t}),Q()}get clientstyling(){return this.$$.ctx[18]}set clientstyling(t){this.$$set({clientstyling:t}),Q()}get clientstylingurl(){return this.$$.ctx[19]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),Q()}get translationurl(){return this.$$.ctx[20]}set translationurl(t){this.$$set({translationurl:t}),Q()}get gmversion(){return this.$$.ctx[21]}set gmversion(t){this.$$set({gmversion:t}),Q()}get displaybalanceoption(){return this.$$.ctx[22]}set displaybalanceoption(t){this.$$set({displaybalanceoption:t}),Q()}get totalcalculationmode(){return this.$$.ctx[12]}set totalcalculationmode(t){this.$$set({totalcalculationmode:t}),Q()}get balancelimitsbutton(){return this.$$.ctx[0]}set balancelimitsbutton(t){this.$$set({balancelimitsbutton:t}),Q()}get hideproducttype(){return this.$$.ctx[23]}set hideproducttype(t){this.$$set({hideproducttype:t}),Q()}get currencylocale(){return this.$$.ctx[24]}set currencylocale(t){this.$$set({currencylocale:t}),Q()}get currencydisplay(){return this.$$.ctx[25]}set currencydisplay(t){this.$$set({currencydisplay:t}),Q()}get maximumfractiondigits(){return this.$$.ctx[26]}set maximumfractiondigits(t){this.$$set({maximumfractiondigits:t}),Q()}get minimumfractiondigits(){return this.$$.ctx[27]}set minimumfractiondigits(t){this.$$set({minimumfractiondigits:t}),Q()}get customdisplayformat(){return this.$$.ctx[28]}set customdisplayformat(t){this.$$set({customdisplayformat:t}),Q()}}si(Pr,{userid:{},session:{},endpoint:{},lang:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},balancelimitsbutton:{},hideproducttype:{},currencylocale:{},currencydisplay:{},maximumfractiondigits:{},minimumfractiondigits:{},customdisplayformat:{}},[],[],!0);exports.default=Pr;
24
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function dn(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Ct=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=cn(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(S){t={error:S}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var f=this.initialTeardown;if(Oe(f))try{f()}catch(S){o=S instanceof Zt?S.errors:[S]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var p=cn(m),w=p.next();!w.done;w=p.next()){var _=w.value;try{Un(_)}catch(S){o=o!=null?o:[],S instanceof Zt?o=fn(fn([],hn(o)),hn(S.errors)):o.push(S)}}}catch(S){r={error:S}}finally{try{w&&!w.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}if(o)throw new Zt(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Un(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&dn(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&dn(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Cr=Ct.EMPTY;function Hr(e){return e instanceof Ct||e&&"closed"in e&&Oe(e.remove)&&Oe(e.add)&&Oe(e.unsubscribe)}function Un(e){Oe(e)?e():e.unsubscribe()}var oa={Promise:void 0},aa={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,fn([e,t],hn(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function sa(e){aa.setTimeout(function(){throw e})}function Fn(){}function yt(e){e()}var Or=function(e){lt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Hr(n)&&n.add(r)):r.destination=ca,r}return t.create=function(n,r,i){return new pn(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ct),ua=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){pt(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){pt(r)}else pt(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){pt(n)}},e}(),pn=function(e){lt(t,e);function t(n,r,i){var o=e.call(this)||this,a;return Oe(n)||!n?a={next:n!=null?n:void 0,error:r!=null?r:void 0,complete:i!=null?i:void 0}:a=n,o.destination=new ua(a),o}return t}(Or);function pt(e){sa(e)}function la(e){throw e}var ca={closed:!0,next:Fn,error:la,complete:Fn},ha=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function fa(e){return e}function da(e){return e.length===0?fa:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var Gn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=ma(t)?t:new pn(t,n,r);return yt(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=jn(n),new n(function(i,o){var a=new pn({next:function(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[ha]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return da(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=jn(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function jn(e){var t;return(t=e!=null?e:oa.Promise)!==null&&t!==void 0?t:Promise}function pa(e){return e&&Oe(e.next)&&Oe(e.error)&&Oe(e.complete)}function ma(e){return e&&e instanceof Or||pa(e)&&Hr(e)}var ba=Ar(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Lr=function(e){lt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new kn(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new ba},t.prototype.next=function(n){var r=this;yt(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=cn(r.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;yt(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;yt(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Cr:(this.currentObservers=null,s.push(n),new Ct(function(){r.currentObservers=null,dn(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new Gn;return n.source=this,n},t.create=function(n,r){return new kn(n,r)},t}(Gn),kn=function(e){lt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Cr},t}(Lr),Mr={now:function(){return(Mr.delegate||Date).now()},delegate:void 0},ga=function(e){lt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Mr);var o=e.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},t.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var l=i.now(),u=0,f=1;f<o.length&&o[f]<=l;f+=2)u=f;u&&o.splice(0,u+1)}},t}(Lr);const $n=[],Vn={},ya=(e,t=0)=>{if($n.indexOf(e)==-1){const n=new ga(t);Vn[e]=n,$n.push(e)}return Vn[e]};window.emWidgets={topic:ya};const va=e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));function _a(e){$r(e,"svelte-15fwckg",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}@keyframes growWidthPercent{from{height:0}to{height:100%}}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;background:transparent;border:none;font:inherit;color:inherit;display:flex;flex-wrap:nowrap;white-space:nowrap}.ShowBalance .BalanceValue svg{width:16px;fill:black}.ShowBalance .BalanceValue span{padding-left:5px}.ShowBalance .BalanceValue .TriangleActive,.ShowBalance .BalanceValue .TriangleInactive{display:block;margin:0 3px;transition:all 0.2s}.ShowBalance .BalanceValue .TriangleActive:hover,.ShowBalance .BalanceValue .TriangleInactive:hover{transform:scale(1.2)}.ShowBalance .BalanceValue .TriangleActive svg,.ShowBalance .BalanceValue .TriangleInactive svg{margin:2px 0px}.ShowBalance .BalanceValue .TriangleActive{transform:scale(1.1) rotateX(180deg) translateY(3px)}.ShowBalance .BalanceValue .TriangleActive:hover{transform:scale(1.1) rotateX(180deg) translateY(3px)}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);position:absolute;top:40px;padding:10px;transform:translateX(-45%);box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919;transition:all 0.2s ease-in;opacity:0}.BalanceModalWrapper:before{content:"";background:linear-gradient(90deg, rgb(42, 79, 55) 0%, rgb(0, 61, 92) 100%);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:50%;width:25px;height:10px;z-index:1}.BalanceModalWrapper.Open{opacity:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;transition:all 0.3s ease;background:transparent;border:none;font:inherit;opacity:0}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, white));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModalClose:hover{transform:scale(1.1)}.BalanceModalClose.Open{opacity:1}.BalanceModal{transition:all 0.2s ease-in;width:270px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, white));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, white))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px;gap:5px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--color-primary);font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:30px;border:none;padding:10px 0;cursor:pointer;transition:all 0.2s ease-in;box-shadow:0px 3px 7px 0px rgba(0, 0, 0, 0.2)}.BalanceModalFooter .BalanceModalAction:hover{background:rgba(255, 255, 255, 0.1);color:var(--emw--color-primary);box-shadow:0px 0px 0px 2px inset var(--emw--color-primary);font-size:14px}.BalanceModalFooter .BalanceModalAction:active{background:rgba(255, 255, 255, 0.5)}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16;opacity:0;transition:all 0.2s linear}.ShowBalanceModalOverlay.Open{opacity:1}')}function Xn(e,t,n){const r=e.slice();return r[58]=t[n],r}function zn(e,t,n){const r=e.slice();return r[61]=t[n],r}function Ea(e){let t,n,r=(e[2].Total?e[9](e[2].Total[0].amount):"0")+"",i,o,a,s,l,u,f,m,p,w,_=e[5]&&Wn(e);return{c(){t=X("button"),n=X("p"),i=Se(r),o=we(),a=X("span"),s=En("svg"),l=En("path"),f=we(),_&&_.c(),m=zr(),L(l,"id","arrow"),L(l,"d","M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z"),L(l,"transform","translate(-274.511 -441.088)"),L(l,"fill","#d1d1d1"),L(s,"xmlns","http://www.w3.org/2000/svg"),L(s,"width","14"),L(s,"height","6.835"),L(s,"viewBox","0 0 14 6.835"),L(a,"class",u=e[4]?"TriangleActive":"TriangleInactive"),L(t,"class","BalanceValue")},m(S,D){ye(S,t,D),R(t,n),R(n,i),R(t,o),R(t,a),R(a,s),R(s,l),ye(S,f,D),_&&_.m(S,D),ye(S,m,D),p||(w=it(t,"click",e[29]),p=!0)},p(S,D){D[0]&4&&r!==(r=(S[2].Total?S[9](S[2].Total[0].amount):"0")+"")&&Pe(i,r),D[0]&16&&u!==(u=S[4]?"TriangleActive":"TriangleInactive")&&L(a,"class",u),S[5]?_?_.p(S,D):(_=Wn(S),_.c(),_.m(m.parentNode,m)):_&&(_.d(1),_=null)},d(S){S&&(be(t),be(f),be(m)),_&&_.d(S),p=!1,w()}}}function xa(e){let t,n=e[7]("Loading")+"",r;return{c(){t=X("p"),r=Se(n),L(t,"class","Loading")},m(i,o){ye(i,t,o),R(t,r)},p(i,o){o[0]&128&&n!==(n=i[7]("Loading")+"")&&Pe(r,n)},d(i){i&&be(t)}}}function Wn(e){let t,n,r,i,o,a,s,l,u=e[7]("Title")+"",f,m,p,w,_,S,D=e[7]("DepositButton")+"",ne,ie,N,j,q,Z,re,le=vt(Object.keys(e[2])),k=[];for(let I=0;I<le.length;I+=1)k[I]=qn(Xn(e,le,I));let $=e[0]==="true"&&Yn(e);return{c(){t=X("div"),n=X("button"),i=we(),o=X("div"),a=X("div"),s=X("div"),l=X("p"),f=Se(u),m=we(),p=X("div");for(let I=0;I<k.length;I+=1)k[I].c();w=we(),_=X("div"),S=X("button"),ne=Se(D),ie=we(),$&&$.c(),L(n,"class",r="BalanceModalClose "+(e[4]?"Open":"")),L(l,"class","BalanceModalTitle"),L(s,"class","BalanceModalHeader"),L(p,"class","BalanceModalBody"),L(S,"class","BalanceModalAction DepositButton"),L(_,"class","BalanceModalFooter"),L(a,"class",N="ModalContent "+(e[4]?"Open":"")),L(o,"class",j="BalanceModal "+(e[4]?"Open":"")),L(t,"class",q="BalanceModalWrapper "+(e[4]?"Open":""))},m(I,Y){ye(I,t,Y),R(t,n),R(t,i),R(t,o),R(o,a),R(a,s),R(s,l),R(l,f),R(a,m),R(a,p);for(let U=0;U<k.length;U+=1)k[U]&&k[U].m(p,null);R(a,w),R(a,_),R(_,S),R(S,ne),R(_,ie),$&&$.m(_,null),Z||(re=[it(n,"click",e[30]),it(S,"click",e[31])],Z=!0)},p(I,Y){if(Y[0]&16&&r!==(r="BalanceModalClose "+(I[4]?"Open":""))&&L(n,"class",r),Y[0]&128&&u!==(u=I[7]("Title")+"")&&Pe(f,u),Y[0]&2692){le=vt(Object.keys(I[2]));let U;for(U=0;U<le.length;U+=1){const ce=Xn(I,le,U);k[U]?k[U].p(ce,Y):(k[U]=qn(ce),k[U].c(),k[U].m(p,null))}for(;U<k.length;U+=1)k[U].d(1);k.length=le.length}Y[0]&128&&D!==(D=I[7]("DepositButton")+"")&&Pe(ne,D),I[0]==="true"?$?$.p(I,Y):($=Yn(I),$.c(),$.m(_,null)):$&&($.d(1),$=null),Y[0]&16&&N!==(N="ModalContent "+(I[4]?"Open":""))&&L(a,"class",N),Y[0]&16&&j!==(j="BalanceModal "+(I[4]?"Open":""))&&L(o,"class",j),Y[0]&16&&q!==(q="BalanceModalWrapper "+(I[4]?"Open":""))&&L(t,"class",q)},d(I){I&&be(t),tr(k,I),$&&$.d(),Z=!1,Ze(re)}}}function Zn(e){let t,n,r=e[7](e[58])+"",i,o,a=e[11](e[61])+"",s,l,u,f,m=e[9](e[61].amount)+"",p;return{c(){t=X("div"),n=X("p"),i=Se(r),o=we(),s=Se(a),l=we(),u=X("p"),f=X("span"),p=Se(m),L(n,"class","BalanceModalText"),L(f,"class","BalanceModalAmount"),L(u,"class","BalanceModalValue"),L(t,"class","BalanceModalRowLine")},m(w,_){ye(w,t,_),R(t,n),R(n,i),R(n,o),R(n,s),R(t,l),R(t,u),R(u,f),R(f,p)},p(w,_){_[0]&132&&r!==(r=w[7](w[58])+"")&&Pe(i,r),_[0]&4&&a!==(a=w[11](w[61])+"")&&Pe(s,a),_[0]&4&&m!==(m=w[9](w[61].amount)+"")&&Pe(p,m)},d(w){w&&be(t)}}}function qn(e){let t,n,r=vt(e[2][e[58]]),i=[];for(let o=0;o<r.length;o+=1)i[o]=Zn(zn(e,r,o));return{c(){t=X("div");for(let o=0;o<i.length;o+=1)i[o].c();n=we(),L(t,"class","BalanceModalRowBoth")},m(o,a){ye(o,t,a);for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(t,null);R(t,n)},p(o,a){if(a[0]&2692){r=vt(o[2][o[58]]);let s;for(s=0;s<r.length;s+=1){const l=zn(o,r,s);i[s]?i[s].p(l,a):(i[s]=Zn(l),i[s].c(),i[s].m(t,n))}for(;s<i.length;s+=1)i[s].d(1);i.length=r.length}},d(o){o&&be(t),tr(i,o)}}}function Yn(e){let t,n=e[7]("LimitsButton")+"",r,i,o;return{c(){t=X("button"),r=Se(n),L(t,"class","BalanceModalAction LimitsButton")},m(a,s){ye(a,t,s),R(t,r),i||(o=it(t,"click",e[32]),i=!0)},p(a,s){s[0]&128&&n!==(n=a[7]("LimitsButton")+"")&&Pe(r,n)},d(a){a&&be(t),i=!1,o()}}}function Qn(e){let t,n,r;return{c(){t=X("button"),L(t,"class","ShowBalanceModalOverlay")},m(i,o){ye(i,t,o),n||(r=it(t,"click",e[33]),n=!0)},p:me,d(i){i&&be(t),n=!1,r()}}}function wa(e){let t,n,r,i;function o(u,f){return u[3]?xa:Ea}let a=o(e),s=a(e),l=e[5]&&Qn(e);return{c(){t=X("div"),n=X("div"),s.c(),i=we(),l&&l.c(),L(n,"class",r="ShowBalance "+(e[6]?"Mobile":""))},m(u,f){ye(u,t,f),R(t,n),s.m(n,null),R(t,i),l&&l.m(t,null),e[34](t)},p(u,f){a===(a=o(u))&&s?s.p(u,f):(s.d(1),s=a(u),s&&(s.c(),s.m(n,null))),f[0]&64&&r!==(r="ShowBalance "+(u[6]?"Mobile":""))&&L(n,"class",r),u[5]?l?l.p(u,f):(l=Qn(u),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i:me,o:me,d(u){u&&be(t),s.d(),l&&l.d(),e[34](null)}}}function Sa(e,t,n){let r;kr(e,na,c=>n(7,r=c));let{userid:i=""}=t,{session:o=""}=t,{endpoint:a=""}=t,{lang:s="en"}=t,{mbsource:l=""}=t,{clientstyling:u=""}=t,{clientstylingurl:f=""}=t,{translationurl:m=""}=t,{gmversion:p="gm16"}=t,{displaybalanceoption:w="All"}=t,{totalcalculationmode:_="totalCashAmount"}=t,{balancelimitsbutton:S="false"}=t,{hideproducttype:D=""}=t,{currencylocale:ne="en"}=t,{currencydisplay:ie="symbol"}=t,{maximumfractiondigits:N="2"}=t,{minimumfractiondigits:j="0"}=t,{customdisplayformat:q=""}=t,Z,re=!0,le=!1,k=!1,$=!1,I=!1,Y=window.navigator.userAgent,U,ce="",ge=[],Be;const E={},de=["totalCashAmount","totalRealAmount"],Re=()=>{fetch(m).then(c=>c.json()).then(c=>Object.keys(c).forEach(g=>In(g,c[g]))).catch(c=>console.log(c))};Object.keys(Dn).forEach(c=>In(c,Dn[c]));const ve=c=>{switch(c){case"balance":window.postMessage({type:"BalanceModalStatus",status:"open"},window.location.href),n(5,$=!0),setTimeout(()=>n(4,le=!0),150);break;case"closebalance":n(4,le=!1),window.postMessage({type:"BalanceModalStatus",status:"close"},window.location.href),setTimeout(()=>{n(5,$=!1)},150);break}},_e=c=>{if(q)return Je(c);const g=ne||s,v={style:"currency",currency:ce,useGrouping:!0,currencyDisplay:ie||"code",maximumFractionDigits:N===""||isNaN(Number(N))?2:Number(N),minimumFractionDigits:j===""||isNaN(Number(j))?0:Number(j)};return new Intl.NumberFormat(g,v).format(c)},Je=c=>{const g=[];let v="";for(const d of q)switch(d){default:v+=d;break;case"{":v&&g.push(v),v="";break;case"}":const[A,M]=v.split("|");if(v="",A.toLowerCase()==="currency")v=ce;else if(A.toLowerCase()==="amount"){let T=",",F=".",z=2;M&&(M[0]!==" "&&(T=M[0]),M[1]!==" "&&(F=M[1]),M[2]!==" "&&!isNaN(Number(M[2]))&&(z=Number(M[2])));let[ee,Te]=String(Math.floor(c*Dt(10,z))/Dt(10,z)).split(".");v+=ee[0];for(let Ee=1;Ee<ee.length;++Ee)(ee.length-Ee)%3===0?v+=T+ee[Ee]:v+=ee[Ee];Te&&(v+=F+Te)}v&&g.push(v),v="";break}return g.push(v),g.join("")},ct=()=>Gt(this,null,function*(){var g,v,d;n(3,re=!0);const c=new URL(`${a}/v1/player/${i}/account`);try{const A=yield fetch(c,{method:"GET",headers:{"X-SessionID":o}}),M=yield A.json();if(A.ok)window.postMessage({type:"BalancedFetched"},window.location.href),ge=M.items,ce=(g=ge.find(T=>T.displayName==="Casino"))==null?void 0:g.currency,n(2,E.Total=[{amount:M.totalAmount[ce]}],E),n(2,E.Real=[{amount:(v=ge.find(T=>T.displayName==="Casino"))==null?void 0:v.balanceAmount}],E),n(2,E.Bonus=[{amount:(d=ge.find(T=>T.displayName==="UBS"))==null?void 0:d.balanceAmount}],E);else throw new Error("Failed to fetch balance data !")}catch(A){console.log("Balance error: ",A)}finally{n(3,re=!1)}}),Ht=()=>{n(3,re=!0);const c=new URL(`${a}/v2/player/${i}/balance`),g=new Headers;g.append("X-SessionID",o),fetch(c,{method:"GET",headers:g}).then(d=>d.json()).then(d=>{d[_]||n(12,_=de[0]);const A=d.items.find(T=>T.type==="Real"&&T.walletAccountType==="Ordinary");if(ce=A.currency,k=!!A.productType,n(2,E.Total=[{amount:0}],E),n(2,E.Real=[],E),n(2,E.Bonus=[],E),n(2,E.Credit=[],E),!k){Be={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},n(2,E.Total[0].amount=d[_][ce],E);for(const T of d.items)switch(T.type){case"Bonus":E.Bonus.length===0?E.Bonus.push({amount:T.amount}):n(2,E.Bonus[0].amount+=T.amount,E);break;case"Real":if(T.creditLine&&E.Credit.length===0&&E.Credit.push({amount:T.creditLine}),_==="totalRealAmount")continue;E.Real.length===0?E.Real.push({amount:T.amount}):n(2,E.Real[0].amount+=T.amount,E);break}for(const[T,F]of Object.entries(E))F.length<1&&delete E[T];n(3,re=!1);return}Be={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let M=d.items;w&&w!=="All"&&(M=d.items.filter(T=>T.productType===w));for(const T of M){let F;switch(T.type){case"Bonus":F=E.Bonus.findIndex(z=>z.productType===T.productType),F>0?n(2,E.Bonus[F].amount+=T.amount,E):E.Bonus.push({amount:T.amount,productType:T.productType});break;case"Real":T.creditLine&&E.Credit.push({amount:T.creditLine,productType:T.productType}),F=E.Real.findIndex(z=>z.productType===T.productType),F>0?n(2,E.Real[F].amount+=T.amount,E):E.Real.push({amount:T.amount,productType:T.productType});break}}Ue();for(const[T,F]of Object.entries(E))F.length<1&&delete E[T];window.postMessage({type:"playerBalanceInfo",balance:d},window.location.href),n(3,re=!1)}).catch(d=>{throw n(3,re=!1),console.log("Balance fetch error",d),new Error("Failed to fetch balance data!")})},Ke=()=>{if(U&&U.close(),o.length<1)return;let c,g;switch(p){case"gm16":c=new URL(`${a}/v2/player/${i}/information/updates`),g=A=>Le(A);break;case"gmcore":c=new URL(`${a}/v1/player/${i}/balance/updates`),g=A=>Ot(A);break}const v={accept:"text/event-stream","X-SessionId":o},d=new ia.EventSourcePolyfill(c,{headers:v});U=d,d.addEventListener("message",g)},ht=c=>{let g;try{g=JSON.parse(c)}catch(v){console.log("Balance stream failed: ",v);return}return g},Ot=c=>{var A,M;const g=ht(c.data);if(!g){Ke();return}let v="0";const d=g.balanceChange;ge=ge.map(T=>(d&&d[T.id]&&(T=Ft(Ut({},T),{balanceAmount:d[T.id].afterAmount})),v=(parseFloat(T==null?void 0:T.balanceAmount)+parseFloat(v)).toString(),T)),n(2,E.Real=[{amount:(A=ge[0])==null?void 0:A.balanceAmount}],E),n(2,E.Bonus=[{amount:(M=ge[1])==null?void 0:M.balanceAmount}],E),n(2,E.Total=[{amount:Number(v)}],E)},Ne=(c,g,v)=>{let d=null;switch(v.walletAccountType){case"Ordinary":(v.afterAmount!==v.affectedAmount||g.lastOrdinaryAfterAmount===0)&&(g.lastOrdinaryAfterAmount=v.afterAmount,g.showCreditLineAfterAmount||(d=v.afterAmount));break;case"CreditLine":v.afterAmount!==0?(d=v.afterAmount,g.showCreditLineAfterAmount=!0):(d=g.lastOrdinaryAfterAmount,g.showCreditLineAfterAmount=!1);break;default:d=v.afterAmount}return d===null?c:d},Ue=()=>{switch(_){case"totalCashAmount":let c=0;for(const v of["Real","Bonus"])for(const d of E[v])c+=Math.max(d.amount,0);n(2,E.Total[0].amount=c,E);break;case"totalRealAmount":if(!k)return;let g=0;for(const v of E.Real)g+=v.amount;n(2,E.Total[0].amount=g,E)}},Le=c=>{const g=ht(c.data);if(!g){Ke();return}if(Lt(g==null?void 0:g.type)||g.type!=="BALANCE_UPDATE_V2")return;const v=g.body.balanceChange;for(const[d,A]of Object.entries(v))if(_==="totalRealAmount"&&d==="Real"&&!k&&n(2,E.Total[0].amount=Ne(E.Total[0].amount,Be,A),E),!!E[d])for(const M of E[d]){if(!k){M.amount=d==="Real"?Ne(M.amount,Be,A):A.afterAmount;continue}A.productType===M.productType&&(M.amount=d==="Real"?Ne(M.amount,Be[M.productType],A):A.afterAmount)}Ue()},oe=c=>{switch(ve("closebalance"),c){case"deposit":window.postMessage({type:"GoToDeposit"},window.location.href);break;case"limits":window.postMessage({type:"GoToLimits"},window.location.href);break}typeof gtag=="function"&&gtag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},Lt=c=>c==="SESSION_EXPIRATION"?(window.postMessage({type:"SessionExpiration"},window.location.href),!0):!1,Mt=()=>{de.includes(_)||(console.error(`Unsupported value ('${_}') for totalcalculationmode parameter. Only the following values are supported ${de}. Using default value ('${de[0]}').`),n(12,_=de[0]))},Pt=()=>{switch(ra(s),Mt(),p){case"gmcore":ct();break;case"gm16":Ht();break;default:throw Error(`Invalid apiversion attribute: ${p}`)}},et=c=>{const{data:{type:g}={}}=c||{};switch(g){case"LogoutSuccessfull":U.close();break;case"CloseBalance":ve("closebalance");break}},h=()=>{window.postMessage({type:"UpdateBalanceBackground"},window.location.href)},y=c=>{const g=D.split(",").map(v=>v.trim());return!c.productType||g.includes(c.productType)?"":r(c.productType)};Yr(()=>(window.addEventListener("message",et,!1),n(6,I=va(Y)),()=>{window.removeEventListener("message",et),U&&U.close()}));const x=()=>ve("balance"),b=()=>ve("closebalance"),C=()=>oe("deposit"),B=()=>oe("limits"),H=()=>ve("closebalance");function G(c){qt[c?"unshift":"push"](()=>{Z=c,n(1,Z)})}return e.$$set=c=>{"userid"in c&&n(13,i=c.userid),"session"in c&&n(14,o=c.session),"endpoint"in c&&n(15,a=c.endpoint),"lang"in c&&n(16,s=c.lang),"mbsource"in c&&n(17,l=c.mbsource),"clientstyling"in c&&n(18,u=c.clientstyling),"clientstylingurl"in c&&n(19,f=c.clientstylingurl),"translationurl"in c&&n(20,m=c.translationurl),"gmversion"in c&&n(21,p=c.gmversion),"displaybalanceoption"in c&&n(22,w=c.displaybalanceoption),"totalcalculationmode"in c&&n(12,_=c.totalcalculationmode),"balancelimitsbutton"in c&&n(0,S=c.balancelimitsbutton),"hideproducttype"in c&&n(23,D=c.hideproducttype),"currencylocale"in c&&n(24,ne=c.currencylocale),"currencydisplay"in c&&n(25,ie=c.currencydisplay),"maximumfractiondigits"in c&&n(26,N=c.maximumfractiondigits),"minimumfractiondigits"in c&&n(27,j=c.minimumfractiondigits),"customdisplayformat"in c&&n(28,q=c.customdisplayformat)},e.$$.update=()=>{e.$$.dirty[0]&6414336&&a&&i&&o&&s&&p&&w&&Pt(),e.$$.dirty[0]&2154496&&a&&i&&o&&p&&Ke(),e.$$.dirty[0]&1048576&&m&&Re(),e.$$.dirty[0]&4&&E.Total&&h(),e.$$.dirty[0]&262146&&u&&Z&&ci(Z,u),e.$$.dirty[0]&524290&&f&&Z&&hi(Z,f),e.$$.dirty[0]&131074&&l&&Z&&fi(Z,`${l}.Style`)},[S,Z,E,re,le,$,I,r,ve,_e,oe,y,_,i,o,a,s,l,u,f,m,p,w,D,ne,ie,N,j,q,x,b,C,B,H,G]}class Pr extends ui{constructor(t){super(),ai(this,t,Sa,wa,Kn,{userid:13,session:14,endpoint:15,lang:16,mbsource:17,clientstyling:18,clientstylingurl:19,translationurl:20,gmversion:21,displaybalanceoption:22,totalcalculationmode:12,balancelimitsbutton:0,hideproducttype:23,currencylocale:24,currencydisplay:25,maximumfractiondigits:26,minimumfractiondigits:27,customdisplayformat:28},_a,[-1,-1,-1])}get userid(){return this.$$.ctx[13]}set userid(t){this.$$set({userid:t}),Q()}get session(){return this.$$.ctx[14]}set session(t){this.$$set({session:t}),Q()}get endpoint(){return this.$$.ctx[15]}set endpoint(t){this.$$set({endpoint:t}),Q()}get lang(){return this.$$.ctx[16]}set lang(t){this.$$set({lang:t}),Q()}get mbsource(){return this.$$.ctx[17]}set mbsource(t){this.$$set({mbsource:t}),Q()}get clientstyling(){return this.$$.ctx[18]}set clientstyling(t){this.$$set({clientstyling:t}),Q()}get clientstylingurl(){return this.$$.ctx[19]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),Q()}get translationurl(){return this.$$.ctx[20]}set translationurl(t){this.$$set({translationurl:t}),Q()}get gmversion(){return this.$$.ctx[21]}set gmversion(t){this.$$set({gmversion:t}),Q()}get displaybalanceoption(){return this.$$.ctx[22]}set displaybalanceoption(t){this.$$set({displaybalanceoption:t}),Q()}get totalcalculationmode(){return this.$$.ctx[12]}set totalcalculationmode(t){this.$$set({totalcalculationmode:t}),Q()}get balancelimitsbutton(){return this.$$.ctx[0]}set balancelimitsbutton(t){this.$$set({balancelimitsbutton:t}),Q()}get hideproducttype(){return this.$$.ctx[23]}set hideproducttype(t){this.$$set({hideproducttype:t}),Q()}get currencylocale(){return this.$$.ctx[24]}set currencylocale(t){this.$$set({currencylocale:t}),Q()}get currencydisplay(){return this.$$.ctx[25]}set currencydisplay(t){this.$$set({currencydisplay:t}),Q()}get maximumfractiondigits(){return this.$$.ctx[26]}set maximumfractiondigits(t){this.$$set({maximumfractiondigits:t}),Q()}get minimumfractiondigits(){return this.$$.ctx[27]}set minimumfractiondigits(t){this.$$set({minimumfractiondigits:t}),Q()}get customdisplayformat(){return this.$$.ctx[28]}set customdisplayformat(t){this.$$set({customdisplayformat:t}),Q()}}si(Pr,{userid:{},session:{},endpoint:{},lang:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},balancelimitsbutton:{},hideproducttype:{},currencylocale:{},currencydisplay:{},maximumfractiondigits:{},minimumfractiondigits:{},customdisplayformat:{}},[],[],!0);exports.default=Pr;
@@ -1 +1 @@
1
- "use strict";if(typeof window!="undefined"){let n=function(t){return function(...s){try{return t.apply(this,s)}catch(e){if(e instanceof DOMException&&e.message.includes("has already been used with this registry")||e.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/PlayerAccountBalanceModalNd-D-2Gsd5s.cjs")).then(({default:t})=>{!customElements.get("player-account-balance-modal-nd")&&customElements.define("player-account-balance-modal-nd",t.element)})}
1
+ "use strict";if(typeof window!="undefined"){let n=function(t){return function(...s){try{return t.apply(this,s)}catch(e){if(e instanceof DOMException&&e.message.includes("has already been used with this registry")||e.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw e}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/PlayerAccountBalanceModalNd-DmmxW9ey.cjs")).then(({default:t})=>{!customElements.get("player-account-balance-modal-nd")&&customElements.define("player-account-balance-modal-nd",t.element)})}
@@ -10,7 +10,7 @@ if (typeof window != "undefined") {
10
10
  }
11
11
  };
12
12
  };
13
- customElements.define = n(customElements.define), import("../components/PlayerAccountBalanceModalNd-CF6KEwrV.js").then(({ default: t }) => {
13
+ customElements.define = n(customElements.define), import("../components/PlayerAccountBalanceModalNd-DdzjJ4xT.js").then(({ default: t }) => {
14
14
  !customElements.get("player-account-balance-modal-nd") && customElements.define("player-account-balance-modal-nd", t.element);
15
15
  });
16
16
  }
@@ -1,4 +1,4 @@
1
- import { P as a } from "../components/PlayerAccountBalanceModalNd-4KBmRLkM.js";
1
+ import { P as a } from "../components/PlayerAccountBalanceModalNd-DSSEFyLG.js";
2
2
  function s(t) {
3
3
  return function(...n) {
4
4
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-account-balance-modal-nd",
3
- "version": "1.83.10",
3
+ "version": "1.83.11",
4
4
  "type": "module",
5
5
  "main": "es2015/player-account-balance-modal-nd.cjs",
6
6
  "module": "esnext/player-account-balance-modal-nd.js",