PageSourceSearch

https://rotohound.com/assets/ConnectExtensionPage-DWUbcnXi.js

js rotohound.com collected 2026-09-24 14:18:12 UTC 5,851 bytes, 1 lines download raw bytes

1import{j as e,q as y,C as F,n as R,l as E,L as I,k as o,u as x,A as S,h as g,i as O}from"./vendor-mantine-DnsVasE9.js";import{r as j}from"./vendor-react-DEH02D30.js";import{u as B,s as b}from"./index-BFBzg06E.js";import{c as H}from"./extension-tokens-BP5UJvLB.js";import{i as k,C as N}from"./extension-detect-BcqzZu3H.js";import"./vendor-supabase-D8ud9Cwr.js";async function P(i,h,n){for(let m=0;m<20&&!n()&&!h();m++)i(),await new Promise(u=>setTimeout(u,400));return!n()&&h()}const z="rotohound-connect-page",L="rotohound-connect-ext";function G(){const i=new URLSearchParams(window.location.search).get("client")==="safari",h=new URLSearchParams(window.location.search).get("platform"),n=["NFBC","CBS","ESPN","Fantrax","RTSports"].includes(h||"")?h:"NFBC",{user:m,loading:u}=B(),[d,a]=j.useState("checking"),[T,f]=j.useState("");return j.useEffect(()=>{if(u)return;if(!m){b(i?`/connect-extension?client=safari&platform=${n}`:"/connect-extension"),a("need-login");return}let t=!1,c=!1,l=!1;a("checking");const p=s=>window.postMessage({source:z,...s},window.location.origin),w=async()=>{if(t||l)return;l=!0,a("connecting");let s;try{s=(await H(i?"Safari extension":"Chrome extension (one-click connect)")).token}catch(r){t||(f(r?.message||"Could not create a token."),a("error"));return}t||(p({type:"connect-token",token:s}),window.setTimeout(()=>{!t&&!c&&(f(i?"The extension didn’t confirm. Allow RotoHound Importer on this website in Safari’s extension menu, then reload this page.":"The extension didn’t confirm. Reload this page to retry, or paste the token in the extension’s Options."),a("error"))},4e3))},C=s=>{if(s.origin!==window.location.origin||s.source!==window)return;const r=s.data;if(!(!r||r.source!==L))if(r.type==="connect-status"){if(c||l)return;r.hasToken?(c=!0,t||a("connected")):w()}else r.type==="connected"?(c=!0,t||a("connected")):r.type==="connect-error"&&(c=!0,t||(f(r.error||"The extension could not store the token."),a("error")))};return window.addEventListener("message",C),(async()=>{if(i){await P(()=>p({type:"connect-check"}),()=>c||l,()=>t),!t&&!c&&!l&&a("need-extension");return}for(let s=0;s<12&&!k();s++)if(await new Promise(r=>setTimeout(r,150)),t)return;if(!t){if(!k()){a("need-extension");return}p({type:"connect-check"}),window.setTimeout(()=>{!t&&!c&&!l&&w()},1500)}})(),()=>{t=!0,window.removeEventListener("message",C)}},[m,u,i,n]),e.jsx(y,{mih:"100vh",p:"md",children:e.jsx(F,{withBorder:!0,radius:"md",p:"xl",maw:440,w:"100%",children:e.jsxs(R,{gap:"md",align:"center",ta:"center",children:[e.jsx(E,{order:3,children:"Connect to RotoHound"}),(d==="checking"||d==="connecting")&&e.jsxs(e.Fragment,{children:[e.jsx(I,{}),e.jsx(o,{c:"dimmed",size:"sm",children:d==="connecting"?"Linking the RotoHound Importer extension…":"Checking…"})]}),d==="connected"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{fz:40,"aria-hidden":!0,children:"✓"}),e.jsx(o,{fw:600,children:"Extension connected"}),i?e.jsxs(e.Fragment,{children:[e.jsxs(o,{fw:600,size:"sm",children:["Next, import your ",n," leagues"]}),e.jsxs(x,{size:"sm",spacing:"xs",ta:"left",children:[e.jsx(x.Item,{children:n==="NFBC"?e.jsxs(e.Fragment,{children:["Open ",e.jsx(S,{href:"https://nfc.shgn.com/myTeams",children:"NFBC My Teams"})," in Safari and sign in."]}):e.jsxs(e.Fragment,{children:["Open your ",n," baseball league website in Safari and sign in."]})}),e.jsxs(x.Item,{children:["Tap Safari’s page menu beside the website address, then ",e.jsx("strong",{children:"RotoHound Importer"}),". Tap ",e.jsx("strong",{children:"…"})," if it is not visible. On Mac, use the extension in Safari’s toolbar."]}),e.jsx(x.Item,{children:n==="NFBC"||n==="Fantrax"?e.jsxs(e.Fragment,{children:["Choose ",e.jsxs("strong",{children:["Open ",n," importer"]}),", select your leagues, and tap ",e.jsx("strong",{children:"Import selected leagues"}),"."]}):e.jsxs(e.Fragment,{children:["Select ",n," and tap ",e.jsx("strong",{children:"Import"})," to continue league setup."]})})]}),n==="NFBC"&&e.jsx(o,{c:"dimmed",size:"sm",children:"A signed-in NFBC league page also works. The importer opens the roster grid and standings for you."})]}):e.jsx(o,{c:"dimmed",size:"sm",children:"You can close this tab. Open the RotoHound Importer on any supp
1orted league page (CBS, NFBC, Fantrax, ESPN, Yahoo, Ottoneu, OnRoto, RTSports, or Fleaflicker) and click Import."})]}),d==="need-login"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{fw:600,children:"Sign in to finish connecting"}),e.jsx(o,{c:"dimmed",size:"sm",children:"Sign in to RotoHound and we’ll bring you right back here to finish connecting the extension, automatically."}),e.jsx(g,{component:"a",href:"/login",children:"Sign in"})]}),d==="need-extension"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{fw:600,children:i?"Safari hasn’t connected the extension yet":"Extension not detected"}),e.jsx(o,{c:"dimmed",size:"sm",children:i?"Tap Try again to reload this page. If it still cannot connect, open Safari’s page menu, choose RotoHound Importer, and allow access to rotohound.com.":e.jsxs(e.Fragment,{children:["Install the RotoHound Importer extension, then click ",e.jsx("strong",{children:"Connect to RotoHound"})," in its popup to open this page again."]})}),i?e.jsx(g,{onClick:()=>window.location.reload(),children:"Try again"}):e.jsx(g,{component:"a",href:N,target:"_blank",rel:"noreferrer",children:"Get the extension"})]}),d==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{fw:600,c:"red",children:"Couldn’t connect"}),e.jsx(o,{c:"dimmed",size:"sm",children:T}),e.jsx(O,{children:e.jsx(g,{variant:"default",onClick:()=>window.location.reload(),children:"Try again"})}),!i&&e.jsxs(o,{c:"dimmed",size:"xs",children:["Or generate a token in ",e.jsx(S,{href:"/settings",children:"Settings → Chrome Extension Tokens"})," and paste it into the extension’s Options."]})]})]})})})}export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.