1import{R as l}from"./Route-CxMm_NyP.js";import{S as w}from"./Switch-Co2yodZD.js";import{w as T}from"./CoreSessionContext-DF_QCjn3.js";import{F as S}from"./Flow-DK59I9CX.js";import{u as O}from"./RouteContext-DPNEaInE.js";import{u as y}from"./EnvironmentContext-MT90sLfX.js";import{u as C}from"./useFetch-D5tAkU8G.js";import{u as G}from"./GoogleOneTap-CN_wORrA.js";import{withCardStateProvider as k}from"./index-BJ4nsr-b.js";import{ed as _,ee as v,bU as I,c as R,r as s,bM as n}from"./index-DaJJdpWR.js";import"./useNavigateToFlowStart-DZHGmDS_.js";import"./url-DaPDWryr-CvKPTBom.js";import"./underscore-ClYSgvuy-PzdM3hke.js";import"./index-B670rpzz.js";import"./AppearanceContext-Bn3JpDe3.js";import"./OptionsContext-QJQyYAAJ.js";import"./makeCustomizable-CNSTBc9X.js";import"./redirectUrls-BgUwm5y9.js";import"./makeLocalizable-Bw_lbo8G.js";import"./localizationKeys-L95TEc06.js";import"./floating-ui.react-DY7EhHRq.js";async function b(){if(!window.google)try{await _("https://accounts.google.com/gsi/client",{defer:!0})}catch{v("Google Identity Services")}return window.google}function x(){const r=I(),{user:t}=R(),d=y(),i=s.useRef(!1),{navigate:m}=O(),a=G();async function f(o){i.current=!1;try{const c=await r.authenticateWithGoogleOneTap({token:o.credential});await r.handleGoogleOneTapCallback(c,a.generateCallbackUrls(window.location.href),m)}catch(c){console.error(c)}}const p=d.displayConfig.googleOneTapClientId,g=!(t!=null&&t.id)&&!!p;async function h(){const o=await b();return o.accounts.id.initialize({client_id:p,callback:f,itp_support:a.itpSupport,cancel_on_tap_outside:a.cancelOnTapOutside,auto_select:!1,use_fedcm_for_prompt:a.fedCmSupport}),o}const{data:e}=C(g?h:void 0,"google-identity-services-script");return s.useEffect(()=>{e&&!(t!=null&&t.id)&&!i.current&&(e.accounts.id.prompt(o=>{o.getMomentType()==="skipped"&&r.closeGoogleOneTap()}),i.current=!0)},[r,e,t==null?void 0:t.id]),s.useEffect(()=>()=>{e&&i.current&&(i.current=!1,e.accounts.id.cancel())},[e]),null}const E=k(x);function u(){return n(l,{path:"one-tap",children:n(S.Root,{flow:"oneTap",children:n(w,{children:n(l,{index:!0,children:n(E,{})})})})})}u.displayName="OneTap";const $=T(u);export{$ as OneTap};
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.