1import{o as e}from"./chunk-94642797-1-81-19.js";import{t as r}from"./chunk-108386687-1-81-19.js";import{x as n}from"./chunk-1117061659-1-81-19.js";const o="onboardingStep",c="done";var i=["plan-selection","marketing-email","desktop-app"];function isOnboardingInProgress(e){return"string"==typeof e&&i.includes(e)}function resolveResumeStep(e){return isOnboardingInProgress(e)?e:"plan-selection"}var u=e(r(),1),s=e(n(),1),l=(0,u.forwardRef)(({as:e="div",...r},n)=>(0,s.jsx)(e,{...r,ref:n})),d="onloadTurnstileCallback",p=e=>!!document.getElementById(e),m=({render:e="explicit",onLoadCallbackName:r=d,scriptOptions:{nonce:n="",defer:o=!0,async:c=!0,id:i="",appendTo:u,onError:s,crossOrigin:l=""}={}})=>{let f=i||"cf-turnstile-script";if(p(f))return;let v=document.createElement("script");v.id=f,v.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?onload=${r}&render=${e}`,!document.querySelector(`script[src="${v.src}"]`)&&(v.defer=!!o,v.async=!!c,n&&(v.nonce=n),l&&(v.crossOrigin=l),s&&(v.onerror=s,delete window[r]),("body"===u?document.body:document.getElementsByTagName("head")[0]).appendChild(v))},f={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}};function g(e){if("invisible"!==e&&"interactionOnly"!==e)return e}function _(e="cf-turnstile-script"){let[r,n]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{let t=()=>{p(e)&&n(!0)},r=new MutationObserver(t);return r.observe(document,{childList:!0,subtree:!0}),t(),()=>{r.disconnect()}},[e]),r}var v,w="unloaded",h=new Promise((e,r)=>{v={resolve:e,reject:r},"ready"===w&&e(void 0)}),x=(e=d)=>("unloaded"===w&&(w="loading",window[e]=()=>{v.resolve(),w="ready",delete window[e]}),h),b=(0,u.forwardRef)((e,r)=>{let{scriptOptions:n,options:o={},siteKey:c,onWidgetLoad:i,onSuccess:d,onExpire:v,onError:h,onBeforeInteractive:b,onAfterInteractive:y,onUnsupported:E,onTimeout:k,onLoadScript:S,id:T,style:I,as:C="div",injectScript:O=!0,rerenderOnCallbackChange:R=!1,...L}=e,A=o.size,P=(0,u.useCallback)(()=>void 0===A?{}:"execute"===o.execution?f.invisible:"interaction-only"===o.appearance?f.interactionOnly:f[A],[o.execution,A,o.appearance]),[N,j]=(0,u.useState)(P()),G=(0,u.useRef)(null),[F,B]=(0,u.useState)(!1),$=(0,u.useRef)(void 0),U=(0,u.useRef)(!1),q=T||"cf-turnstile",D=(0,u.useRef)({onSuccess:d,onError:h,onExpire:v,onBeforeInteractive:b,onAfterInteractive:y,onUnsupported:E,onTimeout:k});(0,u.useEffect)(()=>{R||(D.current={onSuccess:d,onError:h,onExpire:v,onBeforeInteractive:b,onAfterInteractive:y,onUnsupported:E,onTimeout:k})});let M=n?.id||"cf-turnstile-script",z=_(M),W=n?.onLoadCallbackName||"onloadTurnstileCallback",H=o.appearance||"always",K=(0,u.useMemo)(()=>({sitekey:c,action:o.action,cData:o.cData,theme:o.theme||"auto",language:o.language||"auto",tabindex:o.tabIndex,"response-field":o.responseField,"response-field-name":o.responseFieldName,size:g(A),retry:o.retry||"auto","retry-interval":o.retryInterval||8e3,"refresh-expired":o.refreshExpired||"auto","refresh-timeout":o.refreshTimeout||"auto",execution:o.execution||"render",appearance:o.appearance||"always","feedback-enabled":o.feedbackEnabled??!0,callback:e=>{U.current=!0,R?d?.(e):D.current.onSuccess?.(e)},"error-callback":R?h:(...e)=>D.current.onError?.(...e),"expired-callback":R?v:(...e)=>D.current.onExpire?.(...e),"before-interactive-callback":R?b:(...e)=>D.current.onBeforeInteractive?.(...e),"after-interactive-callback":R?y:(...e)=>D.current.onAfterInteractive?.(...e),"unsupported-callback":R?E:(...e)=>D.current.onUnsupported?.(...e),"timeout-callback":R?k:(...e)=>D.current.onTimeout?.(...e)}),[o.action,o.appearance,o.cData,o.execution,o.language,o.refreshExpired,o.responseField,o.responseFieldName,o.retry,o.retryInterval,o.tabIndex,o.theme,o.feedbackEnabled,o.refreshTimeout,c,A,R,R?d:null,R?h:null,R?v:null,R?b:null,R?y:null,R?E:null,R?k:null]),J=(0,u.useCallback)(()=>typeof window<"u"&&!!window.turnstile,[]);return(0,u.useEffect)(function(){O&&!F&&(x(W),m({onLoadCallbackName:W,scriptOptions:{...n,id:M}}))},[O,F,n,M,W]),(0,u.useEffect)(function(){"ready"!==w&&x(W).then(()=>B(!0)).catch(console.error)},[W]),(0,u.useEffect)(function(){if(!G.current||!F)return;let e=!1;return(async()=>{e||!G.current||($.current=window.turnstile.render(G.current,K),$.current&&i?.($.current))})(),()=>{e=!0,$.current&&(window.turnstile.remove($.current),U.current=!1)}},[q,F,K]),(0,u.useImperativeHandle)(r,()=>{let{turnstile:e}=window;return{getResponse(){if(e?.getResponse&&$.current&&J())return e.getResponse($.current);console.warn("Turnstile has not been loaded")},getResponsePromise:async(e=3e4,r=100)=>new Promise((n,o)=>{let c,a=async()=>
1{if(U.current&&window.turnstile&&$.current)try{let e=window.turnstile.getResponse($.current);return c&&clearTimeout(c),e?n(e):o(Error("No response received"))}catch(e){return c&&clearTimeout(c),console.warn("Failed to get response",e),o(Error("Failed to get response"))}c||=setTimeout(()=>{c&&clearTimeout(c),o(Error("Timeout"))},e),await new Promise(e=>setTimeout(e,r)),await a()};a()}),reset(){if(e?.reset&&$.current&&J()){"execute"===o.execution&&j(f.invisible);try{U.current=!1,e.reset($.current)}catch(e){console.warn(`Failed to reset Turnstile widget ${$.current}`,e)}}else console.warn("Turnstile has not been loaded")},remove(){e?.remove&&$.current&&J()?(j(f.invisible),U.current=!1,e.remove($.current),$.current=null):console.warn("Turnstile has not been loaded")},render(){if(!e?.render||!G.current||!J()||$.current)return void console.warn("Turnstile has not been loaded or container not found");let r=e.render(G.current,K);return $.current=r,$.current&&i?.($.current),"execute"!==o.execution&&j(A?f[A]:{}),r},execute(){"execute"===o.execution?e?.execute&&G.current&&$.current&&J()?(e.execute(G.current,K),j(A?f[A]:{})):console.warn("Turnstile has not been loaded or container not found"):console.warn('Execution mode is not set to "execute"')},isExpired:()=>e?.isExpired&&$.current&&J()?e.isExpired($.current):(console.warn("Turnstile has not been loaded"),!1)}},[$,o.execution,A,K,G,J,F,i]),(0,u.useEffect)(()=>{if(F||!z)return;if(window.turnstile)return void B(!0);let e=setInterval(()=>{window.turnstile&&(B(!0),clearInterval(e))},50);return()=>{clearInterval(e)}},[F,z]),(0,u.useEffect)(()=>{j(P())},[o.execution,A,H]),(0,u.useEffect)(()=>{!z||"function"!=typeof S||S()},[z]),(0,s.jsx)(l,{ref:G,as:C,id:q,style:{...N,...I},...L})});b.displayName="Turnstile";var y=(0,u.createContext)(null);function GoogleOAuthProvider({clientId:e,nonce:r,onScriptLoadSuccess:n,onScriptLoadError:o,children:c}){const i=function useLoadGsiScript(e={}){const{nonce:r,onScriptLoadSuccess:n,onScriptLoadError:o}=e,[c,i]=(0,u.useState)(!1),s=(0,u.useRef)(n);s.current=n;const l=(0,u.useRef)(o);return l.current=o,(0,u.useEffect)(()=>{const e=document.createElement("script");return e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,e.nonce=r,e.onload=()=>{var e;i(!0),null===(e=s.current)||void 0===e||e.call(s)},e.onerror=()=>{var e;i(!1),null===(e=l.current)||void 0===e||e.call(l)},document.body.appendChild(e),()=>{document.body.removeChild(e)}},[r]),c}({nonce:r,onScriptLoadSuccess:n,onScriptLoadError:o}),s=(0,u.useMemo)(()=>({clientId:e,scriptLoadedSuccessfully:i}),[e,i]);return u.createElement(y.Provider,{value:s},c)}function useGoogleLogin({flow:e="implicit",scope:r="",onSuccess:n,onError:o,onNonOAuthError:c,overrideScope:i,state:s,...l}){const{clientId:d,scriptLoadedSuccessfully:f}=function useGoogleOAuth(){const e=(0,u.useContext)(y);if(!e)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return e}(),v=(0,u.useRef)(),w=(0,u.useRef)(n);w.current=n;const h=(0,u.useRef)(o);h.current=o;const b=(0,u.useRef)(c);b.current=c,(0,u.useEffect)(()=>{var n,o;if(!f)return;const c="implicit"===e?"initTokenClient":"initCodeClient";v.current=null===(o=null===(n=null===window||void 0===window?void 0:window.google)||void 0===n?void 0:n.accounts)||void 0===o?void 0:o.oauth2[c]({client_id:d,scope:i?r:`openid profile email ${r}`,callback:e=>{var r,n;if(e.error)return null===(r=h.current)||void 0===r?void 0:r.call(h,e);null===(n=w.current)||void 0===n||n.call(w,e)},error_callback:e=>{var r;null===(r=b.current)||void 0===r||r.call(b,e)},state:s,...l})},[d,f,e,r,s]);const E=(0,u.useCallback)(e=>{var r;return null===(r=v.current)||void 0===r?void 0:r.requestAccessToken(e)},[]),k=(0,u.useCallback)(()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.requestCode()},[]);return"implicit"===e?E:k}export{o as a,c as i,useGoogleLogin as n,isOnboardingInProgress as o,b as r,resolveResumeStep as s,GoogleOAuthProvider as t}; 2//# sourceMappingURL=chunk-808656285-1-81-19.js.map
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.