import { useState as w, useEffect as V, useCallback as C } from "react";
import { R as U } from "./RouteUtils-f2d71427.mjs";
import { v4 as _ } from "uuid";
import { SdkCache as p, CodeGenUtil as h, Validate as v, ApiUtils as F, Network as A, VALIDATION_ERROR_CODE as S, DecodeError as k } from "@accelbyte/sdk";
import { z as r } from "zod";
import N from "axios";
import { LoginErrorParam as G } from "@accelbyte/sdk-iam";
const tt = r.enum(["EMAILPASSWD"]), c = r.enum([
  "steam",
  "steamopenid",
  "facebook",
  "google",
  "oculus",
  "twitch",
  "ios",
  "device",
  "discord",
  "epicgames",
  "ps4",
  "ps4web",
  "ps5",
  "live",
  "xblweb",
  "stadia",
  "stadiaweb",
  "apple",
  "netflix",
  "eaorigin",
  "azuresaml"
]), at = r.enum(["psn", "steamnetwork"]), B = r.object({
  namespace: r.string(),
  platformUserId: r.string(),
  displayName: r.string().optional()
});
r.object({
  linkedPlatforms: r.array(B),
  namespace: r.string(),
  userId: r.string(),
  displayName: r.string(),
  emailAddress: r.string()
});
const nt = r.enum(["SUCCESS", "FAILED", "PENDING"]);
var M = /* @__PURE__ */ ((e) => (e.TEMPLATE_CONFIG = "templateConfig", e.AVATARS_LIST_CONFIG = "avatarsList", e.LAUNCHER_DOWNLOAD_LINK_CONFIG = "launcherDownloadLink", e.LAUNCHER_UPDATE_URL_CONFIG = "launcherUpdateUrl", e.PAGE_CONFIG = "pageConfig", e.SOCIAL_LINKS = "socialLinks", e.EXPERIMENTAL_FEATURE_FLAGS = "experimentalFeatureFlags", e.LAUNCHER_FEATURE_FLAGS = "launcherFeatureFlags", e.PP_FEATURE_FLAGS = "ppFeatureFlags", e.LOGIN_FEATURE_FLAGS = "loginFeatureFlags", e.SUPPORT_FEATURE_FLAGS = "supportFeatureFlags", e.APP_ID = "appId", e.COMPANY_LOGO = "companyLogo", e.BRAND_NAME = "brandName", e.META_DATA = "metaData", e.FOOTER = "footer", e.HOMEPAGE = "homepage", e.FAVICON = "favicon", e.COPYRIGHT = "copyright", e.SUPPORT_EMAIL = "supportEmail", e.GLOBAL_PAGE_CONFIG = "globalPageConfig", e.THIRD_PARTY_LOGIN = "thirdPartyLogin", e.LOGO_VARIANT = "logoVariant", e.LAUNCHER_TEMPLATE_INFO = "launcherTemplateInfo", e.LEGAL_TEMPLATE_INFO = "legalTemplateInfo", e.LOGIN_TEMPLATE_INFO = "loginTemplateInfo", e.PP_TEMPLATE_INFO = "ppTemplateInfo", e.PAYMENT_TEMPLATE_INFO = "paymentTemplateInfo", e.TWITCHDROP_TEMPLATE_INFO = "twitchDropTemplateInfo", e.GAMELIST = "gameList", e.STREAMER_INFO = "streamerInfo", e.BACKGROUND = "backgroundConfig", e.PAGE_TITLE = "pageTitle", e.SUBMISSION_FORM = "submissionForm", e.DISPLAY_CTA_BUTTON = "displayCTAButton", e.KNOWLEDGE_BASE_SETTING = "knowledgeBaseSettings", e.LAUNCHER_ICON = "launcherIcon", e))(M || {}), W = /* @__PURE__ */ ((e) => (e.TWITCH = "twitch", e.DISCORD = "discord", e.TWITTER = "twitter", e.YOUTUBE = "youtube", e.FACEBOOK = "facebook", e.TIKTOK = "tiktok", e.INSTAGRAM = "instagram", e.REDDIT = "reddit", e.LINKEDIN = "linkedin", e))(W || {}), H = /* @__PURE__ */ ((e) => (e.TITLE_FONT = "font-title", e.BODY_FONT = "font-body", e.HEADING_FONT = "font-heading", e))(H || {}), l = /* @__PURE__ */ ((e) => (e.PP = "pp", e.LAUNCHER = "launcher", e.WIDGET = "widget", e.LOGIN = "login", e.LEGAL = "legal", e.PAYMENT = "payment", e.TWITCHDROP = "twitchdrop", e.SUPPORT = "support", e))(l || {});
const ot = r.enum([
  c.enum.steamopenid,
  c.enum.epicgames,
  c.enum.ps4web,
  c.enum.xblweb,
  c.enum.facebook,
  c.enum.google,
  c.enum.twitch,
  c.enum.apple,
  c.enum.discord
]), st = "preview", O = {};
function I(e) {
  const t = _();
  return O[t] = {
    state: e,
    initialState: e,
    subscribers: []
  }, O[t];
}
function y(e) {
  const [t, a] = w(e.state);
  V(() => {
    const i = {
      id: _(),
      setState: a
    };
    return e.subscribers.push(i), () => {
      const s = e.subscribers.findIndex((o) => o === i);
      if (s > -1) {
        const o = e.subscribers.slice(0, s).concat(e.subscribers.slice(s + 1));
        e.subscribers = o;
      }
    };
  }, [e]);
  const n = C(
    (i) => {
      const s = typeof i == "function" ? i(e.state) : { ...e.state, ...i };
      e.state = s;
      for (let o = 0; o < e.subscribers.length; o++)
        e.subscribers[o].setState(s);
    },
    [e]
  );
  return [t, n];
}
const $ = I();
function rt() {
  return y($);
}
const Z = I();
function it() {
  return y(Z);
}
const Y = {
  name: "launcherDownloadLink",
  data: {
    value: "https://cdn.development.accelbyte.io/public/OdinLauncher-setup-development-latest.exe"
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.39404716+07:00",
  version: 0
}, j = {
  name: "metaData",
  data: {
    description: "AccelByte is a gaming platform and community that helps players discover incredible games",
    image: "https://cdn.development.accelbyte.io/app-config/meta-image/default-meta-image.jpg",
    title: "Discover Incredible games"
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394058652+07:00",
  version: 0
}, J = {
  name: "pageConfig",
  data: {
    isLocalStyleEnabled: !1,
    global: {
      colors: {
        background: {
          hex: "#000a33",
          rgb: {
            a: 1,
            b: 51,
            g: 10,
            r: 0
          }
        },
        card: {
          hex: "#00104f",
          rgb: {
            a: 1,
            b: 79,
            g: 16,
            r: 0
          }
        },
        overlay: {
          hex: "#000E46",
          rgb: {
            a: 0.6,
            b: 70,
            g: 14,
            r: 0
          }
        },
        primary: {
          hex: "#ff0000",
          rgb: {
            a: 1,
            b: 0,
            g: 0,
            r: 255
          }
        },
        secondary: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        },
        text: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        }
      },
      fonts: {
        title: "Rubik",
        customTitleFontUrl: "",
        body: "Rubik",
        customBodyFontUrl: ""
      }
    }
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394047751+07:00",
  version: 0
}, q = {
  name: "footer",
  data: {
    value: {
      links: [
        {
          id: "privacyPolicy",
          link: "https://development.accelbyte.io/privacy-policy",
          name: "Privacy Policy"
        },
        {
          id: "legal",
          link: "https://development.accelbyte.io/legal",
          name: "Legal"
        },
        {
          id: "termsOfUse",
          link: "https://development.accelbyte.io/terms-of-use",
          name: "Terms of Use"
        },
        {
          id: "additional1",
          link: "https://development.accelbyte.io/refund",
          name: "Refund Policy"
        },
        {
          id: "additional2",
          link: "https://development.accelbyte.io/cookies",
          name: "Cookies"
        }
      ]
    }
  },
  format: "v1",
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  version: 0
}, z = {
  name: "homepage",
  data: {
    isDisabled: !1,
    redirectionURL: "https://development.accelbyte.io/account/overview",
    siteBrandURL: ""
  },
  format: "v0",
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  version: 0
}, Q = {
  name: "logoVariant",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    header: null,
    footer: null
  }
}, X = {
  launcherDownloadLink: Y,
  metaData: j,
  pageConfig: J,
  footer: q,
  homepage: z,
  logoVariant: Q
}, K = {
  name: "pageConfig",
  data: {
    isLocalStyleEnabled: !1,
    global: {
      colors: {
        background: {
          hex: "#000a33",
          rgb: {
            a: 1,
            b: 51,
            g: 10,
            r: 0
          }
        },
        card: {
          hex: "#00104f",
          rgb: {
            a: 1,
            b: 79,
            g: 16,
            r: 0
          }
        },
        overlay: {
          hex: "#000E46",
          rgb: {
            a: 0.6,
            b: 70,
            g: 14,
            r: 0
          }
        },
        primary: {
          hex: "#ff0000",
          rgb: {
            a: 1,
            b: 0,
            g: 0,
            r: 255
          }
        },
        secondary: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        },
        text: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        }
      },
      fonts: {
        title: "Rubik",
        customTitleFontUrl: "",
        body: "Rubik",
        customBodyFontUrl: ""
      }
    }
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394047751+07:00",
  version: 0
}, ee = {
  name: "knowledgeBaseSettings",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    isKnowledgeBaseEnabled: !0
  }
}, te = {
  name: "submissionForm",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    email: "",
    isUseExternalSupportEnabled: !0,
    externalSupportURL: ""
  }
}, ae = {
  name: "displayCTAButton",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    isPlayerPortalEnabled: !1,
    isLauncherEnabled: !1
  }
}, ne = {
  pageConfig: K,
  knowledgeBaseSettings: ee,
  submissionForm: te,
  displayCTAButton: ae
}, L = r.object({
  data: r.record(r.any()),
  format: r.string(),
  name: r.string(),
  updatedAt: r.string(),
  version: r.number().int()
});
class oe {
  constructor(t, a, n = !1) {
    this.axiosInstance = t, this.namespace = a, this.cache = n;
  }
  getStaticConfig_ByConfig(t) {
    const a = {}, n = "/odin-config/v1/public/namespaces/{namespace}/staticConfigs/{config}".replace("{namespace}", this.namespace).replace("{config}", t), i = this.axiosInstance.get(n, { params: a }), s = () => v.responseType(() => i, L, "Config");
    if (!this.cache)
      return p.withoutCache(s);
    const o = n + h.hashCode(JSON.stringify({ params: a }));
    return p.withCache(o, s);
  }
}
function se(e, t) {
  const a = e.assembly(), n = t != null && t.namespace ? t == null ? void 0 : t.namespace : a.namespace, i = t != null && t.cache ? t == null ? void 0 : t.cache : a.cache, s = F.mergedConfigs(a.config, t);
  async function o(f) {
    const u = await new oe(A.create(s), n, i).getStaticConfig_ByConfig(f);
    if (u.error)
      throw u.error;
    return u.response.data;
  }
  return {
    getStaticConfig_ByConfig: o
  };
}
const re = r.record(L);
class P {
  constructor(t, a, n = !1) {
    this.axiosInstance = t, this.namespace = a, this.cache = n;
  }
  getConfigs_ByTemplate(t) {
    const a = {}, n = "/odin-config/v1/public/namespaces/{namespace}/templates/{template}/configs".replace("{namespace}", this.namespace).replace("{template}", t), i = this.axiosInstance.get(n, { params: a }), s = () => v.responseType(() => i, re, "Configs");
    if (!this.cache)
      return p.withoutCache(s);
    const o = n + h.hashCode(JSON.stringify({ params: a }));
    return p.withCache(o, s);
  }
  getConfig_ByTemplate_ByConfig(t, a) {
    const n = {}, i = "/odin-config/v1/public/namespaces/{namespace}/templates/{template}/configs/{config}".replace("{namespace}", this.namespace).replace("{template}", t).replace("{config}", a), s = this.axiosInstance.get(i, { params: n }), o = () => v.responseType(() => s, L, "Config");
    if (!this.cache)
      return p.withoutCache(o);
    const f = i + h.hashCode(JSON.stringify({ params: n }));
    return p.withCache(f, o);
  }
}
function ie(e, t) {
  const a = e.assembly(), n = t != null && t.namespace ? t == null ? void 0 : t.namespace : a.namespace, i = t != null && t.cache ? t == null ? void 0 : t.cache : a.cache, s = F.mergedConfigs(a.config, t);
  async function o(m) {
    const g = await new P(A.create(s), n, i).getConfigs_ByTemplate(m);
    if (g.error)
      throw g.error;
    return g.response.data;
  }
  async function f(m, u) {
    const T = await new P(A.create(s), n, i).getConfig_ByTemplate_ByConfig(m, u);
    if (T.error)
      throw T.error;
    return T.response.data;
  }
  return {
    getConfigs_ByTemplate: o,
    getConfig_ByTemplate_ByConfig: f
  };
}
const le = {
  StaticConfigsApi: se,
  TemplatesApi: ie
}, x = le, ce = "template-discovery";
class d {
  static errorToString(t) {
    return JSON.stringify(t, Object.getOwnPropertyNames(t));
  }
  static isAxiosError(t) {
    return !!t && !!t.config;
  }
  static isAxiosNetworkError(t) {
    return d.isAxiosError(t) && (!t.response || t.code === N.AxiosError.ERR_NETWORK);
  }
  static isAxiosServerError(t) {
    var a, n;
    if (t instanceof N.AxiosError && ((a = t.response) != null && a.status)) {
      const i = (n = t.response) == null ? void 0 : n.status;
      return d.isAxiosError(t) && i >= 500 && i <= 599;
    }
    return !1;
  }
  static isLoginSessionExpired(t) {
    return t.message === G.Enum.login_session_expired;
  }
  static extractServiceErrorCode(t) {
    var a;
    if (d.isAxiosError(t) && ((a = t == null ? void 0 : t.response) != null && a.data)) {
      const n = t.response.data;
      if (ue.safeParse(n).success)
        return n.errorCode;
      if (de.safeParse(n).success)
        return n.ErrorCode;
    }
    return null;
  }
  static isInputValidationError(t) {
    return d.isAxiosError(t) && d.extractServiceErrorCode(t) === S;
  }
}
const de = r.object({
  ErrorCode: r.number(),
  ErrorMessage: r.string()
}), ue = r.object({
  errorCode: r.number(),
  errorMessage: r.string()
});
var pe = /* @__PURE__ */ ((e) => (e.IDLE = "idle", e.FETCHING = "fetching", e.CREATING = "creating", e.UPDATING = "updating", e.PURCHASING = "purchasing", e.CLAIMING = "claiming", e.REDEEMING = "redeeming", e.CANCELLING = "cancelling", e.REQUESTING = "requesting", e.VERIFYING = "verifying", e.DELETING = "deleting", e.DOWNLOADING = "downloading", e.SENDING = "sending", e))(pe || {});
class lt {
  static getErrorType(t) {
    return console.error(t), t;
  }
}
const fe = I(U.createWidgetRoutes({}));
function ct() {
  const [e, t] = y(fe), a = C((n) => {
    t(n);
  }, []);
  return {
    state: e,
    mutations: {
      initRoutes: a
    }
  };
}
var b = /* @__PURE__ */ ((e) => (e.UNKNOWN = "10000", e.NO_DISCOVERY_TEMPLATE_FOUND = "10001", e.NO_TEMPLATES_FOUND = "10002", e.INVALID_CONFIGS = "10003", e.INVALID_GAME = "10004", e))(b || {});
class E extends Error {
  constructor(t, a, n = "10000") {
    super(t), this.appName = a, this.code = n, this.name = "ConfigError";
  }
}
const me = {
  name: "ppTemplateInfo",
  data: {
    draft: "pp-default",
    published: "pp-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, ge = {
  name: "launcherTemplateInfo",
  data: {
    draft: "launcher-default",
    published: "launcher-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, be = {
  name: "loginTemplateInfo",
  data: {
    draft: "login-default",
    published: "login-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Te = {
  name: "legalTemplateInfo",
  data: {
    draft: "legal-default",
    published: "legal-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, he = {
  name: "paymentTemplateInfo",
  data: {
    draft: "payment-default",
    published: "payment-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, ve = {
  name: "twitchDropTemplateInfo",
  data: {
    draft: "twitchdrop-default",
    published: "twitchdrop-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Ae = {
  name: "supportTemplateInfo",
  data: {
    draft: "support-default",
    published: "support-default"
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Ee = {
  name: "ppFeatureFlags",
  data: {
    isAccountOverviewVisible: !0,
    isChangePasswordVisible: !0,
    isDeleteAccountVisible: !0,
    isGetLauncherVisible: !0,
    isLinkedAccountsVisible: !0,
    isMyProfileVisible: !0,
    isNewsVisible: !1,
    isNotificationsVisible: !1,
    isOrderHistoryVisible: !0,
    isPaymentMethodsVisible: !0,
    isPersonalDataVisible: !0,
    isLegalAgreementsVisible: !0,
    isPurchasedItemsVisible: !0,
    isRedeemCodeVisible: !0,
    isStoreVisible: !0,
    isSubscriptionsVisible: !1,
    isVirtualCurrencyVisible: !1,
    isNewsV2Visible: !1,
    isTwitchDropEnabled: !1,
    isLegalEnabled: !0
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Ie = {
  name: "launcherFeatureFlags",
  data: {
    isAccountOverviewVisible: !1,
    isChangePasswordVisible: !1,
    isDeleteAccountVisible: !0,
    isLinkedAccountsVisible: !0,
    isMyProfileVisible: !0,
    isNewsVisible: !1,
    isNotificationsVisible: !1,
    isOrderHistoryVisible: !0,
    isPaymentMethodsVisible: !0,
    isPersonalDataVisible: !0,
    isLegalAgreementsVisible: !0,
    isPurchasedItemsVisible: !0,
    isRedeemCodeVisible: !0,
    isStoreVisible: !0,
    isSubscriptionsVisible: !1,
    isVirtualCurrencyVisible: !1,
    isNewsV2Visible: !1,
    isLegalEnabled: !0
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, ye = {
  name: "loginFeatureFlags",
  data: {
    isRegisterVisible: !0,
    isLegalEnabled: !0
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Le = {
  name: "supportFeatureFlags",
  data: {
    isPlayerPortalSupportVisible: !1,
    isLauncherSupportVisible: !1
  },
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Ne = {
  name: "experimentalFeatureFlags",
  data: {},
  format: "v0",
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  version: 0
}, Oe = {
  name: "socialLinks",
  version: 0,
  updatedAt: "2022-08-02T10:10:18.055702328Z",
  format: "v0",
  data: {
    value: []
  }
}, Pe = {
  name: "copyright",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    value: "CopyrightⒸ 2022 AccelByte"
  }
}, Ce = {
  name: "templateConfig",
  data: {
    value: "single-game"
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394046739+07:00",
  version: 0
}, _e = {
  name: "globalPageConfig",
  data: {
    global: {
      colors: {
        background: {
          hex: "#000a33",
          rgb: {
            a: 1,
            b: 51,
            g: 10,
            r: 0
          }
        },
        card: {
          hex: "#00104f",
          rgb: {
            a: 1,
            b: 69,
            g: 30,
            r: 3
          }
        },
        overlay: {
          hex: "#000E46",
          rgb: {
            a: 0.6,
            b: 70,
            g: 14,
            r: 0
          }
        },
        primary: {
          hex: "#ff0000",
          rgb: {
            a: 1,
            b: 0,
            g: 0,
            r: 255
          }
        },
        secondary: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        },
        text: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        }
      },
      fonts: {
        body: "Rubik",
        customBodyFontUrl: "",
        title: "Rubik",
        customTitleFontUrl: ""
      }
    }
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394047751+07:00",
  version: 0
}, Fe = {
  name: "companyLogo",
  data: {
    images: [
      {
        name: "default",
        url: "https://cdn.development.accelbyte.io/files/accelbyte/od-assets/d084de15761f4bdfb96f004426e3db05.png"
      },
      {
        name: "",
        url: ""
      },
      {
        name: "",
        url: ""
      },
      {
        name: "",
        url: ""
      }
    ],
    defaultIndex: 0
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394055516+07:00",
  version: 0
}, xe = {
  name: "appId",
  data: {
    value: ""
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394055185+07:00",
  version: 0
}, Re = {
  name: "avatarsList",
  data: {
    value: `https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-1.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-2.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-3.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-4.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-5.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-6.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-7.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-8.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-9.svg
https://cdn.development.accelbyte.io/app-config/default-avatars/user-avatar-10.svg`
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.39404694+07:00",
  version: 0
}, De = {
  name: "favicon",
  data: {
    value: ""
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394055516+07:00",
  version: 0
}, we = {
  name: "brandName",
  data: {
    value: "AccelByte"
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394058922+07:00",
  version: 0
}, Ve = {
  name: "pageTitle",
  data: {
    value: "{pageTitle} - {brandName}"
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394058922+07:00",
  version: 0
}, Ue = {
  name: "launcherIcon",
  data: {
    value: ""
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394055516+07:00",
  version: 0
}, Se = {
  ppTemplateInfo: me,
  launcherTemplateInfo: ge,
  loginTemplateInfo: be,
  legalTemplateInfo: Te,
  paymentTemplateInfo: he,
  twitchDropTemplateInfo: ve,
  supportTemplateInfo: Ae,
  ppFeatureFlags: Ee,
  launcherFeatureFlags: Ie,
  loginFeatureFlags: ye,
  supportFeatureFlags: Le,
  experimentalFeatureFlags: Ne,
  socialLinks: Oe,
  copyright: Pe,
  templateConfig: Ce,
  globalPageConfig: _e,
  companyLogo: Fe,
  appId: xe,
  avatarsList: Re,
  favicon: De,
  brandName: we,
  pageTitle: Ve,
  launcherIcon: Ue
}, ke = {
  name: "logoVariant",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    footer: null
  }
}, Ge = {
  name: "launcherUpdateUrl",
  data: {
    value: "https://cdn.development.accelbyte.io/public/"
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394047381+07:00",
  version: 0
}, Be = {
  name: "pageConfig",
  data: {
    isLocalStyleEnabled: !0,
    global: {
      colors: {
        background: {
          hex: "#000a33",
          rgb: {
            r: 0,
            g: 10,
            b: 51,
            a: 1
          }
        },
        card: {
          hex: "#00104f",
          rgb: {
            r: 0,
            g: 16,
            b: 79,
            a: 1
          }
        },
        overlay: {
          hex: "#000E46",
          rgb: {
            r: 0,
            g: 14,
            b: 70,
            a: 0.6
          }
        },
        primary: {
          hex: "#0b6cff",
          rgb: {
            a: 1,
            b: 255,
            g: 108,
            r: 11
          }
        },
        secondary: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        },
        text: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        }
      },
      fonts: {
        title: "Rubik",
        customTitleFontUrl: "",
        body: "Rubik",
        customBodyFontUrl: ""
      }
    },
    loginPage: {
      background: "https://cdn.development.accelbyte.io/files/accelbyte/od-assets/d2f1d54fb10f4ca99deade04cfa64ff9.webp",
      backgroundOverlay: {
        isEnabled: !0,
        opacity: 100,
        type: "gradient"
      },
      boxButtonText: "Login",
      boxInfo: `Login to your account to play Omega Nebula,
connect with your friends, and explore our collection of exclusive content.`,
      boxLogo: "Omega Nebula",
      boxTitle: "Connect and Play",
      template: "defaultLoginPage"
    },
    mainPage: {
      background: "https://cdn.development.accelbyte.io/files/accelbyte/od-assets/efac3184c8fc4224b0f5bdcbe643556e.webp",
      backgroundOverlay: {
        isEnabled: !0,
        opacity: 100,
        type: "gradient"
      },
      gameTitle: "Omega Nebula",
      template: "defaultLoginPage"
    }
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394047751+07:00",
  version: 0
}, Me = {
  logoVariant: ke,
  launcherUpdateUrl: Ge,
  pageConfig: Be
}, We = {
  name: "logoVariant",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    header: null
  }
}, He = {
  name: "gameList",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    games: []
  }
}, $e = {
  name: "streamerInfo",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    isStreamButtonEnabled: !0,
    streamButton: {
      label: "View Streams",
      url: "https://example.com/streamer-info-url"
    }
  }
}, Ze = {
  name: "backgroundConfig",
  version: 0,
  updatedAt: "2022-11-24T18:51:26.92887125+07:00",
  format: "v0",
  data: {
    background: "",
    backgroundOverlay: {
      isEnabled: !0,
      opacity: 100,
      type: "gradient"
    }
  }
}, Ye = {
  name: "pageConfig",
  data: {
    isLocalStyleEnabled: !1,
    global: {
      colors: {
        background: {
          hex: "#000a33",
          rgb: {
            r: 0,
            g: 10,
            b: 51,
            a: 1
          }
        },
        card: {
          hex: "#00104f",
          rgb: {
            r: 0,
            g: 16,
            b: 79,
            a: 1
          }
        },
        overlay: {
          hex: "#000E46",
          rgb: {
            r: 0,
            g: 14,
            b: 70,
            a: 0.6
          }
        },
        primary: {
          hex: "#0b6cff",
          rgb: {
            a: 1,
            b: 255,
            g: 108,
            r: 11
          }
        },
        secondary: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        },
        text: {
          hex: "#ffffff",
          rgb: {
            a: 1,
            b: 255,
            g: 255,
            r: 255
          }
        }
      },
      fonts: {
        title: "Rubik",
        customTitleFontUrl: "",
        body: "Rubik",
        customBodyFontUrl: ""
      }
    }
  },
  format: "v0",
  updatedAt: "2022-08-03T09:36:32.394047751+07:00",
  version: 0
}, je = {
  logoVariant: We,
  gameList: He,
  streamerInfo: $e,
  backgroundConfig: Ze,
  pageConfig: Ye
}, R = class {
};
let D = R;
D.fetchDiscovery = async ({
  sdk: e,
  appName: t,
  widgetOptions: a,
  useConfigService: n
}) => {
  var i;
  if (a)
    return a;
  if (t !== l.WIDGET && !n)
    return Se;
  try {
    return await x.TemplatesApi(e).getConfigs_ByTemplate(ce);
  } catch (s) {
    throw d.isAxiosError(s) && ((i = s.response) == null ? void 0 : i.status) === 404 ? new E("Template discovery not found", t, b.NO_DISCOVERY_TEMPLATE_FOUND) : s instanceof k ? new E("Invalid configs structure", t, b.INVALID_CONFIGS) : s;
  }
};
D.fetchConfigs = async ({
  sdk: e,
  appName: t,
  discoveryData: a,
  widgetOptions: n,
  useConfigService: i
}) => {
  if (n)
    return n;
  if (t !== l.WIDGET && !i)
    return t === l.LAUNCHER ? Me : t === l.TWITCHDROP ? je : t === l.SUPPORT ? ne : X;
  let s = "";
  const o = a || await R.fetchDiscovery({ sdk: e, appName: t, useConfigService: i });
  if (!(o != null && o.ppTemplateInfo) && !(o != null && o.launcherTemplateInfo) && !(o != null && o.twitchDropTemplateInfo))
    throw new E("No templates have been published.", t, b.NO_TEMPLATES_FOUND);
  return t === l.PP || t === l.WIDGET ? s = o.ppTemplateInfo.data.published : t === l.LAUNCHER ? s = o.launcherTemplateInfo.data.published : t === l.TWITCHDROP ? s = o.twitchDropTemplateInfo.data.published : t === l.SUPPORT && (s = o.supportTemplateInfo.data.published), await x.TemplatesApi(e).getConfigs_ByTemplate(s);
};
export {
  l as A,
  E as C,
  d as E,
  pe as F,
  nt as L,
  H as O,
  W as S,
  lt as W,
  it as a,
  ct as b,
  b as c,
  L as d,
  I as e,
  y as f,
  D as g,
  st as h,
  c as i,
  ot as j,
  at as k,
  tt as l,
  M as m,
  X as p,
  ne as s,
  rt as u
};
