!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0b198109-a240-3f85-9232-a485a311c0c1")}catch(e){}}(); define(["require","exports","./c_init_data_debug_panel","./c_pap-events_browse_view_folder_picker","./e_file_viewer_static_scl_page_folder","./c_core_notify","./c_core_i18n","react","react-dom","./c_atoms_dwg-box_index","./c_helpers_hooks_component-did-mount","./c_dig-icons_assets_ui-icon_line_globe","./c_react-transition-group_CSSTransition","./c_pap-events_enums_flexible_sharing_entry_point_variant-utils","./c_admin_registration_source_constants","./e_core_exception","./e_edison","./c_flux_action_type","./c_ungated_idx_db_access_lib","./c_viewer_json"],(function(e,t,n,i,o,a,s,r,l,d,c,g,u,h,p,m,_,S,E,f){"use strict";function I(e){return e&&e.__esModule?e:{default:e}}var v=I(r),L=I(l);const T={log_web_login_intent(){G({".tag":"web_login_intent"})},log_web_signup_intent(){G({".tag":"web_signup_intent"})},log_web_login_captcha(){G({".tag":"web_login_captcha"})},log_web_signup_captcha(){G({".tag":"web_signup_captcha"})}},O=(e,t)=>{const n=o.filterApiError(t);if(!n)return!1;let i;const a=(null==n?void 0:n.response)||(null==n?void 0:n.message)||(null==n?void 0:n.summary);return!!a&&(a.indexOf("Fetch network failure - message aborted or user offline")>-1?i="Fetch network failure - message aborted or user offline":a.indexOf("invalid_logged_out_cookie/")>-1?i="invalid_logged_out_cookie":a.indexOf("invalid_csrf_token/")>-1&&(i="invalid_csrf_token"),!!i&&(o.UDCL.logEvent({class:"api_error",action:"auth_event_logger",object:"client"},{tags:{event_name:e,rpc_path:"log_auth_event",error:i}}),!0))},G=e=>{const t=new o.NoAuthApiV2Client;try{(function(e){return e.ns("auth_logger")})(t).rpc("log_auth_event",{event_name:e,event_url:o.get_href()},{})}catch(t){const n=e[".tag"];O(n,t)||m.reportException({err:t,severity:m.SEVERITY.NONCRITICAL,tags:["login_or_register"]})}};var C;t.SignupEndpoints=void 0,(C=t.SignupEndpoints||(t.SignupEndpoints={})).TEAM_REGISTER="/team/join/register",C.MIGRATING_TEAM_REGISTER="/team/join/new_personal",C.THIRD_PARTY_SIGNUP="/ajax_thirdparty_register",C.PAIR_ACCOUNT="/team/join/new_pair_ajax";const y=v.default.createContext({onError:()=>{}});class b extends Error{constructor(e,t){super(e),this.name="DWGComponentRenderError",this.stack=null==t?void 0:t.stack}}class N extends v.default.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!!e}}componentDidCatch(e){var t;const{hostComponentName:n,extraMessage:i,onError:o,isCritical:a}=this.props,s=new b(`A ${a?"critical":"non-critical"} error happened in ${n} and it is being handled locally and does not block the plank. ${e.message}. ${null!=i?i:""}`,e);"function"==typeof(null===(t=this.context)||void 0===t?void 0:t.onError)&&this.context.onError({err:s,componentName:n,isCritical:a}),"function"==typeof o&&o(s)}render(){return this.state.hasError?this.props.fallback:this.props.children}}N.displayName="DWGNonCriticalComponentErrorBoundary",N.contextType=y;const A=({fallback:e=null,...t})=>c.useComponentDidMount()?v.default.createElement(r.Suspense,{fallback:e,...t}):v.default.isValidElement(e)?e:null,w={ArrowRightLine:o.ArrowRightLine,ChevronDownLine:o.ChevronDownLine,GlobeLine:g.GlobeLine},P=({className:e,color:t,children:n=null,isPictogram:i,size:a,dataTestId:s})=>{const r=i?"pictogram":a,l=o.cx(e,`dwg-lazy-icon--${r}`);return v.default.createElement(d.DWGBox,{tagName:"span",className:l,display:"inline-block",color:t,"data-testid":s},n)},M=v.default.lazy((()=>{const t=new Promise((function(t,n){e(["./c_dig-icons_index"],t,n)})).then((({UIIcon:e,PictogramIcon:t})=>[e,t])),n=new Promise((function(t,n){e(["./c_dig-icons_assets_index"],t,n)})).then((function(e){return e.AllIcons})).then((({ActivityLine:e,AddFolderLine:t,AiLine:n,AnalyticsDownloadLine:i,AnalyticsLine:o,AppleExternalLogo:a,AppsLine:s,ArrowDownLine:r,ArrowRightLine:l,ArrowUpLine:d,ArrowLeftLine:c,AgreementLine:g,BackupLine:u,CheckmarkCircleLine:h,CheckmarkLine:p,ChevronDownLine:m,ChevronLeftLine:_,ChevronRightLine:S,ClockLine:E,CloseLine:f,ClosedCaptionsLine:I,CloudDoneLine:v,CommentLine:L,CustomizeLine:T,DropboxDashLine:O,DropboxDocSendLine:G,DropboxSignLine:C,EmailFill:y,EmojiAddLine:b,EmojiSmileUpsideDownLine:N,EncryptedLine:A,FacebookExternalLogo:w,FailLine:P,FilterLine:M,FolderLine:R,FullscreenLine:k,FullscreenExitLine:D,GlobeLine:x,HideLine:U,ImageLine:F,InstagramExternalLogo:B,InfoLine:V,InfoSmallLine:z,KakaoTalkExternalLogo:W,KeyLine:H,LegalLine:j,LinkedInExternalLogo:$,LinkLine:q,ListViewLine:Y,LockLine:J,MeetingNotesLine:X,MobileLine:K,MoneyAddLine:Q,MultipleFoldersLine:Z,PasswordsLine:ee,PdfLine:te,PersonLine:ne,PersonMultipleLine:ie,PersonPausePictogram:oe,PhoneSupportLine:ae,PauseCircleLine:se,PlayCircleFill:re,PlayCircleLine:le,PuzzlePieceLine:de,SearchLine:ce,SendLine:ge,SettingsLine:ue,ShareArrowLine:he,ShareLine:pe,ShieldLine:me,ShowLine:_e,SignatureLine:Se,SignInLine:Ee,SpaceLine:fe,ThumbsUpLine:Ie,Twinkle2Line:ve,UploadLine:Le,UpsellLine:Te,VideoProjectLine:Oe,WarningLine:Ge,WatermarkLine:Ce,XTwitterExternalLogo:ye,YoutubeExternalLogo:be})=>({ActivityLine:e,AddFolderLine:t,AiLine:n,AnalyticsDownloadLine:i,AnalyticsLine:o,AppleExternalLogo:a,AppsLine:s,ArrowDownLine:r,ArrowRightLine:l,ArrowUpLine:d,ArrowLeftLine:c,AgreementLine:g,BackupLine:u,CheckmarkCircleLine:h,CheckmarkLine:p,ChevronDownLine:m,ChevronLeftLine:_,ChevronRightLine:S,ClockLine:E,CloseLine:f,ClosedCaptionsLine:I,CloudDoneLine:v,CommentLine:L,CustomizeLine:T,DropboxDashLine:O,DropboxDocSendLine:G,DropboxSignLine:C,EmailFill:y,EmojiAddLine:b,EmojiSmileUpsideDownLine:N,EncryptedLine:A,FacebookExternalLogo:w,FailLine:P,FilterLine:M,FolderLine:R,FullscreenLine:k,FullscreenExitLine:D,GlobeLine:x,HideLine:U,ImageLine:F,InstagramExternalLogo:B,InfoLine:V,InfoSmallLine:z,KakaoTalkExternalLogo:W,KeyLine:H,LegalLine:j,LinkedInExternalLogo:$,LinkLine:q,ListViewLine:Y,LockLine:J,MeetingNotesLine:X,MobileLine:K,MoneyAddLine:Q,MultipleFoldersLine:Z,PasswordsLine:ee,PdfLine:te,PersonLine:ne,PersonMultipleLine:ie,PersonPausePictogram:oe,PhoneSupportLine:ae,PauseCircleLine:se,PlayCircleFill:re,PlayCircleLine:le,PuzzlePieceLine:de,SearchLine:ce,SendLine:ge,SettingsLine:ue,ShareArrowLine:he,ShareLine:pe,ShieldLine:me,ShowLine:_e,SignatureLine:Se,SignInLine:Ee,SpaceLine:fe,ThumbsUpLine:Ie,Twinkle2Line:ve,UploadLine:Le,UpsellLine:Te,VideoProjectLine:Oe,WarningLine:Ge,WatermarkLine:Ce,XTwitterExternalLogo:ye,YoutubeExternalLogo:be})));return Promise.all([t,n]).then((([e,t])=>({default:({src:n,size:i,moduleName:o})=>{const a=t[n],s=e["PictogramIcon"===o?1:0];return a?v.default.createElement(s,{src:a,size:i}):null}})))})),R=({src:e,className:t,size:n="standard",color:i,dataTestId:a})=>{const s=w[e];return v.default.createElement(P,{className:t,isPictogram:!1,color:i,size:n,dataTestId:a},s?v.default.createElement(o.UIIcon,{src:s,size:n}):v.default.createElement(N,{fallback:null,hostComponentName:`dwg-lazy-icon-${e}`},v.default.createElement(A,null,v.default.createElement(M,{src:e,moduleName:"UIIcon",size:n}))))};R.displayName="DWGLazyUIIcon";const k=({children:e,className:t,tagName:n="div",alignItems:i="center",justifyContent:a,justifySelf:s,style:r,display:l="grid",padding:c=0,margin:g=0,innerRef:u,...h})=>{const p=o.cx("dwg-stack","dwg-stack--v2",t);return v.default.createElement(d.DWGBox,{...h,tagName:n,className:p,style:r,padding:c,margin:g,display:l,justifyContent:a,justifySelf:s,alignItems:i,ref:u},e)},D=({className:e,gap:t,justifyContent:n,...i})=>v.default.createElement(k,{className:o.cx(e,"dwg-stack--grid-flow-row",d.getClassesFromBreakpoints(d.cleanBreakpointValue(t,o.spacingValuesSansAuto,void 0),"dwg-row-gap")),justifyContent:null!=n?n:"stretch",...i});D.displayName="DWGStackVertical";const x=({className:e,gap:t,justifyContent:n,justifySelf:i,...a})=>v.default.createElement(k,{className:o.cx(e,"dwg-stack--grid-flow-column",d.getClassesFromBreakpoints(d.cleanBreakpointValue(t,o.spacingValuesSansAuto,void 0),"dwg-column-gap")),justifyContent:null!=n?n:"flex-start",justifySelf:i,...a});x.displayName="DWGStackHorizontal";const U=(e,t)=>"object"==typeof e?e[t]:e,F=(e,t)=>{var n;return"mobile"===t?U(e,t):null!==(n=U(e,t))&&void 0!==n?n:F(e,(e=>{switch(e){case"mobileLarge":return"mobile";case"tablet":return"mobileLarge";case"tabletLarge":return"tablet";case"desktop":return"tabletLarge";case"desktopLarge":return"desktop";case"ultrawide":return"desktopLarge"}})(t))};function B(e,t){const{isHomepageRedesignNav:n}=t;switch(e){case"primary":return{backgroundColor:n?"core-primary":"core-accent",backgroundColorDisabled:"disabled",borderColor:n?"core-primary":"core-accent",borderColorDisabled:"disabled",borderStyle:"solid",color:"inverse-standard",colorDisabled:n?"inverse-standard":"inverse-faint"};case"outline":return{backgroundColor:"transparent",borderColor:"core-primary",borderColorActive:"core-primary",borderColorDisabled:"disabled",borderStyle:"solid",color:"standard",colorDisabled:"disabled"};case"transparent":return{backgroundColor:"transparent",color:"standard",colorActive:"standard",colorDisabled:"disabled"}}}const V=({icon:e,className:t})=>{switch(e){case"up":return v.default.createElement(R,{className:t,src:"ArrowUpLine",dataTestId:"icon--ArrowUpLine"});case"down":return v.default.createElement(R,{className:t,src:"ArrowDownLine",dataTestId:"icon--ArrowDownLine"});case"end":return v.default.createElement(R,{className:t,src:"ArrowRightLine"});case"start":return v.default.createElement(R,{className:t,src:"ArrowLeftLine"})}};function z(e){switch(e){case"none":return{padding:0};case"x-small":return{paddingLeft:1.5,paddingRight:1.5};case"small":return{paddingTop:1,paddingBottom:1,paddingLeft:3,paddingRight:3};case"standard":return{paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3};case"large":return{padding:3}}}function W({href:e,disabled:t,arrowLocation:n}){const i="#"===e||"#top"===e,o=!(t||void 0===e)&&!!e&&(/^#[a-zA-Z][\w:.-]*$/.test(e)||i),[a,s]=r.useState(0),l=r.useCallback((t=>{if(o&&e&&!i&&t){const n=document.querySelector(e);n&&s(t.compareDocumentPosition(n))}}),[e,i,o]),d=function(e,t,n,i){return e?e&&(t||n&H)?"up":e&&n&j?"down":void 0:i}(o,i,a,n);return[l,d]}const H=2,j=4;const $=v.default.memo((({buttonStyle:t,customIcon:n,disableArrow:i,size:a="standard",labelSize:s="standard",width:l,disabled:g=!1,arrowLocation:u="end",rel:h="",target:p,href:m,onClick:_,label:S,iconMargin:E=3,className:f,susiRefreshExpIsLoading:I,susiRefreshExpSpinnerValueText:L,susiRefreshExpPreloadProgressIndicators:T,spinnerIsMonochromatic:O,spinnerIsOpaqueTrack:G,justifySelf:C,textDecoration:y="none",isHomepageRedesignNav:b,...N})=>{const A=g||void 0===m,w=A?"button":"a",P="dwg-button2",M=o.cx(f,P,`${P}--button-style-${t}`,`${P}--button-size-${a}`,{[`${P}--disabled`]:g,[`${P}--loading`]:I,[`${P}--homepage-redesign-nav`]:b});"_blank"!==p||h.includes("noreferrer")||(h+=" noreferrer");const[k,D]=W({href:m,disabled:g,arrowLocation:u}),[U,H]=r.useState();r.useEffect((()=>{U||!I&&!T||new Promise((function(t,n){e(["./e_file_viewer_static_scl_page_folder"],t,n)})).then((function(e){return e.index_esm$1})).then((({Spinner:e})=>{H(v.default.createElement(e,{size:"small","aria-valuetext":L,inverse:"outline"!==t,monochromatic:"outline"===t||O,hasOpaqueTrack:G}))}))}),[U,L,I,T,t,O,G]);let j="space-between";"transparent"===t?j="flex-start":i&&(j="center");const $={mobile:F(i,"mobile")?"none":"inline",mobileLarge:F(i,"mobileLarge")?"none":"inline",tablet:F(i,"tablet")?"none":"inline",tabletLarge:F(i,"tabletLarge")?"none":"inline",desktop:F(i,"desktop")?"none":"inline",desktopLarge:F(i,"desktopLarge")?"none":"inline",ultrawide:F(i,"ultrawide")?"none":"inline"},q=D&&!("boolean"==typeof i&&i)?v.default.createElement(d.DWGBox,{tagName:"span",display:$,className:o.cx(`${P}__icon`,{[`${P}__icon--${D}`]:!n})},n?v.default.createElement(R,{src:n}):v.default.createElement(V,{icon:D})):null;return v.default.createElement(d.DWGBox,{tagName:w,display:"inline-block",ref:k,disabled:g,className:M,width:l,borderStyle:"none",href:A?void 0:m,onClick:_,target:A?void 0:p,rel:h,...B(t,{isHomepageRedesignNav:b}),...z(a),...d.allowedHtmlAttributes(N,w)},v.default.createElement(x,{gap:E,display:"inline-grid",height:"full",width:"full",alignItems:"center",justifyContent:j,justifySelf:C,position:"relative",textDecoration:y},"start"===u?q:null,v.default.createElement(c.DWGTypographyV2Label,{className:`${P}__text`,size:s,color:"inherit",weight:"medium",textAlign:i&&"transparent"!==t?"center":void 0},S),"end"===u?q:null,I&&v.default.createElement("div",{className:`${P}__spinner`},U)))}));$.displayName="DWGButton2";const q=e=>v.default.createElement($,{...e,buttonStyle:"primary"});q.displayName="DWGPrimaryButton";const Y=e=>v.default.createElement($,{...e,buttonStyle:"outline"});Y.displayName="DWGOutlineButton";const J=e=>v.default.createElement($,{...e,buttonStyle:"transparent",size:"none",textDecoration:"underline",width:"fit-content",iconMargin:.5});function X(e){return e.ns("account")}function K(e){const t=e=>decodeURIComponent(escape(e)),[n,i,a]=e.split(".").map((e=>atob(e.split("_").join("/").split("-").join("+"))));if(!a)return o.GoogleOneTapAmpLogger.logCredentialsDecodeError(),null;try{if("JWT"!==JSON.parse(t(n)).typ)return null;const e=JSON.parse(t(i));return{userId:e.sub.toString(),email:e.email.toString(),givenName:e.given_name.toString(),familyName:e.family_name.toString(),emailVerified:Boolean(e.email_verified).valueOf()}}catch{return o.GoogleOneTapAmpLogger.logCredentialsDecodeError(),null}}function Q({googleCredentials:e,select_by:t,tos_signed:n,marketingOptedIn:i,cont_url:a,visitorId:s,fpRequestId:r,webSigninTag:l,webSignupTag:d,referralCode:c,referralSource:g,emailHash:u,additionalAuthParams:h,signupReferrer:p,fpSealedResult:m}){const _={id_token:e,one_tap_platform:{".tag":"web"},select_by:t,remember_me:!0,pair_user:!1,tos_signed:n,source_url:o.get_href(),marketing_opt_in:i,cont_url:a,visitor_id:s,web_signin_tag:l,fp_request_id:r,referral_code:c,referral_source:g,web_signup_tag:d,email_hash:u,additional_auth_params:h,signup_referrer:p,fp_sealed_result:m};return X(new o.NoAuthApiV2Client).rpc("register_or_sign_in_with_1tap",_,{})}function Z(e){switch(e.error[".tag"]){case"unsupported_platform":a.Notify.error(s.intl.formatMessage({id:"zxg8L5",defaultMessage:"This platform is not supported by Google One Tap."}));break;case"unverified_email":a.Notify.error(s.intl.formatMessage({id:"8vxEe0",defaultMessage:"Verify your email with Google to sign in with this email address."}));break;case"disabled_user":a.Notify.error(s.intl.formatMessage({id:"FtHoiO",defaultMessage:"This account has been marked as inactive. Contact the team admin."}));break;case"user_already_invited_to_team":a.Notify.error(s.intl.formatMessage({id:"WPQLwi",defaultMessage:"You've already been invited. Check your email for an invite link or ask the admin to resend it."}));break;case"invalid_token":a.Notify.error(s.intl.formatMessage({id:"hcIBNz",defaultMessage:"That email address wasn't found, try checking it for typos."}));break;case"require_role":a.Notify.error(s.intl.formatMessage({id:"2y3bQh",defaultMessage:"Please sign in with a work account."}));break;default:a.Notify.error(s.intl.formatMessage({id:"bLA3rA",defaultMessage:"There was a problem completing this request."}));O("google_one_tap",e)||m.reportException({err:e,severity:m.SEVERITY.NONCRITICAL,tags:["google_one_tap","unknown_error"]})}}function ee(e,t){const n=t.match(/^[^_]+/),i=e||p.RegistrationSource.DEFAULT_ONE_TAP_PLATFORM;if(!n)return;switch(n[0]){case"btn":return[i,"google_login"].join("_");case"user":return[i,"one_tap_login"].join("_");case"auto":return[i,"one_tap_login_auto"].join("_");default:return}}J.displayName="DWGTransparentButton";async function te(e,t){let n=0;for(o.UDCL.logStart("ungated_store_susi_save_file",{tags:{state:"start",store:(null==e?void 0:e.store)||"undefined"}}),e.onUploadStart&&e.onUploadStart();n<3;)try{let n=e.sessionId;if(e.store&&(n=await E.ungatedDBStore.getLatestUngatedSessionKeyForStore(e.store)),!n)return;const i=o.createUser(f.createUserProto(t));if(i){const t=await E.ungatedDBStore.getFileData(n);t&&await ne(t,i,e)}return o.UDCL.logEnd("ungated_store_susi_save_file",{eventState:"success",tags:{store:(null==e?void 0:e.store)||"undefined"}}),E.ungatedDBStore.deleteUngatedSession(n)}catch(t){if(n++,3===n&&e.onErrorCallback)return o.UDCL.logEnd("ungated_store_susi_save_file",{eventState:"failed",tags:{store:(null==e?void 0:e.store)||"undefined"}}),void e.onErrorCallback()}}async function ne(e,t,n){const i=e.byteLength;let a=0;const s=new o.DefaultUserApiV2Client(t).ns("files");let r="";for(;ae.match(oe),this.checkSsoState=(e="",t,n=!1)=>{this.shouldCheckSsoState(e)?this.CACHE[e]?t(e,this.CACHE[e]):!n&&this.INFLIGHT[e]||(this.INFLIGHT[e]=!0,function(e){return new Promise((t=>o.WebRequest$1({url:ie(),data:{email:e},success:e=>t(JSON.parse(e))})))}(e).then((n=>{this.CACHE[e]=n,t(e,this.CACHE[e])})).finally((()=>{delete this.INFLIGHT[e]}))):t(e,{user_sso_state:o.SsoState.OFF})},this.CACHE={},this.INFLIGHT={}}}class se extends v.default.Component{shouldComponentUpdate(e){return this.hasNewError(e.error)}hasNewError(e){var t;return!this.hasMatchingErrorMessage(e)||(null==e?void 0:e.clientTimestamp)!==(null===(t=this.props.error)||void 0===t?void 0:t.clientTimestamp)}hasMatchingErrorMessage(e){var t,n;return(null==e?void 0:e.message_html)===(null===(t=this.props.error)||void 0===t?void 0:t.message_html)&&(null==e?void 0:e.message_text)===(null===(n=this.props.error)||void 0===n?void 0:n.message_text)}render(){const{error:e,errorId:t}=this.props;return e&&e.message_html?v.default.createElement("div",{id:t,"aria-live":"polite","aria-atomic":"true",className:"text-input-error-wrapper",dangerouslySetInnerHTML:{__html:a.purify.sanitize(e.message_html)}}):e&&e.message_text?v.default.createElement("div",{id:t,"aria-live":"polite","aria-atomic":"true",className:"text-input-error-wrapper"},v.default.createElement("span",{className:"error-message"},e.message_text,v.default.createElement("span",{className:"text-input-error-hidden ax-visually-hidden","aria-hidden":"true",style:{visibility:"hidden"}},e.clientTimestamp))):v.default.createElement("div",{id:t,"aria-live":"polite","aria-atomic":"true",className:"text-input-error-wrapper"})}}se.displayName="AuthError";const re=e=>{const{label:t,htmlFor:n,unsafeLabelHTML:i}=e;return t?v.default.createElement("label",{htmlFor:n,className:"checkbox_label"},v.default.createElement("span",null,t)):i?v.default.createElement("label",{htmlFor:n,className:"checkbox_label"},v.default.createElement("span",{dangerouslySetInnerHTML:{__html:a.purify.sanitize(i)}})):null},le=e=>{const{name:t,error:n,label:i,onChange:s,className:r,checked:l,id:d,errorId:c,uxaEventName:g,disabled:u,autoFocus:h}=e,p=n&&(n.message_text||n.message_html);return v.default.createElement("div",{className:"auth__checkbox-row"},v.default.createElement(o.FormRow,{variant:"control"},v.default.createElement(o.Checkbox,{className:r,name:t,id:d,onChange:s,checked:l,"aria-checked":l,"aria-invalid":p?"true":"false","aria-describedby":c,"data-uxa-log":g,disabled:u,autoFocus:h}),v.default.createElement(re,{htmlFor:d,label:i})),v.default.createElement("div",{id:c,"aria-live":"polite","aria-atomic":"true"},p&&v.default.createElement(o.FormHelperText,{variant:"alert"},v.default.createElement(o.UIIcon,{src:o.FailLine,size:"small"}),(null==n?void 0:n.message_html)?v.default.createElement("span",{dangerouslySetInnerHTML:{__html:a.purify.sanitize(n.message_html)}}):v.default.createElement("span",null,null==n?void 0:n.message_text))))},de=e=>{const{checked:t,className:n,disabled:i,error:a,inline:s,label:l,maestroStyle:d,name:c,onChange:g,unsafeLabelHTML:u,variant:h,uxaEventName:p}=e,m=r.useMemo((()=>o.generateId(c)),[c]),_=r.useMemo((()=>o.genErrorId(m)),[m]),S=a&&(a.message_text||a.message_html);if(h===o.AuthFormVariant.DIG20)return v.default.createElement(le,{...e,id:m,errorId:_});const E=o.cx("checkbox",h,n,{"checkbox-inline":s});let f=v.default.createElement("input",{type:"checkbox",id:m,name:c,checked:t,onChange:g,disabled:i,"aria-invalid":S?"true":"false","aria-describedby":_,"data-uxa-log":p});d&&(f=v.default.createElement("label",{className:"maestro_checkbox",htmlFor:m},f,v.default.createElement("span",null)));const I=v.default.createElement(se,{error:a,errorId:_});return v.default.createElement("div",{className:E},!d&&I,f,v.default.createElement(re,{htmlFor:m,label:l,unsafeLabelHTML:u}),d&&I)};var ce;de.displayName="AuthCheckbox",t.TOSModalVariant=void 0,(ce=t.TOSModalVariant||(t.TOSModalVariant={})).V1="v1",ce.V2="v2";const ge="one-tap-tos-modal-container",ue=e=>{let t=document.getElementById(ge);t||(t=document.createElement("div"),o.GSIEventManager.getGSIState().isMobile&&t.classList.add("one-tap-tos-mobile-model-container"),t.id=ge,t.classList.add(ge));const n=(!!e.containerParentSelector&&document.getElementById(e.containerParentSelector)||document.body).appendChild(t);L.default.render(v.default.createElement(me,{...e}),n,(()=>{const e=document.querySelector('.one-tap-tos__terms-checkbox-container input[type="checkbox"]');e&&e.focus()}))},he=()=>{const e=document.getElementById(ge);e&&(L.default.unmountComponentAtNode(e),e.remove())},pe=({modalVariant:e,animationVariant:t,onSubmit:n,onToggle:i,onDismiss:a,onPrivacyClick:s,onServicesAgreementClick:r,onDashAccessAgreementClick:l,onTermsClick:d,onTosShown:c,showMarketingOptIn:g,implicitTOSVariant:h,googleCredentials:p,thirdPartyType:m})=>(t=t||e,v.default.createElement(u.CSSTransition,{in:!0,timeout:125,appear:!0,classNames:`one-tap-tos__modal-animation-${t}`,mountOnEnter:!0,unmountOnExit:!0},v.default.createElement(o.Modal$1.Content,{className:"one-tap-tos__modal"},v.default.createElement(_e,{modalVariant:e,animationVariant:t,onSubmit:n,onToggle:i,onDismiss:a,onPrivacyClick:s,onServicesAgreementClick:r,onDashAccessAgreementClick:l,onTermsClick:d,onTosShown:c,showMarketingOptIn:g,implicitTOSVariant:h,googleCredentials:p,thirdPartyType:m}))));pe.displayName="SusiThirdPartyTosModal";const me=o.requireCssWithComponent(pe,["/static/typescript/component_libraries/dwg-components/src/index.web-vflFu78ol.css","/static/metaserver/static/css/dig-components/index.web-vflSNNWF8.css"]),_e=({onSubmit:e,onDismiss:t,onPrivacyClick:n,onServicesAgreementClick:i,onDashAccessAgreementClick:a,onTermsClick:l,onTosShown:c,showMarketingOptIn:g,modalVariant:u,animationVariant:h,implicitTOSVariant:p,thirdPartyType:m})=>{const[_,S]=r.useState(!0),[E,f]=r.useState(!1),I=`${m}_${_?"signup_marketing_opt_out":"signup_marketing_opt_in"}`,{tosMessage:L,ctaMessage:T}=o.getTOSDataByVariant(p,l,i,a,n),O=v.default.createElement("div",{className:"one-tap-tos__terms-container one-tap-tos__row one-tap-tos__tos","data-testid":"row"},v.default.createElement(d.DWGText,{fontFamily:"atlas-grotesk",fontSize:12,lineHeight:18},L));v.default.useEffect((()=>{c&&c()}),[c]);const G=o.getSUSIDigTheme(),C=o.getSUSIDigMode(),y=`third_party_tos_${m}`;return v.default.createElement("form",{className:o.cx(`one-tap-tos one-tap-tos-animation-${h}`,`one-tap-tos-modal-${u}`,`one-tap-tos-modal-animation-${h}`,G,C),"data-uxa-log":y,"data-uxa-interactions":"shown",onSubmit:async t=>{t.preventDefault(),f(!0);await e(g?_:void 0)||f(!1)}},v.default.createElement("div",{className:"one-tap-tos__title-container","data-testid":"row"},v.default.createElement("div",{className:"one-tap-tos__title-content"},v.default.createElement(d.DWGText,{fontFamily:"atlas-grotesk",lineHeight:20,fontSize:16,fontWeight:"medium"},Se),v.default.createElement(o.IconButton,{variant:"transparent",size:"small",onClick:()=>{t()},type:"button","aria-label":Ee,disabled:E},v.default.createElement(o.UIIcon,{src:o.CloseLine})))),g&&v.default.createElement("div",{className:"one-tap-tos__terms-container one-tap-tos__row one-tap-tos__marketing-opt-in","data-testid":"row","data-uxa-log":`${y}_marketing_opt_in_checkbox`,"data-uxa-interactions":"shown click"},v.default.createElement(de,{checked:_,className:"one-tap-tos__terms-checkbox-container",disabled:E,inline:!1,label:s.intl.formatMessage({id:"puZoGX",defaultMessage:"I’d like to receive direct marketing email updates from Dropbox"}),maestroStyle:!1,name:"marketing_opt_in",onChange:()=>{S(!_)},variant:o.AuthFormVariant.DIG20,uxaEventName:I})),O,v.default.createElement("div",{className:"one-tap-tos__signup-container one-tap-tos__row one-tap-tos__submit","data-testid":"row"},E?v.default.createElement("div",{className:"one-tap-tos__loading-indicator"},v.default.createElement(o.Spinner,{"aria-valuetext":"Signing up",size:"small"})):v.default.createElement(d.DWGBox,{theme:"coconut-200"},v.default.createElement(q,{label:T,size:"small",width:"full",style:{justifyContent:"center"},disableArrow:!0,"data-uxa-log":`${y}_submit`,"data-uxa-interactions":"click"}))))};_e.displayName="SusiThirdPartyTOS";const Se=s.intl.formatMessage({id:"9csKpE",defaultMessage:"Continue to Dropbox"}),Ee=s.intl.formatMessage({id:"56IzdQ",defaultMessage:"Close sign up prompt"}),fe=["scl-folder-page","shared-link-folder-page"];class Ie{constructor(){if(this.tosPromptShown=!1,this.googleIframeObserver=null,this.bodyClass="google-one-tap-displayed",this.tosBodyClass="google-one-tap-tos-displayed",this.currentContext="signin",this.isPromptClosed=!1,this.hasPendingAuthFlow=!1,this.defaultAdditionalAuthParams={},this.autoSignInEnabled=!1,this.userFinishedSignup=!1,this.isFedCMOn=!1,this.init=(e,t,n)=>{(!this.config&&e||t)&&(this.config=e,this.defaultAdditionalAuthParams=this.config.additionalAuthParams,this.isFedCMOn=this.config.isFedCMEnabled,this.currentContext=e.context,this.autoSignInEnabled=this.autoSignInExperimentEnabled()&&!this.isFromLogout(),o.GSIEventManager.sendGSIEvent(o.GSIEvent.INITIALIZE_PLATFORM),e.context!==o.GSIEventManager.getGSIState().context&&this.updateStateContext(e.context),e.isInline&&(o.GSIEventManager.sendGSIEvent(o.GSIEvent.USE_INLINE_PROMPT),o.GSIEventManager.sendGSIEvent(o.GSIEvent.PROMPT_OPEN),document.body.addEventListener("focusin",this.handleFocusIn)),this.fingerprintJSRef=o.initFingerprintJS(),this.loadGSILibrary().then(this.initGSIClient),this.listenForContextChanges(),e.isMobile&&o.GSIEventManager.sendGSIEvent(o.GSIEvent.IS_MOBILE),this.autoSignInEnabled&&(window.onbeforeunload=e=>{o.GSIEventManager.getGSIState().tosPromptDisplayed&&!this.userFinishedSignup&&google.accounts.id.revoke(this.userId,(e=>{}))})),this.config.additionalAuthParams=this.defaultAdditionalAuthParams,e&&e.additionalAuthParams&&(this.config.additionalAuthParams={...this.config.additionalAuthParams,...e.additionalAuthParams}),n&&(this.onBeforeRedirect=n)},this.updateLoginContUrl=e=>{this.config&&(this.config.loginContUrl=e)},this.getCurrentSignInTag=()=>this.config.signinTag,this.getCurrentSignUpTag=()=>this.config.signupTag,this.updateSignInSignUpTags=(e,t)=>{this.config&&(this.config.signinTag=e,this.config.signupTag=t)},this.getLogger=()=>new o.GoogleDoubleLogger(this.config.signinTag,this.config.signupTag),this.handleScriptLoadError=()=>{o.GoogleOneTapAmpLogger.logScriptLoadError()},this.handleScriptLoad=()=>{o.GoogleOneTapAmpLogger.logScriptLoadSuccess()},this.loadGSILibrary=()=>{if(this.config.isTest)return async function(){const e=new URLSearchParams(window.location.search),t=e.get("test_token")||"",n=e.get("hide_test_onetap_prompt")||"";let i;window.google={accounts:{id:{initialize:({callback:e})=>{i=()=>{e({credential:t,select_by:"test-select-by"})}},prompt:e=>{const t={isDisplayMoment:()=>!n,isNotDisplayed:()=>!!n,isDisplayed:()=>!1,isSkippedMoment:()=>!1,isDismissedMoment:()=>!1,getNotDisplayedReason:()=>"test-not-display-reason",getMomentType:()=>n?"skipped":"displayed"},o="onetap-test-modal";if(!document.getElementById(o)){const e=document.createElement("div");e.id=o,e.style.position="absolute",e.style.top="100px",e.style.right="150px",e.style.width="100px",e.style.height="70px",e.style.zIndex="1000";const t=document.createElement("button");t.textContent="Google OneTap test button",t.onclick=i,n||(e.append(t),document.body.append(e))}e(t)},renderButton:()=>{const e="onetap-test-sig-button";if(!document.getElementById(e)){const t=document.createElement("button");t.id=e,t.textContent="Sign in with Google test button",t.onclick=i;const n=document.getElementById(o.DEFAULT_SIGNIN_BUTTON_CONTAINER_ID)||document.getElementById(o.DEFAULT_SIGNUP_BUTTON_CONTAINER_ID);n&&n.append(t)}}}}}}();const e=document.getElementsByTagName("head")[0],t=document.createElement("script");return t.type="text/javascript",t.async=!0,t.defer=!0,t.src="https://accounts.google.com/gsi/client",t.onerror=this.handleScriptLoadError,new Promise((n=>{t.onload=()=>{this.handleScriptLoad(),n()},e.insertBefore(t,e.firstChild)}))},this.initGSIClient=()=>{this.config.clientId&&"undefined"!=typeof google&&(this.applyPendingContext(),o.GSIEventManager.clearPendingContext(),this.initContainerListeners(),o.GSIEventManager.sendGSIEvent(o.GSIEvent.GSI_INIT_COMPLETE))},this.displaySigButton=()=>{o.GSIEventManager.getGSIState().googleAccountInitialized||this.initGoogleAccount();let e=null;const t=o.SIG_BUTTON_TEXT.CONTINUE_WITH;"signin"===this.currentContext?e=document.getElementById(o.DEFAULT_SIGNIN_BUTTON_CONTAINER_ID):"signup"===this.currentContext&&(e=document.getElementById(o.DEFAULT_SIGNUP_BUTTON_CONTAINER_ID));const n=o.SIG_BUTTON_STYLES.get(this.config.pageName),i=this.buttonWidth?this.buttonWidth:(null==n?void 0:n.width)||350;if(e){if(this.refreshFormContainer&&!this.refreshSigWrapper){const t=document.createElement("div");t.classList.add("sig-wrapper--dwg-refresh"),e.appendChild(t),this.refreshSigWrapper=t}const a=console.warn;console.warn=function(e){o.reportGSILoggerError(e),a(e)},google.accounts.id.renderButton(this.refreshSigWrapper?this.refreshSigWrapper:e,{text:t,width:i,logo_alignment:n?n.logo_alignment:"left",locale:this.config.locale,click_listener:this.handleSiGClick}),console.warn=a}},this.handleSiGClick=()=>{this.hasPendingAuthFlow&&this.getLogger().logLoginCancel(!1),this.hasPendingAuthFlow=!0,this.getLogger().logLoginStart(!1)},this.initContainerListeners=()=>{this.config.isInline&&!o.GSIEventManager.getGSIState().inlineContainerMounted||this.config.hidePromptOnInit||this.isPromptClosed||this.displayOneTapPrompt(),o.GSIEventManager.createGSIEventListener(o.GSIEvent.INLINE_CONTAINER_MOUNTED,this.displayOneTapPrompt),o.GSIEventManager.createGSIEventListener(o.GSIEvent.SHOW_PROMPT,this.displayOneTapPrompt),o.GSIEventManager.createGSIEventListener(o.GSIEvent.REMOVE_PROMPT,(()=>{google.accounts.id.cancel(),this.setPromptClosedState(!0,"Removed by code")})),o.GSIEventManager.getGSIState().buttonContainerMounted&&(this.initGoogleAccount(),this.initRefreshResizeObserver(),this.displaySigButton()),this.resizeThrottle&&this.resizeObserver||o.GSIEventManager.createGSIEventListener(o.GSIEvent.BUTTON_CONTAINER_MOUNTED,this.initRefreshResizeObserver),o.GSIEventManager.createGSIEventListener(o.GSIEvent.BUTTON_CONTAINER_MOUNTED,this.displaySigButton)},this.getRefreshFormContainerWidth=e=>Math.floor(e.getBoundingClientRect().width),this.handleRefreshResize=()=>{this.buttonWidth=this.getRefreshFormContainerWidth(this.refreshFormContainer),this.displaySigButton()},this.initRefreshResizeObserver=()=>{let e=document.querySelector(".login-register-container--dwg-refresh");e||(e=document.querySelector(".unified-susi-na")),e&&(this.refreshFormContainer=e,this.buttonWidth=this.getRefreshFormContainerWidth(this.refreshFormContainer),this.resizeThrottle&&this.resizeObserver&&(this.resizeThrottle.cancelPending(),this.resizeObserver.disconnect()),this.resizeThrottle=new i.RafThrottle((()=>{this.handleRefreshResize()})),this.resizeObserver=new ResizeObserver(this.resizeThrottle.request),this.resizeObserver.observe(this.refreshFormContainer),o.GSIEventManager.createGSIEventListener(o.GSIEvent.BUTTON_CONTAINER_UNMOUNTED,this.removeRefreshResizeObserver),o.GSIEventManager.createGSIEventListener(o.GSIEvent.BUTTON_CONTAINER_UNMOUNTED,this.removeRefreshSigWrapper))},this.removeRefreshResizeObserver=()=>{this.resizeObserver&&this.resizeObserver.disconnect()},this.removeRefreshSigWrapper=()=>{this.refreshSigWrapper&&(this.refreshSigWrapper.remove(),this.refreshSigWrapper=void 0)},this.displayOneTapPrompt=()=>{const e=this.getPromptParentId(),t=!!document.getElementById(e||"");this.config.isInline&&!t||(this.initGoogleAccount(),google.accounts.id.prompt((e=>{!this.isFedCMOn&&e.isDisplayMoment()&&this.handleDisplayMoment(e);const t=!this.isFedCMOn&&e.isNotDisplayed()||e.isSkippedMoment()||e.isDismissedMoment();let n="";e.isSkippedMoment()?(this.isFedCMOn?o.GoogleOneTapAmpLogger.logOneTapNotShown("It's a skipped moment"):(n=e.getSkippedReason(),o.GoogleOneTapAmpLogger.logOneTapNotShown(e.getSkippedReason())),o.displayEvent(o.GoogleOneTapEvent.LOGGED_IN_GOOGLE_USER,!0),this.isFedCMOn||e.getSkippedReason()!==o.GoogleNotShownReason.USER_CANCEL||(this.getLogger().logOneTapDismissed(),o.clickEvent(o.GoogleOneTapEvent.DISMISS_GOOGLE_ONE_TAP))):!this.isFedCMOn&&e.isNotDisplayed()?(n=e.getNotDisplayedReason(),e.getNotDisplayedReason()!==o.GoogleNotShownReason.OPT_OUT_OR_NO_SESSION&&o.displayEvent(o.GoogleOneTapEvent.LOGGED_IN_GOOGLE_USER,!0),o.GoogleOneTapAmpLogger.logOneTapNotShown(e.getNotDisplayedReason())):e.isDismissedMoment()&&(o.GoogleOneTapAmpLogger.logOneTapNotShown(e.getDismissedReason()),o.displayEvent(o.GoogleOneTapEvent.LOGGED_IN_GOOGLE_USER,!0),n=e.getDismissedReason());const i=e.getMomentType();if(n=n||["skipped","dismissed"].includes(i)?i:"",this.setPromptClosedState(t,n),o.GSIEventManager.getGSIState().isMobile&&!this.googleOneTapDisabledOverlay){this.googleOneTapDisabledOverlay=document.createElement("div"),this.googleOneTapDisabledOverlay.classList.add("google-one-tap-disabled-mobile-overlay");const e=this.getGoogleIframe();null==e||e.insertAdjacentElement("afterend",this.googleOneTapDisabledOverlay)}t?(o.displayEvent(o.GoogleOneTapEvent.GOOGLE_ONE_TAP_NOT_SHOWN,!1),this.setOneTapHeightCssVar("0px"),this.stopObservingGoogleContainer(),document.body.classList.remove(this.bodyClass),this.googleOneTapDisabledOverlay&&this.googleOneTapDisabledOverlay.remove()):(o.displayEvent(o.GoogleOneTapEvent.SHOW_GOOGLE_ONE_TAP,!0),o.displayEvent(o.GoogleOneTapEvent.LOGGED_IN_GOOGLE_USER,!0))})))},this.handleDisplayMoment=e=>{o.GSIEventManager.sendGSIEvent(o.GSIEvent.DISPLAY_MOMENT),!this.isFedCMOn&&e.isDisplayed()&&(this.setOneTapHeightCssVar(this.getOneTapIframeHeight()),this.observeGoogleIframe(),document.body.classList.add(this.bodyClass),this.config.pageName&&document.body.classList.add(this.config.pageName),this.config.isInline?n.safari?o.GSIEventManager.sendGSIEvent(o.GSIEvent.INLINE_PROMPT_UI_READY):this.pollAndClearIframeFocus():o.GSIEventManager.sendGSIEvent(o.GSIEvent.PROMPT_UI_HAS_DISPLAYED))},this.setPromptClosedState=(e,t)=>{this.isPromptClosed=e,e?o.GSIEventManager.sendGSIEvent(o.GSIEvent.PROMPT_CLOSE,{promptNotShownReason:t}):o.GSIEventManager.sendGSIEvent(o.GSIEvent.PROMPT_OPEN)},this.listenForContextChanges=()=>{this.clearContextChangesListener(),o.GSIEventManager.createGSIEventListener(o.GSIEvent.CONTEXT_CHANGE_SIGNUP,this.handleContextChange),o.GSIEventManager.createGSIEventListener(o.GSIEvent.CONTEXT_CHANGE_SIGNIN,this.handleContextChange)},this.clearContextChangesListener=()=>{o.GSIEventManager.removeGSIEventListener(o.GSIEvent.CONTEXT_CHANGE_SIGNUP,this.handleContextChange),o.GSIEventManager.removeGSIEventListener(o.GSIEvent.CONTEXT_CHANGE_SIGNIN,this.handleContextChange)},this.applyPendingContext=()=>{o.GSIEventManager.getPendingContext()&&this.setCurrentContext(o.GSIEventManager.getPendingContext())},this.handleContextChange=()=>{const e=o.GSIEventManager.getGSIState().context;e!==this.currentContext&&(this.cancelTOS(),this.setCurrentContext(e),this.refreshGSIClient())},this.isFromLogout=()=>"logout"===new URLSearchParams(window.location.search).get("src"),this.autoSignInExperimentEnabled=()=>{var e;return"V1"===(null===(e=this.config)||void 0===e?void 0:e.autoSignInVariant)},this.refreshGSIClient=()=>{var e;o.GSIEventManager.getGSIState().googleAccountInitialized&&(o.GSIEventManager.sendGSIEvent(o.GSIEvent.RESET_DISPLAY_MOMENT),o.GSIEventManager.sendGSIEvent(o.GSIEvent.INLINE_PROMPT_UI_NOT_READY),(null===(e=this.config)||void 0===e?void 0:e.isInline)&&"undefined"!=typeof google&&google.accounts.id.cancel(),this.initGSIClient())},this.googleSignInCallback=async({select_by:e,credential:n})=>{o.GoogleOneTapAmpLogger.logAuthType(e);const i=o.BUTTON_AUTH_TYPES.includes(e);i||(this.getLogger().logLoginStart(!0),o.clickEvent(o.GoogleOneTapEvent.GOOGLE_ONE_TAP_CONTINUE),o.displayEvent("auto"===e?o.GoogleOneTapEvent.GOOGLE_ONE_TAP_VERIFICATION_AUTO_SUCCESS:o.GoogleOneTapEvent.GOOGLE_ONE_TAP_VERIFICATION_SUCCESS,!0)),o.GSIEventManager.sendGSIEvent(i?o.GSIEvent.USE_BUTTON_FLOW:o.GSIEvent.USE_ONE_TAP_FLOW),!o.isTest()&&this.fingerprintJSRef.current&&await this.fingerprintJSRef.current.getWrappedComponent().invokeFPJSIframeAndLog("",void 0,2e3),this.isButtonFlow=i,this.googleCredentials=n,this.selectBy=e,this.config.signupEndpoint===t.SignupEndpoints.TEAM_REGISTER?(({signupKey:e,fromSource:n,continuationUrl:i,thirdPartyAuthJWT:r})=>{if(r&&null==K(r))return void a.Notify.error(s.intl.formatMessage({id:"yriEWs",defaultMessage:"An error occurred when processing your Google Account. Please try again or try another signup method."}));const l={signup_key:e,from_source:n,cont:i,tos_agree:!0,third_party_auth_token:r};o.WebRequest({url:t.SignupEndpoints.TEAM_REGISTER,type:"POST",data:l,success:(e,t,n)=>{const r=JSON.parse(e);if("OK"===r.status){const e=r.url||i||"/";o.unsafeRedirect(e)}else"Two Factor Auth Enabled"===r.message?a.Notify.error(s.intl.formatMessage({id:"iBIZIv",defaultMessage:"Your team requires Two Factor Authentication. Please Fill out the form to proceed."})):"Invalid Email"===r.message?a.Notify.error(s.intl.formatMessage({id:"+7HsA2",defaultMessage:"Please use the email provided in the Sign Up link."})):a.Notify.error(s.intl.formatMessage({id:"XPZ3+m",defaultMessage:"Error completing the request, please try again."}))},error:(e,t,n)=>{var i;const o=JSON.parse(n);(null===(i=o.password)||void 0===i?void 0:i.message_text)?a.Notify.error(o.password.message_text):a.Notify.error(s.intl.formatMessage({id:"XPZ3+m",defaultMessage:"Error completing the request, please try again."}))}})})({signupKey:this.config.additionalAuthParams.signupKey,fromSource:this.config.additionalAuthParams.fromSource,continuationUrl:this.config.registerContUrl,thirdPartyAuthJWT:n}):this.signIn(i)},this.getVisitorData=e=>{if(!this.fingerprintJSRef.current)return;return o.get_visitor_id(this.fingerprintJSRef.current)[e]},this.signIn=e=>{var t;const n=document.referrer;Q({googleCredentials:this.googleCredentials,select_by:this.selectBy,tos_signed:!1,visitorId:this.getVisitorData("visitor-id"),fpRequestId:this.getVisitorData("fp-request-id"),pageName:this.config.pageName,additionalAuthParams:this.config.additionalAuthParams,webSigninTag:this.config.signinTag,webSignupTag:this.config.signupTag,cont_url:(null===(t=this.config)||void 0===t?void 0:t.loginContUrl)||o.DEFAULT_CONTINUATION_URL,signupReferrer:n,fpSealedResult:this.getVisitorData("fp_sealed_result")}).then((async t=>{var n,i,r;const l=(null===(n=this.config)||void 0===n?void 0:n.loginContUrl)||o.DEFAULT_CONTINUATION_URL,d=t[".tag"];switch("tos_required"!==d&&(this.isButtonFlow?o.AuthAMPLogger.logLoginAttempt(o.AuthType.GOOGLE,"normal"):o.AuthAMPLogger.logLoginAttempt(o.AuthType.GOOGLE_ONE_TAP,"auto"===this.selectBy?"auto":"normal")),this.hasPendingAuthFlow=!1,this.getLogger().logLoginResponse(!this.isButtonFlow,d,"google_login_not_allowed"===d&&!!t.redirect_url,"success"===d?t.user_id:void 0),this.onBeforeRedirect&&await this.onBeforeRedirect(e),d){case"success":if(this.logOneTapLoginResponse(!0,null,this.selectBy),e||o.displayEvent("auto"===this.selectBy?o.GoogleOneTapEvent.GOOGLE_ONE_TAP_ACCOUNT_AUTO_LOGIN_SUCCESS:o.GoogleOneTapEvent.GOOGLE_ONE_TAP_ACCOUNT_LOGIN_SUCCESS,!0),this.config.disableRedirect){this.onGoogleLoginSuccess(t);break}this.shouldCallOnLoginSuccess()&&this.onGoogleLoginSuccess(t),a.Notify.success(s.intl.formatMessage({id:"/qL3on",defaultMessage:"Log in successful! Your browser will be redirected in a few seconds."})),o.redirect(l);break;case"requires_twofactor":{this.logOneTapLoginResponse(!1,"tfa_required",this.selectBy),e||o.displayEvent("auto"===this.selectBy?o.GoogleOneTapEvent.GOOGLE_ONE_TAP_ACCOUNT_AUTO_LOGIN_SUCCESS:o.GoogleOneTapEvent.GOOGLE_ONE_TAP_ACCOUNT_LOGIN_SUCCESS,!0);const n=new h.URI({path:"/verify_code"}).updateQuery({remember_me:t.remember_me.toString(),pair_user:t.pair_user.toString(),cont:l,web_signin_tag:ee(this.config.signinTag,this.selectBy)});o.redirect(n.toString());break}case"tos_required":o.GSIEventManager.sendGSIEvent(o.GSIEvent.TOS_PROMPT_OPEN),this.showTOSPrompt(e);break;case"enable_twofactor_required":{this.logOneTapLoginResponse(!1,d,this.selectBy);const e=new h.URI({path:"/twofactor"}).updateQuery({remember_me:t.remember_me.toString(),pair_user:t.pair_user.toString(),cont:l,web_signin_tag:ee(this.config.signinTag,this.selectBy)});o.redirect(e.toString());break}case"google_login_not_allowed":this.logOneTapLoginResponse(!1,d,this.selectBy),t.redirect_url?o.unsafeRedirect(t.redirect_url):(a.Notify.error(s.intl.formatMessage({id:"oW2LTj",defaultMessage:"Google Sign In is not allowed with this email."})),this.ssoChecker.checkSsoState((null===(i=t.profile)||void 0===i?void 0:i.email)||"",this.onSsoStateUpdate));break;case"sso_required":this.logOneTapLoginResponse(!1,d,this.selectBy),t.redirect_url?o.unsafeRedirect(t.redirect_url):window.location.href.includes("/login")&&o.GSIEventManager.sendGSIEvent(o.GSIEvent.SSO_REQUIRED,{email:null===(r=t.profile)||void 0===r?void 0:r.email});break;case"requires_password":{this.logOneTapLoginResponse(!1,d,this.selectBy);const e=new h.URI({path:"/show_password_form"}).updateQuery({remember_me:t.remember_me.toString(),pair_user:t.pair_user.toString(),cont:l});o.redirect(e.toString());break}default:this.logOneTapLoginResponse(!1,d,this.selectBy),a.Notify.error(s.intl.formatMessage({id:"9n1q0s",defaultMessage:"There was a problem completing this request. Please Try Again."}))}})).catch((e=>{var t,n;this.getLogger().logLoginResponse(!this.isButtonFlow,e.error[".tag"]||(null===(t=e.error.reason)||void 0===t?void 0:t[".tag"])),this.logOneTapLoginResponse(!1,e.error[".tag"]||(null===(n=e.error.reason)||void 0===n?void 0:n[".tag"]),this.selectBy),this.hasPendingAuthFlow=!1,Z(e)}))},this.logOneTapLoginResponse=(e,t,n)=>{this.isButtonFlow?o.AuthAMPLogger.logThirdPartyLoginResponse(o.AuthType.GOOGLE,"normal",e,t):o.AuthAMPLogger.logThirdPartyLoginResponse(o.AuthType.GOOGLE_ONE_TAP,"auto"===n?"auto":"normal",e,t)},this.onSsoStateUpdate=(e,t)=>{t.user_sso_state!==o.SsoState.REQUIRED&&t.user_sso_state!==o.SsoState.OPTIONAL||o.GSIEventManager.sendGSIEvent(o.GSIEvent.SSO_REQUIRED,{email:e})},this.shouldCallOnLoginSuccess=()=>fe.includes(this.config.pageName),this.shouldCallOnRegisterSuccess=()=>fe.includes(this.config.pageName),this.onGoogleLoginSuccess=e=>{var t,n;const i=(null===(t=e.profile)||void 0===t?void 0:t.name)||"",a=e.user_id,s=(null===(n=e.profile)||void 0===n?void 0:n.email)||"";o.GSIEventManager.sendGSIEvent(o.GSIEvent.LOGIN_SUCCESS,{name:i,id:a,email:s})},this.onGoogleRegisterSuccess=e=>{var t,n;const i=(null===(t=e.profile)||void 0===t?void 0:t.name)||"",a=e.user_id,s=(null===(n=e.profile)||void 0===n?void 0:n.email)||"";o.GSIEventManager.sendGSIEvent(o.GSIEvent.REGISTER_SUCCESS,{name:i,id:a,email:s})},this.signUp=e=>{const t=document.referrer;return Q({googleCredentials:this.googleCredentials,select_by:this.selectBy,tos_signed:!0,marketingOptedIn:e,referralCode:this.config.referralCode,referralSource:this.config.referralSource,emailHash:this.config.emailHash,webSignupTag:this.config.signupTag,additionalAuthParams:{...this.config.additionalAuthParams||{},tos_variant:o.getTOSVariant(o.TOSType.GOOGLE_ONE_TAP,this.config.implicitTOSVariant),is_edison:S.isServedByEdisonWebServer().toString()},cont_url:this.config.additionalAuthParams.postUpsellRedirectUrl,visitorId:this.getVisitorData("visitor-id"),fpRequestId:this.getVisitorData("fp-request-id"),signupReferrer:t,fpSealedResult:this.getVisitorData("fp_sealed_result")}).then((e=>{if("success"===e[".tag"]){if(this.userFinishedSignup=!0,this.isButtonFlow?o.AuthAMPLogger.logSignupResponse(o.AuthType.GOOGLE,!0,null,{dwgRefreshVariant:this.config.dwgRefreshVariant}):(o.AuthAMPLogger.logSignupResponse(o.AuthType.GOOGLE_ONE_TAP,!0,null,{dwgRefreshVariant:this.config.dwgRefreshVariant}),o.displayEvent(o.GoogleOneTapEvent.GOOGLE_ONE_TAP_ACCOUNT_CREATION_SUCCESS,!0)),this.getLogger().logSignupResponse(e[".tag"],!this.isButtonFlow,{},e.user_id),!("localStorageSessionId"in this.config.additionalAuthParams)&&!("localStorageStoreId"in this.config.additionalAuthParams))return this.signUpSuccessHelper(e);{const t=this.config.additionalAuthParams.localStorageSessionId,n=this.config.additionalAuthParams.localStorageStoreId,i="localStorageFilename"in this.config.additionalAuthParams?this.config.additionalAuthParams.localStorageFilename:void 0,a="localStorageAutoRename"in this.config.additionalAuthParams?Boolean(this.config.additionalAuthParams.localStorageAutoRename):void 0,s=()=>{o.GSIEventManager.sendGSIEvent(o.GSIEvent.LOGIN_SUCCESS,{})};(async()=>{var o;await te({sessionId:t,store:n,filename:i,autoRename:a,onErrorCallback:s},{id:e.user_id,email:null===(o=e.profile)||void 0===o?void 0:o.email,root_ns_id:e.root_ns_id,home_ns_id:e.home_ns_id}),this.signUpSuccessHelper(e)})()}return!0}return this.getLogger().logSignupResponse(e[".tag"],!this.isButtonFlow),s.intl.formatMessage({id:"kQwNuJ",defaultMessage:"There was a problem completing this request. Please try again."}),a.Notify.error(s.intl.formatMessage({id:"2q7GH0",defaultMessage:"There was a problem completing this request. Please Try Again."})),!1})).catch((e=>{var t;return this.getLogger().logSignupResponse(e.error[".tag"]||(null===(t=e.error.reason)||void 0===t?void 0:t[".tag"]),!this.isButtonFlow),this.isButtonFlow?o.AuthAMPLogger.logSignupResponse(o.AuthType.GOOGLE,!1,e.error[".tag"],{dwgRefreshVariant:this.config.dwgRefreshVariant}):o.AuthAMPLogger.logSignupResponse(o.AuthType.GOOGLE_ONE_TAP,!1,e.error[".tag"],{dwgRefreshVariant:this.config.dwgRefreshVariant}),Z(e),!1}))},this.signUpSuccessHelper=e=>{var t;if(this.config.disableRedirect)return this.cancelTOS(),this.onGoogleRegisterSuccess(e),!0;this.shouldCallOnRegisterSuccess()&&this.onGoogleRegisterSuccess(e);const n=e.force_redirect_url?e.redirect_url:(null===(t=this.config)||void 0===t?void 0:t.registerContUrl)||e.redirect_url||"/trial_first";return o.redirect(n),!0},this.showTOSPrompt=e=>{if(!this.tosPromptShown){const n=e&&!this.config.isMobile,i=this.config.isInline||n?t.TOSModalVariant.V2:t.TOSModalVariant.V1;let a;i===t.TOSModalVariant.V2&&"signin"===this.currentContext&&(a=t.TOSModalVariant.V1),this.userId=function(e){const t=K(e);return null!=t?t.userId:""}(this.googleCredentials),ue({modalVariant:i,animationVariant:a,onToggle:this.handleToggleTOS,onDismiss:this.handleDismissTOS,onSubmit:this.handleTOSSubmit,onTermsClick:this.getLogger().logSignupTermsClick||(()=>{}),onServicesAgreementClick:this.getLogger().logSignupServicesAgreementClick||(()=>{}),onDashAccessAgreementClick:this.getLogger().logSignupDashAccessAgreementClick||(()=>{}),onPrivacyClick:this.getLogger().logSignupPrivacyClick||(()=>{}),onTosShown:()=>this.getLogger().logSignupInlineTermsOfServiceView("google_one_tap"),containerParentSelector:i===t.TOSModalVariant.V2?`${"signup"===this.currentContext?o.DEFAULT_ONE_TAP_INLINE_TOS_ID_REGISTER:o.DEFAULT_ONE_TAP_INLINE_TOS_ID_LOGIN}`:void 0,showMarketingOptIn:this.config.showMarketingOptIn,implicitTOSVariant:o.getTOSVariant(o.TOSType.GOOGLE_ONE_TAP,this.config.implicitTOSVariant),googleCredentials:this.googleCredentials,thirdPartyType:"google_one_tap"}),this.tosPromptShown=!0,document.body.classList.add(this.tosBodyClass)}},this.cancelTOS=()=>{o.GSIEventManager.sendGSIEvent(o.GSIEvent.TOS_PROMPT_CLOSE),this.tosPromptShown&&(he(),this.tosPromptShown=!1)},this.handleDismissTOS=()=>{o.clickEvent(o.GoogleOneTapEvent.GOOGLE_ONE_TAP_SIGNUP_DISMISS_TOS),this.cancelTOS(),document.body.classList.remove(this.tosBodyClass),this.autoSignInExperimentEnabled()?google.accounts.id.revoke(this.userId,(e=>{this.autoSignInEnabled=!1,this.refreshGSIClient()})):this.refreshGSIClient()},this.handleToggleTOS=e=>{},this.handleTOSSubmit=e=>(this.getLogger().logSignupStart(!this.isButtonFlow),this.isButtonFlow?o.AuthAMPLogger.logSignupAttempt(o.AuthType.GOOGLE):o.AuthAMPLogger.logSignupAttempt(o.AuthType.GOOGLE_ONE_TAP),this.signUp(e)),this.observeGoogleIframe=()=>{const e=this.getGoogleIframe();!this.googleIframeObserver&&e&&(this.googleIframeObserver=new MutationObserver(this.googleIframeObserverCallback),this.googleIframeObserver.observe(e,{attributes:!0}))},this.stopObservingGoogleContainer=()=>{var e;null===(e=this.googleIframeObserver)||void 0===e||e.disconnect(),this.googleIframeObserver=null},this.googleIframeObserverCallback=e=>{e.length&&"style"===e[0].attributeName&&this.setOneTapHeightCssVar(this.getOneTapIframeHeight())},this.setOneTapHeightCssVar=e=>{this.styleTag||(this.styleTag=document.createElement("style"),document.head.appendChild(this.styleTag)),this.styleTag.innerText=`:root {\n ${o.ONE_TAP_HEIGHT_CSS_VAR}: ${e};\n ${o.ONE_TAP_HEIGHT_MOBILE_CSS_VAR}: ${this.config.isMobile?e:"0px"};\n }`},this.getGoogleIframe=()=>document.getElementById(o.GOOGLE_ONE_TAP_IFRAME_ID)||document.querySelector(`#${o.GOOGLE_ONE_TAP_CREDENTIAL_CONTAINER_ID} iframe`),this.getOneTapIframeHeight=()=>{const e=this.getGoogleIframe();return(null==e?void 0:e.style.height)||"0px"},this.pollAndClearIframeFocus=()=>{const e=setInterval((()=>{var t,n;document.activeElement&&document.activeElement===this.getGoogleIframe()&&(null===(t=document.activeElement)||void 0===t||t.blur(),null===(n=this.activeElement)||void 0===n||n.focus(),o.GSIEventManager.sendGSIEvent(o.GSIEvent.INLINE_PROMPT_UI_READY),clearInterval(e))}),5);setTimeout((()=>{o.GSIEventManager.sendGSIEvent(o.GSIEvent.INLINE_PROMPT_UI_READY),clearInterval(e)}),3e3)},this.handleFocusIn=()=>{document.activeElement!==this.getGoogleIframe()&&(this.activeElement=document.activeElement)},this.getPromptParentId=()=>{var e;return(null===(e=this.config)||void 0===e?void 0:e.isInline)?this.getInlineContainerId():void 0},this.getInlineContainerId=()=>this.config&&"signup"===this.currentContext?o.DEFAULT_SIGNUP_CONTAINER_ID:o.DEFAULT_SIGNIN_CONTAINER_ID,this.setCurrentContext=e=>{this.currentContext=e},this.updateStateContext=e=>{const t="signup"===e?o.GSIEvent.CONTEXT_CHANGE_SIGNUP:o.GSIEvent.CONTEXT_CHANGE_SIGNIN;o.GSIEventManager.sendGSIEvent(t)},Ie.instance)return Ie.instance;Ie.instance=this,this.ssoChecker=new ae}initGoogleAccount(){const e={client_id:this.config.clientId,callback:this.googleSignInCallback,cancel_on_tap_outside:!1,context:this.currentContext,prompt_parent_id:this.isFedCMOn?"":this.getPromptParentId(),itp_support:!0,auto_select:this.autoSignInEnabled,use_fedcm_for_prompt:this.isFedCMOn};google.accounts.id.initialize(e),this.isFromLogout()&&google.accounts.id.disableAutoSelect(),o.GSIEventManager.getGSIState().googleAccountInitialized||o.GSIEventManager.sendGSIEvent(o.GSIEvent.INITIALIZE_GOOGLE_ACCOUNT)}}const ve=new Ie;function Le(e){e&&!o.GSIEventManager.getGSIState().isInline&&o.GSIEventManager.sendGSIEvent(o.GSIEvent.USE_INLINE_PROMPT);const[t,n]=r.useState(o.GSIEventManager.getGSIState()),i=[o.GSIEvent.INITIALIZE_PLATFORM,o.GSIEvent.PROMPT_OPEN,o.GSIEvent.PROMPT_CLOSE,o.GSIEvent.DISPLAY_MOMENT,o.GSIEvent.RESET_DISPLAY_MOMENT,o.GSIEvent.INLINE_PROMPT_UI_READY,o.GSIEvent.INLINE_PROMPT_UI_NOT_READY],a=[o.GSIEvent.TOS_PROMPT_OPEN,o.GSIEvent.TOS_PROMPT_CLOSE,o.GSIEvent.IS_MOBILE,...e?i:[]],s=()=>{n(o.GSIEventManager.getGSIState())};return r.useEffect((()=>(o.GSIEventManager.removeGSIEventListener(a,s),o.GSIEventManager.createGSIEventListener(a,s),()=>{o.GSIEventManager.removeGSIEventListener(a,s)})),[]),t}var Te=Object.freeze({__proto__:null,GoogleOneTapPlatform:ve,GoogleOneTapPlatformSingleton:Ie,UseGsiState:Le,initialize_module:function(e){ve.init(e)}});t.AuthEventLogger=T,t.DWGLazyUIIcon=R,t.DWGOutlineButton=Y,t.DWGPrimaryButton=q,t.DWGStackVertical=D,t.DWGTransparentButton=J,t.GetAccountRoutes=X,t.GoogleOneTapPlatform=ve,t.SsoStateChecker=ae,t.UseGsiState=Le,t.displayTOS=ue,t.google_one_tap_platform_esnext=Te,t.retrieveAndSaveFile=te,t.setGoogleOneTapDisabledBodyClass=e=>{document.body.classList.toggle(o.GOOGLE_ONE_TAP_BUTTON_PROMPT_DISABLED,e)},t.showOneTapInlineGoogleButton=function(e){const t=(null==e?void 0:e.isButtonFlow)&&!(null==e?void 0:e.isMobile),n=((null==e?void 0:e.tosPromptDisplayed)||(null==e?void 0:e.promptNotShownReason)===o.PromptNotShownReason.inFlow)&&((null==e?void 0:e.isInline)||t);return!((null==e?void 0:e.isInline)&&(!(null==e?void 0:e.isPromptClosed)||(null==e?void 0:e.tosPromptDisplayed))||n)},t.unmountTOS=he})); //# sourceMappingURL=c_google_one_tap_google_one_tap_platform.js-vfl9nJLVR.map //# debugId=0b198109-a240-3f85-9232-a485a311c0c1