"use strict";const D=require("./Env-b79cd29a.js"),E=require("@accelbyte/sdk");function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R={},B={get exports(){return R},set exports(e){R=e}};exports.assertStringExports={};var N={get exports(){return exports.assertStringExports},set exports(e){exports.assertStringExports=e}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=g;function l(f){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?l=function(o){return typeof o}:l=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},l(f)}function g(f){var i=typeof f=="string"||f instanceof String;if(!i){var o=l(f);throw f===null?o="null":o==="object"&&(o=f.constructor.name),new TypeError("Expected a string but received a ".concat(o))}}e.exports=r.default,e.exports.default=r.default})(N,exports.assertStringExports);var x={},H={get exports(){return x},set exports(e){x=e}};exports.mergeExports={};var T={get exports(){return exports.mergeExports},set exports(e){exports.mergeExports=e}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;function l(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=arguments.length>1?arguments[1]:void 0;for(var i in f)typeof g[i]>"u"&&(g[i]=f[i]);return g}e.exports=r.default,e.exports.default=r.default})(T,exports.mergeExports);(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=o;var l=f(exports.assertStringExports),g=f(exports.mergeExports);function f(n){return n&&n.__esModule?n:{default:n}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1};function o(n,p){(0,l.default)(n),p=(0,g.default)(p,i),p.allow_trailing_dot&&n[n.length-1]==="."&&(n=n.substring(0,n.length-1)),p.allow_wildcard===!0&&n.indexOf("*.")===0&&(n=n.substring(2));var v=n.split("."),c=v[v.length-1];return p.require_tld&&(v.length<2||!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(c)||/\s/.test(c))||!p.allow_numeric_tld&&/^\d+$/.test(c)?!1:v.every(function(_){return!(_.length>63||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(_)||/[\uff01-\uff5e]/.test(_)||/^-|-$/.test(_)||!p.allow_underscores&&/_/.test(_))})}e.exports=r.default,e.exports.default=r.default})(H,x);var b={},W={get exports(){return b},set exports(e){b=e}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=v;var l=g(exports.assertStringExports);function g(c){return c&&c.__esModule?c:{default:c}}var f="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(f,"[.]){3}").concat(f),o=new RegExp("^".concat(i,"$")),n="(?:[0-9a-fA-F]{1,4})",p=new RegExp("^("+"(?:".concat(n,":){7}(?:").concat(n,"|:)|")+"(?:".concat(n,":){6}(?:").concat(i,"|:").concat(n,"|:)|")+"(?:".concat(n,":){5}(?::").concat(i,"|(:").concat(n,"){1,2}|:)|")+"(?:".concat(n,":){4}(?:(:").concat(n,"){0,1}:").concat(i,"|(:").concat(n,"){1,3}|:)|")+"(?:".concat(n,":){3}(?:(:").concat(n,"){0,2}:").concat(i,"|(:").concat(n,"){1,4}|:)|")+"(?:".concat(n,":){2}(?:(:").concat(n,"){0,3}:").concat(i,"|(:").concat(n,"){1,5}|:)|")+"(?:".concat(n,":){1}(?:(:").concat(n,"){0,4}:").concat(i,"|(:").concat(n,"){1,6}|:)|")+"(?::((?::".concat(n,"){0,5}:").concat(i,"|(?::").concat(n,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function v(c){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if((0,l.default)(c),_=String(_),!_)return v(c,4)||v(c,6);if(_==="4"){if(!o.test(c))return!1;var P=c.split(".").sort(function(A,F){return A-F});return P[3]<=255}return _==="6"?!!p.test(c):!1}e.exports=r.default,e.exports.default=r.default})(W,b);(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=$;var l=o(exports.assertStringExports),g=o(x),f=o(b),i=o(exports.mergeExports);function o(t){return t&&t.__esModule?t:{default:t}}function n(t,a){return P(t)||_(t,a)||v(t,a)||p()}function p(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(t,a){if(t){if(typeof t=="string")return c(t,a);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return c(t,a)}}function c(t,a){(a==null||a>t.length)&&(a=t.length);for(var s=0,d=new Array(a);s<a;s++)d[s]=t[s];return d}function _(t,a){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var s=[],d=!0,h=!1,w=void 0;try{for(var y=t[Symbol.iterator](),m;!(d=(m=y.next()).done)&&(s.push(m.value),!(a&&s.length===a));d=!0);}catch(u){h=!0,w=u}finally{try{!d&&y.return!=null&&y.return()}finally{if(h)throw w}}return s}}function P(t){if(Array.isArray(t))return t}var A={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},F=/^\[([^\]]+)\](?::([0-9]+))?$/;function k(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function O(t,a){for(var s=0;s<a.length;s++){var d=a[s];if(t===d||k(d)&&d.test(t))return!0}return!1}function $(t,a){if((0,l.default)(t),!t||/[\s<>]/.test(t)||t.indexOf("mailto:")===0||(a=(0,i.default)(a,A),a.validate_length&&t.length>=2083)||!a.allow_fragments&&t.includes("#")||!a.allow_query_components&&(t.includes("?")||t.includes("&")))return!1;var s,d,h,w,y,m,u,U;if(u=t.split("#"),t=u.shift(),u=t.split("?"),t=u.shift(),u=t.split("://"),u.length>1){if(s=u.shift().toLowerCase(),a.require_valid_protocol&&a.protocols.indexOf(s)===-1)return!1}else{if(a.require_protocol)return!1;if(t.substr(0,2)==="//"){if(!a.allow_protocol_relative_urls)return!1;u[0]=t.substr(2)}}if(t=u.join("://"),t==="")return!1;if(u=t.split("/"),t=u.shift(),t===""&&!a.require_host)return!0;if(u=t.split("@"),u.length>1){if(a.disallow_auth||u[0]===""||(d=u.shift(),d.indexOf(":")>=0&&d.split(":").length>2))return!1;var j=d.split(":"),I=n(j,2),C=I[0],V=I[1];if(C===""&&V==="")return!1}w=u.join("@"),m=null,U=null;var L=w.match(F);if(L?(h="",U=L[1],m=L[2]||null):(u=w.split(":"),h=u.shift(),u.length&&(m=u.join(":"))),m!==null&&m.length>0){if(y=parseInt(m,10),!/^[0-9]+$/.test(m)||y<=0||y>65535)return!1}else if(a.require_port)return!1;return a.host_whitelist?O(h,a.host_whitelist):!(!(0,f.default)(h)&&!(0,g.default)(h,a)&&(!U||!(0,f.default)(U,6))||(h=h||U,a.host_blacklist&&O(h,a.host_blacklist)))}e.exports=r.default,e.exports.default=r.default})(B,R);const z=M(R),q=class{static silentUrlBuilder(e){try{return new URL(e)}catch{return null}}static silentSearchParamsBuilder(e){try{return new URLSearchParams(e)}catch{return new URLSearchParams("")}}static makeAbsolutePath(e){return`/${E.UrlHelper.trimSlashFromStringStart(e)}`}static transformToValidURLOrUndefined(e){try{if(e)return new URL(e)}catch{}}static isValidUrl(e){return typeof e!="string"?!1:z(e,{protocols:["http","https"],require_tld:!1})&&e}static isImageURL(e){return!!this.isValidUrl(e)&&e.match(/\.(jpeg|jpg|gif|png)$/)!=null}static getCurrentPathWithNoBaseName(){return window.location.pathname.slice(D.Env.PLAYER_PORTAL_BASE_URL.length)}static getRedirectUrl(e,r){return E.DesktopChecker.isDesktopApp()?`${e}${E.UrlHelper.trimSlashFromStringStart(r)}`:`${E.UrlHelper.combineURLPaths(e,r)}`}static getRouterRedirection(e,r){const l=new URL(e),g=new URL(r),f=l.origin===window.location.origin,i=l.origin===g.origin;return f||D.Env.IS_DEV_MODE&&i?`${l.pathname}${l.search}`:null}};let S=q;S.stripColonFromProtocol=e=>e[e.length-1]===":"?e.slice(0,e.length-1):e;S.checkUrlValidity=(e,r=!0)=>q.isValidUrl2(e,r)?null:`${e} is not a valid URL.`;S.isValidUrl2=(e,r=!0)=>{try{return Boolean(new URL(e))}catch(l){return r&&console.error(l),!1}};S.fixUrl=e=>q.isValidUrl2(e,!1)?e:`https://${e}`;S.buildURLSearchParamsFromObject=e=>{const r={};for(const l in e)e[l]&&(r[l]=`${e[l]}`);return new URLSearchParams(r)};exports.UrlUtils=S;exports.getDefaultExportFromCjs=M;
