"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),N=require("./LauncherDownloadButton-c791cffe.js"),H=require("./i18n-32443dcb.js"),l=require("./FetchConfigsUtils-c73b687c.js"),m=require("classnames"),w=require("react-i18next"),d=require("./UrlUtils-9f8c497b.js"),k=require("./LoginWidget-e21bcd11.js"),b=require("./useAppConfigs-4e45ddb8.js"),q=require("./index-99b8957b.js"),R=require("./HeaderAlerts-285d6db8.js"),f=require("./useCompanyLogo-4171f0bd.js"),M=require("./useDiscoveryConfigs-367fb38f.js");require("./MockVars-66680ee9.js");require("@accelbyte/sdk");require("./Env-b79cd29a.js");require("flat");require("i18next");require("date-fns");require("./SSRHelper-b80e8420.js");require("./RouteUtils-afc2b70b.js");require("zod");require("uuid");require("axios");require("@accelbyte/sdk-iam");require("./LoginIcon-ac34cdc4.js");require("./Button-44f4db23.js");require("react-feather");require("./CommonError-c282a0a2.js");require("./ArrowIcon-2acb52ce.js");require("./Loading-d3cd7ee0.js");require("./ProfileImage-5c51b03f.js");require("./LogoutIcon-bcb108a7.js");require("./useUserInfo-dc3105ae.js");require("@accelbyte/sdk-basic");require("./useAppState-f8f05e41.js");require("@accelbyte/sdk-gdpr");require("@accelbyte/sdk-legal");require("./widget-ctx-77b0a02e.js");require("shortid");require("./InfoIcon-57b0b7a1.js");require("./Alert-dec85153.js");require("./useHeaderAlerts-609b825f.js");const C=({className:t,title:n})=>e.createElement("i",{className:t},e.createElement("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},!!n&&e.createElement("title",null,n),e.createElement("path",{d:"M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"})));const S=({logo:t,isHomepageDisabled:n,siteBrandURL:i,redirectionURL:c})=>{const{state:r}=l.useRoutes(),[o]=l.useSdkOptions();let a=r.home.link,u=!1;if(n){if(i){const s=d.UrlUtils.getRouterRedirection(i,o.baseURL);u=!s,a=s||i}if(!i&&c){const s=d.UrlUtils.getRouterRedirection(c,o.baseURL);u=!s,a=s||c}}return u?e.createElement("a",{className:"logo",href:a},e.createElement("img",{src:t,alt:"logo"})):e.createElement(q.Link,{className:"logo",to:a},e.createElement("img",{src:t,alt:"logo"}))},U=({menus:t})=>e.createElement("nav",{className:"navigationContainer"},t==null?void 0:t.map((n,i)=>e.createElement(q.NavLink,{key:`menuLink-${i}`,className:"menuLink",to:n.pathname},n.label))),O=t=>{const{areLinksHidden:n,menus:i,userDropdownMenus:c}=t,{state:{playerPortalConfigData:r}}=b.useAppConfigs(),{state:{flags:o}}=M.useDiscoveryConfigs(),{companyLogo:a}=f.useCompanyLogo(l.AppName.PP,"header"),u=e.useRef(null),[s,g]=e.useState(!1),E=r==null?void 0:r.homepage.data.siteBrandURL,h=r==null?void 0:r.homepage.data.redirectionURL,p=!!(r!=null&&r.homepage.data.isDisabled),v=o==null?void 0:o.isGetLauncherVisible,L=()=>{g(!s)};return e.createElement(e.Fragment,null,e.createElement("header",{className:m("headerPP",l.OverrideCSS.TITLE_FONT,"headerPreview")},e.createElement("div",{className:"translucent"}),e.createElement("div",{className:"headerContent"},e.createElement("div",{className:"logoContainer"},a&&e.createElement(S,{logo:a,isHomepageDisabled:p,siteBrandURL:E,redirectionURL:h})),!n&&e.createElement(e.Fragment,null,e.createElement("div",{className:"hamburgerMenu"},e.createElement("button",{ref:u,className:"menuIconContainer",onClick:L},e.createElement(C,{className:"menuIcon",title:H.t("Header.menuTitle")}))),e.createElement("div",{className:m("dropdownMenu",s?"open":"closed")},e.createElement(U,{menus:i}),e.createElement(k.LoginWidget,{userDropdownMenus:c}),v&&e.createElement("div",{className:"getLauncherButtonContainer"},e.createElement(N.LauncherDownloadButton,null,e.createElement(w.Trans,{i18nKey:"Header.getLauncherButton"},"Get Launcher")))))),e.createElement(R.HeaderAlerts,{className:"headerAlerts"})))};exports.HeaderWidget=O;
