"use strict";const f=require("./Env-a6f11491.js"),w=require("./MockVars-3f79373d.js"),D=require("./LauncherLink-02383409.js"),m=require("classnames"),s=require("react"),c=require("./index-dae188cc.js");function b(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const g=b(s);const v=e=>{const{state:{playerPortalConfigData:t}}=c.useAppConfigs(),{state:{discoveryConfigData:n}}=c.useDiscoveryConfigs(),{mutations:{fetchLauncherConfigs:o}}=c.useAppConfigs(),{children:h,className:L}=e,[u]=f.useSdk();let l=!1;try{l=location.pathname.includes("/player-portal")}catch{}const[a,k]=s.useState(l?w.mockLauncherDownloadLink:t==null?void 0:t.launcherDownloadLink.data.value);return s.useEffect(()=>{if(!u)return;(async()=>{var d;if(n&&!a){const r=await o(n),p=await D.LauncherLink.getLauncherDownloadLink((d=r==null?void 0:r.data)==null?void 0:d.launcherUpdateUrl.data.value);k(p)}return null})()},[u,a]),g.createElement("a",{className:m(L,"btn small btn-primary","launcherDownloadButton",!a&&"disabled",f.OverrideCSS.TITLE_FONT),title:a||"Not available",target:"_blank",rel:"noreferrer",href:a||"",onClick:i=>{a||i.preventDefault()}},h)};exports.LauncherDownloadButton=v;
