@notix.games/react-bridge 3.1.2 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={781:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(632),t),o(r(448),t),o(r(732),t)},473:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrame=function(e){var t=e.eventHandler,r=e.context,a=e.React,i=e.src,u=e.gameId,c=e.style,s=e.customProps,l=a.createRef(),d=a.createElement("iframe",n({src:i,id:(0,o.createIFrameId)(u),style:c,ref:l},s)),f=function(e){var n;e.source===(null===(n=l.current)||void 0===n?void 0:n.contentWindow)&&(null==t||t(e,r))};return window.addEventListener("message",f,!1),{iframe:d,destructor:function(){window.removeEventListener("message",f,!1),function(){var e;try{(null===(e=null==r?void 0:r.getMetadata())||void 0===e?void 0:e.prevWindowTitle)?window.top.document.title=r.getMetadata().prevWindowTitle:window.localStorage.getItem("prevWindowTitle")?window.top.document.title=window.localStorage.getItem("prevWindowTitle"):window.top.document.title=""}catch(e){console.log("Error trying to set document title (KEEP CALM, for now it`s OK for iFrame-in-iFrame setting due to parent window security settings):",e)}}()},meta:{iframeRef:l}}};var o=r(598)},105:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(473),t)},953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrame=function(e){var t=e.src,r=e.gameId,o=e.style,a=e.eventHandler,i=e.context,u=e.customProps,c=document.createElement("iframe");for(var s in c.src=t,c.id=(0,n.createIFrameId)(r),o)if(s in c.style){var l=o[s];try{c.style.setProperty(s,"number"==typeof l?"".concat(l,"px"):l)}catch(e){console.error("Error setting style for ".concat(s,": "),e)}}for(var s in Object.keys(Object(u)))c.setAttribute(s,u[s]);var d=function(e){e.source===c.contentWindow&&(null==a||a(e,i))};return window.addEventListener("message",d,!1),{iframe:c,destructor:function(){window.removeEventListener("message",d,!1),function(){var e;try{(null===(e=null==i?void 0:i.getMetadata())||void 0===e?void 0:e.prevWindowTitle)?window.top.document.title=i.getMetadata().prevWindowTitle:window.localStorage.getItem("prevWindowTitle")?window.top.document.title=window.localStorage.getItem("prevWindowTitle"):window.top.document.title=""}catch(e){console.log("Error trying to set document title (KEEP CALM, for now it`s OK for iFrame-in-iFrame setting due to parent window security settings):",e)}}()},meta:{}}};var n=r(598)},441:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(953),t)},981:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIX_BACKEND_BASE_URL_DEV=t.NOTIX_BACKEND_BASE_URL_STAGE=t.NOTIX_BACKEND_BASE_URL=t.IFRAME_GAME_ID_PREFIX=void 0,t.IFRAME_GAME_ID_PREFIX="notix_embedded_",t.NOTIX_BACKEND_BASE_URL="https://game-aggregator.notix.games/external/api/v1",t.NOTIX_BACKEND_BASE_URL_STAGE="https://game-aggregator.stage.notix.games/external/api/v1",t.NOTIX_BACKEND_BASE_URL_DEV="https://game-aggregator.main.notix.games/external/api/v1"},874:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.iFrameCreators=void 0,t.initNotixBridge=function(e){var r,s,l,p=this,v=!1,h=e,y="prod",b=function(e){var t=e.token,n=e.environment,o=e.setting,a=e.url;if(!t)throw new Error("Token is not provided on Notix Bridge configuration.");r=t,n&&(y=n),"lobby"===o&&(s=!0),a&&(l=a),v=!0};return{createIFrame:function(e){return function(e){return o(this,void 0,void 0,(function(){var o,c,p,b,g,w,m,_,P,I,O,A,E,M,S,j,T,x,U,R,G,k,W,L,N,F,B,D,C,q,K;return a(this,(function(a){switch(a.label){case 0:if(o=e.gameId,c=e.nodeId,p=e.player,b=e.browserSession,g=e.balance,w=e.eventHandler,m=e.customProps,_=e.style,P=e.sessionId,I=p.id,O=p.country,A=b.viewType,E=b.language,M=b.timeZone,S=b.ip,j=g.currency,T=g.amount,!v)throw new Error("Notix Bridge is not configured. Please call the configure method first.");a.label=1;case 1:return a.trys.push([1,3,,4]),x=(0,i.v4)(),[4,(0,u.startGame)({gameId:o,nodeId:c,requestId:x,player:{id:I,country:O},browserSession:{language:E,viewType:A,timeZone:M,ip:S},balance:{currency:j,amount:T},partnerToken:r,env:y,isLobby:s,sessionId:P,providedURL:l})];case 2:if(U=a.sent(),R=U.iFrameURI,G=U.token,!R)throw new Error("No iFrame URI provided by the server.");if(!G)throw new Error("No player token provided by the server.");if(k={_playerToken:G,_iframe:null,_metadata:{},updateMetadata:function(e){this._metadata=Object.assign(this._metadata,e)},addPropertyToMetadata:function(e,t){this._metadata[e]=t},getMetadata:function(){return this._metadata},getPlayerToken:function(){return this._playerToken},getIframe:function(){return this._iframe},updatePlayerToken:function(e){this._playerToken=e},updateIframe:function(e){this._iframe=e}},W=(0,d.createEventMiddleware)(f.handleGPWebAppInit,f.handleGPWebAppSetPageLoaded,f.handleGPWebAppSetPageTitle,f.handleGPWebAppShowAuthenticationFailed,f.handleGPWebAppShowGameState)(w),L=null,"react"===h){if(!(N=e.React))throw new Error("React instance is not provided.");F={eventHandler:W,context:k,React:N,customProps:m,src:R,gameId:o,style:_},L=t.iFrameCreators.react(F)}else"vanilla"===h&&(B={eventHandler:W,customProps:m,context:k,src:R,gameId:o,style:_},L=t.iFrameCreators.vanilla(B));if(!L)throw new Error("No iFrame creator result.");return D=L.iframe,C=L.destructor,q=L.meta,k.updateIframe(D),k.updateMetadata(Object.assign(q,{framework:h})),[2,n({iframe:D,destructor:C},q)];case 3:return[2,{error:K=a.sent(),message:K.message}];case 4:return[2]}}))}))}(e)},configure:b,configureAsync:function(e){return o(p,[e],void 0,(function(e){var t=e.token,r=e.environment,n=e.setting,o=e.url;return a(this,(function(e){return[2,new Promise((function(e,a){try{b({token:t,environment:r,setting:n,url:o}),e()}catch(e){a(e)}}))]}))}))},getGames:function(){return o(p,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:if(t.trys.push([0,2,,3]),!v)throw new Error("Notix Bridge is not configured. Please call the configure method first.");return[4,(0,c.getGamesList)({token:r,env:y,isLobby:s,providedURL:l})];case 1:return[2,t.sent()];case 2:return[2,{error:e=t.sent(),message:e.message}];case 3:return[2]}}))}))},getIFrameURI:function(e){return o(this,void 0,void 0,(function(){var t,n,o,c,d,f,p,h,b,g,w,m,_,P,I,O,A,E,M;return a(this,(function(a){switch(a.label){case 0:if(t=e.gameId,n=e.nodeId,o=e.player,c=e.browserSession,d=e.balance,f=e.sessionId,p=o.id,h=o.country,b=c.viewType,g=c.language,w=c.timeZone,m=c.ip,_=d.currency,P=d.amount,!v)throw new Error("Notix Bridge is not configured. Please call the configure method first.");a.label=1;case 1:return a.trys.push([1,3,,4]),I=(0,i.v4)(),console.log("🚀 ~ getIFrameURI ~ requestId:",I),[4,(0,u.startGame)({gameId:t,nodeId:n,requestId:I,player:{id:p,country:h},browserSession:{language:g,viewType:b,timeZone:w,ip:m},balance:{currency:_,amount:P},partnerToken:r,env:y,sessionId:f,isLobby:s,providedURL:l})];case 2:if(O=a.sent(),A=O.iFrameURI,E=O.token,!A)throw new Error("No iFrame URI provided by the server.");if(!E)throw new Error("No player token provided by the server.");return[2,A];case 3:return[2,{error:M=a.sent(),message:M.message}];case 4:return[2]}}))}))},configured:v}};var i=r(935),u=r(597),c=r(148),s=r(105),l=r(441),d=r(598),f=r(155);t.iFrameCreators={react:s.createIFrame,vanilla:l.createIFrame}},155:(e,t)=>{function r(e){var t,r=e.getIframe(),n=e.getMetadata();return"react"===n.framework?null===(t=null==n?void 0:n.iframeRef)||void 0===t?void 0:t.current:r}Object.defineProperty(t,"__esModule",{value:!0}),t.handleGPWebAppShowGameState=t.handleGPWebAppShowAuthenticationFailed=t.handleGPWebAppSetPageTitle=t.handleGPWebAppSetPageLoaded=t.handleGPWebAppInit=void 0;t.handleGPWebAppInit=function(e,t,n){var o,a,i;if("GPWebAppInit"===e.data.type){var u=r(t);null===(o=null==u?void 0:u.contentWindow)||void 0===o||o.postMessage({type:"GPWebAppInitResult",data:{result:!0,requestId:null===(i=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.data)||void 0===i?void 0:i.requestId}},"*")}n()};t.handleGPWebAppSetPageLoaded=function(e,t,n){"GPWebAppSetPageLoaded"===e.data.type&&r(t).contentWindow.postMessage({type:"GPWebAppSetPageLoadedResult",data:{result:!0,requestId:e.data.data.requestId}},"*");n()};t.handleGPWebAppSetPageTitle=function(e,t,n){try{var o=r(t);if("GPWebAppSetPageTitle"===e.data.type){var a=window.top.document.title;window.top.document.title=e.data.data.title,t.addPropertyToMetadata("prevWindowTitle",a),window.localStorage.setItem("prevWindowTitle",a),o.contentWindow.postMessage({type:"GPWebAppSetPageTitleResult",data:{result:!0,requestId:e.data.data.requestId}},"*")}}catch(e){console.log("Error trying to read document title (KEEP CALM, for now it`s OK for iFrame-in-iFrame setting due to parent window security settings):",e)}n()};t.handleGPWebAppShowAuthenticationFailed=function(e,t,n){var o=r(t);"GPWebAppShowAuthenticationFailed"===e.data.type&&(console.log("AUTH FAIL",e.data.type,e),o.contentWindow.postMessage({type:"GPWebAppShowAuthenticationFailedResult",data:{result:!0,requestId:e.data.data.requestId,token:"NEW_TOKEN_WILL_BE_HERE"}},"*")),n()};t.handleGPWebAppShowGameState=function(e,t,n){var o=r(t);"GPWebAppShowGameState"===e.data.type&&o.contentWindow.postMessage({type:"GPWebAppShowGameStateResult",data:{result:!0,requestId:e.data.data.requestId}},"*"),n()}},632:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(874),t),o(r(850),t)},148:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getGamesList=void 0;var a=r(710),i=function(e,t,r,i){return n(void 0,void 0,void 0,(function(){var n,u,c;return o(this,(function(o){switch(o.label){case 0:return n=i||(0,a.default)(t),u="".concat(n,r?"/partners/lobby/games/list":"/partners/games/list"),[4,fetch(u,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}})];case 1:if(!(c=o.sent()).ok)throw new Error("Failed to fetch games list: Server responeded with status ".concat(c.status));return[2,c.json()]}}))}))};t.getGamesList=function(e){return n(void 0,[e],void 0,(function(e){var t=e.token,r=e.env,n=e.isLobby,a=e.providedURL;return o(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,i(t,r,n,a)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}}))}))}},597:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.startGame=void 0;var a=r(710);t.startGame=function(e){return n(void 0,void 0,void 0,(function(){var t,r,n,i,u,c;return o(this,(function(o){switch(o.label){case 0:t=e.providedURL||(0,a.default)(e.env),r=e.isLobby?"".concat(t,"/partners/lobby/games/start"):"".concat(t,"/partners/games/start"),n=function(e){var t=e.gameId,r=e.nodeId,n=e.requestId,o=e.player,a=e.browserSession,i=e.balance,u=e.sessionId;return{requestId:n,gameId:t,nodeId:r,isTest:!0,player:{id:o.id,country:o.country},browserSession:{language:a.language,viewType:a.viewType,timeZone:a.timeZone,ip:a.ip},balance:{currency:i.currency,amount:i.amount},sessionId:u}}(e),i={method:"POST",headers:{Authorization:"Bearer ".concat(e.partnerToken),"Content-Type":"application/json"},body:JSON.stringify(n)},o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(r,i)];case 2:if(!(u=o.sent()).ok)throw new Error("Failed to start game: Server responded with status ".concat(u.status));return[4,u.json()];case 3:return c=o.sent(),[2,{iFrameURI:decodeURI(null==c?void 0:c.uri),token:null==c?void 0:c.sessionId}];case 4:throw o.sent();case 5:return[2]}}))}))}},850:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},568:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEventMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var o=this;return function(a,i){return r(o,void 0,void 0,(function(){var o,u=this;return n(this,(function(c){switch(c.label){case 0:o=function(c){return r(u,void 0,void 0,(function(){var u=this;return n(this,(function(s){switch(s.label){case 0:return c<e.length?[4,e[c](a,i,(function(){return r(u,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,o(c+1)];case 1:return e.sent(),[2]}}))}))}))]:[3,2];case 1:return s.sent(),[3,4];case 2:return[4,t(a)];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,o(0)];case 2:return[2,c.sent()];case 3:throw c.sent();case 4:return[2]}}))}))}}}},710:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("dev"===e)return n.NOTIX_BACKEND_BASE_URL_DEV;if("stage"===e)return n.NOTIX_BACKEND_BASE_URL_STAGE;if("prod"===e)return n.NOTIX_BACKEND_BASE_URL;throw new Error("Incorrect env identifier passed in getBaseURL in Bridge backend request. Could not find matching base url")};var n=r(981)},598:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrameId=function(e){return"".concat(a.IFRAME_GAME_ID_PREFIX).concat(e)};var a=r(981);o(r(568),t)},448:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotixBridge=void 0;var n=(0,r(781).initNotixBridge)("react");t.NotixBridge=n},732:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VanillaNotixBridge=void 0;var n=(0,r(632).initNotixBridge)("vanilla");t.VanillaNotixBridge=n},935:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var n=f(r(766)),o=f(r(532)),a=f(r(521)),i=f(r(10)),u=f(r(688)),c=f(r(687)),s=f(r(893)),l=f(r(750)),d=f(r(512));function f(e){return e&&e.__esModule?e:{default:e}}},391:(e,t)=>{function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function o(e,t,r,o,a,i){return n((u=n(n(t,e),n(o,i)))<<(c=a)|u>>>32-c,r);var u,c}function a(e,t,r,n,a,i,u){return o(t&r|~t&n,e,t,a,i,u)}function i(e,t,r,n,a,i,u){return o(t&n|r&~n,e,t,a,i,u)}function u(e,t,r,n,a,i,u){return o(t^r^n,e,t,a,i,u)}function c(e,t,r,n,a,i,u){return o(r^(t|~n),e,t,a,i,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let o=0;o<r;o+=8){const r=e[o>>5]>>>o%32&255,a=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let o=1732584193,s=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const r=o,f=s,p=l,v=d;o=a(o,s,l,d,e[t],7,-680876936),d=a(d,o,s,l,e[t+1],12,-389564586),l=a(l,d,o,s,e[t+2],17,606105819),s=a(s,l,d,o,e[t+3],22,-1044525330),o=a(o,s,l,d,e[t+4],7,-176418897),d=a(d,o,s,l,e[t+5],12,1200080426),l=a(l,d,o,s,e[t+6],17,-1473231341),s=a(s,l,d,o,e[t+7],22,-45705983),o=a(o,s,l,d,e[t+8],7,1770035416),d=a(d,o,s,l,e[t+9],12,-1958414417),l=a(l,d,o,s,e[t+10],17,-42063),s=a(s,l,d,o,e[t+11],22,-1990404162),o=a(o,s,l,d,e[t+12],7,1804603682),d=a(d,o,s,l,e[t+13],12,-40341101),l=a(l,d,o,s,e[t+14],17,-1502002290),s=a(s,l,d,o,e[t+15],22,1236535329),o=i(o,s,l,d,e[t+1],5,-165796510),d=i(d,o,s,l,e[t+6],9,-1069501632),l=i(l,d,o,s,e[t+11],14,643717713),s=i(s,l,d,o,e[t],20,-373897302),o=i(o,s,l,d,e[t+5],5,-701558691),d=i(d,o,s,l,e[t+10],9,38016083),l=i(l,d,o,s,e[t+15],14,-660478335),s=i(s,l,d,o,e[t+4],20,-405537848),o=i(o,s,l,d,e[t+9],5,568446438),d=i(d,o,s,l,e[t+14],9,-1019803690),l=i(l,d,o,s,e[t+3],14,-187363961),s=i(s,l,d,o,e[t+8],20,1163531501),o=i(o,s,l,d,e[t+13],5,-1444681467),d=i(d,o,s,l,e[t+2],9,-51403784),l=i(l,d,o,s,e[t+7],14,1735328473),s=i(s,l,d,o,e[t+12],20,-1926607734),o=u(o,s,l,d,e[t+5],4,-378558),d=u(d,o,s,l,e[t+8],11,-2022574463),l=u(l,d,o,s,e[t+11],16,1839030562),s=u(s,l,d,o,e[t+14],23,-35309556),o=u(o,s,l,d,e[t+1],4,-1530992060),d=u(d,o,s,l,e[t+4],11,1272893353),l=u(l,d,o,s,e[t+7],16,-155497632),s=u(s,l,d,o,e[t+10],23,-1094730640),o=u(o,s,l,d,e[t+13],4,681279174),d=u(d,o,s,l,e[t],11,-358537222),l=u(l,d,o,s,e[t+3],16,-722521979),s=u(s,l,d,o,e[t+6],23,76029189),o=u(o,s,l,d,e[t+9],4,-640364487),d=u(d,o,s,l,e[t+12],11,-421815835),l=u(l,d,o,s,e[t+15],16,530742520),s=u(s,l,d,o,e[t+2],23,-995338651),o=c(o,s,l,d,e[t],6,-198630844),d=c(d,o,s,l,e[t+7],10,1126891415),l=c(l,d,o,s,e[t+14],15,-1416354905),s=c(s,l,d,o,e[t+5],21,-57434055),o=c(o,s,l,d,e[t+12],6,1700485571),d=c(d,o,s,l,e[t+3],10,-1894986606),l=c(l,d,o,s,e[t+10],15,-1051523),s=c(s,l,d,o,e[t+1],21,-2054922799),o=c(o,s,l,d,e[t+8],6,1873313359),d=c(d,o,s,l,e[t+15],10,-30611744),l=c(l,d,o,s,e[t+6],15,-1560198380),s=c(s,l,d,o,e[t+13],21,1309151649),o=c(o,s,l,d,e[t+4],6,-145523070),d=c(d,o,s,l,e[t+11],10,-1120210379),l=c(l,d,o,s,e[t+2],15,718787259),s=c(s,l,d,o,e[t+9],21,-343485551),o=n(o,r),s=n(s,f),l=n(l,p),d=n(d,v)}return[o,s,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};t.default=s},460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},688:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default="00000000-0000-0000-0000-000000000000"},512:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(893))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};t.default=a},264:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},722:(e,t)=>{let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},210:(e,t)=>{function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e){const t=[1518500249,1859775393,2400959708,3395469782],o=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const a=e.length/4+2,i=Math.ceil(a/16),u=new Array(i);for(let t=0;t<i;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];u[t]=r}u[i-1][14]=8*(e.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++e){const a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=u[e][t];for(let e=16;e<80;++e)a[e]=n(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let i=o[0],c=o[1],s=o[2],l=o[3],d=o[4];for(let e=0;e<80;++e){const o=Math.floor(e/20),u=n(i,5)+r(o,c,s,l)+d+t[o]+a[e]>>>0;d=l,l=s,s=n(c,30)>>>0,c=i,i=u}o[0]=o[0]+i>>>0,o[1]=o[1]+c>>>0,o[2]=o[2]+s>>>0,o[3]=o[3]+l>>>0,o[4]=o[4]+d>>>0}return[o[0]>>24&255,o[0]>>16&255,o[0]>>8&255,255&o[0],o[1]>>24&255,o[1]>>16&255,o[1]>>8&255,255&o[1],o[2]>>24&255,o[2]>>16&255,o[2]>>8&255,255&o[2],o[3]>>24&255,o[3]>>16&255,o[3]>>8&255,255&o[3],o[4]>>24&255,o[4]>>16&255,o[4]>>8&255,255&o[4]]};t.default=o},750:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=i;var n,o=(n=r(893))&&n.__esModule?n:{default:n};const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function i(e,t=0){return a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]}var u=function(e,t=0){const r=i(e,t);if(!(0,o.default)(r))throw TypeError("Stringified UUID is invalid");return r};t.default=u},766:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(722))&&n.__esModule?n:{default:n},a=r(750);let i,u,c=0,s=0;var l=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let d=(e=e||{}).node||i,f=void 0!==e.clockseq?e.clockseq:u;if(null==d||null==f){const t=e.random||(e.rng||o.default)();null==d&&(d=i=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==f&&(f=u=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:s+1;const h=p-c+(v-s)/1e4;if(h<0&&void 0===e.clockseq&&(f=f+1&16383),(h<0||p>c)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,s=v,u=f,p+=122192928e5;const y=(1e4*(268435455&p)+v)%4294967296;l[n++]=y>>>24&255,l[n++]=y>>>16&255,l[n++]=y>>>8&255,l[n++]=255&y;const b=p/4294967296*1e4&268435455;l[n++]=b>>>8&255,l[n++]=255&b,l[n++]=b>>>24&15|16,l[n++]=b>>>16&255,l[n++]=f>>>8|128,l[n++]=255&f;for(let e=0;e<6;++e)l[n+e]=d[e];return t||(0,a.unsafeStringify)(l)};t.default=l},532:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(449)),o=a(r(391));function a(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v3",48,o.default);t.default=i},449:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,i,u){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,a.default)(n)),16!==(null===(c=n)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+e.length);if(s.set(n),s.set(e,n.length),s=r(s),s[6]=15&s[6]|t,s[8]=63&s[8]|128,i){u=u||0;for(let e=0;e<16;++e)i[u+e]=s[e];return i}return(0,o.unsafeStringify)(s)}try{n.name=e}catch(e){}return n.DNS=i,n.URL=u,n};var n,o=r(750),a=(n=r(512))&&n.__esModule?n:{default:n};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=i;const u="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=u},521:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(460)),o=i(r(722)),a=r(750);function i(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const i=(e=e||{}).random||(e.rng||o.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=i[e];return t}return(0,a.unsafeStringify)(i)};t.default=u},10:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(449)),o=a(r(210));function a(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v5",80,o.default);t.default=i},893:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(264))&&n.__esModule?n:{default:n};var a=function(e){return"string"==typeof e&&o.default.test(e)};t.default=a},687:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(893))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};t.default=a}},t={};var r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(448);module.exports=r})();
1
+ (()=>{"use strict";var e={781:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(632),t),o(r(448),t),o(r(732),t)},473:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrame=function(e){var t=e.eventHandler,r=e.context,a=e.React,i=e.src,u=e.gameId,s=e.style,c=e.customProps,l=a.createRef(),d=a.createElement("iframe",n({src:i,id:(0,o.createIFrameId)(u),style:s,ref:l},c)),f=function(e){var n;e.source===(null===(n=l.current)||void 0===n?void 0:n.contentWindow)&&(null==t||t(e,r))};return window.addEventListener("message",f,!1),{iframe:d,destructor:function(){window.removeEventListener("message",f,!1),function(){var e;try{(null===(e=null==r?void 0:r.getMetadata())||void 0===e?void 0:e.prevWindowTitle)?window.top.document.title=r.getMetadata().prevWindowTitle:window.localStorage.getItem("prevWindowTitle")?window.top.document.title=window.localStorage.getItem("prevWindowTitle"):window.top.document.title=""}catch(e){console.log("Error trying to set document title (KEEP CALM, for now it`s OK for iFrame-in-iFrame setting due to parent window security settings):",e)}}()},meta:{iframeRef:l}}};var o=r(598)},105:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(473),t)},953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrame=function(e){var t=e.src,r=e.gameId,o=e.style,a=e.eventHandler,i=e.context,u=e.customProps,s=document.createElement("iframe");for(var c in s.src=t,s.id=(0,n.createIFrameId)(r),o)if(c in s.style){var l=o[c];try{s.style.setProperty(c,"number"==typeof l?"".concat(l,"px"):l)}catch(e){console.error("Error setting style for ".concat(c,": "),e)}}for(var c in Object.keys(Object(u)))s.setAttribute(c,u[c]);var d=function(e){e.source===s.contentWindow&&(null==a||a(e,i))};return window.addEventListener("message",d,!1),{iframe:s,destructor:function(){window.removeEventListener("message",d,!1),function(){var e;try{(null===(e=null==i?void 0:i.getMetadata())||void 0===e?void 0:e.prevWindowTitle)?window.top.document.title=i.getMetadata().prevWindowTitle:window.localStorage.getItem("prevWindowTitle")?window.top.document.title=window.localStorage.getItem("prevWindowTitle"):window.top.document.title=""}catch(e){console.log("Error trying to set document title (KEEP CALM, for now it`s OK for iFrame-in-iFrame setting due to parent window security settings):",e)}}()},meta:{}}};var n=r(598)},441:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(953),t)},981:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.config=void 0,t.config={IFRAME_GAME_ID_PREFIX:"notix_embedded_",backendBaseUrls:{prod:"https://game-aggregator.notix.games/external/api/v1",stage:"https://game-aggregator.stage.notix.games/external/api/v1",dev:"https://game-aggregator.main.notix.games/external/api/v1"},authUrls:{prod:"https://auth-service.notix.games/external/api/v1",stage:"https://auth-service.stage.notix.games/external/api/v1",dev:"https://auth-service.main.notix.games/external/api/v1"}}},874:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.iFrameCreators=void 0,t.initNotixBridge=function(e){var r,l,d,h,y,b,g=this,w=!1,m=e,_="prod",P=null,I=function(){return o(g,void 0,void 0,(function(){var e,t,n,o,i,s;return a(this,(function(a){switch(a.label){case 0:if(!y)throw new Error("Refresh token is not available.");return e=h||(0,v.default)(_,"auth"),t="".concat(e,"/partners/auth/refresh"),[4,fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Bearer ".concat(r)},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:y})})];case 1:if(!(n=a.sent()).ok)throw new Error("Failed to refresh access token.");return[4,n.json()];case 2:return o=a.sent(),console.log("token update res data",o),i=o.access_token,s=(0,u.jwtDecode)(i),r=i,b=1e3*s.exp,y=o.refresh_token,M(),[2]}}))}))},O=function(e){var t=e.token,n=e.refreshToken,o=e.environment,a=e.setting,i=e.url,s=e.authUrl;if(!t)throw new Error("Token is not provided on Notix Bridge configuration.");var c=(0,u.jwtDecode)(t);r=t,y=n||"",b=1e3*c.exp,o&&(_=o),"lobby"===a&&(l=!0),i&&(d=i),s&&(h=s),w=!0,M()},j=function(){return o(g,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:if(t=Date.now(),!(b<=t))return[3,5];if(!y)return[3,4];if(!(1e3*(0,u.jwtDecode)(y).exp<=Date.now()))return[3,1];throw new Error("Due to long inactivity both refresh and auth tokens are expired. Probably you should reload page or reinitialize to obtain a new pair.");case 1:return[4,I()];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:throw new Error("Access token is expired and no refresh token is available.");case 5:return[2]}var t}))}))},M=function(){if(y){var e=Date.now(),t=b-e-18e4;P&&clearTimeout(P),P=setTimeout((function(){return o(g,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,I()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.error("Error refreshing token:",e),[3,3];case 3:return[2]}}))}))}),t)}};return{createIFrame:function(e){return function(e){return o(this,void 0,void 0,(function(){var o,u,c,v,h,y,b,g,P,I,O,M,k,x,S,A,E,T,U,G,W,R,F,L,D,N,B,C,q,H,K;return a(this,(function(a){switch(a.label){case 0:return[4,j()];case 1:if(a.sent(),o=e.gameId,u=e.nodeId,c=e.player,v=e.browserSession,h=e.balance,y=e.eventHandler,b=e.customProps,g=e.style,P=e.sessionId,I=c.id,O=c.country,M=v.viewType,k=v.language,x=v.timeZone,S=v.ip,A=h.currency,E=h.amount,!w)throw new Error("Notix Bridge is not configured. Please call the configure method first.");a.label=2;case 2:return a.trys.push([2,4,,5]),T=(0,i.v4)(),[4,(0,s.startGame)({gameId:o,nodeId:u,requestId:T,player:{id:I,country:O},browserSession:{language:k,viewType:M,timeZone:x,ip:S},balance:{currency:A,amount:E},partnerToken:r,env:_,isLobby:l,sessionId:P,providedURL:d})];case 3:if(U=a.sent(),G=U.iFrameURI,W=U.token,!G)throw new Error("No iFrame URI provided by the server.");if(!W)throw new Error("No player token provided by the server.");if(R={_playerToken:W,_iframe:null,_metadata:{},updateMetadata:function(e){this._metadata=Object.assign(this._metadata,e)},addPropertyToMetadata:function(e,t){this._metadata[e]=t},getMetadata:function(){return this._metadata},getPlayerToken:function(){return this._playerToken},getIframe:function(){return this._iframe},updatePlayerToken:function(e){this._playerToken=e},updateIframe:function(e){this._iframe=e}},F=(0,f.createEventMiddleware)(p.handleGPWebAppInit,p.handleGPWebAppSetPageLoaded,p.handleGPWebAppSetPageTitle,p.handleGPWebAppShowAuthenticationFailed,p.handleGPWebAppShowGameState)(y),L=null,"react"===m){if(!(D=e.React))throw new Error("React instance is not provided.");N={eventHandler:F,context:R,React:D,customProps:b,src:G,gameId:o,style:g},L=t.iFrameCreators.react(N)}else"vanilla"===m&&(B={eventHandler:F,customProps:b,context:R,src:G,gameId:o,style:g},L=t.iFrameCreators.vanilla(B));if(!L)throw new Error("No iFrame creator result.");return C=L.iframe,q=L.destructor,H=L.meta,R.updateIframe(C),R.updateMetadata(Object.assign(H,{framework:m})),[2,n({iframe:C,destructor:q},H)];case 4:return[2,{error:K=a.sent(),message:K.message}];case 5:return[2]}}))}))}(e)},configure:O,configureAsync:function(e){return o(g,void 0,void 0,(function(){return a(this,(function(t){return[2,new Promise((function(t,r){try{O(e),t()}catch(e){r(e)}}))]}))}))},getGames:function(){return o(g,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return[4,j()];case 1:t.sent(),t.label=2;case 2:if(t.trys.push([2,4,,5]),!w)throw new Error("Notix Bridge is not configured. Please call the configure method first.");return[4,(0,c.getGamesList)({token:r,env:_,isLobby:l,providedURL:d})];case 3:return[2,t.sent()];case 4:return[2,{error:e=t.sent(),message:e.message}];case 5:return[2]}}))}))},getIFrameURI:function(e){return o(this,void 0,void 0,(function(){var t,n,o,u,c,f,p,v,h,y,b,g,m,P,I,O,M,k,x;return a(this,(function(a){switch(a.label){case 0:return[4,j()];case 1:if(a.sent(),t=e.gameId,n=e.nodeId,o=e.player,u=e.browserSession,c=e.balance,f=e.sessionId,p=o.id,v=o.country,h=u.viewType,y=u.language,b=u.timeZone,g=u.ip,m=c.currency,P=c.amount,!w)throw new Error("Notix Bridge is not configured. Please call the configure method first.");a.label=2;case 2:return a.trys.push([2,4,,5]),I=(0,i.v4)(),console.log("🚀 ~ getIFrameURI ~ requestId:",I),[4,(0,s.startGame)({gameId:t,nodeId:n,requestId:I,player:{id:p,country:v},browserSession:{language:y,viewType:h,timeZone:b,ip:g},balance:{currency:m,amount:P},partnerToken:r,env:_,sessionId:f,isLobby:l,providedURL:d})];case 3:if(O=a.sent(),M=O.iFrameURI,k=O.token,!M)throw new Error("No iFrame URI provided by the server.");if(!k)throw new Error("No player token provided by the server.");return[2,M];case 4:return[2,{error:x=a.sent(),message:x.message}];case 5:return[2]}}))}))},configured:w}};var i=r(935),u=r(63),s=r(597),c=r(148),l=r(105),d=r(441),f=r(598),p=r(155),v=r(710);t.iFrameCreators={react:l.createIFrame,vanilla:d.createIFrame}},155:(e,t)=>{function r(e){var t,r=e.getIframe(),n=e.getMetadata();return"react"===n.framework?null===(t=null==n?void 0:n.iframeRef)||void 0===t?void 0:t.current:r}Object.defineProperty(t,"__esModule",{value:!0}),t.handleGPWebAppShowGameState=t.handleGPWebAppShowAuthenticationFailed=t.handleGPWebAppSetPageTitle=t.handleGPWebAppSetPageLoaded=t.handleGPWebAppInit=void 0;t.handleGPWebAppInit=function(e,t,n){var o,a,i;if("GPWebAppInit"===e.data.type){var u=r(t);null===(o=null==u?void 0:u.contentWindow)||void 0===o||o.postMessage({type:"GPWebAppInitResult",data:{result:!0,requestId:null===(i=null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.data)||void 0===i?void 0:i.requestId}},"*")}n()};t.handleGPWebAppSetPageLoaded=function(e,t,n){"GPWebAppSetPageLoaded"===e.data.type&&r(t).contentWindow.postMessage({type:"GPWebAppSetPageLoadedResult",data:{result:!0,requestId:e.data.data.requestId}},"*");n()};t.handleGPWebAppSetPageTitle=function(e,t,n){try{var o=r(t);if("GPWebAppSetPageTitle"===e.data.type){var a=window.top.document.title;window.top.document.title=e.data.data.title,t.addPropertyToMetadata("prevWindowTitle",a),window.localStorage.setItem("prevWindowTitle",a),o.contentWindow.postMessage({type:"GPWebAppSetPageTitleResult",data:{result:!0,requestId:e.data.data.requestId}},"*")}}catch(e){console.log("Error trying to read document title (KEEP CALM, for now it`s OK for iFrame-in-iFrame setting due to parent window security settings):",e)}n()};t.handleGPWebAppShowAuthenticationFailed=function(e,t,n){var o=r(t);"GPWebAppShowAuthenticationFailed"===e.data.type&&(console.log("AUTH FAIL",e.data.type,e),o.contentWindow.postMessage({type:"GPWebAppShowAuthenticationFailedResult",data:{result:!0,requestId:e.data.data.requestId,token:"NEW_TOKEN_WILL_BE_HERE"}},"*")),n()};t.handleGPWebAppShowGameState=function(e,t,n){var o=r(t);"GPWebAppShowGameState"===e.data.type&&o.contentWindow.postMessage({type:"GPWebAppShowGameStateResult",data:{result:!0,requestId:e.data.data.requestId}},"*"),n()}},632:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(874),t),o(r(850),t)},148:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getGamesList=void 0;var a=r(710),i=function(e,t,r,i){return n(void 0,void 0,void 0,(function(){var n,u,s;return o(this,(function(o){switch(o.label){case 0:return n=i||(0,a.default)(t),u="".concat(n,r?"/partners/lobby/games/list":"/partners/games/list"),[4,fetch(u,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}})];case 1:if(!(s=o.sent()).ok)throw new Error("Failed to fetch games list: Server responeded with status ".concat(s.status));return[2,s.json()]}}))}))};t.getGamesList=function(e){return n(void 0,[e],void 0,(function(e){var t=e.token,r=e.env,n=e.isLobby,a=e.providedURL;return o(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,i(t,r,n,a)];case 1:return[2,e.sent()];case 2:throw e.sent();case 3:return[2]}}))}))}},597:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.startGame=void 0;var a=r(710);t.startGame=function(e){return n(void 0,void 0,void 0,(function(){var t,r,n,i,u,s;return o(this,(function(o){switch(o.label){case 0:t=e.providedURL||(0,a.default)(e.env),r=e.isLobby?"".concat(t,"/partners/lobby/games/start"):"".concat(t,"/partners/games/start"),n=function(e){var t=e.gameId,r=e.nodeId,n=e.requestId,o=e.player,a=e.browserSession,i=e.balance,u=e.sessionId;return{requestId:n,gameId:t,nodeId:r,isTest:!0,player:{id:o.id,country:o.country},browserSession:{language:a.language,viewType:a.viewType,timeZone:a.timeZone,ip:a.ip},balance:{currency:i.currency,amount:i.amount},sessionId:u}}(e),i={method:"POST",headers:{Authorization:"Bearer ".concat(e.partnerToken),"Content-Type":"application/json"},body:JSON.stringify(n)},o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(r,i)];case 2:if(!(u=o.sent()).ok)throw new Error("Failed to start game: Server responded with status ".concat(u.status));return[4,u.json()];case 3:return s=o.sent(),[2,{iFrameURI:decodeURI(null==s?void 0:s.uri),token:null==s?void 0:s.sessionId}];case 4:throw o.sent();case 5:return[2]}}))}))}},850:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},568:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}s((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.createEventMiddleware=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var o=this;return function(a,i){return r(o,void 0,void 0,(function(){var o,u=this;return n(this,(function(s){switch(s.label){case 0:o=function(s){return r(u,void 0,void 0,(function(){var u=this;return n(this,(function(c){switch(c.label){case 0:return s<e.length?[4,e[s](a,i,(function(){return r(u,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,o(s+1)];case 1:return e.sent(),[2]}}))}))}))]:[3,2];case 1:return c.sent(),[3,4];case 2:return[4,t(a)];case 3:c.sent(),c.label=4;case 4:return[2]}}))}))},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,o(0)];case 2:return[2,s.sent()];case 3:throw s.sent();case 4:return[2]}}))}))}}}},710:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===t&&(t="games");var r=("games"===t?n.config.backendBaseUrls:n.config.authUrls)[e];if(r)return r;throw new Error("Incorrect env identifier passed in getBaseURL in Bridge backend request. Could not find matching base url")};var n=r(981)},598:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.createIFrameId=function(e){return"".concat(a).concat(e)};var a=r(981).config.IFRAME_GAME_ID_PREFIX;o(r(568),t)},448:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NotixBridge=void 0;var n=(0,r(781).initNotixBridge)("react");t.NotixBridge=n},732:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VanillaNotixBridge=void 0;var n=(0,r(632).initNotixBridge)("vanilla");t.VanillaNotixBridge=n},935:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return s.default}});var n=f(r(766)),o=f(r(532)),a=f(r(521)),i=f(r(10)),u=f(r(688)),s=f(r(687)),c=f(r(893)),l=f(r(750)),d=f(r(512));function f(e){return e&&e.__esModule?e:{default:e}}},391:(e,t)=>{function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function o(e,t,r,o,a,i){return n((u=n(n(t,e),n(o,i)))<<(s=a)|u>>>32-s,r);var u,s}function a(e,t,r,n,a,i,u){return o(t&r|~t&n,e,t,a,i,u)}function i(e,t,r,n,a,i,u){return o(t&n|r&~n,e,t,a,i,u)}function u(e,t,r,n,a,i,u){return o(t^r^n,e,t,a,i,u)}function s(e,t,r,n,a,i,u){return o(r^(t|~n),e,t,a,i,u)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var c=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let o=0;o<r;o+=8){const r=e[o>>5]>>>o%32&255,a=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let o=1732584193,c=-271733879,l=-1732584194,d=271733878;for(let t=0;t<e.length;t+=16){const r=o,f=c,p=l,v=d;o=a(o,c,l,d,e[t],7,-680876936),d=a(d,o,c,l,e[t+1],12,-389564586),l=a(l,d,o,c,e[t+2],17,606105819),c=a(c,l,d,o,e[t+3],22,-1044525330),o=a(o,c,l,d,e[t+4],7,-176418897),d=a(d,o,c,l,e[t+5],12,1200080426),l=a(l,d,o,c,e[t+6],17,-1473231341),c=a(c,l,d,o,e[t+7],22,-45705983),o=a(o,c,l,d,e[t+8],7,1770035416),d=a(d,o,c,l,e[t+9],12,-1958414417),l=a(l,d,o,c,e[t+10],17,-42063),c=a(c,l,d,o,e[t+11],22,-1990404162),o=a(o,c,l,d,e[t+12],7,1804603682),d=a(d,o,c,l,e[t+13],12,-40341101),l=a(l,d,o,c,e[t+14],17,-1502002290),c=a(c,l,d,o,e[t+15],22,1236535329),o=i(o,c,l,d,e[t+1],5,-165796510),d=i(d,o,c,l,e[t+6],9,-1069501632),l=i(l,d,o,c,e[t+11],14,643717713),c=i(c,l,d,o,e[t],20,-373897302),o=i(o,c,l,d,e[t+5],5,-701558691),d=i(d,o,c,l,e[t+10],9,38016083),l=i(l,d,o,c,e[t+15],14,-660478335),c=i(c,l,d,o,e[t+4],20,-405537848),o=i(o,c,l,d,e[t+9],5,568446438),d=i(d,o,c,l,e[t+14],9,-1019803690),l=i(l,d,o,c,e[t+3],14,-187363961),c=i(c,l,d,o,e[t+8],20,1163531501),o=i(o,c,l,d,e[t+13],5,-1444681467),d=i(d,o,c,l,e[t+2],9,-51403784),l=i(l,d,o,c,e[t+7],14,1735328473),c=i(c,l,d,o,e[t+12],20,-1926607734),o=u(o,c,l,d,e[t+5],4,-378558),d=u(d,o,c,l,e[t+8],11,-2022574463),l=u(l,d,o,c,e[t+11],16,1839030562),c=u(c,l,d,o,e[t+14],23,-35309556),o=u(o,c,l,d,e[t+1],4,-1530992060),d=u(d,o,c,l,e[t+4],11,1272893353),l=u(l,d,o,c,e[t+7],16,-155497632),c=u(c,l,d,o,e[t+10],23,-1094730640),o=u(o,c,l,d,e[t+13],4,681279174),d=u(d,o,c,l,e[t],11,-358537222),l=u(l,d,o,c,e[t+3],16,-722521979),c=u(c,l,d,o,e[t+6],23,76029189),o=u(o,c,l,d,e[t+9],4,-640364487),d=u(d,o,c,l,e[t+12],11,-421815835),l=u(l,d,o,c,e[t+15],16,530742520),c=u(c,l,d,o,e[t+2],23,-995338651),o=s(o,c,l,d,e[t],6,-198630844),d=s(d,o,c,l,e[t+7],10,1126891415),l=s(l,d,o,c,e[t+14],15,-1416354905),c=s(c,l,d,o,e[t+5],21,-57434055),o=s(o,c,l,d,e[t+12],6,1700485571),d=s(d,o,c,l,e[t+3],10,-1894986606),l=s(l,d,o,c,e[t+10],15,-1051523),c=s(c,l,d,o,e[t+1],21,-2054922799),o=s(o,c,l,d,e[t+8],6,1873313359),d=s(d,o,c,l,e[t+15],10,-30611744),l=s(l,d,o,c,e[t+6],15,-1560198380),c=s(c,l,d,o,e[t+13],21,1309151649),o=s(o,c,l,d,e[t+4],6,-145523070),d=s(d,o,c,l,e[t+11],10,-1120210379),l=s(l,d,o,c,e[t+2],15,718787259),c=s(c,l,d,o,e[t+9],21,-343485551),o=n(o,r),c=n(c,f),l=n(l,p),d=n(d,v)}return[o,c,l,d]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};t.default=c},460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},688:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default="00000000-0000-0000-0000-000000000000"},512:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(893))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};t.default=a},264:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},722:(e,t)=>{let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},210:(e,t)=>{function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e){const t=[1518500249,1859775393,2400959708,3395469782],o=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const a=e.length/4+2,i=Math.ceil(a/16),u=new Array(i);for(let t=0;t<i;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];u[t]=r}u[i-1][14]=8*(e.length-1)/Math.pow(2,32),u[i-1][14]=Math.floor(u[i-1][14]),u[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++e){const a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=u[e][t];for(let e=16;e<80;++e)a[e]=n(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let i=o[0],s=o[1],c=o[2],l=o[3],d=o[4];for(let e=0;e<80;++e){const o=Math.floor(e/20),u=n(i,5)+r(o,s,c,l)+d+t[o]+a[e]>>>0;d=l,l=c,c=n(s,30)>>>0,s=i,i=u}o[0]=o[0]+i>>>0,o[1]=o[1]+s>>>0,o[2]=o[2]+c>>>0,o[3]=o[3]+l>>>0,o[4]=o[4]+d>>>0}return[o[0]>>24&255,o[0]>>16&255,o[0]>>8&255,255&o[0],o[1]>>24&255,o[1]>>16&255,o[1]>>8&255,255&o[1],o[2]>>24&255,o[2]>>16&255,o[2]>>8&255,255&o[2],o[3]>>24&255,o[3]>>16&255,o[3]>>8&255,255&o[3],o[4]>>24&255,o[4]>>16&255,o[4]>>8&255,255&o[4]]};t.default=o},750:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=i;var n,o=(n=r(893))&&n.__esModule?n:{default:n};const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function i(e,t=0){return a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]}var u=function(e,t=0){const r=i(e,t);if(!(0,o.default)(r))throw TypeError("Stringified UUID is invalid");return r};t.default=u},766:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(722))&&n.__esModule?n:{default:n},a=r(750);let i,u,s=0,c=0;var l=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let d=(e=e||{}).node||i,f=void 0!==e.clockseq?e.clockseq:u;if(null==d||null==f){const t=e.random||(e.rng||o.default)();null==d&&(d=i=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==f&&(f=u=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:c+1;const h=p-s+(v-c)/1e4;if(h<0&&void 0===e.clockseq&&(f=f+1&16383),(h<0||p>s)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,c=v,u=f,p+=122192928e5;const y=(1e4*(268435455&p)+v)%4294967296;l[n++]=y>>>24&255,l[n++]=y>>>16&255,l[n++]=y>>>8&255,l[n++]=255&y;const b=p/4294967296*1e4&268435455;l[n++]=b>>>8&255,l[n++]=255&b,l[n++]=b>>>24&15|16,l[n++]=b>>>16&255,l[n++]=f>>>8|128,l[n++]=255&f;for(let e=0;e<6;++e)l[n+e]=d[e];return t||(0,a.unsafeStringify)(l)};t.default=l},532:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(449)),o=a(r(391));function a(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v3",48,o.default);t.default=i},449:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,i,u){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,a.default)(n)),16!==(null===(s=n)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(n),c.set(e,n.length),c=r(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,i){u=u||0;for(let e=0;e<16;++e)i[u+e]=c[e];return i}return(0,o.unsafeStringify)(c)}try{n.name=e}catch(e){}return n.DNS=i,n.URL=u,n};var n,o=r(750),a=(n=r(512))&&n.__esModule?n:{default:n};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=i;const u="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=u},521:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(460)),o=i(r(722)),a=r(750);function i(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const i=(e=e||{}).random||(e.rng||o.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=i[e];return t}return(0,a.unsafeStringify)(i)};t.default=u},10:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(449)),o=a(r(210));function a(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v5",80,o.default);t.default=i},893:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(264))&&n.__esModule?n:{default:n};var a=function(e){return"string"==typeof e&&o.default.test(e)};t.default=a},687:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(893))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};t.default=a},63:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecode=t.InvalidTokenError=void 0;class r extends Error{}function n(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}t.InvalidTokenError=r,r.prototype.name="InvalidTokenError",t.jwtDecode=function(e,t){if("string"!=typeof e)throw new r("Invalid token specified: must be a string");t||(t={});const o=!0===t.header?0:1,a=e.split(".")[o];if("string"!=typeof a)throw new r(`Invalid token specified: missing part #${o+1}`);let i;try{i=n(a)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new r(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}}},t={};var r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}(448);module.exports=r})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notix.games/react-bridge",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "Notix Games Bridge Module React Library",
5
5
  "main": "./index.js",
6
6
  "types": "./types/index.d.ts",
@@ -1,4 +1,13 @@
1
- export declare const IFRAME_GAME_ID_PREFIX = "notix_embedded_";
2
- export declare const NOTIX_BACKEND_BASE_URL = "https://game-aggregator.notix.games/external/api/v1";
3
- export declare const NOTIX_BACKEND_BASE_URL_STAGE = "https://game-aggregator.stage.notix.games/external/api/v1";
4
- export declare const NOTIX_BACKEND_BASE_URL_DEV = "https://game-aggregator.main.notix.games/external/api/v1";
1
+ export declare const config: {
2
+ IFRAME_GAME_ID_PREFIX: string;
3
+ backendBaseUrls: {
4
+ prod: string;
5
+ stage: string;
6
+ dev: string;
7
+ };
8
+ authUrls: {
9
+ prod: string;
10
+ stage: string;
11
+ dev: string;
12
+ };
13
+ };
@@ -5,9 +5,11 @@ import { CreateIFrameProps as ReactCreateIFrameProps } from '../adapters/react';
5
5
  import { CreateIFrameProps as VanillaCreateIFrameProps } from '../adapters/vanilla';
6
6
  export interface InitNotixBridgeParams {
7
7
  token: string;
8
+ refreshToken?: string;
8
9
  environment?: env;
9
10
  setting?: 'lobby' | 'default';
10
11
  url?: string;
12
+ authUrl?: string;
11
13
  }
12
14
  export type Framework = 'react' | 'vanilla';
13
15
  export type iFrameCreatorsProps = ReactCreateIFrameProps | VanillaCreateIFrameProps;
@@ -1,2 +1,2 @@
1
1
  import { env } from './../../src/types';
2
- export default function getBaseURL(env: env): string;
2
+ export default function getBaseURL(env: env, requestType?: 'games' | 'auth'): string;