@clerk/ui 1.0.0-snapshot.v20251216175437 → 1.0.0-snapshot.v20251217165918

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/{207_ui_338113_1.0.0-snapshot.v20251216175437.js → 207_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  2. package/dist/{217_ui_338113_1.0.0-snapshot.v20251216175437.js → 217_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  3. package/dist/{360_ui_338113_1.0.0-snapshot.v20251216175437.js → 360_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  4. package/dist/{444_ui_338113_1.0.0-snapshot.v20251216175437.js → 444_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  5. package/dist/{573_ui_338113_1.0.0-snapshot.v20251216175437.js → 573_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  6. package/dist/{970_ui_338113_1.0.0-snapshot.v20251216175437.js → 970_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  7. package/dist/ClerkUi.js +2 -2
  8. package/dist/{apiKeys_ui_338113_1.0.0-snapshot.v20251216175437.js → apiKeys_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  9. package/dist/{checkout_ui_338113_1.0.0-snapshot.v20251216175437.js → checkout_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +2 -2
  10. package/dist/components/OrganizationProfile/index.js +4 -3
  11. package/dist/components/OrganizationProfile/index.js.map +1 -1
  12. package/dist/components/SignIn/SignInFactorTwoAlternativeMethods.js +3 -1
  13. package/dist/components/SignIn/SignInFactorTwoAlternativeMethods.js.map +1 -1
  14. package/dist/components/SignIn/index.js +2 -1
  15. package/dist/components/SignIn/index.js.map +1 -1
  16. package/dist/components/SignUp/index.js +2 -1
  17. package/dist/components/SignUp/index.js.map +1 -1
  18. package/dist/components/UserProfile/index.js +3 -2
  19. package/dist/components/UserProfile/index.js.map +1 -1
  20. package/dist/components/UserVerification/UserVerificationFactorTwo.js +1 -1
  21. package/dist/components/UserVerification/UserVerificationFactorTwo.js.map +1 -1
  22. package/dist/components/UserVerification/index.js.map +1 -1
  23. package/dist/{createorganization_ui_338113_1.0.0-snapshot.v20251216175437.js → createorganization_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  24. package/dist/customizables/parseAppearance.d.ts +2 -2
  25. package/dist/customizables/parseAppearance.d.ts.map +1 -1
  26. package/dist/customizables/parseAppearance.js.map +1 -1
  27. package/dist/{enableOrganizationsPrompt_ui_338113_1.0.0-snapshot.v20251216175437.js → enableOrganizationsPrompt_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  28. package/dist/{impersonationfab_ui_338113_1.0.0-snapshot.v20251216175437.js → impersonationfab_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/internal/index.d.ts +2 -1
  31. package/dist/internal/index.d.ts.map +1 -1
  32. package/dist/internal/index.js +1 -1
  33. package/dist/internal/index.js.map +1 -1
  34. package/dist/internal/routing.d.ts +13 -0
  35. package/dist/internal/routing.d.ts.map +1 -0
  36. package/dist/{keylessPrompt_ui_338113_1.0.0-snapshot.v20251216175437.js → keylessPrompt_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  37. package/dist/lazyModules/components.d.ts +4 -3
  38. package/dist/lazyModules/components.d.ts.map +1 -1
  39. package/dist/{oauthConsent_ui_338113_1.0.0-snapshot.v20251216175437.js → oauthConsent_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  40. package/dist/{onetap_ui_338113_1.0.0-snapshot.v20251216175437.js → onetap_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  41. package/dist/{op-api-keys-page_ui_338113_1.0.0-snapshot.v20251216175437.js → op-api-keys-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  42. package/dist/{organizationlist_ui_338113_1.0.0-snapshot.v20251216175437.js → organizationlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  43. package/dist/{organizationprofile_ui_338113_1.0.0-snapshot.v20251216175437.js → organizationprofile_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  44. package/dist/{organizationswitcher_ui_338113_1.0.0-snapshot.v20251216175437.js → organizationswitcher_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  45. package/dist/{payment-attempt-page_ui_338113_1.0.0-snapshot.v20251216175437.js → payment-attempt-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  46. package/dist/{planDetails_ui_338113_1.0.0-snapshot.v20251216175437.js → planDetails_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  47. package/dist/{prefetchorganizationlist_ui_338113_1.0.0-snapshot.v20251216175437.js → prefetchorganizationlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  48. package/dist/{pricingTable_ui_338113_1.0.0-snapshot.v20251216175437.js → pricingTable_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  49. package/dist/{revoke-api-key-modal_ui_338113_1.0.0-snapshot.v20251216175437.js → revoke-api-key-modal_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  50. package/dist/{sessionTasks_ui_338113_1.0.0-snapshot.v20251216175437.js → sessionTasks_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  51. package/dist/signin_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +1 -0
  52. package/dist/{signup_ui_338113_1.0.0-snapshot.v20251216175437.js → signup_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  53. package/dist/{statement-page_ui_338113_1.0.0-snapshot.v20251216175437.js → statement-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  54. package/dist/{subscriptionDetails_ui_338113_1.0.0-snapshot.v20251216175437.js → subscriptionDetails_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  55. package/dist/{taskChooseOrganization_ui_338113_1.0.0-snapshot.v20251216175437.js → taskChooseOrganization_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  56. package/dist/{taskResetPassword_ui_338113_1.0.0-snapshot.v20251216175437.js → taskResetPassword_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  57. package/dist/types.d.ts.map +1 -1
  58. package/dist/{ui-common_ui_338113_1.0.0-snapshot.v20251216175437.js → ui-common_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +4 -4
  59. package/dist/ui.browser.js +1 -1
  60. package/dist/{up-api-keys-page_ui_338113_1.0.0-snapshot.v20251216175437.js → up-api-keys-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  61. package/dist/{useravatar_ui_338113_1.0.0-snapshot.v20251216175437.js → useravatar_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  62. package/dist/{userbutton_ui_338113_1.0.0-snapshot.v20251216175437.js → userbutton_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  63. package/dist/{userprofile_ui_338113_1.0.0-snapshot.v20251216175437.js → userprofile_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +2 -2
  64. package/dist/{userverification_ui_338113_1.0.0-snapshot.v20251216175437.js → userverification_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  65. package/dist/{waitlist_ui_338113_1.0.0-snapshot.v20251216175437.js → waitlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +1 -1
  66. package/package.json +6 -6
  67. package/dist/signin_ui_338113_1.0.0-snapshot.v20251216175437.js +0 -1
  68. /package/dist/{blankcaptcha_ui_338113_1.0.0-snapshot.v20251216175437.js → blankcaptcha_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  69. /package/dist/{copy-api-key-modal_ui_338113_1.0.0-snapshot.v20251216175437.js → copy-api-key-modal_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  70. /package/dist/{framework_ui_338113_1.0.0-snapshot.v20251216175437.js → framework_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  71. /package/dist/{op-billing-page_ui_338113_1.0.0-snapshot.v20251216175437.js → op-billing-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  72. /package/dist/{op-plans-page_ui_338113_1.0.0-snapshot.v20251216175437.js → op-plans-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  73. /package/dist/{up-billing-page_ui_338113_1.0.0-snapshot.v20251216175437.js → up-billing-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  74. /package/dist/{up-plans-page_ui_338113_1.0.0-snapshot.v20251216175437.js → up-plans-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
  75. /package/dist/{vendors_ui_338113_1.0.0-snapshot.v20251216175437.js → vendors_ui_7e9f20_1.0.0-snapshot.v20251217165918.js} +0 -0
@@ -1,3 +1,3 @@
1
1
  !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(globalThis,()=>(()=>{"use strict";var e,t,n,r={3727:function(e,t,n){n.d(t,{x:()=>l});var r=n(2166),a=n(4670),o=n(1421),i=n(5074);let l=()=>{let[e,t]=i.useState({startPath:"",path:"",componentName:"",socialProvider:""}),n=(0,o.F)();i.useLayoutEffect(()=>{n&&t(n)},[]);let l=()=>{t({startPath:"",path:"",componentName:"",socialProvider:""})};return{urlStateParam:{...e,clearUrlStateParam:l},decodedRedirectParams:n,clearUrlStateParam:l,removeQueryParam:()=>(0,a.r)(r.r)}}},4096:function(e,t,n){n.d(t,{Gb:()=>C,JJ:()=>R,L1:()=>k,M9:()=>i,O3:()=>U,Qj:()=>v,RW:()=>$,Sm:()=>O,Xi:()=>_,am:()=>y,gK:()=>f,jr:()=>D,ju:()=>E,yc:()=>u,yd:()=>c,ym:()=>N});var r=n(5074);let a={SignIn:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472"),n.e("444"),n.e("10")]).then(n.bind(n,8319)),SignUp:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472")]).then(n.bind(n,8480)),UserAvatar:()=>Promise.all([n.e("545"),n.e("666"),n.e("58")]).then(n.bind(n,7714)),UserButton:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("444"),n.e("99")]).then(n.bind(n,6240)),UserProfile:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("217"),n.e("718")]).then(n.bind(n,4308)),CreateOrganization:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("573"),n.e("243")]).then(n.bind(n,4472)),OrganizationProfile:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("573"),n.e("310")]).then(n.bind(n,6568)),OrganizationSwitcher:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("364")]).then(n.bind(n,7498)),OrganizationList:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("573"),n.e("799")]).then(n.bind(n,4013)),ImpersonationFab:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("917")]).then(n.bind(n,7399)),GoogleOneTap:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("721")]).then(n.bind(n,3109)),BlankCaptchaModal:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("328")]).then(n.bind(n,5723)),UserVerification:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("636")]).then(n.bind(n,9066)),Waitlist:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("265")]).then(n.bind(n,1170)),KeylessPrompt:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("522")]).then(n.bind(n,3131)),PricingTable:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("970"),n.e("30")]).then(n.bind(n,6334)),Checkout:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("217"),n.e("256")]).then(n.bind(n,2677)),SessionTasks:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472"),n.e("723"),n.e("390")]).then(n.bind(n,1662)),TaskChooseOrganization:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472"),n.e("723")]).then(n.bind(n,9024)),TaskResetPassword:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472"),n.e("67")]).then(n.bind(n,7959)),PlanDetails:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("841")]).then(n.bind(n,3598)),SubscriptionDetails:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("451")]).then(n.bind(n,1461)),APIKeys:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("326")]).then(n.bind(n,4875)),OAuthConsent:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("591")]).then(n.bind(n,9576)),EnableOrganizationsPrompt:()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("533")]).then(n.bind(n,7334))},o=(0,r.lazy)(()=>a.SignIn().then(e=>({default:e.SignIn}))),i=(0,r.lazy)(()=>a.SignIn().then(e=>({default:e.SignInModal}))),l=(0,r.lazy)(()=>a.GoogleOneTap().then(e=>({default:e.OneTap}))),s=(0,r.lazy)(()=>a.UserVerification().then(e=>({default:e.UserVerification}))),c=(0,r.lazy)(()=>a.UserVerification().then(e=>({default:e.UserVerificationModal}))),u=(0,r.lazy)(()=>a.EnableOrganizationsPrompt().then(e=>({default:e.EnableOrganizationsPrompt}))),p=(0,r.lazy)(()=>a.SignUp().then(e=>({default:e.SignUp}))),f=(0,r.lazy)(()=>a.SignUp().then(e=>({default:e.SignUpModal}))),d=(0,r.lazy)(()=>a.UserAvatar().then(e=>({default:e.UserAvatar}))),h=(0,r.lazy)(()=>a.UserButton().then(e=>({default:e.UserButton}))),m=(0,r.lazy)(()=>a.UserProfile().then(e=>({default:e.UserProfile}))),y=(0,r.lazy)(()=>a.UserProfile().then(e=>({default:e.UserProfileModal}))),g=(0,r.lazy)(()=>a.CreateOrganization().then(e=>({default:e.CreateOrganization}))),_=(0,r.lazy)(()=>a.CreateOrganization().then(e=>({default:e.CreateOrganizationModal}))),b=(0,r.lazy)(()=>a.OrganizationProfile().then(e=>({default:e.OrganizationProfile}))),v=(0,r.lazy)(()=>a.OrganizationProfile().then(e=>({default:e.OrganizationProfileModal}))),P=(0,r.lazy)(()=>a.OrganizationSwitcher().then(e=>({default:e.OrganizationSwitcher}))),S=(0,r.lazy)(()=>a.OrganizationList().then(e=>({default:e.OrganizationList}))),w=(0,r.lazy)(()=>a.Waitlist().then(e=>({default:e.Waitlist}))),k=(0,r.lazy)(()=>a.Waitlist().then(e=>({default:e.WaitlistModal}))),C=(0,r.lazy)(()=>a.BlankCaptchaModal().then(e=>({default:e.BlankCaptchaModal}))),O=(0,r.lazy)(()=>a.ImpersonationFab().then(e=>({default:e.ImpersonationFab}))),E=(0,r.lazy)(()=>a.KeylessPrompt().then(e=>({default:e.KeylessPrompt}))),A=(0,r.lazy)(()=>a.PricingTable().then(e=>({default:e.PricingTable}))),M=(0,r.lazy)(()=>a.APIKeys().then(e=>({default:e.APIKeys}))),$=(0,r.lazy)(()=>a.Checkout().then(e=>({default:e.Checkout}))),x=(0,r.lazy)(()=>a.TaskChooseOrganization().then(e=>({default:e.TaskChooseOrganization}))),z=(0,r.lazy)(()=>a.TaskResetPassword().then(e=>({default:e.TaskResetPassword}))),N=(0,r.lazy)(()=>a.PlanDetails().then(e=>({default:e.PlanDetails}))),T=(0,r.lazy)(()=>a.SubscriptionDetails().then(e=>({default:e.SubscriptionDetails}))),I=(0,r.lazy)(()=>a.OAuthConsent().then(e=>({default:e.OAuthConsent}))),R=(0,r.lazy)(()=>a.SessionTasks().then(e=>({default:e.SessionTasks}))),D=async e=>a[e]?.(),U={SignIn:o,SignUp:p,UserAvatar:d,UserButton:h,UserProfile:m,UserVerification:s,EnableOrganizationsPrompt:u,OrganizationSwitcher:P,OrganizationList:S,OrganizationProfile:b,CreateOrganization:g,SignInModal:i,SignUpModal:f,UserProfileModal:y,OrganizationProfileModal:v,CreateOrganizationModal:_,UserVerificationModal:c,GoogleOneTap:l,Waitlist:w,WaitlistModal:k,BlankCaptchaModal:C,PricingTable:A,Checkout:$,PlanDetails:N,APIKeys:M,OAuthConsent:I,SubscriptionDetails:T,TaskChooseOrganization:x,TaskResetPassword:z}},4642:function(e,t,n){n.d(t,{Nx:()=>E,Vv:()=>C,Fj:()=>w,up:()=>S,$h:()=>O,t8:()=>k,dB:()=>A,xg:()=>M});var r=n(4518),a=n(4653);let o=new Set;var i=n(5074),l=n(4096);let s=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,9367)).then(e=>({default:e.CoreClerkContextWrapper}))),c=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,9367)).then(e=>({default:e.EnvironmentProvider}))),u=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,9367)).then(e=>({default:e.OptionsProvider}))),p=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,9367)).then(e=>({default:e.ModuleManagerProvider}))),f=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,8272)).then(e=>({default:e.AppearanceProvider}))),d=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,3394)).then(e=>({default:e.VirtualRouter}))),h=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666")]).then(n.bind(n,2245)).then(e=>({default:e.InternalThemeProvider}))),m=(0,i.lazy)(()=>n.e("666").then(n.bind(n,5287)).then(e=>({default:e.StyleCacheProvider}))),y=(0,i.lazy)(()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472"),n.e("360")]).then(n.bind(n,9661)).then(e=>({default:e.Portal}))),g=(0,i.lazy)(()=>Promise.all([n.e("26"),n.e("545"),n.e("666"),n.e("472"),n.e("360")]).then(n.bind(n,9661)).then(e=>({default:e.VirtualBodyRootPortal}))),_=(0,i.lazy)(()=>Promise.all([n.e("26"),n.e("545"),n.e("666")]).then(n.bind(n,3269)).then(e=>({default:e.FlowMetadataProvider}))),b=(0,i.lazy)(()=>Promise.all([n.e("26"),n.e("545"),n.e("666")]).then(n.bind(n,6705)).then(e=>({default:e.Modal}))),v=(0,i.lazy)(()=>Promise.all([n.e("26"),n.e("545"),n.e("666")]).then(n.bind(n,8532)).then(e=>({default:e.Drawer.Root}))),P=(0,i.lazy)(()=>Promise.all([n.e("26"),n.e("545"),n.e("666")]).then(n.bind(n,8532)).then(e=>({default:e.Drawer.Overlay}))),S=(0,i.lazy)(()=>Promise.all([n.e("545"),n.e("666"),n.e("608")]).then(n.bind(n,4817)).then(e=>({default:e.OrganizationSwitcherPrefetch}))),w=e=>(0,r.Y)(m,{nonce:e.options.nonce,cssLayerName:e.options.appearance?.cssLayerName,children:(0,r.Y)(p,{moduleManager:e.moduleManager,children:(0,r.Y)(s,{clerk:e.clerk,children:(0,r.Y)(c,{value:e.environment,children:(0,r.Y)(u,{value:e.options,children:e.children})})})})}),k=e=>{var t,n;let i,s;return e?.componentProps?.routing==="virtual"&&(t='routing="virtual"',i=(0,a.r)()||(0,a.n)(),s=n??t,o.has(s)||i||(o.add(s),console.warn(`Clerk - DEPRECATION WARNING: "${t}" is deprecated and will be removed in the next major release.
2
2
  Use routing="hash" instead.`))),(0,r.Y)(f,{globalAppearance:e.globalAppearance,appearanceKey:e.appearanceKey,appearance:e.componentAppearance,children:(0,r.Y)(y,{node:e.node,component:l.O3[e.componentName],props:e.componentProps,componentName:e.componentName})})},C=e=>(0,r.Y)(i.Suspense,{fallback:"",children:(0,r.Y)(f,{globalAppearance:e.globalAppearance,appearanceKey:e.appearanceKey,appearance:e.componentAppearance,children:(0,r.Y)(_,{flow:e.flowName||"",children:(0,r.Y)(h,{children:(0,r.Y)(b,{id:e.modalId,style:e.modalStyle,handleClose:e.onClose,containerSx:e.modalContainerSx,contentSx:e.modalContentSx,canCloseModal:e.canCloseModal,children:e.startPath?(0,r.Y)(i.Suspense,{children:(0,r.Y)(d,{startPath:e.startPath,onExternalNavigate:e.onExternalNavigate,children:e.children})}):e.children})})})})}),O=e=>(0,r.Y)(i.Suspense,{fallback:"",children:(0,r.Y)(d,{startPath:"",children:(0,r.Y)(f,{globalAppearance:e.globalAppearance,appearanceKey:e.appearanceKey,appearance:e.componentAppearance,children:(0,r.Y)(_,{flow:e.flowName||"",children:(0,r.Y)(h,{children:(0,r.FD)(v,{open:e.open,onOpenChange:e.onOpenChange,strategy:e.portalId||e.portalRoot?"absolute":"fixed",portalProps:{id:e.portalId?e.portalId:void 0,root:e.portalRoot?e.portalRoot:void 0},children:[(0,r.Y)(P,{}),e.children]})})})})})}),E=e=>(0,r.Y)(i.Suspense,{children:(0,r.Y)(d,{startPath:"",children:(0,r.Y)(f,{globalAppearance:e.globalAppearance,appearanceKey:"impersonationFab",children:e.children})})}),A=e=>(0,r.Y)(i.Suspense,{children:(0,r.Y)(d,{startPath:"",children:(0,r.Y)(f,{globalAppearance:e.globalAppearance,appearanceKey:"enableOrganizationsPrompt",children:e.children})})}),M=e=>(0,r.Y)(f,{globalAppearance:e.globalAppearance,appearanceKey:"oneTap",appearance:e.componentAppearance,children:(0,r.Y)(g,{startPath:e.startPath,component:l.O3.GoogleOneTap,props:e.componentProps,componentName:"GoogleOneTap"})})},1785:function(e,t,n){n.d(t,{A:()=>K});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t));var t,n=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else n.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),a=Math.abs,o=String.fromCharCode,i=Object.assign;function l(e,t,n){return e.replace(t,n)}function s(e,t){return e.indexOf(t)}function c(e,t){return 0|e.charCodeAt(t)}function u(e,t,n){return e.slice(t,n)}function p(e){return e.length}function f(e,t){return t.push(e),e}var d=1,h=1,m=0,y=0,g=0,_="";function b(e,t,n,r,a,o,i){return{value:e,root:t,parent:n,type:r,props:a,children:o,line:d,column:h,length:i,return:""}}function v(e,t){return i(b("",null,null,"",null,null,0),e,{length:-e.length},t)}function P(){return g=y<m?c(_,y++):0,h++,10===g&&(h=1,d++),g}function S(){return c(_,y)}function w(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function k(e){return d=h=1,m=p(_=e),y=0,[]}function C(e){var t,n;return(t=y-1,n=function e(t){for(;P();)switch(g){case t:return y;case 34:case 39:34!==t&&39!==t&&e(g);break;case 40:41===t&&e(t);break;case 92:P()}return y}(91===e?e+2:40===e?e+1:e),u(_,t,n)).trim()}var O="-ms-",E="-moz-",A="-webkit-",M="comm",$="rule",x="decl",z="@keyframes";function N(e,t){for(var n="",r=e.length,a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function T(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case x:return e.return=e.return||e.value;case M:return"";case z:return e.return=e.value+"{"+N(e.children,r)+"}";case $:e.value=e.props.join(",")}return p(n=N(e.children,r))?e.return=e.value+"{"+n+"}":""}function I(e,t,n,r,o,i,s,c,p,f,d){for(var h=o-1,m=0===o?i:[""],y=m.length,g=0,_=0,v=0;g<r;++g)for(var P=0,S=u(e,h+1,h=a(_=s[g])),w=e;P<y;++P)(w=(_>0?m[P]+" "+S:l(S,/&\f/g,m[P])).trim())&&(p[v++]=w);return b(e,t,n,0===o?$:c,p,f,d)}function R(e,t,n,r){return b(e,t,n,x,u(e,0,r),u(e,r+1,-1),r)}var D=function(e,t,n){for(var r=0,a=0;r=a,a=S(),38===r&&12===a&&(t[n]=1),!w(a);)P();return u(_,e,y)},U=function(e,t){var n=-1,r=44;do switch(w(r)){case 0:38===r&&12===S()&&(t[n]=1),e[n]+=D(y-1,t,n);break;case 2:e[n]+=C(r);break;case 4:if(44===r){e[++n]=58===S()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=o(r)}while(r=P());return e},j=function(e,t){var n;return n=U(k(e),t),_="",n},Y=new WeakMap,L=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Y.get(n))&&!r){Y.set(e,!0);for(var a=[],o=j(t,a),i=n.props,l=0,s=0;l<o.length;l++)for(var c=0;c<i.length;c++,s++)e.props[s]=a[l]?o[l].replace(/&\f/g,i[c]):i[c]+" "+o[l]}}},F=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},V=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case x:e.return=function e(t,n){switch(45^c(t,0)?(((n<<2^c(t,0))<<2^c(t,1))<<2^c(t,2))<<2^c(t,3):0){case 5103:return A+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return A+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return A+t+E+t+O+t+t;case 6828:case 4268:return A+t+O+t+t;case 6165:return A+t+O+"flex-"+t+t;case 5187:return A+t+l(t,/(\w+).+(:[^]+)/,A+"box-$1$2"+O+"flex-$1$2")+t;case 5443:return A+t+O+"flex-item-"+l(t,/flex-|-self/,"")+t;case 4675:return A+t+O+"flex-line-pack"+l(t,/align-content|flex-|-self/,"")+t;case 5548:return A+t+O+l(t,"shrink","negative")+t;case 5292:return A+t+O+l(t,"basis","preferred-size")+t;case 6060:return A+"box-"+l(t,"-grow","")+A+t+O+l(t,"grow","positive")+t;case 4554:return A+l(t,/([^-])(transform)/g,"$1"+A+"$2")+t;case 6187:return l(l(l(t,/(zoom-|grab)/,A+"$1"),/(image-set)/,A+"$1"),t,"")+t;case 5495:case 3959:return l(t,/(image-set\([^]*)/,A+"$1$`$1");case 4968:return l(l(t,/(.+:)(flex-)?(.*)/,A+"box-pack:$3"+O+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+A+t+t;case 4095:case 3583:case 4068:case 2532:return l(t,/(.+)-inline(.+)/,A+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(p(t)-1-n>6)switch(c(t,n+1)){case 109:if(45!==c(t,n+4))break;case 102:return l(t,/(.+:)(.+)-([^]+)/,"$1"+A+"$2-$3$1"+E+(108==c(t,n+3)?"$3":"$2-$3"))+t;case 115:return~s(t,"stretch")?e(l(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==c(t,n+1))break;case 6444:switch(c(t,p(t)-3-(~s(t,"!important")&&10))){case 107:return l(t,":",":"+A)+t;case 101:return l(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+A+(45===c(t,14)?"inline-":"")+"box$3$1"+A+"$2$3$1"+O+"$2box$3")+t}break;case 5936:switch(c(t,n+11)){case 114:return A+t+O+l(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return A+t+O+l(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return A+t+O+l(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return A+t+O+t+t}return t}(e.value,e.length);break;case z:return N([v(e,{value:l(e.value,"@","@"+A)})],r);case $:if(e.length){var a,o;return a=e.props,o=function(t){var n;switch(n=t,(n=/(::plac\w+|:read-\w+)/.exec(n))?n[0]:n){case":read-only":case":read-write":return N([v(e,{props:[l(t,/:(read-\w+)/,":"+E+"$1")]})],r);case"::placeholder":return N([v(e,{props:[l(t,/:(plac\w+)/,":"+A+"input-$1")]}),v(e,{props:[l(t,/:(plac\w+)/,":"+E+"$1")]}),v(e,{props:[l(t,/:(plac\w+)/,O+"input-$1")]})],r)}return""},a.map(o).join("")}}}],K=function(e){var t,n,a,i,m,v=e.key;if("css"===v){var O=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(O,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var E=e.stylisPlugins||V,A={},$=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+v+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)A[t[n]]=!0;$.push(e)});var x=(n=(t=[L,F].concat(E,[T,(a=function(e){m.insert(e)},function(e){!e.root&&(e=e.return)&&a(e)})])).length,function(e,r,a,o){for(var i="",l=0;l<n;l++)i+=t[l](e,r,a,o)||"";return i}),z=function(e){var t,n;return N((n=function e(t,n,r,a,i,m,v,k,O){for(var E,A=0,$=0,x=v,z=0,N=0,T=0,D=1,U=1,j=1,Y=0,L="",F=i,V=m,K=a,B=L;U;)switch(T=Y,Y=P()){case 40:if(108!=T&&58==c(B,x-1)){-1!=s(B+=l(C(Y),"&","&\f"),"&\f")&&(j=-1);break}case 34:case 39:case 91:B+=C(Y);break;case 9:case 10:case 13:case 32:B+=function(e){for(;g=S();)if(g<33)P();else break;return w(e)>2||w(g)>3?"":" "}(T);break;case 92:B+=function(e,t){for(var n;--t&&P()&&!(g<48)&&!(g>102)&&(!(g>57)||!(g<65))&&(!(g>70)||!(g<97)););return n=y+(t<6&&32==S()&&32==P()),u(_,e,n)}(y-1,7);continue;case 47:switch(S()){case 42:case 47:f((E=function(e,t){for(;P();)if(e+g===57)break;else if(e+g===84&&47===S())break;return"/*"+u(_,t,y-1)+"*"+o(47===e?e:P())}(P(),y),b(E,n,r,M,o(g),u(E,2,-2),0)),O);break;default:B+="/"}break;case 123*D:k[A++]=p(B)*j;case 125*D:case 59:case 0:switch(Y){case 0:case 125:U=0;case 59+$:-1==j&&(B=l(B,/\f/g,"")),N>0&&p(B)-x&&f(N>32?R(B+";",a,r,x-1):R(l(B," ","")+";",a,r,x-2),O);break;case 59:B+=";";default:if(f(K=I(B,n,r,A,$,i,k,L,F=[],V=[],x),m),123===Y)if(0===$)e(B,n,K,K,F,m,x,k,V);else switch(99===z&&110===c(B,3)?100:z){case 100:case 108:case 109:case 115:e(t,K,K,a&&f(I(t,K,K,0,0,i,k,L,i,F=[],x),V),i,V,x,k,a?F:V);break;default:e(B,K,K,K,[""],V,0,k,V)}}A=$=N=0,D=j=1,L=B="",x=v;break;case 58:x=1+p(B),N=T;default:if(D<1){if(123==Y)--D;else if(125==Y&&0==D++&&125==(g=y>0?c(_,--y):0,h--,10===g&&(h=1,d--),g))continue}switch(B+=o(Y),Y*D){case 38:j=$>0?1:(B+="\f",-1);break;case 44:k[A++]=(p(B)-1)*j,j=1;break;case 64:45===S()&&(B+=C(P())),z=S(),$=x=p(L=B+=function(e){for(;!w(S());)P();return u(_,e,y)}(y)),Y++;break;case 45:45===T&&2==p(B)&&(D=0)}}return m}("",null,null,null,[""],t=k(t=e),0,[0],t),_="",n),x)},D={key:v,sheet:new r({key:v,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:A,registered:{},insert:function(e,t,n,r){m=n,z(e?e+"{"+t.styles+"}":t.styles),r&&(D.inserted[t.name]=!0)}};return D.sheet.hydrate($),D}},6668:function(e,t,n){n.d(t,{E:()=>P,h:()=>f,a:()=>g,c:()=>b,C:()=>h});var r,a=n(5074),o=n(1785);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var l=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}},s=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},c=function(e,t,n){s(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next;while(void 0!==a)}},u=n(399),p=n(7063),f={}.hasOwnProperty,d=a.createContext("undefined"!=typeof HTMLElement?(0,o.A)({key:"css"}):null),h=d.Provider,m=a.createContext({}),y=l(function(e){return l(function(t){var n,r;return n=e,"function"==typeof(r=t)?r(n):i({},n,r)})}),g=function(e){var t=a.useContext(m);return e.theme!==t&&(t=y(t)(e.theme)),a.createElement(m.Provider,{value:t},e.children)},_="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",b=function(e,t){var n={};for(var r in t)f.call(t,r)&&(n[r]=t[r]);return n[_]=e,n},v=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return s(t,n,r),(0,p.s)(function(){return c(t,n,r)}),null},P=(r=function(e,t,n){var r,o,i,l=e.css;"string"==typeof l&&void 0!==t.registered[l]&&(l=t.registered[l]);var s=e[_],c=[l],p="";"string"==typeof e.className?(r=t.registered,o=e.className,i="",o.split(" ").forEach(function(e){void 0!==r[e]?c.push(r[e]+";"):e&&(i+=e+" ")}),p=i):null!=e.className&&(p=e.className+" ");var d=(0,u.J)(c,void 0,a.useContext(m));p+=t.key+"-"+d.name;var h={};for(var y in e)f.call(e,y)&&"css"!==y&&y!==_&&(h[y]=e[y]);return h.ref=n,h.className=p,a.createElement(a.Fragment,null,a.createElement(v,{cache:t,serialized:d,isStringTag:"string"==typeof s}),a.createElement(s,h))},(0,a.forwardRef)(function(e,t){return r(e,(0,a.useContext)(d),t)}))},4518:function(e,t,n){n.d(t,{FD:()=>l,FK:()=>o,Y:()=>i});var r=n(6842),a=n(6668);n(5074),n(1785),n(8863),n(7063);var o=r.Fragment;function i(e,t,n){return a.h.call(t,"css")?r.jsx(a.E,(0,a.c)(e,t),n):r.jsx(e,t,n)}function l(e,t,n){return a.h.call(t,"css")?r.jsxs(a.E,(0,a.c)(e,t),n):r.jsxs(e,t,n)}},399:function(e,t,n){n.d(t,{J:()=>m});var r,a,o,i={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},l=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},p=(r=function(e){return c(e)?e:e.replace(l,"-$&").toLowerCase()},a=Object.create(null),function(e){return void 0===a[e]&&(a[e]=r(e)),a[e]}),f=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(s,function(e,t,n){return o={name:t,styles:n,next:o},t})}return 1===i[e]||c(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return o={name:n.name,styles:n.styles,next:o},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)o={name:r.name,styles:r.styles,next:o},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=d(e,t,n[a])+";";else for(var o in n){var i=n[o];if("object"!=typeof i)null!=t&&void 0!==t[i]?r+=o+"{"+t[i]+"}":u(i)&&(r+=p(o)+":"+f(o,i)+";");else if(Array.isArray(i)&&"string"==typeof i[0]&&(null==t||void 0===t[i[0]]))for(var l=0;l<i.length;l++)u(i[l])&&(r+=p(o)+":"+f(o,i[l])+";");else{var s=d(e,t,i);switch(o){case"animation":case"animationName":r+=p(o)+":"+s+";";break;default:r+=o+"{"+s+"}"}}}return r}(e,t,n);case"function":if(void 0!==e){var a=o,i=n(e);return o=a,d(e,t,i)}}if(null==t)return n;var l=t[n];return void 0!==l?l:n}var h=/label:\s*([^\s;{]+)\s*(;|$)/g;function m(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r,a=!0,i="";o=void 0;var l=e[0];null==l||void 0===l.raw?(a=!1,i+=d(n,t,l)):i+=l[0];for(var s=1;s<e.length;s++)i+=d(n,t,e[s]),a&&(i+=l[s]);h.lastIndex=0;for(var c="";null!==(r=h.exec(i));)c+="-"+r[1];return{name:function(e){for(var t,n=0,r=0,a=e.length;a>=4;++r,a-=4)t=(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))*0x5bd1e995+((t>>>16)*59797<<16),t^=t>>>24,n=(65535&t)*0x5bd1e995+((t>>>16)*59797<<16)^(65535&n)*0x5bd1e995+((n>>>16)*59797<<16);switch(a){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n^=255&e.charCodeAt(r),n=(65535&n)*0x5bd1e995+((n>>>16)*59797<<16)}return n^=n>>>13,(((n=(65535&n)*0x5bd1e995+((n>>>16)*59797<<16))^n>>>15)>>>0).toString(36)}(i)+c,styles:i,next:o}}},7063:function(e,t,n){n.d(t,{s:()=>i});var r,a=n(5074),o=!!(r||(r=n.t(a,2))).useInsertionEffect&&(r||(r=n.t(a,2))).useInsertionEffect,i=o||function(e){return e()};o||a.useLayoutEffect},8863:function(e,t,n){var r=n(2243),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var a=d(n);a&&a!==h&&e(t,a,r)}var i=u(n);p&&(i=i.concat(p(n)));for(var l=s(t),m=s(n),y=0;y<i.length;++y){var g=i[y];if(!o[g]&&!(r&&r[g])&&!(m&&m[g])&&!(l&&l[g])){var _=f(n,g);try{c(t,g,_)}catch(e){}}}}return t}},6983:function(e,t){var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,_=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function P(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case o:case l:case i:case d:return e;default:switch(e=e&&e.$$typeof){case c:case f:case y:case m:case s:return e;default:return t}}case a:return t}}}function S(e){return P(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=y,t.Memo=m,t.Portal=a,t.Profiler=l,t.StrictMode=i,t.Suspense=d,t.isAsyncMode=function(e){return S(e)||P(e)===u},t.isConcurrentMode=S,t.isContextConsumer=function(e){return P(e)===c},t.isContextProvider=function(e){return P(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return P(e)===f},t.isFragment=function(e){return P(e)===o},t.isLazy=function(e){return P(e)===y},t.isMemo=function(e){return P(e)===m},t.isPortal=function(e){return P(e)===a},t.isProfiler=function(e){return P(e)===l},t.isStrictMode=function(e){return P(e)===i},t.isSuspense=function(e){return P(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===p||e===l||e===i||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===f||e.$$typeof===_||e.$$typeof===b||e.$$typeof===v||e.$$typeof===g)},t.typeOf=P},2243:function(e,t,n){e.exports=n(6983)},9234:function(e,t,n){var r=n(5074),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!s.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:a,type:e,key:c,ref:u,props:o,_owner:l.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},9709:function(e,t){var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.iterator,h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,y={};function g(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||h}function _(){}function b(e,t,n){this.props=e,this.context=t,this.refs=y,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=g.prototype;var v=b.prototype=new _;v.constructor=b,m(v,g.prototype),v.isPureReactComponent=!0;var P=Array.isArray,S=Object.prototype.hasOwnProperty,w={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var a,o={},i=null,l=null;if(null!=t)for(a in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)S.call(t,a)&&!k.hasOwnProperty(a)&&(o[a]=t[a]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(a in s=e.defaultProps)void 0===o[a]&&(o[a]=s[a]);return{$$typeof:n,type:e,key:i,ref:l,props:o,_owner:w.current}}function O(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function A(e,t){var n,r;return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36)}function M(e,t,a){if(null==e)return e;var o=[],i=0;return!function e(t,a,o,i,l){var s,c,u,p=typeof t;("undefined"===p||"boolean"===p)&&(t=null);var f=!1;if(null===t)f=!0;else switch(p){case"string":case"number":f=!0;break;case"object":switch(t.$$typeof){case n:case r:f=!0}}if(f)return l=l(f=t),t=""===i?"."+A(f,0):i,P(l)?(o="",null!=t&&(o=t.replace(E,"$&/")+"/"),e(l,a,o,"",function(e){return e})):null!=l&&(O(l)&&(s=l,c=o+(!l.key||f&&f.key===l.key?"":(""+l.key).replace(E,"$&/")+"/")+t,l={$$typeof:n,type:s.type,key:c,ref:s.ref,props:s.props,_owner:s._owner}),a.push(l)),1;if(f=0,i=""===i?".":i+":",P(t))for(var h=0;h<t.length;h++){var m=i+A(p=t[h],h);f+=e(p,a,o,m,l)}else if("function"==typeof(m=null===(u=t)||"object"!=typeof u?null:"function"==typeof(u=d&&u[d]||u["@@iterator"])?u:null))for(t=m.call(t),h=0;!(p=t.next()).done;)m=i+A(p=p.value,h++),f+=e(p,a,o,m,l);else if("object"===p)throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(a=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return f}(e,o,"","",function(e){return t.call(a,e,i++)}),o}function $(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var x={current:null},z={transition:null};function N(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=g,t.Fragment=a,t.Profiler=i,t.PureComponent=b,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:z,ReactCurrentOwner:w},t.act=N,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=m({},e.props),o=e.key,i=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,l=w.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)S.call(t,c)&&!k.hasOwnProperty(c)&&(a[c]=void 0===t[c]&&void 0!==s?s[c]:t[c])}var c=arguments.length-2;if(1===c)a.children=r;else if(1<c){s=Array(c);for(var u=0;u<c;u++)s[u]=arguments[u+2];a.children=s}return{$$typeof:n,type:e.type,key:o,ref:i,props:a,_owner:l}},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:l,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=O,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:$}},t.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=z.transition;z.transition={};try{e()}finally{z.transition=t}},t.unstable_act=N,t.useCallback=function(e,t){return x.current.useCallback(e,t)},t.useContext=function(e){return x.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return x.current.useDeferredValue(e)},t.useEffect=function(e,t){return x.current.useEffect(e,t)},t.useId=function(){return x.current.useId()},t.useImperativeHandle=function(e,t,n){return x.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return x.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return x.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return x.current.useMemo(e,t)},t.useReducer=function(e,t,n){return x.current.useReducer(e,t,n)},t.useRef=function(e){return x.current.useRef(e)},t.useState=function(e){return x.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return x.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return x.current.useTransition()},t.version="18.3.1"},5074:function(e,t,n){e.exports=n(9709)},6842:function(e,t,n){e.exports=n(9234)},2166:function(e,t,n){n.d(t,{a:()=>i,c:()=>s,d:()=>u,f:()=>f,i:()=>l,l:()=>r,o:()=>o,r:()=>a,s:()=>p,t:()=>d,u:()=>c});let r=["redirect_url","after_sign_in_url","after_sign_up_url","sign_in_force_redirect_url","sign_in_fallback_redirect_url","sign_up_force_redirect_url","sign_up_fallback_redirect_url"],a="__clerk_modal_state",o="__clerk_synced",i="suffixed_cookies",l="__clerk_satellite_url",s={FORM_IDENTIFIER_NOT_FOUND:"form_identifier_not_found",FORM_PASSWORD_INCORRECT:"form_password_incorrect",FORM_PASSWORD_PWNED:"form_password_pwned",INVALID_STRATEGY_FOR_USER:"strategy_for_user_invalid",NOT_ALLOWED_TO_SIGN_UP:"not_allowed_to_sign_up",OAUTH_ACCESS_DENIED:"oauth_access_denied",OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:"oauth_email_domain_reserved_by_saml",NOT_ALLOWED_ACCESS:"not_allowed_access",SAML_USER_ATTRIBUTE_MISSING:"saml_user_attribute_missing",USER_LOCKED:"user_locked",EXTERNAL_ACCOUNT_NOT_FOUND:"external_account_not_found",SESSION_EXISTS:"session_exists",SIGN_UP_MODE_RESTRICTED:"sign_up_mode_restricted",SIGN_UP_MODE_RESTRICTED_WAITLIST:"sign_up_restricted_waitlist",ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:"enterprise_sso_user_attribute_missing",ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:"enterprise_sso_email_address_domain_mismatch",ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:"enterprise_sso_hosted_domain_mismatch",SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:"saml_email_address_domain_mismatch",INVITATION_ACCOUNT_NOT_EXISTS:"invitation_account_not_exists",ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:"organization_membership_quota_exceeded_for_sso",CAPTCHA_INVALID:"captcha_invalid",FRAUD_DEVICE_BLOCKED:"device_blocked",FRAUD_ACTION_BLOCKED:"action_blocked",SIGNUP_RATE_LIMIT_EXCEEDED:"signup_rate_limit_exceeded",USER_BANNED:"user_banned"},c=["email_address","phone_number","username"],u=["email_address","phone_number","username","first_name","last_name"],p=350,f={PUBLIC:"public",RESTRICTED:"restricted",WAITLIST:"waitlist"},d="clerk-captcha"},526:function(e,t,n){n.d(t,{t:()=>a});var r=n(8693);let a=()=>{let e=r.t,t=r.t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}},2950:function(e,t,n){n.d(t,{a:()=>a,c:()=>o,n:()=>i,o:()=>u,s:()=>c,t:()=>l,x:()=>s});let r="ClerkJS:";function a(e){throw Error(`${r} Missing path option. The ${e} component was mounted with path routing so you need to specify the path where the component is mounted on e.g. path="/sign-in".`)}function o(e){throw Error(`${r} Invalid routing strategy, path cannot be used in tandem with ${e}.`)}function i(){throw Error(`${r} Clerk instance not found. Make sure Clerk is initialized before using any Clerk components.`)}function l(e){throw Error(`${r} ${e} not found. Make sure you wrap your app with <${e}>.`)}function s(){throw Error(`${r} The target element is empty. Provide a valid DOM element.`)}function c(e,t){throw Error(`${r} Response: ${e||0} not supported yet.
3
- For more information contact us at ${t}`)}function u(e){throw Error(`${r} Unable to retrieve a third party script${e?` ${e}`:""}.`)}},1421:function(e,t,n){n.d(t,{F:()=>o,j:()=>i});var r=n(2166),a=n(4670);let o=()=>{let e=(0,a.n)(r.r)??"";return e?JSON.parse(atob(e)):null},i=({url:e,startPath:t="/user",currentPath:n="",componentName:a,socialProvider:o=""})=>{var i;let l=(i=JSON.stringify({path:n.replace(/CLERK-ROUTER\/VIRTUAL\/.*\//,"")||"",componentName:a,startPath:t,socialProvider:o}),global.btoa(i)),s=new URL(e),c=s.searchParams;return c.set(r.r,l),s.search=c.toString(),s.toString()}},8693:function(e,t,n){n.d(t,{t:()=>r});let r=(...e)=>{}},4670:function(e,t,n){n.d(t,{r:()=>i,n:()=>o,t:()=>l});var r=n(2166);let a=["__clerk_status","__clerk_created_session","__clerk_invitation_token","__clerk_ticket","__clerk_modal_state","__clerk_handshake","__clerk_handshake_nonce","__clerk_help","__clerk_netlify_cache_bust",r.o,r.i,r.a];function o(e){return new URL(window.location.href).searchParams.get(e)||null}function i(e){let t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState(window.history.state,"",t))}function l(e){let t=new URLSearchParams(window.location.search),n=e||new URLSearchParams;for(let e of a){let r=t.get(e);r&&n.set(e,r)}return n}},4653:function(e,t,n){n.d(t,{n:()=>o,r:()=>a,t:()=>r});let r=()=>!1,a=()=>!1,o=()=>{try{return!0}catch{}return!1}}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return r[e](n,n.exports,o),n.exports}o.m=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var n=Object.create(null);o.r(n);var r={};i=i||[null,l({}),l([]),l(l)];for(var a=2&t&&e;("object"==typeof a||"function"==typeof a)&&!~i.indexOf(a);a=l(a))Object.getOwnPropertyNames(a).forEach(t=>{r[t]=()=>e[t]});return r.default=()=>e,o.d(n,r),n},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,n)=>(o.f[n](e,t),t),[])),o.u=e=>""+(({10:"signin",110:"up-plans-page",122:"payment-attempt-page",223:"op-api-keys-page",243:"createorganization",256:"checkout",259:"up-billing-page",26:"framework",264:"op-plans-page",265:"waitlist",289:"op-billing-page",30:"pricingTable",310:"organizationprofile",326:"apiKeys",328:"blankcaptcha",364:"organizationswitcher",390:"sessionTasks",394:"copy-api-key-modal",451:"subscriptionDetails",472:"signup",505:"revoke-api-key-modal",522:"keylessPrompt",533:"enableOrganizationsPrompt",545:"vendors",58:"useravatar",591:"oauthConsent",608:"prefetchorganizationlist",627:"statement-page",636:"userverification",666:"ui-common",67:"taskResetPassword",718:"userprofile",721:"onetap",723:"taskChooseOrganization",799:"organizationlist",817:"up-api-keys-page",841:"planDetails",917:"impersonationfab",99:"userbutton"})[e]||e)+"_ui_"+o.h().slice(0,6)+"_1.0.0-snapshot.v20251216175437.js",o.h=()=>"338113b567e4b4f2",o.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},o.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var a,i,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="@clerk/ui:"+n){a=u;break}}a||(i=!0,(a=document.createElement("script")).timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack","@clerk/ui:"+n),a.src=e),s[e]=[t];var p=function(t,n){a.onerror=a.onload=null,clearTimeout(f);var r=s[e];if(delete s[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),i&&document.head.appendChild(a)},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(c=o.g.location+"");var i,l,s,c,u=o.g.document;if(!c&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(c=u.currentScript.src),!c)){var p=u.getElementsByTagName("script");if(p.length)for(var f=p.length-1;f>-1&&(!c||!/^http(s?):/.test(c));)c=p[f--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");return o.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e={4:0},o.f.j=function(t,n){var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise((n,a)=>r=e[t]=[n,a]);n.push(r[2]=a);var i=o.p+o.u(t),l=Error();o.l(i,function(n){if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,r[1](l)}},"chunk-"+t,t)}},t=(t,n)=>{var r,a,[i,l,s]=n,c=0;if(i.some(t=>0!==e[t])){for(r in l)o.o(l,r)&&(o.m[r]=l[r]);s&&s(o)}for(t&&t(n);c<i.length;c++)a=i[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0},(n=globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n)),(()=>{var e=o(4518),t=o(2950),n=o(526),r=o(5074),a=o(3727),i=o(4096);let l=(0,r.lazy)(()=>Promise.all([o.e("545"),o.e("666")]).then(o.bind(o,8501)).then(e=>({default:e.MountedCheckoutDrawer}))),s=(0,r.lazy)(()=>Promise.all([o.e("545"),o.e("666")]).then(o.bind(o,4027)).then(e=>({default:e.MountedPlanDetailDrawer}))),c=(0,r.lazy)(()=>Promise.all([o.e("26"),o.e("545"),o.e("666"),o.e("451")]).then(o.bind(o,9949)).then(e=>({default:e.MountedSubscriptionDetailDrawer})));var u=o(4642);let p=({base:e,path:t})=>t?e+t:e;function f(e,t){if(!e)return{};let n="signin"===t?"signIn":"signUp",r={[`${n}ForceRedirectUrl`]:e.forceRedirectUrl,[`${n}FallbackRedirectUrl`]:e.fallbackRedirectUrl},a={...e,...r};return delete a.forceRedirectUrl,delete a.fallbackRedirectUrl,a}let d="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,h=0,m={},y=Object.freeze({SignUp:"signUpModal",SignIn:"signInModal",UserProfile:"userProfileModal",OrganizationProfile:"organizationProfileModal",CreateOrganization:"createOrganizationModal",Waitlist:"waitlistModal"}),g=n=>{let[o,g]=r.useState({appearance:n.options.appearance,options:n.options,googleOneTapModal:null,signInModal:null,signUpModal:null,userProfileModal:null,userVerificationModal:null,organizationProfileModal:null,createOrganizationModal:null,enableOrganizationsPromptModal:null,organizationSwitcherPrefetch:!1,waitlistModal:null,blankCaptchaModal:null,checkoutDrawer:{open:!1,props:null},planDetailsDrawer:{open:!1,props:null},subscriptionDetailsDrawer:{open:!1,props:null},nodes:new Map,impersonationFab:!1}),{googleOneTapModal:_,signInModal:b,signUpModal:v,userProfileModal:P,userVerificationModal:S,organizationProfileModal:w,createOrganizationModal:k,waitlistModal:C,blankCaptchaModal:O,checkoutDrawer:E,planDetailsDrawer:A,subscriptionDetailsDrawer:M,nodes:$}=o,{urlStateParam:x,clearUrlStateParam:z,decodedRedirectParams:N}=(0,a.x)();d(()=>{N&&g(e=>({...e,[y[N.componentName]]:!0})),m.mountComponent=e=>{let{node:n,name:r,props:a,appearanceKey:o}=e;n||(0,t.x)(),g(e=>(e.nodes.set(n,{key:`p${++h}`,name:r,props:a,appearanceKey:o}),{...e,nodes:$}))},m.unmountComponent=e=>{let{node:t}=e;g(e=>(e.nodes.delete(t),{...e,nodes:$}))},m.updateProps=({node:e,props:t,...n})=>{if(e&&t&&"object"==typeof t){let n=o.nodes.get(e);if(n){n.props={...t},g(e=>({...e}));return}}g(e=>({...e,...n,options:{...e.options,...n.options}}))},m.closeModal=(e,t={})=>{let{notify:n=!0}=t;z(),g(t=>{let r;return(r=t[`${e}Modal`])&&"object"==typeof r&&"afterVerificationCancelled"in r&&n&&r.afterVerificationCancelled?.(),{...t,[`${e}Modal`]:null}})},m.openModal=(e,t)=>{"enableOrganizationsPrompt"===e?g(n=>n.enableOrganizationsPromptModal?n:{...n,[`${e}Modal`]:t}):"afterVerificationCancelled"in t?"afterVerificationCancelled"in t&&g(n=>({...n,[`${e}Modal`]:{...t,afterVerification(){t.afterVerification?.(),m.closeModal(e,{notify:!1})}}})):g(n=>({...n,[`${e}Modal`]:t}))},m.mountImpersonationFab=()=>{g(e=>({...e,impersonationFab:!0}))},m.openDrawer=(e,t)=>{g(n=>({...n,[`${e}Drawer`]:{open:!0,props:t}}))},m.closeDrawer=e=>{g(t=>{let n=t[`${e}Drawer`];return n?.props?.onClose?.(),{...t,[`${e}Drawer`]:{...t[`${e}Drawer`],open:!1}}})},m.prefetch=e=>{g(t=>({...t,[`${e}Prefetch`]:!0}))},n.onComponentsMounted()},[]);let T=(0,e.Y)(u.xg,{componentProps:_,globalAppearance:o.appearance,componentAppearance:_?.appearance,startPath:p({base:"/one-tap",path:""})}),I=(0,e.FD)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"signIn",componentAppearance:b?.appearance,flowName:"signIn",onClose:()=>m.closeModal("signIn"),onExternalNavigate:()=>m.closeModal("signIn"),startPath:p({base:"/sign-in",path:x?.path}),componentName:"SignInModal",children:[(0,e.Y)(i.M9,{...b}),(0,e.Y)(i.gK,{...f(b,"signin")}),(0,e.Y)(i.L1,{...C})]}),R=(0,e.FD)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"signUp",componentAppearance:v?.appearance,flowName:"signUp",onClose:()=>m.closeModal("signUp"),onExternalNavigate:()=>m.closeModal("signUp"),startPath:p({base:"/sign-up",path:x?.path}),componentName:"SignUpModal",children:[(0,e.Y)(i.M9,{...f(v,"signup")}),(0,e.Y)(i.gK,{...v}),(0,e.Y)(i.L1,{...C})]}),D=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"userProfile",componentAppearance:P?.appearance,flowName:"userProfile",onClose:()=>m.closeModal("userProfile"),onExternalNavigate:()=>m.closeModal("userProfile"),startPath:p({base:"/user",path:P?.__experimental_startPath||x?.path}),componentName:"UserProfileModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,e.Y)(i.am,{...P})}),U=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"userVerification",componentAppearance:S?.appearance,flowName:"userVerification",onClose:()=>m.closeModal("userVerification"),onExternalNavigate:()=>m.closeModal("userVerification"),startPath:p({base:"/user-verification",path:x?.path}),componentName:"UserVerificationModal",modalContainerSx:{alignItems:"center"},children:(0,e.Y)(i.yd,{...S})}),j=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"organizationProfile",componentAppearance:w?.appearance,flowName:"organizationProfile",onClose:()=>m.closeModal("organizationProfile"),onExternalNavigate:()=>m.closeModal("organizationProfile"),startPath:p({base:"/organizationProfile",path:w?.__experimental_startPath||x?.path}),componentName:"OrganizationProfileModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,e.Y)(i.Qj,{...w})}),Y=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"createOrganization",componentAppearance:k?.appearance,flowName:"createOrganization",onClose:()=>m.closeModal("createOrganization"),onExternalNavigate:()=>m.closeModal("createOrganization"),startPath:p({base:"/createOrganization",path:x?.path}),componentName:"CreateOrganizationModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$120}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,e.Y)(i.Xi,{...k})}),L=(0,e.FD)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"waitlist",componentAppearance:C?.appearance,flowName:"waitlist",onClose:()=>m.closeModal("waitlist"),onExternalNavigate:()=>m.closeModal("waitlist"),startPath:p({base:"/waitlist",path:x?.path}),componentName:"WaitlistModal",children:[(0,e.Y)(i.L1,{...C}),(0,e.Y)(i.M9,{...C})]}),F=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"blankCaptcha",componentAppearance:{},flowName:"blankCaptcha",onClose:()=>m.closeModal("blankCaptcha"),startPath:p({base:"/blank-captcha",path:x?.path}),componentName:"BlankCaptchaModal",canCloseModal:!1,modalId:"cl-modal-captcha-wrapper",modalStyle:{visibility:"hidden",pointerEvents:"none"},children:(0,e.Y)(i.Gb,{})});return(0,e.Y)(r.Suspense,{fallback:"",children:(0,e.FD)(u.Fj,{clerk:n.getClerk(),environment:n.getEnvironment(),options:o.options,moduleManager:n.moduleManager,children:[[...$].map(([t,n])=>(0,e.Y)(u.t8,{node:t,globalAppearance:o.appearance,appearanceKey:n.appearanceKey,componentAppearance:n.props?.appearance,componentName:n.name,componentProps:n.props},n.key)),_&&T,b&&I,v&&R,P&&D,S&&U,w&&j,k&&Y,C&&L,O&&F,(0,e.Y)(l,{appearance:o.appearance,checkoutDrawer:E,onOpenChange:()=>m.closeDrawer("checkout")}),(0,e.Y)(s,{appearance:o.appearance,planDetailsDrawer:A,onOpenChange:()=>m.closeDrawer("planDetails")}),(0,e.Y)(c,{appearance:o.appearance,subscriptionDetailsDrawer:M,onOpenChange:()=>m.closeDrawer("subscriptionDetails")}),o.impersonationFab&&(0,e.Y)(u.Nx,{globalAppearance:o.appearance,children:(0,e.Y)(i.Sm,{})}),o.enableOrganizationsPromptModal&&(0,e.Y)(u.dB,{globalAppearance:o.appearance,children:(0,e.Y)(i.yc,{...o.enableOrganizationsPromptModal})}),o.options?.__internal_keyless_claimKeylessApplicationUrl&&o.options?.__internal_keyless_copyInstanceKeysUrl&&(0,e.Y)(u.Nx,{globalAppearance:o.appearance,children:(0,e.Y)(i.ju,{claimUrl:o.options.__internal_keyless_claimKeylessApplicationUrl,copyKeysUrl:o.options.__internal_keyless_copyInstanceKeysUrl,onDismiss:o.options.__internal_keyless_dismissPrompt})}),(0,e.Y)(r.Suspense,{children:o.organizationSwitcherPrefetch&&(0,e.Y)(u.up,{})})]})})};window.__internal_ClerkUiCtor||(window.__internal_ClerkUiCtor=class{static version="1.0.0-snapshot.v20251216175437";version="1.0.0-snapshot.v20251216175437";#e;constructor(t,r,a,l){this.#e=((t,r,a,l)=>{let s,c={...a};c.appearance&&(c.appearance=function(e){let t;if(!e||"object"!=typeof e)return e;let n=e.theme;if(!n)return e;if(Array.isArray(n)){n.forEach(e=>{!t&&"object"==typeof e&&e.cssLayerName&&(t=e.cssLayerName)});let r=n.map(e=>{if("string"==typeof e)return e;let{cssLayerName:t,...n}=e;return n}),a=e.cssLayerName||t,o={...e,theme:r};return a&&(o.cssLayerName=a),o}{let t;"object"==typeof n&&n.cssLayerName&&(t=n.cssLayerName);let r="string"==typeof n?n:(()=>{let{cssLayerName:e,...t}=n;return t})(),a=e.cssLayerName||t,o={...e,theme:r};return a&&(o.cssLayerName=a),o}}(c.appearance));let u=document.getElementById("clerk-components");return u||((u=document.createElement("div")).setAttribute("id","clerk-components"),document.body.appendChild(u)),{ensureMounted:async a=>{let{preloadHint:p}=a||{};if(!s){let a=(0,n.t)();p&&(0,i.jr)(p),s=Promise.all([o.e("26"),o.e("666")]).then(o.bind(o,6053)).then(({createRoot:n})=>(n(u).render((0,e.Y)(g,{getClerk:t,getEnvironment:r,options:c,onComponentsMounted:a.resolve,moduleManager:l})),a.promise.then(()=>m)))}return s.then(e=>e)}}})(t,r,a,l)}ensureMounted(e){return this.#e.ensureMounted(e)}})})(),{}})());
3
+ For more information contact us at ${t}`)}function u(e){throw Error(`${r} Unable to retrieve a third party script${e?` ${e}`:""}.`)}},1421:function(e,t,n){n.d(t,{F:()=>o,j:()=>i});var r=n(2166),a=n(4670);let o=()=>{let e=(0,a.n)(r.r)??"";return e?JSON.parse(atob(e)):null},i=({url:e,startPath:t="/user",currentPath:n="",componentName:a,socialProvider:o=""})=>{var i;let l=(i=JSON.stringify({path:n.replace(/CLERK-ROUTER\/VIRTUAL\/.*\//,"")||"",componentName:a,startPath:t,socialProvider:o}),global.btoa(i)),s=new URL(e),c=s.searchParams;return c.set(r.r,l),s.search=c.toString(),s.toString()}},8693:function(e,t,n){n.d(t,{t:()=>r});let r=(...e)=>{}},4670:function(e,t,n){n.d(t,{r:()=>i,n:()=>o,t:()=>l});var r=n(2166);let a=["__clerk_status","__clerk_created_session","__clerk_invitation_token","__clerk_ticket","__clerk_modal_state","__clerk_handshake","__clerk_handshake_nonce","__clerk_help","__clerk_netlify_cache_bust",r.o,r.i,r.a];function o(e){return new URL(window.location.href).searchParams.get(e)||null}function i(e){let t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState(window.history.state,"",t))}function l(e){let t=new URLSearchParams(window.location.search),n=e||new URLSearchParams;for(let e of a){let r=t.get(e);r&&n.set(e,r)}return n}},4653:function(e,t,n){n.d(t,{n:()=>o,r:()=>a,t:()=>r});let r=()=>!1,a=()=>!1,o=()=>{try{return!0}catch{}return!1}}},a={};function o(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return r[e](n,n.exports,o),n.exports}o.m=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var n=Object.create(null);o.r(n);var r={};i=i||[null,l({}),l([]),l(l)];for(var a=2&t&&e;("object"==typeof a||"function"==typeof a)&&!~i.indexOf(a);a=l(a))Object.getOwnPropertyNames(a).forEach(t=>{r[t]=()=>e[t]});return r.default=()=>e,o.d(n,r),n},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,n)=>(o.f[n](e,t),t),[])),o.u=e=>""+(({10:"signin",110:"up-plans-page",122:"payment-attempt-page",223:"op-api-keys-page",243:"createorganization",256:"checkout",259:"up-billing-page",26:"framework",264:"op-plans-page",265:"waitlist",289:"op-billing-page",30:"pricingTable",310:"organizationprofile",326:"apiKeys",328:"blankcaptcha",364:"organizationswitcher",390:"sessionTasks",394:"copy-api-key-modal",451:"subscriptionDetails",472:"signup",505:"revoke-api-key-modal",522:"keylessPrompt",533:"enableOrganizationsPrompt",545:"vendors",58:"useravatar",591:"oauthConsent",608:"prefetchorganizationlist",627:"statement-page",636:"userverification",666:"ui-common",67:"taskResetPassword",718:"userprofile",721:"onetap",723:"taskChooseOrganization",799:"organizationlist",817:"up-api-keys-page",841:"planDetails",917:"impersonationfab",99:"userbutton"})[e]||e)+"_ui_"+o.h().slice(0,6)+"_1.0.0-snapshot.v20251217165918.js",o.h=()=>"7e9f20f40454c525",o.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},o.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var a,i,l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="@clerk/ui:"+n){a=u;break}}a||(i=!0,(a=document.createElement("script")).timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack","@clerk/ui:"+n),a.src=e),s[e]=[t];var p=function(t,n){a.onerror=a.onload=null,clearTimeout(f);var r=s[e];if(delete s[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),i&&document.head.appendChild(a)},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(c=o.g.location+"");var i,l,s,c,u=o.g.document;if(!c&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(c=u.currentScript.src),!c)){var p=u.getElementsByTagName("script");if(p.length)for(var f=p.length-1;f>-1&&(!c||!/^http(s?):/.test(c));)c=p[f--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");return o.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e={4:0},o.f.j=function(t,n){var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var a=new Promise((n,a)=>r=e[t]=[n,a]);n.push(r[2]=a);var i=o.p+o.u(t),l=Error();o.l(i,function(n){if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,r[1](l)}},"chunk-"+t,t)}},t=(t,n)=>{var r,a,[i,l,s]=n,c=0;if(i.some(t=>0!==e[t])){for(r in l)o.o(l,r)&&(o.m[r]=l[r]);s&&s(o)}for(t&&t(n);c<i.length;c++)a=i[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0},(n=globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n)),(()=>{var e=o(4518),t=o(2950),n=o(526),r=o(5074),a=o(3727),i=o(4096);let l=(0,r.lazy)(()=>Promise.all([o.e("545"),o.e("666")]).then(o.bind(o,8501)).then(e=>({default:e.MountedCheckoutDrawer}))),s=(0,r.lazy)(()=>Promise.all([o.e("545"),o.e("666")]).then(o.bind(o,4027)).then(e=>({default:e.MountedPlanDetailDrawer}))),c=(0,r.lazy)(()=>Promise.all([o.e("26"),o.e("545"),o.e("666"),o.e("451")]).then(o.bind(o,9949)).then(e=>({default:e.MountedSubscriptionDetailDrawer})));var u=o(4642);let p=({base:e,path:t})=>t?e+t:e;function f(e,t){if(!e)return{};let n="signin"===t?"signIn":"signUp",r={[`${n}ForceRedirectUrl`]:e.forceRedirectUrl,[`${n}FallbackRedirectUrl`]:e.fallbackRedirectUrl},a={...e,...r};return delete a.forceRedirectUrl,delete a.fallbackRedirectUrl,a}let d="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,h=0,m={},y=Object.freeze({SignUp:"signUpModal",SignIn:"signInModal",UserProfile:"userProfileModal",OrganizationProfile:"organizationProfileModal",CreateOrganization:"createOrganizationModal",Waitlist:"waitlistModal"}),g=n=>{let[o,g]=r.useState({appearance:n.options.appearance,options:n.options,googleOneTapModal:null,signInModal:null,signUpModal:null,userProfileModal:null,userVerificationModal:null,organizationProfileModal:null,createOrganizationModal:null,enableOrganizationsPromptModal:null,organizationSwitcherPrefetch:!1,waitlistModal:null,blankCaptchaModal:null,checkoutDrawer:{open:!1,props:null},planDetailsDrawer:{open:!1,props:null},subscriptionDetailsDrawer:{open:!1,props:null},nodes:new Map,impersonationFab:!1}),{googleOneTapModal:_,signInModal:b,signUpModal:v,userProfileModal:P,userVerificationModal:S,organizationProfileModal:w,createOrganizationModal:k,waitlistModal:C,blankCaptchaModal:O,checkoutDrawer:E,planDetailsDrawer:A,subscriptionDetailsDrawer:M,nodes:$}=o,{urlStateParam:x,clearUrlStateParam:z,decodedRedirectParams:N}=(0,a.x)();d(()=>{N&&g(e=>({...e,[y[N.componentName]]:!0})),m.mountComponent=e=>{let{node:n,name:r,props:a,appearanceKey:o}=e;n||(0,t.x)(),g(e=>(e.nodes.set(n,{key:`p${++h}`,name:r,props:a,appearanceKey:o}),{...e,nodes:$}))},m.unmountComponent=e=>{let{node:t}=e;g(e=>(e.nodes.delete(t),{...e,nodes:$}))},m.updateProps=({node:e,props:t,...n})=>{if(e&&t&&"object"==typeof t){let n=o.nodes.get(e);if(n){n.props={...t},g(e=>({...e}));return}}g(e=>({...e,...n,options:{...e.options,...n.options}}))},m.closeModal=(e,t={})=>{let{notify:n=!0}=t;z(),g(t=>{let r;return(r=t[`${e}Modal`])&&"object"==typeof r&&"afterVerificationCancelled"in r&&n&&r.afterVerificationCancelled?.(),{...t,[`${e}Modal`]:null}})},m.openModal=(e,t)=>{"enableOrganizationsPrompt"===e?g(n=>n.enableOrganizationsPromptModal?n:{...n,[`${e}Modal`]:t}):"afterVerificationCancelled"in t?"afterVerificationCancelled"in t&&g(n=>({...n,[`${e}Modal`]:{...t,afterVerification(){t.afterVerification?.(),m.closeModal(e,{notify:!1})}}})):g(n=>({...n,[`${e}Modal`]:t}))},m.mountImpersonationFab=()=>{g(e=>({...e,impersonationFab:!0}))},m.openDrawer=(e,t)=>{g(n=>({...n,[`${e}Drawer`]:{open:!0,props:t}}))},m.closeDrawer=e=>{g(t=>{let n=t[`${e}Drawer`];return n?.props?.onClose?.(),{...t,[`${e}Drawer`]:{...t[`${e}Drawer`],open:!1}}})},m.prefetch=e=>{g(t=>({...t,[`${e}Prefetch`]:!0}))},n.onComponentsMounted()},[]);let T=(0,e.Y)(u.xg,{componentProps:_,globalAppearance:o.appearance,componentAppearance:_?.appearance,startPath:p({base:"/one-tap",path:""})}),I=(0,e.FD)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"signIn",componentAppearance:b?.appearance,flowName:"signIn",onClose:()=>m.closeModal("signIn"),onExternalNavigate:()=>m.closeModal("signIn"),startPath:p({base:"/sign-in",path:x?.path}),componentName:"SignInModal",children:[(0,e.Y)(i.M9,{...b}),(0,e.Y)(i.gK,{...f(b,"signin")}),(0,e.Y)(i.L1,{...C})]}),R=(0,e.FD)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"signUp",componentAppearance:v?.appearance,flowName:"signUp",onClose:()=>m.closeModal("signUp"),onExternalNavigate:()=>m.closeModal("signUp"),startPath:p({base:"/sign-up",path:x?.path}),componentName:"SignUpModal",children:[(0,e.Y)(i.M9,{...f(v,"signup")}),(0,e.Y)(i.gK,{...v}),(0,e.Y)(i.L1,{...C})]}),D=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"userProfile",componentAppearance:P?.appearance,flowName:"userProfile",onClose:()=>m.closeModal("userProfile"),onExternalNavigate:()=>m.closeModal("userProfile"),startPath:p({base:"/user",path:P?.__experimental_startPath||x?.path}),componentName:"UserProfileModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,e.Y)(i.am,{...P})}),U=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"userVerification",componentAppearance:S?.appearance,flowName:"userVerification",onClose:()=>m.closeModal("userVerification"),onExternalNavigate:()=>m.closeModal("userVerification"),startPath:p({base:"/user-verification",path:x?.path}),componentName:"UserVerificationModal",modalContainerSx:{alignItems:"center"},children:(0,e.Y)(i.yd,{...S})}),j=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"organizationProfile",componentAppearance:w?.appearance,flowName:"organizationProfile",onClose:()=>m.closeModal("organizationProfile"),onExternalNavigate:()=>m.closeModal("organizationProfile"),startPath:p({base:"/organizationProfile",path:w?.__experimental_startPath||x?.path}),componentName:"OrganizationProfileModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,e.Y)(i.Qj,{...w})}),Y=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"createOrganization",componentAppearance:k?.appearance,flowName:"createOrganization",onClose:()=>m.closeModal("createOrganization"),onExternalNavigate:()=>m.closeModal("createOrganization"),startPath:p({base:"/createOrganization",path:x?.path}),componentName:"CreateOrganizationModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$120}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,e.Y)(i.Xi,{...k})}),L=(0,e.FD)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"waitlist",componentAppearance:C?.appearance,flowName:"waitlist",onClose:()=>m.closeModal("waitlist"),onExternalNavigate:()=>m.closeModal("waitlist"),startPath:p({base:"/waitlist",path:x?.path}),componentName:"WaitlistModal",children:[(0,e.Y)(i.L1,{...C}),(0,e.Y)(i.M9,{...C})]}),F=(0,e.Y)(u.Vv,{globalAppearance:o.appearance,appearanceKey:"blankCaptcha",componentAppearance:{},flowName:"blankCaptcha",onClose:()=>m.closeModal("blankCaptcha"),startPath:p({base:"/blank-captcha",path:x?.path}),componentName:"BlankCaptchaModal",canCloseModal:!1,modalId:"cl-modal-captcha-wrapper",modalStyle:{visibility:"hidden",pointerEvents:"none"},children:(0,e.Y)(i.Gb,{})});return(0,e.Y)(r.Suspense,{fallback:"",children:(0,e.FD)(u.Fj,{clerk:n.getClerk(),environment:n.getEnvironment(),options:o.options,moduleManager:n.moduleManager,children:[[...$].map(([t,n])=>(0,e.Y)(u.t8,{node:t,globalAppearance:o.appearance,appearanceKey:n.appearanceKey,componentAppearance:n.props?.appearance,componentName:n.name,componentProps:n.props},n.key)),_&&T,b&&I,v&&R,P&&D,S&&U,w&&j,k&&Y,C&&L,O&&F,(0,e.Y)(l,{appearance:o.appearance,checkoutDrawer:E,onOpenChange:()=>m.closeDrawer("checkout")}),(0,e.Y)(s,{appearance:o.appearance,planDetailsDrawer:A,onOpenChange:()=>m.closeDrawer("planDetails")}),(0,e.Y)(c,{appearance:o.appearance,subscriptionDetailsDrawer:M,onOpenChange:()=>m.closeDrawer("subscriptionDetails")}),o.impersonationFab&&(0,e.Y)(u.Nx,{globalAppearance:o.appearance,children:(0,e.Y)(i.Sm,{})}),o.enableOrganizationsPromptModal&&(0,e.Y)(u.dB,{globalAppearance:o.appearance,children:(0,e.Y)(i.yc,{...o.enableOrganizationsPromptModal})}),o.options?.__internal_keyless_claimKeylessApplicationUrl&&o.options?.__internal_keyless_copyInstanceKeysUrl&&(0,e.Y)(u.Nx,{globalAppearance:o.appearance,children:(0,e.Y)(i.ju,{claimUrl:o.options.__internal_keyless_claimKeylessApplicationUrl,copyKeysUrl:o.options.__internal_keyless_copyInstanceKeysUrl,onDismiss:o.options.__internal_keyless_dismissPrompt})}),(0,e.Y)(r.Suspense,{children:o.organizationSwitcherPrefetch&&(0,e.Y)(u.up,{})})]})})};window.__internal_ClerkUiCtor||(window.__internal_ClerkUiCtor=class{static version="1.0.0-snapshot.v20251217165918";version="1.0.0-snapshot.v20251217165918";#e;constructor(t,r,a,l){this.#e=((t,r,a,l)=>{let s,c={...a};c.appearance&&(c.appearance=function(e){let t;if(!e||"object"!=typeof e)return e;let n=e.theme;if(!n)return e;if(Array.isArray(n)){n.forEach(e=>{!t&&"object"==typeof e&&e.cssLayerName&&(t=e.cssLayerName)});let r=n.map(e=>{if("string"==typeof e)return e;let{cssLayerName:t,...n}=e;return n}),a=e.cssLayerName||t,o={...e,theme:r};return a&&(o.cssLayerName=a),o}{let t;"object"==typeof n&&n.cssLayerName&&(t=n.cssLayerName);let r="string"==typeof n?n:(()=>{let{cssLayerName:e,...t}=n;return t})(),a=e.cssLayerName||t,o={...e,theme:r};return a&&(o.cssLayerName=a),o}}(c.appearance));let u=document.getElementById("clerk-components");return u||((u=document.createElement("div")).setAttribute("id","clerk-components"),document.body.appendChild(u)),{ensureMounted:async a=>{let{preloadHint:p}=a||{};if(!s){let a=(0,n.t)();p&&(0,i.jr)(p),s=Promise.all([o.e("26"),o.e("666")]).then(o.bind(o,6053)).then(({createRoot:n})=>(n(u).render((0,e.Y)(g,{getClerk:t,getEnvironment:r,options:c,onComponentsMounted:a.resolve,moduleManager:l})),a.promise.then(()=>m)))}return s.then(e=>e)}}})(t,r,a,l)}ensureMounted(e){return this.#e.ensureMounted(e)}})})(),{}})());
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["817"],{8201:function(e,l,i){i.d(l,{APIKeysPage:()=>p});var t=i(4518),a=i(5543),r=i(5240),o=i(8188),n=i(8272),c=i(8920),s=i(2861),u=i(6153),h=i(9764),d=i(4875);let p=()=>{let{user:e}=(0,a.Jd)(),{contentRef:l}=(0,h.n8)(),{apiKeysProps:i}=(0,r.B)();return e?(0,t.FD)(n.fv,{gap:4,elementDescriptor:c.$z.page,children:[(0,t.Y)(u.Y.Root,{children:(0,t.Y)(u.Y.Title,{localizationKey:(0,s.G)("userProfile.apiKeysPage.title"),textVariant:"h2"})}),(0,t.Y)(o.w.Provider,{value:{componentName:"APIKeys",...i},children:(0,t.Y)(d.APIKeysPage,{subject:e.id,revokeModalRoot:l})})]}):null}}}]);
1
+ "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["817"],{8201:function(e,l,i){i.d(l,{APIKeysPage:()=>p});var t=i(4518),a=i(1210),r=i(5240),o=i(8188),n=i(8272),c=i(8920),s=i(2861),u=i(6153),h=i(9764),d=i(4875);let p=()=>{let{user:e}=(0,a.Jd)(),{contentRef:l}=(0,h.n8)(),{apiKeysProps:i}=(0,r.B)();return e?(0,t.FD)(n.fv,{gap:4,elementDescriptor:c.$z.page,children:[(0,t.Y)(u.Y.Root,{children:(0,t.Y)(u.Y.Title,{localizationKey:(0,s.G)("userProfile.apiKeysPage.title"),textVariant:"h2"})}),(0,t.Y)(o.w.Provider,{value:{componentName:"APIKeys",...i},children:(0,t.Y)(d.APIKeysPage,{subject:e.id,revokeModalRoot:l})})]}):null}}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["58"],{7714:function(e,r,t){t.r(r),t.d(r,{UserAvatar:()=>c,_UserAvatar:()=>d});var a=t(4518),n=t(5543),s=t(3620),l=t(3264),o=t(8920),u=t(9538),i=t(9406);let d=e=>{let r=(0,s.d)(),{user:t}=(0,n.Jd)();return(0,a.Y)(i.S,{children:(0,a.Y)(u.H,{boxElementDescriptor:o.$z.userAvatarBox,imageElementDescriptor:o.$z.userAvatarImage,...t,rounded:e.rounded??r.rounded??!0,size:e=>e.sizes.$7})})},c=(0,l.G)(d)},3620:function(e,r,t){t.d(r,{E:()=>n,d:()=>s});var a=t(5074);let n=(0,a.createContext)(null),s=()=>{let e=(0,a.useContext)(n);if(!e||"UserAvatar"!==e.componentName)throw Error("Clerk: useUserAvatarContext called outside UserAvatar.");let{componentName:r,...t}=e;return{...t,componentName:r}}}}]);
1
+ "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["58"],{7714:function(e,r,t){t.r(r),t.d(r,{UserAvatar:()=>c,_UserAvatar:()=>d});var a=t(4518),n=t(1210),s=t(3620),l=t(3264),o=t(8920),u=t(9538),i=t(9406);let d=e=>{let r=(0,s.d)(),{user:t}=(0,n.Jd)();return(0,a.Y)(i.S,{children:(0,a.Y)(u.H,{boxElementDescriptor:o.$z.userAvatarBox,imageElementDescriptor:o.$z.userAvatarImage,...t,rounded:e.rounded??r.rounded??!0,size:e=>e.sizes.$7})})},c=(0,l.G)(d)},3620:function(e,r,t){t.d(r,{E:()=>n,d:()=>s});var a=t(5074);let n=(0,a.createContext)(null),s=()=>{let e=(0,a.useContext)(n);if(!e||"UserAvatar"!==e.componentName)throw Error("Clerk: useUserAvatarContext called outside UserAvatar.");let{componentName:r,...t}=e;return{...t,componentName:r}}}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["99"],{6240:function(e,n,r){r.r(n),r.d(n,{UserButton:()=>S});var o=r(4518),t=r(5074),i=r(3269),l=r(4373),s=r(9233),a=r(3264),d=r(4607),c=r(1577),u=r(5543),p=r(9972),h=r(1005),Y=r(9345),m=r(7697),g=r(8920),f=r(1052),$=r(2540);let k=t.forwardRef((e,n)=>{let{close:r,...t}=e,i=()=>r?.(!1),{session:l}=(0,u.wV)(),a=(0,s.Y)(),{__experimental_asStandalone:d}=a,{authConfig:c}=(0,m.O)(),{user:k}=(0,u.Jd)(),{handleAddAccountClicked:C,handleManageAccountClicked:B,handleSessionClicked:b,handleSignOutAllClicked:v,handleSignOutSessionClicked:D,handleUserProfileActionClicked:x,otherSessions:z}=(0,$.u)({...a,actionCompleteCallback:i,user:k});return(0,o.Y)(h.M,{elementDescriptor:g.$z.userButtonPopoverRootBox,children:(0,o.FD)(p.Y.Root,{elementDescriptor:g.$z.userButtonPopoverCard,ref:n,role:"dialog","aria-label":"User button popover",shouldEntryAnimate:!d,...t,children:[(0,o.FD)(p.Y.Content,{elementDescriptor:g.$z.userButtonPopoverMain,children:[(0,o.Y)(Y.c,{elementId:"userButton",user:k,sx:e=>({width:"100%",padding:`${e.space.$4} ${e.space.$5}`})}),c.singleSessionMode?(0,o.Y)(f.iR,{handleManageAccountClicked:B,handleSignOutSessionClicked:D,handleUserProfileActionClicked:x,session:l,completedCallback:i}):(0,o.Y)(f.pS,{session:l,otherSessions:z,handleManageAccountClicked:B,handleSignOutSessionClicked:D,handleSessionClicked:b,handleAddAccountClicked:C,handleUserProfileActionClicked:x,completedCallback:i})]}),(0,o.Y)(p.Y.Footer,{elementDescriptor:g.$z.userButtonPopoverFooter,children:!c.singleSessionMode&&z.length>0&&(0,o.Y)(f.ww,{handleSignOutAllClicked:v})})]})})});var C=r(9538),B=r(1778),b=r(78),v=r(8272),D=r(2861),x=r(8095);let z=({showName:e})=>{let{user:n}=(0,u.Jd)();return n&&e?(0,o.Y)(v.EY,{variant:"subtitle",as:"span",elementDescriptor:g.$z.userButtonOuterIdentifier,sx:[e=>({paddingLeft:e.space.$2})],children:(0,x.dS)(n)||(0,x.Cm)(n)}):null},A=(0,B.H)((0,t.forwardRef)((e,n)=>{let{sx:r,...t}=e,{user:i}=(0,u.Jd)(),{showName:l}=(0,s.Y)(),{t:a}=(0,b._)();return(0,o.Y)(v.$n,{elementDescriptor:g.$z.userButtonTrigger,variant:"roundWrapper",sx:[e=>({borderRadius:l?e.radii.$md:e.radii.$circle,color:e.colors.$colorForeground}),r],ref:n,"aria-label":`${a(e.isOpen?(0,D.G)("userButton.action__closeUserMenu"):(0,D.G)("userButton.action__openUserMenu"))}`,"aria-expanded":e.isOpen,"aria-haspopup":"dialog",...t,children:(0,o.FD)(v.so,{elementDescriptor:g.$z.userButtonBox,isOpen:e.isOpen,align:"center",as:"span",gap:2,children:[(0,o.Y)(z,{showName:l}),(0,o.Y)(C.H,{boxElementDescriptor:g.$z.userButtonAvatarBox,imageElementDescriptor:g.$z.userButtonAvatarImage,...i,size:e=>e.sizes.$7})]})})})),O=(0,i.P4)(({children:e})=>{let{defaultOpen:n}=(0,s.Y)(),{floating:r,reference:i,styles:a,toggle:d,isOpen:u,nodeId:p,context:h}=(0,c.f)({defaultOpen:n,placement:"bottom-end",offset:8}),Y=(0,t.useId)();return(0,o.FD)(o.FK,{children:[(0,o.Y)(A,{ref:i,onClick:d,isOpen:u,"aria-controls":u?Y:void 0,"aria-expanded":u}),(0,o.Y)(l.A,{nodeId:p,context:h,isOpen:u,children:(0,t.cloneElement)(e,{id:Y,close:d,ref:r,style:a})})]})}),S=(0,a.G)((0,i.dm)(()=>{let{__experimental_asStandalone:e}=(0,s.Y)();return(0,o.Y)(d.n.Root,{flow:"userButton",sx:{display:"inline-flex"},children:e?(0,o.Y)(k,{close:"function"==typeof e?e:void 0}):(0,o.Y)(O,{children:(0,o.Y)(k,{})})})}))}}]);
1
+ "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["99"],{6240:function(e,n,r){r.r(n),r.d(n,{UserButton:()=>S});var o=r(4518),t=r(5074),i=r(3269),l=r(4373),s=r(9233),a=r(3264),d=r(4607),c=r(1577),u=r(1210),p=r(9972),h=r(1005),Y=r(9345),m=r(7697),g=r(8920),f=r(1052),$=r(2540);let k=t.forwardRef((e,n)=>{let{close:r,...t}=e,i=()=>r?.(!1),{session:l}=(0,u.wV)(),a=(0,s.Y)(),{__experimental_asStandalone:d}=a,{authConfig:c}=(0,m.O)(),{user:k}=(0,u.Jd)(),{handleAddAccountClicked:C,handleManageAccountClicked:B,handleSessionClicked:b,handleSignOutAllClicked:v,handleSignOutSessionClicked:D,handleUserProfileActionClicked:x,otherSessions:z}=(0,$.u)({...a,actionCompleteCallback:i,user:k});return(0,o.Y)(h.M,{elementDescriptor:g.$z.userButtonPopoverRootBox,children:(0,o.FD)(p.Y.Root,{elementDescriptor:g.$z.userButtonPopoverCard,ref:n,role:"dialog","aria-label":"User button popover",shouldEntryAnimate:!d,...t,children:[(0,o.FD)(p.Y.Content,{elementDescriptor:g.$z.userButtonPopoverMain,children:[(0,o.Y)(Y.c,{elementId:"userButton",user:k,sx:e=>({width:"100%",padding:`${e.space.$4} ${e.space.$5}`})}),c.singleSessionMode?(0,o.Y)(f.iR,{handleManageAccountClicked:B,handleSignOutSessionClicked:D,handleUserProfileActionClicked:x,session:l,completedCallback:i}):(0,o.Y)(f.pS,{session:l,otherSessions:z,handleManageAccountClicked:B,handleSignOutSessionClicked:D,handleSessionClicked:b,handleAddAccountClicked:C,handleUserProfileActionClicked:x,completedCallback:i})]}),(0,o.Y)(p.Y.Footer,{elementDescriptor:g.$z.userButtonPopoverFooter,children:!c.singleSessionMode&&z.length>0&&(0,o.Y)(f.ww,{handleSignOutAllClicked:v})})]})})});var C=r(9538),B=r(1778),b=r(78),v=r(8272),D=r(2861),x=r(8095);let z=({showName:e})=>{let{user:n}=(0,u.Jd)();return n&&e?(0,o.Y)(v.EY,{variant:"subtitle",as:"span",elementDescriptor:g.$z.userButtonOuterIdentifier,sx:[e=>({paddingLeft:e.space.$2})],children:(0,x.dS)(n)||(0,x.Cm)(n)}):null},A=(0,B.H)((0,t.forwardRef)((e,n)=>{let{sx:r,...t}=e,{user:i}=(0,u.Jd)(),{showName:l}=(0,s.Y)(),{t:a}=(0,b._)();return(0,o.Y)(v.$n,{elementDescriptor:g.$z.userButtonTrigger,variant:"roundWrapper",sx:[e=>({borderRadius:l?e.radii.$md:e.radii.$circle,color:e.colors.$colorForeground}),r],ref:n,"aria-label":`${a(e.isOpen?(0,D.G)("userButton.action__closeUserMenu"):(0,D.G)("userButton.action__openUserMenu"))}`,"aria-expanded":e.isOpen,"aria-haspopup":"dialog",...t,children:(0,o.FD)(v.so,{elementDescriptor:g.$z.userButtonBox,isOpen:e.isOpen,align:"center",as:"span",gap:2,children:[(0,o.Y)(z,{showName:l}),(0,o.Y)(C.H,{boxElementDescriptor:g.$z.userButtonAvatarBox,imageElementDescriptor:g.$z.userButtonAvatarImage,...i,size:e=>e.sizes.$7})]})})})),O=(0,i.P4)(({children:e})=>{let{defaultOpen:n}=(0,s.Y)(),{floating:r,reference:i,styles:a,toggle:d,isOpen:u,nodeId:p,context:h}=(0,c.f)({defaultOpen:n,placement:"bottom-end",offset:8}),Y=(0,t.useId)();return(0,o.FD)(o.FK,{children:[(0,o.Y)(A,{ref:i,onClick:d,isOpen:u,"aria-controls":u?Y:void 0,"aria-expanded":u}),(0,o.Y)(l.A,{nodeId:p,context:h,isOpen:u,children:(0,t.cloneElement)(e,{id:Y,close:d,ref:r,style:a})})]})}),S=(0,a.G)((0,i.dm)(()=>{let{__experimental_asStandalone:e}=(0,s.Y)();return(0,o.Y)(d.n.Root,{flow:"userButton",sx:{display:"inline-flex"},children:e?(0,o.Y)(k,{close:"function"==typeof e?e:void 0}):(0,o.Y)(O,{children:(0,o.Y)(k,{})})})}))}}]);
@@ -1,4 +1,4 @@
1
- "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["718"],{4308:function(e,r,t){t.r(r),t.d(r,{UserProfile:()=>r5,UserProfileModal:()=>r4});var i=t(4518),n=t(5074),l=t(3269),o=t(9764),a=t(5396),s=t(1227),c=t(3264),d=t(5240),u=t(4607),h=t(2861),m=t(7831),f=t(2265);let p=e=>{let{pages:r,apiKeysProps:t}=(0,d.B)(),n=r.routes.filter(e=>e.id!==s.j2.API_KEYS||!t?.hide);return(0,i.FD)(o.XM,{contentRef:e.contentRef,children:[(0,i.Y)(o.jq,{title:(0,h.G)("userProfile.navbar.title"),description:(0,h.G)("userProfile.navbar.description"),routes:n,contentRef:e.contentRef}),e.children]})};var g=t(540),Y=t(7697),v=t(5543),P=t(6088),b=t(6153),y=t(8272),S=t(8920),_=t(1421),D=t(4003),R=t(8080),G=t(4468),C=t(2660),F=t(3453),$=t(2513),w=t(2216),x=t(4964),I=t(6735);let k=e=>{let{strategy:r}=e,t=(0,l.f0)(),{user:n}=(0,v.Jd)(),{navigate:o}=(0,x.r)(),{strategyToDisplayData:a}=(0,w.k)(),{additionalOAuthScopes:s,componentName:c,mode:u}=(0,d.B)(),m="modal"===u,f=(0,v.Wp)(()=>{let e=r.replace("oauth_",""),t=m?(0,_.j)({url:window.location.href,componentName:c,socialProvider:e}):window.location.href,i=s?s[e]:[];return n?.createExternalAccount({strategy:r,redirectUrl:t,additionalScopes:i})}),p=a[r].iconUrl?(0,i.Y)(y._V,{isLoading:t.loadingMetadata===r,isDisabled:t.isLoading,elementDescriptor:S.$z.providerIcon,elementId:S.$z.providerIcon.setId(a[r].id),src:a[r].iconUrl,alt:`Connect ${a[r].name} account`,sx:e=>({width:e.sizes.$4})}):(0,i.Y)(C.T,{id:a[r].id,value:a[r].name,isLoading:t.loadingMetadata===r,isDisabled:t.isLoading});return(0,i.Y)(D.rd.ActionMenuItem,{id:a[r].id,onClick:()=>{if(n)return t.setLoading(r),f().then(e=>{e&&e.verification?.externalVerificationRedirectURL&&((0,I.y)(2e3).then(()=>t.setIdle(r)),o(e.verification.externalVerificationRedirectURL.href))}).catch(e=>{(0,G.H4)(e,[],t.setError),t.setIdle(r)})},isDisabled:t.isLoading,variant:"ghost",isLoading:t.loadingMetadata===r,focusRing:!1,closeAfterClick:!1,localizationKey:(0,h.G)("userProfile.connectedAccountPage.socialButtonsBlockButton",{provider:a[r].name}),sx:e=>({justifyContent:"start",gap:e.space.$2}),leftIcon:p},r)},A=({onClick:e})=>{let{user:r}=(0,v.Jd)(),{strategies:t}=(0,w.k)(),n=t.filter(e=>e.startsWith("oauth")),l=r?.verifiedExternalAccounts.map(e=>`oauth_${e.provider}`),o=n.filter(e=>!l.includes(e));return 0===o.length?null:(0,i.Y)(D.rd.ActionMenu,{triggerLocalizationKey:(0,h.G)("userProfile.start.connectedAccountsSection.primaryButton"),id:"connectedAccounts",onClick:e,children:o.map(e=>(0,i.Y)(k,{strategy:e},e))})};var z=t(8046);let T=e=>{let{onSuccess:r,onReset:t}=e,{user:l}=(0,v.Jd)(),{emailId:o}=e,a=l?.emailAddresses.find(e=>e.id===o),s=n.useRef(a?.emailAddress),c=a?.verification?.status==="verified"?(0,h.G)("userProfile.emailAddressPage.removeResource.messageLine2"):void 0;return s.current?(0,i.Y)(z.P,{title:(0,h.G)("userProfile.emailAddressPage.removeResource.title"),messageLine1:(0,h.G)("userProfile.emailAddressPage.removeResource.messageLine1",{identifier:s.current}),messageLine2:c,successMessage:(0,h.G)("userProfile.emailAddressPage.removeResource.successMessage",{emailAddress:s.current}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:r,onReset:t}):null},E=e=>{let{phoneId:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=o?.phoneNumbers.find(e=>e.id===r),s=n.useRef(a?.phoneNumber),c=a?.verification?.status==="verified"?(0,h.G)("userProfile.phoneNumberPage.removeResource.messageLine2"):void 0;return s.current?(0,i.Y)(z.P,{title:(0,h.G)("userProfile.phoneNumberPage.removeResource.title"),messageLine1:(0,h.G)("userProfile.phoneNumberPage.removeResource.messageLine1",{identifier:s.current}),messageLine2:c,successMessage:(0,h.G)("userProfile.phoneNumberPage.removeResource.successMessage",{phoneNumber:s.current}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:t,onReset:l}):null},L=e=>{let{accountId:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=o?.externalAccounts.find(e=>e.id===r),s=n.useRef(a?.provider),{providerToDisplayData:c}=(0,w.k)();return s.current?(0,i.Y)(z.P,{title:(0,h.G)("userProfile.connectedAccountPage.removeResource.title"),messageLine1:(0,h.G)("userProfile.connectedAccountPage.removeResource.messageLine1",{identifier:c[s.current]?.name||""}),messageLine2:(0,h.G)("userProfile.connectedAccountPage.removeResource.messageLine2"),successMessage:(0,h.G)("userProfile.connectedAccountPage.removeResource.successMessage",{connectedAccount:c[s.current]?.name||""}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:t,onReset:l}):null},O=e=>{let{user:r}=(0,v.Jd)(),{walletId:t,onSuccess:l,onReset:o}=e,a=r?.web3Wallets.find(e=>e.id===t),s=n.useRef(a?.web3Wallet),c=a?.verification?.status==="verified"?(0,h.G)("userProfile.web3WalletPage.removeResource.messageLine2"):void 0;return s.current?(0,i.Y)(z.P,{title:(0,h.G)("userProfile.web3WalletPage.removeResource.title"),messageLine1:(0,h.G)("userProfile.web3WalletPage.removeResource.messageLine1",{identifier:s.current}),messageLine2:c,successMessage:(0,h.G)("userProfile.web3WalletPage.removeResource.successMessage",{web3Wallet:s.current}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:l,onReset:o}):null},K=e=>{let{user:r}=(0,v.Jd)(),{phoneId:t,onSuccess:l,onReset:o}=e,a=r?.phoneNumbers.find(e=>e.id===t),s=n.useRef(a?.phoneNumber);return s.current?(0,i.Y)(z.P,{title:(0,h.G)("userProfile.mfaPhoneCodePage.removeResource.title"),messageLine1:(0,h.G)("userProfile.mfaPhoneCodePage.removeResource.messageLine1",{identifier:s.current}),messageLine2:(0,h.G)("userProfile.mfaPhoneCodePage.removeResource.messageLine2"),successMessage:(0,h.G)("userProfile.mfaPhoneCodePage.removeResource.successMessage",{mfaPhoneCode:s.current}),deleteResource:()=>Promise.resolve(a?.setReservedForSecondFactor({reserved:!1})),onSuccess:l,onReset:o}):null},M=e=>{let{onSuccess:r,onReset:t}=e,{user:n}=(0,v.Jd)();return n?(0,i.Y)(z.P,{title:(0,h.G)("userProfile.mfaTOTPPage.removeResource.title"),messageLine1:(0,h.G)("userProfile.mfaTOTPPage.removeResource.messageLine1"),messageLine2:(0,h.G)("userProfile.mfaTOTPPage.removeResource.messageLine2"),successMessage:(0,h.G)("userProfile.mfaTOTPPage.removeResource.successMessage"),deleteResource:n.disableTOTP,onSuccess:r,onReset:t}):null},N=e=>{let{onSuccess:r,onReset:t,passkey:n}=e;return(0,i.Y)(z.P,{title:(0,h.G)("userProfile.passkeyScreen.removeResource.title"),messageLine1:(0,h.G)("userProfile.passkeyScreen.removeResource.messageLine1",{name:n.name||""}),deleteResource:n.delete,onSuccess:r,onReset:t})},B=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(L,{onSuccess:r,onReset:r,...e})},W=["external_account_missing_refresh_token","oauth_fetch_user_error","oauth_token_exchange_error","external_account_email_address_verification_required"],J=(0,l.dm)(({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)(),t=(0,l.f0)(),o=!!r?.externalAccounts?.length,[a,s]=(0,n.useState)(null);if(!r||!e&&!o)return null;let c=[...r.verifiedExternalAccounts,...r.unverifiedExternalAccounts.filter(e=>e.verification?.error)];return(0,i.FD)(D.rd.Root,{title:(0,h.G)("userProfile.start.connectedAccountsSection.title"),centered:!1,id:"connectedAccounts",children:[(0,i.Y)(P.Z.Alert,{children:t.error}),(0,i.FD)(F.r.Root,{value:a,onChange:s,children:[(0,i.Y)(D.rd.ItemList,{id:"connectedAccounts",children:c.map(e=>(0,i.Y)(q,{account:e},e.id))}),e&&(0,i.Y)(A,{onClick:()=>s(null)})]})]})}),q=({account:e})=>{let{additionalOAuthScopes:r,componentName:t,mode:o}=(0,d.B)(),{navigate:a}=(0,x.r)(),{user:s}=(0,v.Jd)(),c=(0,l.f0)(),u=e.id,m="modal"===o,f=m?(0,_.j)({url:window.location.href,componentName:t}):window.location.href,p=(0,v.Wp)(()=>s?.createExternalAccount({strategy:e.verification.strategy,redirectUrl:f,additionalScopes:b}));if(!s)return null;let{providerToDisplayData:g}=(0,w.k)(),Y=e.username||e.emailAddress,P=e.verification?.error?.longMessage,b=function(e,r){if(!r)return[];let t=r[e.provider]||[],i=e.approvedScopes.split(" ");return 0===t.filter(e=>!i.includes(e)).length?[]:t}(e,r),R=b.length>0&&""!=e.approvedScopes,$=W.includes(e.verification?.error?.code||"")||R,I=$?(0,h.G)("userProfile.start.connectedAccountsSection.subtitle__disconnected"):P,k=async()=>{let r=m?(0,_.j)({url:window.location.href,componentName:t}):window.location.href;try{let t;(t=R?await e.reauthorize({additionalScopes:b,redirectUrl:r}):await p())&&await a(t.verification.externalVerificationRedirectURL?.href||"")}catch(e){(0,G.H4)(e,[],c.setError)}};return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"connectedAccounts",children:[(0,i.FD)(y.so,{sx:e=>({overflow:"hidden",gap:e.space.$2}),children:[(0,i.Y)(()=>g[e.provider].iconUrl?(0,i.Y)(y._V,{elementDescriptor:[S.$z.providerIcon],elementId:S.$z.socialButtonsProviderIcon.setId(e.provider),alt:g[e.provider].name,src:g[e.provider].iconUrl,sx:e=>({width:e.sizes.$4,flexShrink:0})}):(0,i.Y)(C.T,{id:e.provider,value:g[e.provider].name}),{}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:1,center:!0,children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),children:`${g[e.provider].name}`}),(0,i.Y)(y.EY,{truncate:!0,as:"span",colorScheme:"secondary",children:Y?`• ${Y}`:""})]})})]}),(0,i.Y)(U,{account:e})]}),$&&(0,i.FD)(y.az,{sx:e=>({padding:`${e.sizes.$none} ${e.sizes.$none} ${e.sizes.$1x5} ${e.sizes.$8x5}`}),children:[(0,i.Y)(y.EY,{colorScheme:"secondary",sx:e=>({paddingRight:e.sizes.$1x5,display:"inline-block"}),localizationKey:I}),(0,i.Y)(y.$n,{sx:{display:"inline-block"},onClick:k,variant:"link",localizationKey:(0,h.G)("userProfile.start.connectedAccountsSection.actionLabel__connectionFailed")})]}),e.verification?.error?.code&&!$&&(0,i.Y)(y.EY,{colorScheme:"danger",sx:e=>({padding:`${e.sizes.$none} ${e.sizes.$1x5} ${e.sizes.$1x5} ${e.sizes.$8x5}`}),children:P}),(0,i.Y)(F.r.Open,{value:`remove-${u}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(B,{accountId:e.id})})})]},e.id)},U=({account:e})=>{let{open:r}=(0,$.D5)(),t=e.id,n=[{label:(0,h.G)("userProfile.start.connectedAccountsSection.destructiveActionTitle"),isDestructive:!0,onClick:()=>r(`remove-${t}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:n})},j=e=>e.defaultSecondFactor?-1:1;function V(e){let r=[];return Object.entries(e).forEach(([,e])=>{e.used_for_second_factor&&r.push(...e.second_factors)}),r}function H(e,r){let t=V(e);return r.totpEnabled&&(t=t.filter(e=>"totp"!==e)),(r.backupCodeEnabled||!r.twoFactorEnabled)&&(t=t.filter(e=>"backup_code"!==e)),t}function Z(e,r){if(!e)return[];let t=e.filter(e=>e.id===r),i=e.filter(e=>e.id!==r),n=i.filter(e=>e.verification?.status==="verified"),l=i.filter(e=>!!e.verification?.status&&e.verification?.status!=="verified"),o=i.filter(e=>!e.verification.status);return n.sort((e,r)=>e.id.localeCompare(r.id)),l.sort((e,r)=>e.verification?.expireAt&&r.verification?.expireAt?e.verification.expireAt.getTime()-r.verification.expireAt.getTime():0),[...t,...n,...l,...o]}var X=t(2336);let Q=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(T,{onSuccess:r,onReset:r,...e})},ee=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(X.v,{onSuccess:r,onReset:r,...e})},er=({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)();return(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.emailAddressesSection.title"),centered:!1,id:"emailAddresses",children:(0,i.Y)(F.r.Root,{children:(0,i.FD)(D.rd.ItemList,{id:"emailAddresses",children:[Z(r?.emailAddresses,r?.primaryEmailAddressId).map(e=>{let t=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"emailAddresses",children:[(0,i.FD)(y.so,{sx:e=>({overflow:"hidden",gap:e.space.$1}),children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),truncate:!0,children:e.emailAddress}),r?.primaryEmailAddressId===t&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__unverified")})]}),(0,i.Y)(et,{email:e})]}),(0,i.Y)(F.r.Open,{value:`remove-${t}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(Q,{emailId:t})})}),(0,i.Y)(F.r.Open,{value:`verify-${t}`,children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(ee,{emailId:t})})})]},e.emailAddress)}),e&&(0,i.FD)(i.FK,{children:[(0,i.Y)(F.r.Trigger,{value:"add",children:(0,i.Y)(D.rd.ArrowButton,{id:"emailAddresses",localizationKey:(0,h.G)("userProfile.start.emailAddressesSection.primaryButton")})}),(0,i.Y)(F.r.Open,{value:"add",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(ee,{})})})]})]})})})},et=({email:e})=>{let r=(0,l.f0)(),{user:t}=(0,v.Jd)(),{open:n}=(0,$.D5)(),o=e.id,a=t?.primaryEmailAddressId===o,s="verified"===e.verification.status,c=(0,v.Wp)(()=>t?.update({primaryEmailAddressId:o})),d=[a&&!s?{label:(0,h.G)("userProfile.start.emailAddressesSection.detailsAction__primary"),onClick:()=>n(`verify-${o}`)}:null,!a&&s?{label:(0,h.G)("userProfile.start.emailAddressesSection.detailsAction__nonPrimary"),onClick:()=>{c().catch(e=>(0,G.H4)(e,[],r.setError))}}:null,!a&&!s?{label:(0,h.G)("userProfile.start.emailAddressesSection.detailsAction__unverified"),onClick:()=>n(`verify-${o}`)}:null,{label:(0,h.G)("userProfile.start.emailAddressesSection.destructiveAction"),isDestructive:!0,onClick:()=>n(`remove-${o}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:d})},ei=()=>{let{user:e}=(0,v.Jd)(),r=e?.enterpriseAccounts.filter(({enterpriseConnection:e})=>e?.active);return r?.length?(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.enterpriseAccountsSection.title"),id:"enterpriseAccounts",centered:!1,children:(0,i.Y)(D.rd.ItemList,{id:"enterpriseAccounts",children:r.map(e=>(0,i.Y)(en,{account:e},e.id))})}):null},en=({account:e})=>{let r=e.emailAddress,t=e?.enterpriseConnection?.name,n=e.verification?.error?.longMessage;return(0,i.FD)(D.rd.Item,{id:"enterpriseAccounts",sx:e=>({gap:e.space.$2,justifyContent:"start"}),children:[(0,i.Y)(el,{account:e}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:1,center:!0,children:[(0,i.Y)(y.EY,{truncate:!0,colorScheme:"body",children:t}),(0,i.Y)(y.EY,{truncate:!0,as:"span",colorScheme:"secondary",children:r?`• ${r}`:""}),n&&(0,i.Y)(y.Ex,{colorScheme:"danger",localizationKey:(0,h.G)("badge__requiresAction")})]})})]},e.id)},el=({account:e})=>{let{provider:r,enterpriseConnection:t}=e,n=r.replace(/(oauth_|saml_)/,"").trim(),l=t?.name??n,o={elementDescriptor:[S.$z.providerIcon],alt:l,sx:e=>({width:e.sizes.$4}),elementId:S.$z.enterpriseButtonsProviderIcon.setId(e.provider)};return t?.logoPublicUrl?(0,i.Y)(y._V,{...o,src:t.logoPublicUrl}):(0,i.Y)(C.T,{id:n,value:l,"aria-label":`${l}'s icon`,elementDescriptor:[S.$z.providerIcon,S.$z.providerInitialIcon],elementId:S.$z.providerInitialIcon.setId(n)})};var eo=t(7651),ea=t(2454),es=t(1475),ec=t(3549),ed=t(8640),eu=t(6245),eh=t(1282);let em=(0,l.dm)(e=>{let{phoneId:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=n.useRef(o?.phoneNumbers.find(e=>e.id===r)),s=(0,eu.X)({defaultStep:+!!a.current});return(0,i.FD)(eu.s,{...s.props,children:[(0,i.Y)(ef,{resourceRef:a,title:(0,h.G)("userProfile.phoneNumberPage.title"),onSuccess:s.nextStep,onReset:l}),(0,i.Y)(ep,{resourceRef:a,title:(0,h.G)("userProfile.phoneNumberPage.verifyTitle"),onSuccess:t,onReset:l})]})}),ef=e=>{let{title:r,onSuccess:t,onReset:n,onUseExistingNumberClick:o,resourceRef:a}=e,s=(0,l.f0)(),{user:c}=(0,v.Jd)(),d=(0,v.Wp)((e,r)=>e.createPhoneNumber(r)),u=(0,ed.tJ)("phoneNumber","",{type:"tel",label:(0,h.G)("formFieldLabel__phoneNumber"),isRequired:!0}),m=u.value.length>1&&c?.username!==u.value,f=!!c?.phoneNumbers?.length&&o,p=async e=>{if(e.preventDefault(),c)return d(c,{phoneNumber:u.value}).then(e=>{a.current=e,t()}).catch(e=>(0,G.H4)(e,[u],s.setError))};return(0,i.Y)(ec.M,{headerTitle:r,gap:1,children:(0,i.FD)(ea.l.Root,{gap:4,onSubmit:p,children:[(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.phoneNumberPage.infoText"),colorScheme:"secondary"}),(0,i.Y)(ea.l.ControlRow,{elementId:u.id,children:(0,i.Y)(ea.l.PhoneInput,{...u.props,autoFocus:!0})}),(0,i.FD)(y.so,{justify:f?"between":"end",children:[f&&(0,i.Y)(y.$n,{variant:"ghost",localizationKey:(0,h.G)("userProfile.mfaPhoneCodePage.backButton"),onClick:o}),(0,i.Y)(es.G,{submitLabel:(0,h.G)("userProfile.formButtonPrimary__add"),isDisabled:!m,onReset:n})]})]})})},ep=e=>{let{title:r,onSuccess:t,resourceRef:n,onReset:l}=e;return(0,i.Y)(ec.M,{headerTitle:r,headerSubtitle:(0,h.G)("userProfile.phoneNumberPage.verifySubtitle",{identifier:n.current?.phoneNumber||""}),children:(0,i.Y)(eh.j,{nextStep:t,identification:n.current,identifier:n.current?.phoneNumber,prepareVerification:n.current?.prepareVerification,onReset:l})})},eg=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(E,{onSuccess:r,onReset:r,...e})},eY=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(em,{onSuccess:r,onReset:r,...e})},ev=({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)(),t=!!r?.phoneNumbers?.length;return e||t?(0,i.Y)(D.rd.Root,{centered:!1,title:(0,h.G)("userProfile.start.phoneNumbersSection.title"),id:"phoneNumbers",children:(0,i.Y)(F.r.Root,{children:(0,i.FD)(D.rd.ItemList,{id:"phoneNumbers",children:[Z(r?.phoneNumbers,r?.primaryPhoneNumberId).map(e=>{let t=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"phoneNumbers",children:[(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:2,center:!0,children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),children:(0,eo.Om)(e.phoneNumber)}),r?.primaryPhoneNumberId===t&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__unverified")})]})}),(0,i.Y)(eP,{phone:e})]}),(0,i.Y)(F.r.Open,{value:`remove-${t}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(eg,{phoneId:t})})}),(0,i.Y)(F.r.Open,{value:`verify-${t}`,children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(eY,{phoneId:t})})})]},t)}),e&&(0,i.FD)(i.FK,{children:[(0,i.Y)(F.r.Trigger,{value:"add",children:(0,i.Y)(D.rd.ArrowButton,{id:"phoneNumbers",localizationKey:(0,h.G)("userProfile.start.phoneNumbersSection.primaryButton")})}),(0,i.Y)(F.r.Open,{value:"add",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(eY,{})})})]})]})})}):null},eP=({phone:e})=>{let r=(0,l.f0)(),{open:t}=(0,$.D5)(),{user:n}=(0,v.Jd)(),o=e.id,a=(0,v.Wp)(r=>r.update({primaryPhoneNumberId:e.id}));if(!n)return null;let s=n.primaryPhoneNumberId===e.id,c="verified"===e.verification.status,d=[s&&!c?{label:(0,h.G)("userProfile.start.phoneNumbersSection.detailsAction__primary"),onClick:()=>t(`verify-${o}`)}:null,!s&&c?{label:(0,h.G)("userProfile.start.phoneNumbersSection.detailsAction__nonPrimary"),onClick:()=>a(n).catch(e=>(0,G.H4)(e,[],r.setError))}:null,!s&&!c?{label:(0,h.G)("userProfile.start.phoneNumbersSection.detailsAction__unverified"),onClick:()=>t(`verify-${o}`)}:null,{label:(0,h.G)("userProfile.start.phoneNumbersSection.destructiveAction"),isDestructive:!0,onClick:()=>t(`remove-${o}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:d})};var eb=t(7591),ey=t(4557),eS=t(78);let e_=(0,l.dm)(e=>{let{onSuccess:r,onReset:t}=e,{user:n}=(0,v.Jd)(),o=(0,v.Wp)(e=>n?.update({username:e})),{userSettings:a}=(0,Y.O)(),s=(0,l.f0)(),{t:c,locale:d}=(0,eS._)(),{usernameSettings:u}=a,m=(0,ed.tJ)("username",n?.username||"",{type:"text",label:(0,h.G)("formFieldLabel__username"),placeholder:(0,h.G)("formFieldInputPlaceholder__username"),buildErrorMessage:e=>(0,ey.Z)(e,{t:c,locale:d,usernameSettings:u})});if(!n)return null;let f=a.attributes.username?.required,p=(!f||m.value.length>0)&&n.username!==m.value,g=async()=>{try{await o(m.value),r()}catch(e){(0,G.H4)(e,[m],s.setError)}};return(0,i.Y)(ec.M,{headerTitle:n.username?(0,h.G)("userProfile.usernamePage.title__update"):(0,h.G)("userProfile.usernamePage.title__set"),children:(0,i.FD)(ea.l.Root,{onSubmit:g,children:[(0,i.Y)(ea.l.ControlRow,{elementId:m.id,children:(0,i.Y)(ea.l.PlainInput,{...m.props,autoFocus:!0,isRequired:f})}),(0,i.Y)(es.G,{isDisabled:!p,onReset:t})]})})}),eD=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(e_,{onSuccess:e,onReset:e})},eR=()=>{let{user:e}=(0,v.Jd)();return e?(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.usernameSection.title"),id:"username",sx:{alignItems:"center",[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"username",sx:{paddingLeft:e.username?void 0:"0"},children:[e.username&&(0,i.Y)(y.EY,{truncate:!0,sx:e=>({color:e.colors.$colorForeground}),children:e.username}),(0,i.Y)(F.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"username",localizationKey:e.username?(0,h.G)("userProfile.start.usernameSection.primaryButton__updateUsername"):(0,h.G)("userProfile.start.usernameSection.primaryButton__setUsername")})})]})}),(0,i.Y)(F.r.Open,{value:"edit",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(eD,{})})})]})}):null};var eG=t(9345),eC=t(2421),eF=t(8225),e$=t(3817),ew=t(9538);let ex=e=>{let{user:r,...t}=e;return(0,i.Y)(e$.k,{...t,title:(0,h.G)("userProfile.profilePage.imageFormTitle"),avatarPreview:(0,i.Y)(ew.H,{size:e=>e.sizes.$12,...r})})},eI=(0,l.dm)(e=>{let{onSuccess:r,onReset:t}=e,n=(0,l.f0)(),{user:o}=(0,v.Jd)();if(!o)return null;let{first_name:a,last_name:s}=(0,Y.O)().userSettings.attributes,c=a?.enabled,d=s?.enabled,u=o.firstName||"",m=o.lastName||"",f=(0,ed.tJ)("firstName",o.firstName||"",{type:"text",label:(0,h.G)("formFieldLabel__firstName"),placeholder:(0,h.G)("formFieldInputPlaceholder__firstName"),isRequired:s?.required}),p=(0,ed.tJ)("lastName",o.lastName||"",{type:"text",label:(0,h.G)("formFieldLabel__lastName"),placeholder:(0,h.G)("formFieldInputPlaceholder__lastName"),isRequired:s?.required}),g=c&&f.value!==u||d&&p.value!==m,P=c&&a.required||d&&s.required,b=P&&!!p.value&&!!f.value&&g,y=o.enterpriseAccounts.some(e=>e.active),S=async e=>(e.preventDefault(),(g?o.update({firstName:f.value,lastName:p.value}):Promise.resolve()).then(r).catch(e=>{(0,G.H4)(e,[f,p],n.setError)}));return(0,i.FD)(ec.M,{headerTitle:(0,h.G)("userProfile.profilePage.title"),children:[y&&(0,i.Y)(eC.k,{message:(0,h.G)("userProfile.profilePage.readonly")}),(0,i.FD)(ea.l.Root,{onSubmit:S,sx:e=>({gap:e.space.$6}),children:[(0,i.Y)(ex,{user:o,onAvatarChange:e=>o.setProfileImage({file:e}).then(()=>{n.setIdle(),r?.()}).catch(e=>(0,G.H4)(e,[],n.setError)),onAvatarRemove:(0,eF.p)(o.imageUrl)?null:()=>{o.setProfileImage({file:null}).then(()=>{n.setIdle(),r?.()}).catch(e=>(0,G.H4)(e,[],n.setError))}}),(c||d)&&(0,i.FD)(ea.l.ControlRow,{elementId:"name",children:[c&&(0,i.Y)(ea.l.PlainInput,{...f.props,isDisabled:y,autoFocus:!0}),d&&(0,i.Y)(ea.l.PlainInput,{...p.props,isDisabled:y,autoFocus:!c})]}),(0,i.Y)(es.G,{isDisabled:P?!b:!g,onReset:t})]})]})}),ek=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(eI,{onSuccess:e,onReset:e})},eA=()=>{let{user:e}=(0,v.Jd)();if(!e)return null;let{username:r,primaryEmailAddress:t,primaryPhoneNumber:n,primaryWeb3Wallet:l,...o}=e;return(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.profileSection.title"),id:"profile",sx:{[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"profile",children:[(0,i.Y)(eG.c,{user:o,size:"lg",mainIdentifierVariant:"subtitle",sx:e=>({color:e.colors.$colorForeground})}),(0,i.Y)(F.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"profile",localizationKey:(0,h.G)("userProfile.start.profileSection.primaryButton")})})]})}),(0,i.Y)(F.r.Open,{value:"edit",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(ek,{})})})]})})};var ez=t(8099),eT=t(5243);let eE=(0,l.dm)(({onClick:e})=>{let r=(0,l.f0)(),{user:t}=(0,v.Jd)(),{strategies:n,strategyToDisplayData:o}=(0,w.k)(),a=(0,eT.R)(),s=n.filter(e=>e.startsWith("web3")),c=t?.verifiedWeb3Wallets.map(e=>e.verification.strategy),d=s.filter(e=>!c.includes(e)),u=(0,v.Wp)(e=>t?.createWeb3Wallet({web3Wallet:e})),m=async e=>{let i=(0,ez.U)(a),n=e.replace("web3_","").replace("_signature","");r.setError(void 0);try{r.setLoading(e);let l=await i.getWeb3Identifier({provider:n});if(!t)throw Error("user is not defined");let o=await u(l);o=await o?.prepareVerification({strategy:e});let a=o?.verification.message,s=await i.generateWeb3Signature({identifier:l,nonce:a,provider:n});await o?.attemptVerification({signature:s}),r.setIdle()}catch(t){r.setIdle();let e=(0,G.hG)(t);e?r.setError(e.longMessage):(0,G.H4)(t,[],r.setError)}};return 0===d.length?null:(0,i.FD)(i.FK,{children:[(0,i.Y)(D.rd.ActionMenu,{id:"web3Wallets",triggerLocalizationKey:(0,h.G)("userProfile.start.web3WalletsSection.primaryButton"),onClick:e,children:d.map(e=>(0,i.Y)(D.rd.ActionMenuItem,{id:o[e].id,onClick:()=>{m(e)},isLoading:r.loadingMetadata===e,isDisabled:r.isLoading,localizationKey:(0,h.G)("userProfile.web3WalletPage.web3WalletButtonsBlockButton",{provider:o[e].name}),sx:e=>({justifyContent:"start",gap:e.space.$2}),leftIcon:(0,i.Y)(y._V,{elementDescriptor:S.$z.providerIcon,elementId:S.$z.providerIcon.setId(o[e].id),isLoading:r.loadingMetadata===e,isDisabled:r.isLoading,src:o[e].iconUrl,alt:`Connect ${o[e].name}`,sx:e=>({width:e.sizes.$5})})},e))}),r.error&&(0,i.Y)(y.EY,{colorScheme:"danger",sx:e=>({padding:e.sizes.$1x5,paddingLeft:e.sizes.$8x5}),children:r.error})]})}),eL=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(O,{onSuccess:r,onReset:r,...e})},eO=(0,l.dm)(({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)(),t=(0,l.f0)(),{strategyToDisplayData:o}=(0,w.k)(),a=!!r?.web3Wallets?.length,[s,c]=(0,n.useState)(null);return e||a?(0,i.FD)(D.rd.Root,{title:(0,h.G)("userProfile.start.web3WalletsSection.title"),centered:!1,id:"web3Wallets",children:[(0,i.Y)(P.Z.Alert,{children:t.error}),(0,i.FD)(F.r.Root,{value:s,onChange:c,children:[(0,i.Y)(D.rd.ItemList,{id:"web3Wallets",children:Z(r?.web3Wallets,r?.primaryWeb3WalletId).map(e=>{var t;let l=e.verification.strategy,a=e.id;return o[l]&&(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"web3Wallets",align:"start",children:[(0,i.FD)(y.so,{sx:e=>({alignItems:"center",gap:e.space.$2,width:"100%"}),children:[o[l].iconUrl&&(0,i.Y)(y._V,{src:o[l].iconUrl,alt:o[l].name,sx:e=>({width:e.sizes.$4})}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:2,justify:"start",children:[(0,i.FD)(y.EY,{children:[o[l].name," (",(t=e.web3Wallet).length<=10?t:t.slice(0,6)+"..."+t.slice(-4),")"]}),r?.primaryWeb3WalletId===a&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__unverified")})]})})]}),(0,i.Y)(eK,{walletId:a})]},a),(0,i.Y)(F.r.Open,{value:`remove-${a}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(eL,{walletId:e.id})})})]},e.id)})}),e&&(0,i.Y)(eE,{onClick:()=>c(null)})]})]}):null}),eK=({walletId:e})=>{let r=(0,l.f0)(),{open:t}=(0,$.D5)(),{user:n}=(0,v.Jd)(),o=n?.primaryWeb3WalletId===e,a=(0,v.Wp)(()=>n?.update({primaryWeb3WalletId:e})),s=[!o?{label:(0,h.G)("userProfile.start.web3WalletsSection.detailsAction__nonPrimary"),onClick:()=>{a().catch(e=>(0,G.H4)(e,[],r.setError))}}:null,{label:(0,h.G)("userProfile.start.web3WalletsSection.destructiveAction"),isDestructive:!0,onClick:()=>t(`remove-${e}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:s})},eM=(0,l.dm)(()=>{let{attributes:e,social:r,enterpriseSSO:t}=(0,Y.O)().userSettings,n=(0,l.f0)(),{user:o}=(0,v.Jd)(),{shouldAllowIdentificationCreation:a}=(0,d.B)(),s=e.username?.enabled,c=e.email_address?.enabled,u=e.phone_number?.enabled,m=r&&Object.values(r).filter(e=>e.enabled).length>0,f=o&&t.enabled,p=e.web3_wallet?.enabled;return(0,i.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8,color:e.colors.$colorForeground}),children:(0,i.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("account"),children:[(0,i.Y)(b.Y.Root,{children:(0,i.Y)(b.Y.Title,{localizationKey:(0,h.G)("userProfile.start.headerTitle__account"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,i.Y)(P.Z.Alert,{children:n.error}),(0,i.Y)(eA,{}),s&&(0,i.Y)(eR,{}),c&&(0,i.Y)(er,{shouldAllowCreation:a}),u&&(0,i.Y)(ev,{shouldAllowCreation:a}),m&&(0,i.Y)(J,{shouldAllowCreation:a}),f&&(0,i.Y)(ei,{}),p&&(0,i.Y)(eO,{shouldAllowCreation:a})]})})});var eN=t(2611),eB=t(7806),eW=t(7896),eJ=t(4901),eq=t(892),eU=t(8910);let ej=()=>{let e,{user:r}=(0,v.Jd)(),{session:t}=(0,v.wV)(),{data:n,isLoading:l}=(0,eW.s)(r?.getSessions,"user-sessions");return(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.activeDevicesSection.title"),centered:!1,id:"activeDevices",children:(0,i.Y)(D.rd.ItemList,{id:"activeDevices",disableAnimation:!0,children:l?(0,i.Y)(eN.K,{}):n?.sort((e=t.id,r=>r.id===e?-1:1)).map(e=>eV(e.status)?(0,i.Y)(eH,{session:e},e.id):null)})})},eV=e=>["active","pending"].includes(e),eH=({session:e})=>{let r=(0,v.wV)().session?.id===e.id,t=(0,eJ.m)(),n=(0,v.Wp)(e.revoke.bind(e)),l=async()=>{if(!r&&e)return t.setLoading(),n().catch(e=>(0,G.H4)(e,[],t.setError)).finally(()=>t.setIdle())};return(0,i.Y)(D.rd.Item,{id:"activeDevices",elementDescriptor:S.$z.activeDeviceListItem,elementId:r?S.$z.activeDeviceListItem.setId("current"):void 0,sx:{alignItems:"flex-start",opacity:t.isLoading?.5:1},isDisabled:t.isLoading,children:(0,i.FD)(i.FK,{children:[(0,i.Y)(eZ,{session:e}),!r&&(0,i.Y)(eX,{revoke:l})]})})},eZ=e=>{let{session:r}=(0,v.wV)(),t=r?.id===e.session.id,n=!!r?.actor,l=!!e.session.actor,{city:o,country:a,browserName:s,browserVersion:c,deviceType:d,ipAddress:u,isMobile:m}=e.session.latestActivity,f=`${s||""} ${c||""}`.trim()||"Web browser",p=[o||"",a||""].filter(Boolean).join(", ").trim()||null,{t:g}=(0,eS._)();return(0,i.FD)(y.so,{elementDescriptor:S.$z.activeDevice,elementId:t?S.$z.activeDevice.setId("current"):void 0,sx:e=>({width:"100%",overflow:"hidden",gap:e.space.$4,[eb.g.sm]:{gap:e.space.$2}}),children:[(0,i.Y)(y.so,{sx:e=>({[eb.g.sm]:{padding:"0"},borderRadius:e.radii.$md}),children:(0,i.Y)(y.In,{elementDescriptor:S.$z.activeDeviceIcon,elementId:S.$z.activeDeviceIcon.setId(m?"mobile":"desktop"),icon:m?eq.A:eU.A,sx:e=>({"--cl-chassis-bottom":"#444444","--cl-chassis-back":"#343434","--cl-chassis-screen":"#575757","--cl-screen":"#000000",width:e.space.$8,height:e.space.$8})})}),(0,i.FD)(y.fv,{align:"start",gap:1,children:[(0,i.FD)(y.so,{center:!0,gap:2,children:[(0,i.Y)(y.EY,{children:d||(m?"Mobile device":"Desktop device")}),t&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__thisDevice"),colorScheme:n?"danger":"primary"}),n&&!l&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__userDevice")}),!t&&l&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__otherImpersonatorDevice"),colorScheme:"danger"})]}),(0,i.Y)(y.EY,{colorScheme:"secondary",children:f}),(0,i.FD)(y.EY,{colorScheme:"secondary",children:[u," (",p,")"]}),(0,i.Y)(y.EY,{colorScheme:"secondary",children:g((0,eB.T)(e.session.lastActiveAt))})]})]})},eX=({revoke:e})=>{let r=[{label:(0,h.G)("userProfile.start.activeDevicesSection.destructiveAction"),isDestructive:!0,onClick:e}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})};var eQ=t(9599),e0=t(8691);let e1=(0,l.dm)(e=>{let{onReset:r}=e,t=(0,l.f0)(),{afterSignOutUrl:n,afterMultiSessionSingleSignOutUrl:o}=(0,eQ.g)(),{user:a}=(0,v.Jd)(),{t:s}=(0,eS._)(),{otherSessions:c}=(0,e0.z)({user:a}),{setActive:d}=(0,v.ho)(),u=(0,v.Wp)(()=>a?.delete()),m=(0,ed.tJ)("deleteConfirmation","",{type:"text",label:(0,h.G)("userProfile.deletePage.actionDescription"),isRequired:!0,placeholder:(0,h.G)("formFieldInputPlaceholder__confirmDeletionUserAccount")}),f=m.value===(s((0,h.G)("formFieldInputPlaceholder__confirmDeletionUserAccount"))||"Delete account"),p=async()=>{if(f)try{await u();let e=0===c.length?n:o;return await d({session:null,redirectUrl:e})}catch(e){(0,G.H4)(e,[],t.setError)}};return(0,i.Y)(ec.M,{headerTitle:(0,h.G)("userProfile.deletePage.title"),sx:e=>({gap:e.space.$0x5}),children:(0,i.FD)(ea.l.Root,{onSubmit:p,children:[(0,i.FD)(y.fv,{gap:1,children:[(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,h.G)("userProfile.deletePage.messageLine1")}),(0,i.Y)(y.EY,{colorScheme:"danger",localizationKey:(0,h.G)("userProfile.deletePage.messageLine2")})]}),(0,i.Y)(ea.l.ControlRow,{elementId:m.id,children:(0,i.Y)(ea.l.PlainInput,{...m.props,ignorePasswordManager:!0})}),(0,i.Y)(es.G,{submitLabel:(0,h.G)("userProfile.deletePage.confirm"),colorScheme:"danger",isDisabled:!f,onReset:r})]})})}),e2=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(e1,{onSuccess:e,onReset:e})},e5=()=>(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.dangerSection.title"),id:"danger",sx:{alignItems:"center",[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"delete",children:(0,i.Y)(D.rd.Item,{id:"danger",sx:e=>({paddingLeft:e.space.$1}),children:(0,i.Y)(F.r.Trigger,{value:"delete",children:(0,i.Y)(D.rd.Button,{id:"danger",variant:"ghost",colorScheme:"danger",localizationKey:(0,h.G)("userProfile.start.dangerSection.deleteAccountButton")})})})}),(0,i.Y)(F.r.Open,{value:"delete",children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(e2,{})})})]})});var e4=t(1323),e3=t(5079),e6=t(6103),e8=t(2534),e7=t(3610),e9=t(8095),re=t(9126),rr=t(7782),rt=t(1072),ri=t(5976),rn=t(2405),rl=t(2852);let ro=e=>{let{code:r}=e;return(0,i.Y)(y.so,{center:!0,sx:e=>({padding:`${e.space.$1} ${e.space.$4}`}),children:(0,i.Y)(y.EY,{children:r})})},ra=e=>{let{subtitle:r,backupCodes:t}=e,{applicationName:n}=(0,Y.O)().displayConfig,{user:l}=(0,v.Jd)(),{print:o,printableProps:a}=(0,re.h)(),{onCopy:s,hasCopied:c}=(0,rr.i)(t?.join(",")||"");if(!l)return null;let d=(0,e9.Cm)(l);return t?(0,i.FD)(i.FK,{children:[(0,i.FD)(y.fv,{gap:1,children:[(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.backupCodePage.title__codelist"),variant:"subtitle"}),(0,i.Y)(y.EY,{localizationKey:r,variant:"caption",colorScheme:"secondary"})]}),(0,i.FD)(y.az,{sx:e=>({borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg}),children:[(0,i.Y)(y.xA,{gap:2,sx:e=>({gridTemplateColumns:`repeat(2, minmax(${e.sizes.$12}, 1fr))`,padding:`${e.space.$4} ${e.space.$6}`}),children:t.map((e,r)=>(0,i.Y)(ro,{code:e},r))}),(0,i.FD)(y.xA,{sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,gridTemplateColumns:"repeat(3, minmax(0, 1fr))",">:not([hidden])~:not([hidden])":{borderRightWidth:"0px",borderLeftWidth:"1px",borderStyle:"solid",borderColor:e.colors.$borderAlpha100},">:first-child":{borderBottomLeftRadius:e.radii.$lg},">:last-child":{borderBottomRightRadius:e.radii.$lg}}),children:[(0,i.Y)(y.$n,{variant:"ghost",sx:e=>({width:"100%",padding:`${e.space.$2} 0`,borderRadius:0}),onClick:()=>{var e,r,i;let l,o=document.createElement("a"),a=new Blob([(e=t,r=n,i=d,l=e?.join("\n"),`These are your backup codes for ${r} account ${i}.
1
+ "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["718"],{4308:function(e,r,t){t.r(r),t.d(r,{UserProfile:()=>r4,UserProfileModal:()=>r6});var i=t(4518),n=t(5074),l=t(1227),o=t(3264),a=t(5240),s=t(4607),c=t(2861),d=t(3269),u=t(9764),h=t(5396),m=t(7831),f=t(2265);let p=e=>{let{pages:r,apiKeysProps:t}=(0,a.B)(),n=r.routes.filter(e=>e.id!==l.j2.API_KEYS||!t?.hide);return(0,i.FD)(u.XM,{contentRef:e.contentRef,children:[(0,i.Y)(u.jq,{title:(0,c.G)("userProfile.navbar.title"),description:(0,c.G)("userProfile.navbar.description"),routes:n,contentRef:e.contentRef}),e.children]})};var g=t(540),Y=t(7697),v=t(1210),P=t(6088),b=t(6153),y=t(8272),S=t(8920),_=t(1421),D=t(4003),R=t(8080),G=t(4468),C=t(2660),F=t(3453),$=t(2513),w=t(2216),x=t(4964),I=t(6735);let k=e=>{let{strategy:r}=e,t=(0,d.f0)(),{user:n}=(0,v.Jd)(),{navigate:l}=(0,x.r)(),{strategyToDisplayData:o}=(0,w.k)(),{additionalOAuthScopes:s,componentName:u,mode:h}=(0,a.B)(),m="modal"===h,f=(0,v.Wp)(()=>{let e=r.replace("oauth_",""),t=m?(0,_.j)({url:window.location.href,componentName:u,socialProvider:e}):window.location.href,i=s?s[e]:[];return n?.createExternalAccount({strategy:r,redirectUrl:t,additionalScopes:i})}),p=o[r].iconUrl?(0,i.Y)(y._V,{isLoading:t.loadingMetadata===r,isDisabled:t.isLoading,elementDescriptor:S.$z.providerIcon,elementId:S.$z.providerIcon.setId(o[r].id),src:o[r].iconUrl,alt:`Connect ${o[r].name} account`,sx:e=>({width:e.sizes.$4})}):(0,i.Y)(C.T,{id:o[r].id,value:o[r].name,isLoading:t.loadingMetadata===r,isDisabled:t.isLoading});return(0,i.Y)(D.rd.ActionMenuItem,{id:o[r].id,onClick:()=>{if(n)return t.setLoading(r),f().then(e=>{e&&e.verification?.externalVerificationRedirectURL&&((0,I.y)(2e3).then(()=>t.setIdle(r)),l(e.verification.externalVerificationRedirectURL.href))}).catch(e=>{(0,G.H4)(e,[],t.setError),t.setIdle(r)})},isDisabled:t.isLoading,variant:"ghost",isLoading:t.loadingMetadata===r,focusRing:!1,closeAfterClick:!1,localizationKey:(0,c.G)("userProfile.connectedAccountPage.socialButtonsBlockButton",{provider:o[r].name}),sx:e=>({justifyContent:"start",gap:e.space.$2}),leftIcon:p},r)},A=({onClick:e})=>{let{user:r}=(0,v.Jd)(),{strategies:t}=(0,w.k)(),n=t.filter(e=>e.startsWith("oauth")),l=r?.verifiedExternalAccounts.map(e=>`oauth_${e.provider}`),o=n.filter(e=>!l.includes(e));return 0===o.length?null:(0,i.Y)(D.rd.ActionMenu,{triggerLocalizationKey:(0,c.G)("userProfile.start.connectedAccountsSection.primaryButton"),id:"connectedAccounts",onClick:e,children:o.map(e=>(0,i.Y)(k,{strategy:e},e))})};var z=t(8046);let T=e=>{let{onSuccess:r,onReset:t}=e,{user:l}=(0,v.Jd)(),{emailId:o}=e,a=l?.emailAddresses.find(e=>e.id===o),s=n.useRef(a?.emailAddress),d=a?.verification?.status==="verified"?(0,c.G)("userProfile.emailAddressPage.removeResource.messageLine2"):void 0;return s.current?(0,i.Y)(z.P,{title:(0,c.G)("userProfile.emailAddressPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.emailAddressPage.removeResource.messageLine1",{identifier:s.current}),messageLine2:d,successMessage:(0,c.G)("userProfile.emailAddressPage.removeResource.successMessage",{emailAddress:s.current}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:r,onReset:t}):null},E=e=>{let{phoneId:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=o?.phoneNumbers.find(e=>e.id===r),s=n.useRef(a?.phoneNumber),d=a?.verification?.status==="verified"?(0,c.G)("userProfile.phoneNumberPage.removeResource.messageLine2"):void 0;return s.current?(0,i.Y)(z.P,{title:(0,c.G)("userProfile.phoneNumberPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.phoneNumberPage.removeResource.messageLine1",{identifier:s.current}),messageLine2:d,successMessage:(0,c.G)("userProfile.phoneNumberPage.removeResource.successMessage",{phoneNumber:s.current}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:t,onReset:l}):null},L=e=>{let{accountId:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=o?.externalAccounts.find(e=>e.id===r),s=n.useRef(a?.provider),{providerToDisplayData:d}=(0,w.k)();return s.current?(0,i.Y)(z.P,{title:(0,c.G)("userProfile.connectedAccountPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.connectedAccountPage.removeResource.messageLine1",{identifier:d[s.current]?.name||""}),messageLine2:(0,c.G)("userProfile.connectedAccountPage.removeResource.messageLine2"),successMessage:(0,c.G)("userProfile.connectedAccountPage.removeResource.successMessage",{connectedAccount:d[s.current]?.name||""}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:t,onReset:l}):null},O=e=>{let{user:r}=(0,v.Jd)(),{walletId:t,onSuccess:l,onReset:o}=e,a=r?.web3Wallets.find(e=>e.id===t),s=n.useRef(a?.web3Wallet),d=a?.verification?.status==="verified"?(0,c.G)("userProfile.web3WalletPage.removeResource.messageLine2"):void 0;return s.current?(0,i.Y)(z.P,{title:(0,c.G)("userProfile.web3WalletPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.web3WalletPage.removeResource.messageLine1",{identifier:s.current}),messageLine2:d,successMessage:(0,c.G)("userProfile.web3WalletPage.removeResource.successMessage",{web3Wallet:s.current}),deleteResource:()=>Promise.resolve(a?.destroy()),onSuccess:l,onReset:o}):null},K=e=>{let{user:r}=(0,v.Jd)(),{phoneId:t,onSuccess:l,onReset:o}=e,a=r?.phoneNumbers.find(e=>e.id===t),s=n.useRef(a?.phoneNumber);return s.current?(0,i.Y)(z.P,{title:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.title"),messageLine1:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.messageLine1",{identifier:s.current}),messageLine2:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.messageLine2"),successMessage:(0,c.G)("userProfile.mfaPhoneCodePage.removeResource.successMessage",{mfaPhoneCode:s.current}),deleteResource:()=>Promise.resolve(a?.setReservedForSecondFactor({reserved:!1})),onSuccess:l,onReset:o}):null},M=e=>{let{onSuccess:r,onReset:t}=e,{user:n}=(0,v.Jd)();return n?(0,i.Y)(z.P,{title:(0,c.G)("userProfile.mfaTOTPPage.removeResource.title"),messageLine1:(0,c.G)("userProfile.mfaTOTPPage.removeResource.messageLine1"),messageLine2:(0,c.G)("userProfile.mfaTOTPPage.removeResource.messageLine2"),successMessage:(0,c.G)("userProfile.mfaTOTPPage.removeResource.successMessage"),deleteResource:n.disableTOTP,onSuccess:r,onReset:t}):null},N=e=>{let{onSuccess:r,onReset:t,passkey:n}=e;return(0,i.Y)(z.P,{title:(0,c.G)("userProfile.passkeyScreen.removeResource.title"),messageLine1:(0,c.G)("userProfile.passkeyScreen.removeResource.messageLine1",{name:n.name||""}),deleteResource:n.delete,onSuccess:r,onReset:t})},B=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(L,{onSuccess:r,onReset:r,...e})},W=["external_account_missing_refresh_token","oauth_fetch_user_error","oauth_token_exchange_error","external_account_email_address_verification_required"],J=(0,d.dm)(({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)(),t=(0,d.f0)(),l=!!r?.externalAccounts?.length,[o,a]=(0,n.useState)(null);if(!r||!e&&!l)return null;let s=[...r.verifiedExternalAccounts,...r.unverifiedExternalAccounts.filter(e=>e.verification?.error)];return(0,i.FD)(D.rd.Root,{title:(0,c.G)("userProfile.start.connectedAccountsSection.title"),centered:!1,id:"connectedAccounts",children:[(0,i.Y)(P.Z.Alert,{children:t.error}),(0,i.FD)(F.r.Root,{value:o,onChange:a,children:[(0,i.Y)(D.rd.ItemList,{id:"connectedAccounts",children:s.map(e=>(0,i.Y)(q,{account:e},e.id))}),e&&(0,i.Y)(A,{onClick:()=>a(null)})]})]})}),q=({account:e})=>{let{additionalOAuthScopes:r,componentName:t,mode:l}=(0,a.B)(),{navigate:o}=(0,x.r)(),{user:s}=(0,v.Jd)(),u=(0,d.f0)(),h=e.id,m="modal"===l,f=m?(0,_.j)({url:window.location.href,componentName:t}):window.location.href,p=(0,v.Wp)(()=>s?.createExternalAccount({strategy:e.verification.strategy,redirectUrl:f,additionalScopes:b}));if(!s)return null;let{providerToDisplayData:g}=(0,w.k)(),Y=e.username||e.emailAddress,P=e.verification?.error?.longMessage,b=function(e,r){if(!r)return[];let t=r[e.provider]||[],i=e.approvedScopes.split(" ");return 0===t.filter(e=>!i.includes(e)).length?[]:t}(e,r),R=b.length>0&&""!=e.approvedScopes,$=W.includes(e.verification?.error?.code||"")||R,I=$?(0,c.G)("userProfile.start.connectedAccountsSection.subtitle__disconnected"):P,k=async()=>{let r=m?(0,_.j)({url:window.location.href,componentName:t}):window.location.href;try{let t;(t=R?await e.reauthorize({additionalScopes:b,redirectUrl:r}):await p())&&await o(t.verification.externalVerificationRedirectURL?.href||"")}catch(e){(0,G.H4)(e,[],u.setError)}};return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"connectedAccounts",children:[(0,i.FD)(y.so,{sx:e=>({overflow:"hidden",gap:e.space.$2}),children:[(0,i.Y)(()=>g[e.provider].iconUrl?(0,i.Y)(y._V,{elementDescriptor:[S.$z.providerIcon],elementId:S.$z.socialButtonsProviderIcon.setId(e.provider),alt:g[e.provider].name,src:g[e.provider].iconUrl,sx:e=>({width:e.sizes.$4,flexShrink:0})}):(0,i.Y)(C.T,{id:e.provider,value:g[e.provider].name}),{}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:1,center:!0,children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),children:`${g[e.provider].name}`}),(0,i.Y)(y.EY,{truncate:!0,as:"span",colorScheme:"secondary",children:Y?`• ${Y}`:""})]})})]}),(0,i.Y)(U,{account:e})]}),$&&(0,i.FD)(y.az,{sx:e=>({padding:`${e.sizes.$none} ${e.sizes.$none} ${e.sizes.$1x5} ${e.sizes.$8x5}`}),children:[(0,i.Y)(y.EY,{colorScheme:"secondary",sx:e=>({paddingRight:e.sizes.$1x5,display:"inline-block"}),localizationKey:I}),(0,i.Y)(y.$n,{sx:{display:"inline-block"},onClick:k,variant:"link",localizationKey:(0,c.G)("userProfile.start.connectedAccountsSection.actionLabel__connectionFailed")})]}),e.verification?.error?.code&&!$&&(0,i.Y)(y.EY,{colorScheme:"danger",sx:e=>({padding:`${e.sizes.$none} ${e.sizes.$1x5} ${e.sizes.$1x5} ${e.sizes.$8x5}`}),children:P}),(0,i.Y)(F.r.Open,{value:`remove-${h}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(B,{accountId:e.id})})})]},e.id)},U=({account:e})=>{let{open:r}=(0,$.D5)(),t=e.id,n=[{label:(0,c.G)("userProfile.start.connectedAccountsSection.destructiveActionTitle"),isDestructive:!0,onClick:()=>r(`remove-${t}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:n})},j=e=>e.defaultSecondFactor?-1:1;function V(e){let r=[];return Object.entries(e).forEach(([,e])=>{e.used_for_second_factor&&r.push(...e.second_factors)}),r}function H(e,r){let t=V(e);return r.totpEnabled&&(t=t.filter(e=>"totp"!==e)),(r.backupCodeEnabled||!r.twoFactorEnabled)&&(t=t.filter(e=>"backup_code"!==e)),t}function Z(e,r){if(!e)return[];let t=e.filter(e=>e.id===r),i=e.filter(e=>e.id!==r),n=i.filter(e=>e.verification?.status==="verified"),l=i.filter(e=>!!e.verification?.status&&e.verification?.status!=="verified"),o=i.filter(e=>!e.verification.status);return n.sort((e,r)=>e.id.localeCompare(r.id)),l.sort((e,r)=>e.verification?.expireAt&&r.verification?.expireAt?e.verification.expireAt.getTime()-r.verification.expireAt.getTime():0),[...t,...n,...l,...o]}var X=t(2336);let Q=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(T,{onSuccess:r,onReset:r,...e})},ee=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(X.v,{onSuccess:r,onReset:r,...e})},er=({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)();return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.emailAddressesSection.title"),centered:!1,id:"emailAddresses",children:(0,i.Y)(F.r.Root,{children:(0,i.FD)(D.rd.ItemList,{id:"emailAddresses",children:[Z(r?.emailAddresses,r?.primaryEmailAddressId).map(e=>{let t=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"emailAddresses",children:[(0,i.FD)(y.so,{sx:e=>({overflow:"hidden",gap:e.space.$1}),children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),truncate:!0,children:e.emailAddress}),r?.primaryEmailAddressId===t&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__unverified")})]}),(0,i.Y)(et,{email:e})]}),(0,i.Y)(F.r.Open,{value:`remove-${t}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(Q,{emailId:t})})}),(0,i.Y)(F.r.Open,{value:`verify-${t}`,children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(ee,{emailId:t})})})]},e.emailAddress)}),e&&(0,i.FD)(i.FK,{children:[(0,i.Y)(F.r.Trigger,{value:"add",children:(0,i.Y)(D.rd.ArrowButton,{id:"emailAddresses",localizationKey:(0,c.G)("userProfile.start.emailAddressesSection.primaryButton")})}),(0,i.Y)(F.r.Open,{value:"add",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(ee,{})})})]})]})})})},et=({email:e})=>{let r=(0,d.f0)(),{user:t}=(0,v.Jd)(),{open:n}=(0,$.D5)(),l=e.id,o=t?.primaryEmailAddressId===l,a="verified"===e.verification.status,s=(0,v.Wp)(()=>t?.update({primaryEmailAddressId:l})),u=[o&&!a?{label:(0,c.G)("userProfile.start.emailAddressesSection.detailsAction__primary"),onClick:()=>n(`verify-${l}`)}:null,!o&&a?{label:(0,c.G)("userProfile.start.emailAddressesSection.detailsAction__nonPrimary"),onClick:()=>{s().catch(e=>(0,G.H4)(e,[],r.setError))}}:null,!o&&!a?{label:(0,c.G)("userProfile.start.emailAddressesSection.detailsAction__unverified"),onClick:()=>n(`verify-${l}`)}:null,{label:(0,c.G)("userProfile.start.emailAddressesSection.destructiveAction"),isDestructive:!0,onClick:()=>n(`remove-${l}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:u})},ei=()=>{let{user:e}=(0,v.Jd)(),r=e?.enterpriseAccounts.filter(({enterpriseConnection:e})=>e?.active);return r?.length?(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.enterpriseAccountsSection.title"),id:"enterpriseAccounts",centered:!1,children:(0,i.Y)(D.rd.ItemList,{id:"enterpriseAccounts",children:r.map(e=>(0,i.Y)(en,{account:e},e.id))})}):null},en=({account:e})=>{let r=e.emailAddress,t=e?.enterpriseConnection?.name,n=e.verification?.error?.longMessage;return(0,i.FD)(D.rd.Item,{id:"enterpriseAccounts",sx:e=>({gap:e.space.$2,justifyContent:"start"}),children:[(0,i.Y)(el,{account:e}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:1,center:!0,children:[(0,i.Y)(y.EY,{truncate:!0,colorScheme:"body",children:t}),(0,i.Y)(y.EY,{truncate:!0,as:"span",colorScheme:"secondary",children:r?`• ${r}`:""}),n&&(0,i.Y)(y.Ex,{colorScheme:"danger",localizationKey:(0,c.G)("badge__requiresAction")})]})})]},e.id)},el=({account:e})=>{let{provider:r,enterpriseConnection:t}=e,n=r.replace(/(oauth_|saml_)/,"").trim(),l=t?.name??n,o={elementDescriptor:[S.$z.providerIcon],alt:l,sx:e=>({width:e.sizes.$4}),elementId:S.$z.enterpriseButtonsProviderIcon.setId(e.provider)};return t?.logoPublicUrl?(0,i.Y)(y._V,{...o,src:t.logoPublicUrl}):(0,i.Y)(C.T,{id:n,value:l,"aria-label":`${l}'s icon`,elementDescriptor:[S.$z.providerIcon,S.$z.providerInitialIcon],elementId:S.$z.providerInitialIcon.setId(n)})};var eo=t(7651),ea=t(2454),es=t(1475),ec=t(3549),ed=t(8640),eu=t(6245),eh=t(1282);let em=(0,d.dm)(e=>{let{phoneId:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=n.useRef(o?.phoneNumbers.find(e=>e.id===r)),s=(0,eu.X)({defaultStep:+!!a.current});return(0,i.FD)(eu.s,{...s.props,children:[(0,i.Y)(ef,{resourceRef:a,title:(0,c.G)("userProfile.phoneNumberPage.title"),onSuccess:s.nextStep,onReset:l}),(0,i.Y)(ep,{resourceRef:a,title:(0,c.G)("userProfile.phoneNumberPage.verifyTitle"),onSuccess:t,onReset:l})]})}),ef=e=>{let{title:r,onSuccess:t,onReset:n,onUseExistingNumberClick:l,resourceRef:o}=e,a=(0,d.f0)(),{user:s}=(0,v.Jd)(),u=(0,v.Wp)((e,r)=>e.createPhoneNumber(r)),h=(0,ed.tJ)("phoneNumber","",{type:"tel",label:(0,c.G)("formFieldLabel__phoneNumber"),isRequired:!0}),m=h.value.length>1&&s?.username!==h.value,f=!!s?.phoneNumbers?.length&&l,p=async e=>{if(e.preventDefault(),s)return u(s,{phoneNumber:h.value}).then(e=>{o.current=e,t()}).catch(e=>(0,G.H4)(e,[h],a.setError))};return(0,i.Y)(ec.M,{headerTitle:r,gap:1,children:(0,i.FD)(ea.l.Root,{gap:4,onSubmit:p,children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.phoneNumberPage.infoText"),colorScheme:"secondary"}),(0,i.Y)(ea.l.ControlRow,{elementId:h.id,children:(0,i.Y)(ea.l.PhoneInput,{...h.props,autoFocus:!0})}),(0,i.FD)(y.so,{justify:f?"between":"end",children:[f&&(0,i.Y)(y.$n,{variant:"ghost",localizationKey:(0,c.G)("userProfile.mfaPhoneCodePage.backButton"),onClick:l}),(0,i.Y)(es.G,{submitLabel:(0,c.G)("userProfile.formButtonPrimary__add"),isDisabled:!m,onReset:n})]})]})})},ep=e=>{let{title:r,onSuccess:t,resourceRef:n,onReset:l}=e;return(0,i.Y)(ec.M,{headerTitle:r,headerSubtitle:(0,c.G)("userProfile.phoneNumberPage.verifySubtitle",{identifier:n.current?.phoneNumber||""}),children:(0,i.Y)(eh.j,{nextStep:t,identification:n.current,identifier:n.current?.phoneNumber,prepareVerification:n.current?.prepareVerification,onReset:l})})},eg=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(E,{onSuccess:r,onReset:r,...e})},eY=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(em,{onSuccess:r,onReset:r,...e})},ev=({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)(),t=!!r?.phoneNumbers?.length;return e||t?(0,i.Y)(D.rd.Root,{centered:!1,title:(0,c.G)("userProfile.start.phoneNumbersSection.title"),id:"phoneNumbers",children:(0,i.Y)(F.r.Root,{children:(0,i.FD)(D.rd.ItemList,{id:"phoneNumbers",children:[Z(r?.phoneNumbers,r?.primaryPhoneNumberId).map(e=>{let t=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"phoneNumbers",children:[(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:2,center:!0,children:[(0,i.Y)(y.EY,{sx:e=>({color:e.colors.$colorForeground}),children:(0,eo.Om)(e.phoneNumber)}),r?.primaryPhoneNumberId===t&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__unverified")})]})}),(0,i.Y)(eP,{phone:e})]}),(0,i.Y)(F.r.Open,{value:`remove-${t}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(eg,{phoneId:t})})}),(0,i.Y)(F.r.Open,{value:`verify-${t}`,children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(eY,{phoneId:t})})})]},t)}),e&&(0,i.FD)(i.FK,{children:[(0,i.Y)(F.r.Trigger,{value:"add",children:(0,i.Y)(D.rd.ArrowButton,{id:"phoneNumbers",localizationKey:(0,c.G)("userProfile.start.phoneNumbersSection.primaryButton")})}),(0,i.Y)(F.r.Open,{value:"add",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(eY,{})})})]})]})})}):null},eP=({phone:e})=>{let r=(0,d.f0)(),{open:t}=(0,$.D5)(),{user:n}=(0,v.Jd)(),l=e.id,o=(0,v.Wp)(r=>r.update({primaryPhoneNumberId:e.id}));if(!n)return null;let a=n.primaryPhoneNumberId===e.id,s="verified"===e.verification.status,u=[a&&!s?{label:(0,c.G)("userProfile.start.phoneNumbersSection.detailsAction__primary"),onClick:()=>t(`verify-${l}`)}:null,!a&&s?{label:(0,c.G)("userProfile.start.phoneNumbersSection.detailsAction__nonPrimary"),onClick:()=>o(n).catch(e=>(0,G.H4)(e,[],r.setError))}:null,!a&&!s?{label:(0,c.G)("userProfile.start.phoneNumbersSection.detailsAction__unverified"),onClick:()=>t(`verify-${l}`)}:null,{label:(0,c.G)("userProfile.start.phoneNumbersSection.destructiveAction"),isDestructive:!0,onClick:()=>t(`remove-${l}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:u})};var eb=t(7591),ey=t(4557),eS=t(78);let e_=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,{user:n}=(0,v.Jd)(),l=(0,v.Wp)(e=>n?.update({username:e})),{userSettings:o}=(0,Y.O)(),a=(0,d.f0)(),{t:s,locale:u}=(0,eS._)(),{usernameSettings:h}=o,m=(0,ed.tJ)("username",n?.username||"",{type:"text",label:(0,c.G)("formFieldLabel__username"),placeholder:(0,c.G)("formFieldInputPlaceholder__username"),buildErrorMessage:e=>(0,ey.Z)(e,{t:s,locale:u,usernameSettings:h})});if(!n)return null;let f=o.attributes.username?.required,p=(!f||m.value.length>0)&&n.username!==m.value,g=async()=>{try{await l(m.value),r()}catch(e){(0,G.H4)(e,[m],a.setError)}};return(0,i.Y)(ec.M,{headerTitle:n.username?(0,c.G)("userProfile.usernamePage.title__update"):(0,c.G)("userProfile.usernamePage.title__set"),children:(0,i.FD)(ea.l.Root,{onSubmit:g,children:[(0,i.Y)(ea.l.ControlRow,{elementId:m.id,children:(0,i.Y)(ea.l.PlainInput,{...m.props,autoFocus:!0,isRequired:f})}),(0,i.Y)(es.G,{isDisabled:!p,onReset:t})]})})}),eD=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(e_,{onSuccess:e,onReset:e})},eR=()=>{let{user:e}=(0,v.Jd)();return e?(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.usernameSection.title"),id:"username",sx:{alignItems:"center",[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"username",sx:{paddingLeft:e.username?void 0:"0"},children:[e.username&&(0,i.Y)(y.EY,{truncate:!0,sx:e=>({color:e.colors.$colorForeground}),children:e.username}),(0,i.Y)(F.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"username",localizationKey:e.username?(0,c.G)("userProfile.start.usernameSection.primaryButton__updateUsername"):(0,c.G)("userProfile.start.usernameSection.primaryButton__setUsername")})})]})}),(0,i.Y)(F.r.Open,{value:"edit",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(eD,{})})})]})}):null};var eG=t(9345),eC=t(2421),eF=t(8225),e$=t(3817),ew=t(9538);let ex=e=>{let{user:r,...t}=e;return(0,i.Y)(e$.k,{...t,title:(0,c.G)("userProfile.profilePage.imageFormTitle"),avatarPreview:(0,i.Y)(ew.H,{size:e=>e.sizes.$12,...r})})},eI=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,n=(0,d.f0)(),{user:l}=(0,v.Jd)();if(!l)return null;let{first_name:o,last_name:a}=(0,Y.O)().userSettings.attributes,s=o?.enabled,u=a?.enabled,h=l.firstName||"",m=l.lastName||"",f=(0,ed.tJ)("firstName",l.firstName||"",{type:"text",label:(0,c.G)("formFieldLabel__firstName"),placeholder:(0,c.G)("formFieldInputPlaceholder__firstName"),isRequired:a?.required}),p=(0,ed.tJ)("lastName",l.lastName||"",{type:"text",label:(0,c.G)("formFieldLabel__lastName"),placeholder:(0,c.G)("formFieldInputPlaceholder__lastName"),isRequired:a?.required}),g=s&&f.value!==h||u&&p.value!==m,P=s&&o.required||u&&a.required,b=P&&!!p.value&&!!f.value&&g,y=l.enterpriseAccounts.some(e=>e.active),S=async e=>(e.preventDefault(),(g?l.update({firstName:f.value,lastName:p.value}):Promise.resolve()).then(r).catch(e=>{(0,G.H4)(e,[f,p],n.setError)}));return(0,i.FD)(ec.M,{headerTitle:(0,c.G)("userProfile.profilePage.title"),children:[y&&(0,i.Y)(eC.k,{message:(0,c.G)("userProfile.profilePage.readonly")}),(0,i.FD)(ea.l.Root,{onSubmit:S,sx:e=>({gap:e.space.$6}),children:[(0,i.Y)(ex,{user:l,onAvatarChange:e=>l.setProfileImage({file:e}).then(()=>{n.setIdle(),r?.()}).catch(e=>(0,G.H4)(e,[],n.setError)),onAvatarRemove:(0,eF.p)(l.imageUrl)?null:()=>{l.setProfileImage({file:null}).then(()=>{n.setIdle(),r?.()}).catch(e=>(0,G.H4)(e,[],n.setError))}}),(s||u)&&(0,i.FD)(ea.l.ControlRow,{elementId:"name",children:[s&&(0,i.Y)(ea.l.PlainInput,{...f.props,isDisabled:y,autoFocus:!0}),u&&(0,i.Y)(ea.l.PlainInput,{...p.props,isDisabled:y,autoFocus:!s})]}),(0,i.Y)(es.G,{isDisabled:P?!b:!g,onReset:t})]})]})}),ek=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(eI,{onSuccess:e,onReset:e})},eA=()=>{let{user:e}=(0,v.Jd)();if(!e)return null;let{username:r,primaryEmailAddress:t,primaryPhoneNumber:n,primaryWeb3Wallet:l,...o}=e;return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.profileSection.title"),id:"profile",sx:{[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"profile",children:[(0,i.Y)(eG.c,{user:o,size:"lg",mainIdentifierVariant:"subtitle",sx:e=>({color:e.colors.$colorForeground})}),(0,i.Y)(F.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"profile",localizationKey:(0,c.G)("userProfile.start.profileSection.primaryButton")})})]})}),(0,i.Y)(F.r.Open,{value:"edit",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(ek,{})})})]})})};var ez=t(8099),eT=t(5243);let eE=(0,d.dm)(({onClick:e})=>{let r=(0,d.f0)(),{user:t}=(0,v.Jd)(),{strategies:n,strategyToDisplayData:l}=(0,w.k)(),o=(0,eT.R)(),a=n.filter(e=>e.startsWith("web3")),s=t?.verifiedWeb3Wallets.map(e=>e.verification.strategy),u=a.filter(e=>!s.includes(e)),h=(0,v.Wp)(e=>t?.createWeb3Wallet({web3Wallet:e})),m=async e=>{let i=(0,ez.U)(o),n=e.replace("web3_","").replace("_signature","");r.setError(void 0);try{r.setLoading(e);let l=await i.getWeb3Identifier({provider:n});if(!t)throw Error("user is not defined");let o=await h(l);o=await o?.prepareVerification({strategy:e});let a=o?.verification.message,s=await i.generateWeb3Signature({identifier:l,nonce:a,provider:n});await o?.attemptVerification({signature:s}),r.setIdle()}catch(t){r.setIdle();let e=(0,G.hG)(t);e?r.setError(e.longMessage):(0,G.H4)(t,[],r.setError)}};return 0===u.length?null:(0,i.FD)(i.FK,{children:[(0,i.Y)(D.rd.ActionMenu,{id:"web3Wallets",triggerLocalizationKey:(0,c.G)("userProfile.start.web3WalletsSection.primaryButton"),onClick:e,children:u.map(e=>(0,i.Y)(D.rd.ActionMenuItem,{id:l[e].id,onClick:()=>{m(e)},isLoading:r.loadingMetadata===e,isDisabled:r.isLoading,localizationKey:(0,c.G)("userProfile.web3WalletPage.web3WalletButtonsBlockButton",{provider:l[e].name}),sx:e=>({justifyContent:"start",gap:e.space.$2}),leftIcon:(0,i.Y)(y._V,{elementDescriptor:S.$z.providerIcon,elementId:S.$z.providerIcon.setId(l[e].id),isLoading:r.loadingMetadata===e,isDisabled:r.isLoading,src:l[e].iconUrl,alt:`Connect ${l[e].name}`,sx:e=>({width:e.sizes.$5})})},e))}),r.error&&(0,i.Y)(y.EY,{colorScheme:"danger",sx:e=>({padding:e.sizes.$1x5,paddingLeft:e.sizes.$8x5}),children:r.error})]})}),eL=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(O,{onSuccess:r,onReset:r,...e})},eO=(0,d.dm)(({shouldAllowCreation:e=!0})=>{let{user:r}=(0,v.Jd)(),t=(0,d.f0)(),{strategyToDisplayData:l}=(0,w.k)(),o=!!r?.web3Wallets?.length,[a,s]=(0,n.useState)(null);return e||o?(0,i.FD)(D.rd.Root,{title:(0,c.G)("userProfile.start.web3WalletsSection.title"),centered:!1,id:"web3Wallets",children:[(0,i.Y)(P.Z.Alert,{children:t.error}),(0,i.FD)(F.r.Root,{value:a,onChange:s,children:[(0,i.Y)(D.rd.ItemList,{id:"web3Wallets",children:Z(r?.web3Wallets,r?.primaryWeb3WalletId).map(e=>{var t;let o=e.verification.strategy,a=e.id;return l[o]&&(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"web3Wallets",align:"start",children:[(0,i.FD)(y.so,{sx:e=>({alignItems:"center",gap:e.space.$2,width:"100%"}),children:[l[o].iconUrl&&(0,i.Y)(y._V,{src:l[o].iconUrl,alt:l[o].name,sx:e=>({width:e.sizes.$4})}),(0,i.Y)(y.az,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:(0,i.FD)(y.so,{gap:2,justify:"start",children:[(0,i.FD)(y.EY,{children:[l[o].name," (",(t=e.web3Wallet).length<=10?t:t.slice(0,6)+"..."+t.slice(-4),")"]}),r?.primaryWeb3WalletId===a&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__primary")}),"verified"!==e.verification.status&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__unverified")})]})})]}),(0,i.Y)(eK,{walletId:a})]},a),(0,i.Y)(F.r.Open,{value:`remove-${a}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(eL,{walletId:e.id})})})]},e.id)})}),e&&(0,i.Y)(eE,{onClick:()=>s(null)})]})]}):null}),eK=({walletId:e})=>{let r=(0,d.f0)(),{open:t}=(0,$.D5)(),{user:n}=(0,v.Jd)(),l=n?.primaryWeb3WalletId===e,o=(0,v.Wp)(()=>n?.update({primaryWeb3WalletId:e})),a=[!l?{label:(0,c.G)("userProfile.start.web3WalletsSection.detailsAction__nonPrimary"),onClick:()=>{o().catch(e=>(0,G.H4)(e,[],r.setError))}}:null,{label:(0,c.G)("userProfile.start.web3WalletsSection.destructiveAction"),isDestructive:!0,onClick:()=>t(`remove-${e}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:a})},eM=(0,d.dm)(()=>{let{attributes:e,social:r,enterpriseSSO:t}=(0,Y.O)().userSettings,n=(0,d.f0)(),{user:l}=(0,v.Jd)(),{shouldAllowIdentificationCreation:o}=(0,a.B)(),s=e.username?.enabled,u=e.email_address?.enabled,h=e.phone_number?.enabled,m=r&&Object.values(r).filter(e=>e.enabled).length>0,f=l&&t.enabled,p=e.web3_wallet?.enabled;return(0,i.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8,color:e.colors.$colorForeground}),children:(0,i.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("account"),children:[(0,i.Y)(b.Y.Root,{children:(0,i.Y)(b.Y.Title,{localizationKey:(0,c.G)("userProfile.start.headerTitle__account"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,i.Y)(P.Z.Alert,{children:n.error}),(0,i.Y)(eA,{}),s&&(0,i.Y)(eR,{}),u&&(0,i.Y)(er,{shouldAllowCreation:o}),h&&(0,i.Y)(ev,{shouldAllowCreation:o}),m&&(0,i.Y)(J,{shouldAllowCreation:o}),f&&(0,i.Y)(ei,{}),p&&(0,i.Y)(eO,{shouldAllowCreation:o})]})})});var eN=t(2611),eB=t(7806),eW=t(7896),eJ=t(4901),eq=t(892),eU=t(8910);let ej=()=>{let e,{user:r}=(0,v.Jd)(),{session:t}=(0,v.wV)(),{data:n,isLoading:l}=(0,eW.s)(r?.getSessions,"user-sessions");return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.activeDevicesSection.title"),centered:!1,id:"activeDevices",children:(0,i.Y)(D.rd.ItemList,{id:"activeDevices",disableAnimation:!0,children:l?(0,i.Y)(eN.K,{}):n?.sort((e=t.id,r=>r.id===e?-1:1)).map(e=>eV(e.status)?(0,i.Y)(eH,{session:e},e.id):null)})})},eV=e=>["active","pending"].includes(e),eH=({session:e})=>{let r=(0,v.wV)().session?.id===e.id,t=(0,eJ.m)(),n=(0,v.Wp)(e.revoke.bind(e)),l=async()=>{if(!r&&e)return t.setLoading(),n().catch(e=>(0,G.H4)(e,[],t.setError)).finally(()=>t.setIdle())};return(0,i.Y)(D.rd.Item,{id:"activeDevices",elementDescriptor:S.$z.activeDeviceListItem,elementId:r?S.$z.activeDeviceListItem.setId("current"):void 0,sx:{alignItems:"flex-start",opacity:t.isLoading?.5:1},isDisabled:t.isLoading,children:(0,i.FD)(i.FK,{children:[(0,i.Y)(eZ,{session:e}),!r&&(0,i.Y)(eX,{revoke:l})]})})},eZ=e=>{let{session:r}=(0,v.wV)(),t=r?.id===e.session.id,n=!!r?.actor,l=!!e.session.actor,{city:o,country:a,browserName:s,browserVersion:d,deviceType:u,ipAddress:h,isMobile:m}=e.session.latestActivity,f=`${s||""} ${d||""}`.trim()||"Web browser",p=[o||"",a||""].filter(Boolean).join(", ").trim()||null,{t:g}=(0,eS._)();return(0,i.FD)(y.so,{elementDescriptor:S.$z.activeDevice,elementId:t?S.$z.activeDevice.setId("current"):void 0,sx:e=>({width:"100%",overflow:"hidden",gap:e.space.$4,[eb.g.sm]:{gap:e.space.$2}}),children:[(0,i.Y)(y.so,{sx:e=>({[eb.g.sm]:{padding:"0"},borderRadius:e.radii.$md}),children:(0,i.Y)(y.In,{elementDescriptor:S.$z.activeDeviceIcon,elementId:S.$z.activeDeviceIcon.setId(m?"mobile":"desktop"),icon:m?eq.A:eU.A,sx:e=>({"--cl-chassis-bottom":"#444444","--cl-chassis-back":"#343434","--cl-chassis-screen":"#575757","--cl-screen":"#000000",width:e.space.$8,height:e.space.$8})})}),(0,i.FD)(y.fv,{align:"start",gap:1,children:[(0,i.FD)(y.so,{center:!0,gap:2,children:[(0,i.Y)(y.EY,{children:u||(m?"Mobile device":"Desktop device")}),t&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__thisDevice"),colorScheme:n?"danger":"primary"}),n&&!l&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__userDevice")}),!t&&l&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__otherImpersonatorDevice"),colorScheme:"danger"})]}),(0,i.Y)(y.EY,{colorScheme:"secondary",children:f}),(0,i.FD)(y.EY,{colorScheme:"secondary",children:[h," (",p,")"]}),(0,i.Y)(y.EY,{colorScheme:"secondary",children:g((0,eB.T)(e.session.lastActiveAt))})]})]})},eX=({revoke:e})=>{let r=[{label:(0,c.G)("userProfile.start.activeDevicesSection.destructiveAction"),isDestructive:!0,onClick:e}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})};var eQ=t(9599),e0=t(8691);let e1=(0,d.dm)(e=>{let{onReset:r}=e,t=(0,d.f0)(),{afterSignOutUrl:n,afterMultiSessionSingleSignOutUrl:l}=(0,eQ.g)(),{user:o}=(0,v.Jd)(),{t:a}=(0,eS._)(),{otherSessions:s}=(0,e0.z)({user:o}),{setActive:u}=(0,v.ho)(),h=(0,v.Wp)(()=>o?.delete()),m=(0,ed.tJ)("deleteConfirmation","",{type:"text",label:(0,c.G)("userProfile.deletePage.actionDescription"),isRequired:!0,placeholder:(0,c.G)("formFieldInputPlaceholder__confirmDeletionUserAccount")}),f=m.value===(a((0,c.G)("formFieldInputPlaceholder__confirmDeletionUserAccount"))||"Delete account"),p=async()=>{if(f)try{await h();let e=0===s.length?n:l;return await u({session:null,redirectUrl:e})}catch(e){(0,G.H4)(e,[],t.setError)}};return(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.deletePage.title"),sx:e=>({gap:e.space.$0x5}),children:(0,i.FD)(ea.l.Root,{onSubmit:p,children:[(0,i.FD)(y.fv,{gap:1,children:[(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("userProfile.deletePage.messageLine1")}),(0,i.Y)(y.EY,{colorScheme:"danger",localizationKey:(0,c.G)("userProfile.deletePage.messageLine2")})]}),(0,i.Y)(ea.l.ControlRow,{elementId:m.id,children:(0,i.Y)(ea.l.PlainInput,{...m.props,ignorePasswordManager:!0})}),(0,i.Y)(es.G,{submitLabel:(0,c.G)("userProfile.deletePage.confirm"),colorScheme:"danger",isDisabled:!f,onReset:r})]})})}),e2=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(e1,{onSuccess:e,onReset:e})},e5=()=>(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.dangerSection.title"),id:"danger",sx:{alignItems:"center",[eb.g.md]:{alignItems:"flex-start"}},children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"delete",children:(0,i.Y)(D.rd.Item,{id:"danger",sx:e=>({paddingLeft:e.space.$1}),children:(0,i.Y)(F.r.Trigger,{value:"delete",children:(0,i.Y)(D.rd.Button,{id:"danger",variant:"ghost",colorScheme:"danger",localizationKey:(0,c.G)("userProfile.start.dangerSection.deleteAccountButton")})})})}),(0,i.Y)(F.r.Open,{value:"delete",children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(e2,{})})})]})});var e4=t(1323),e3=t(5079),e6=t(6103),e8=t(2534),e7=t(3610),e9=t(8095),re=t(9126),rr=t(7782),rt=t(1072),ri=t(5976),rn=t(2405),rl=t(2852);let ro=e=>{let{code:r}=e;return(0,i.Y)(y.so,{center:!0,sx:e=>({padding:`${e.space.$1} ${e.space.$4}`}),children:(0,i.Y)(y.EY,{children:r})})},ra=e=>{let{subtitle:r,backupCodes:t}=e,{applicationName:n}=(0,Y.O)().displayConfig,{user:l}=(0,v.Jd)(),{print:o,printableProps:a}=(0,re.h)(),{onCopy:s,hasCopied:d}=(0,rr.i)(t?.join(",")||"");if(!l)return null;let u=(0,e9.Cm)(l);return t?(0,i.FD)(i.FK,{children:[(0,i.FD)(y.fv,{gap:1,children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.title__codelist"),variant:"subtitle"}),(0,i.Y)(y.EY,{localizationKey:r,variant:"caption",colorScheme:"secondary"})]}),(0,i.FD)(y.az,{sx:e=>({borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg}),children:[(0,i.Y)(y.xA,{gap:2,sx:e=>({gridTemplateColumns:`repeat(2, minmax(${e.sizes.$12}, 1fr))`,padding:`${e.space.$4} ${e.space.$6}`}),children:t.map((e,r)=>(0,i.Y)(ro,{code:e},r))}),(0,i.FD)(y.xA,{sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100,gridTemplateColumns:"repeat(3, minmax(0, 1fr))",">:not([hidden])~:not([hidden])":{borderRightWidth:"0px",borderLeftWidth:"1px",borderStyle:"solid",borderColor:e.colors.$borderAlpha100},">:first-child":{borderBottomLeftRadius:e.radii.$lg},">:last-child":{borderBottomRightRadius:e.radii.$lg}}),children:[(0,i.Y)(y.$n,{variant:"ghost",sx:e=>({width:"100%",padding:`${e.space.$2} 0`,borderRadius:0}),onClick:()=>{var e,r,i;let l,o=document.createElement("a"),a=new Blob([(e=t,r=n,i=u,l=e?.join("\n"),`These are your backup codes for ${r} account ${i}.
2
2
  Store them securely and keep them secret. Each code can only be used once.
3
3
 
4
- ${l}`)],{type:"text/plain"});o.href=URL.createObjectURL(a),o.download=`${n}_backup_codes.txt`,document.body.appendChild(o),o.click()},children:(0,i.Y)(y.In,{icon:rt.A})}),(0,i.Y)(y.$n,{variant:"ghost",sx:e=>({width:"100%",padding:`${e.space.$2} 0`,borderRadius:0}),onClick:o,children:(0,i.Y)(y.In,{icon:ri.A})}),(0,i.Y)(y.$n,{variant:"ghost",onClick:s,sx:e=>({width:"100%",padding:`${e.space.$2} 0`,borderRadius:0}),children:(0,i.Y)(y.In,{icon:c?rn.A:rl.A})})]})]}),(0,i.FD)(re.L,{...a,children:[(0,i.FD)(y.DZ,{children:["Your backup codes for ",n," account ",d,":"]}),(0,i.Y)(y.fv,{gap:2,children:t.map((e,r)=>(0,i.Y)(ro,{code:e},r))})]})]}):null},rs=(0,l.dm)(e=>{let{onSuccess:r,onReset:t}=e,{user:o}=(0,v.Jd)(),a=(0,l.f0)(),s=(0,v.Wp)(()=>o?.createBackupCode()),[c,d]=n.useState(void 0);return(n.useEffect(()=>{!c&&o&&s().then(e=>d(e)).catch(e=>{if((0,e7.I3)(e))return t();(0,G.H4)(e,[],a.setError)})},[]),a.error)?(0,i.Y)(ec.M,{headerTitle:(0,h.G)("userProfile.backupCodePage.title")}):(0,i.Y)(ec.M,{headerTitle:(0,h.G)("userProfile.backupCodePage.title"),children:c?(0,i.FD)(i.FK,{children:[(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.backupCodePage.successMessage")}),(0,i.Y)(ra,{subtitle:(0,h.G)("userProfile.backupCodePage.subtitle__codelist"),backupCodes:c.codes}),(0,i.Y)(es.c,{children:(0,i.Y)(y.$n,{autoFocus:!0,onClick:r,localizationKey:(0,h.G)("userProfile.formButtonPrimary__finish"),elementDescriptor:S.$z.formButtonPrimary})})]}):(0,i.Y)(eN.K,{})})}),rc=(0,l.dm)(e=>{let{onSuccess:r,onReset:t}=e,n=(0,eu.X)();return(0,i.FD)(eu.s,{...n.props,children:[(0,i.Y)(rd,{onContinue:n.nextStep}),(0,i.Y)(rs,{onSuccess:r,onReset:t})]})}),rd=e=>{let{onContinue:r}=e,{close:t}=(0,$.D5)();return(0,i.FD)(ec.M,{headerTitle:(0,h.G)("userProfile.backupCodePage.title"),children:[(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.backupCodePage.infoText1")}),(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.backupCodePage.infoText2")}),(0,i.FD)(es.c,{sx:{marginTop:0},children:[(0,i.Y)(y.$n,{textVariant:"buttonSmall",onClick:r,localizationKey:(0,h.G)("userProfile.formButtonPrimary__finish"),elementDescriptor:S.$z.formButtonPrimary}),(0,i.Y)(y.$n,{variant:"ghost",onClick:t,localizationKey:(0,h.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})]})]})};var ru=t(155),rh=t(6370),rm=t(9679);let rf=(0,l.dm)(e=>{let{onReset:r,onSuccess:t}=e,l=n.useRef(),o=(0,eu.X)({defaultStep:2}),a=(0,Y.O)().userSettings.attributes.backup_code?.enabled;return(0,i.FD)(eu.s,{...o.props,children:[(0,i.Y)(ef,{title:(0,h.G)("userProfile.phoneNumberPage.title"),resourceRef:l,onSuccess:o.nextStep,onUseExistingNumberClick:()=>o.goToStep(2),onReset:r}),(0,i.Y)(rg,{title:(0,h.G)("userProfile.mfaPhoneCodePage.title"),resourceRef:l,onSuccess:()=>a?o.goToStep(3):t(),onReset:()=>o.goToStep(2)}),(0,i.Y)(rY,{onSuccess:a?o.nextStep:t,onReset:r,onAddPhoneClick:()=>o.goToStep(0),onUnverifiedPhoneClick:e=>{l.current=e,o.goToStep(1)},title:(0,h.G)("userProfile.mfaPhoneCodePage.title"),resourceRef:l}),a&&(0,i.Y)(rh.B,{title:(0,h.G)("userProfile.mfaPhoneCodePage.successTitle"),text:l.current?.backupCodes&&l.current?.backupCodes.length>0?[(0,h.G)("userProfile.mfaPhoneCodePage.successMessage1"),(0,h.G)("userProfile.mfaPhoneCodePage.successMessage2")]:[(0,h.G)("userProfile.mfaPhoneCodePage.successMessage1")],onFinish:r,contents:(0,i.Y)(ra,{backupCodes:l.current?.backupCodes})})]})}),rp=e=>{let{phone:r,onSuccess:t,onUnverifiedPhoneClick:n,resourceRef:o}=e,a=(0,l.f0)(),s=(0,v.Wp)(()=>r.setReservedForSecondFactor({reserved:!0})),{country:c}=(0,eo.Mz)(r.phoneNumber),d=(0,eo.Om)(r.phoneNumber),u=async()=>{if("verified"!==r.verification.status)return n(r);a.setLoading(r.id);try{await s(),o.current=r,t()}catch(e){(0,G.H4)(e,[],a.setError)}finally{a.setIdle()}};return(0,i.FD)(y.$n,{variant:"outline",colorScheme:"neutral",sx:{justifyContent:"start"},onClick:u,isLoading:a.loadingMetadata===r.id,isDisabled:a.isLoading,children:[c.iso.toUpperCase()," ",d]},r.id)},rg=e=>{let{title:r,onSuccess:t,resourceRef:n,onReset:o}=e,a=(0,l.f0)(),s=n.current,c=(0,v.Wp)(()=>s?.setReservedForSecondFactor({reserved:!0})),d=async()=>{a.setLoading(s?.id);try{await c(),n.current=s,t()}catch(e){(0,G.H4)(e,[],a.setError)}finally{a.setIdle()}};return(0,i.Y)(ec.M,{headerTitle:r,headerSubtitle:(0,h.G)("userProfile.phoneNumberPage.verifySubtitle",{identifier:n.current?.phoneNumber||""}),children:(0,i.Y)(eh.j,{nextStep:()=>{d()},identification:n.current,identifier:n.current?.phoneNumber,prepareVerification:n.current?.prepareVerification,onReset:o})})},rY=e=>{let{onSuccess:r,onReset:t,title:n,onAddPhoneClick:l,onUnverifiedPhoneClick:o,resourceRef:a}=e,{user:s}=(0,v.Jd)();if(!s)return null;let c=s.phoneNumbers.filter(e=>!e.reservedForSecondFactor);return(0,i.FD)(ec.M,{headerTitle:n,gap:1,children:[(0,i.Y)(y.EY,{localizationKey:(0,h.G)(c.length?"userProfile.mfaPhoneCodePage.subtitle__availablePhoneNumbers":"userProfile.mfaPhoneCodePage.subtitle__unavailablePhoneNumbers"),colorScheme:"secondary"}),c.length>0&&(0,i.Y)(y.fv,{gap:2,children:c.map(e=>(0,i.Y)(rp,{onSuccess:r,phone:e,onUnverifiedPhoneClick:o,resourceRef:a},e.id))}),(0,i.FD)(es.c,{sx:{flexDirection:"row",justifyContent:"space-between"},children:[(0,i.Y)(ru.K,{variant:"ghost","aria-label":"Add phone number",icon:(0,i.Y)(y.In,{icon:rm.A,sx:e=>({marginRight:e.space.$2})}),localizationKey:(0,h.G)("userProfile.mfaPhoneCodePage.primaryButton__addPhoneNumber"),onClick:l}),(0,i.Y)(y.$n,{variant:"ghost",localizationKey:(0,h.G)("userProfile.formButtonReset"),onClick:t})]})]})};var rv=t(5559),rP=t(2094);let rb=(0,l.dm)(e=>{let{title:r,onSuccess:t,onReset:o}=e,{user:a}=(0,v.Jd)(),s=(0,l.f0)(),c=(0,v.Wp)(()=>a?.createTOTP()),{close:d}=(0,$.D5)(),[u,m]=n.useState(void 0),[f,p]=n.useState("qr");return(n.useEffect(()=>{a&&c().then(e=>m(e)).catch(e=>(0,e7.Cm)(e)&&"reverification_cancelled"===e.code?d():(0,G.H4)(e,[],s.setError))},[]),s.error)?(0,i.Y)(ec.M,{headerTitle:r}):(0,i.FD)(ec.M,{headerTitle:r,headerSubtitle:"qr"==f?(0,h.G)("userProfile.mfaTOTPPage.authenticatorApp.infoText__ableToScan"):(0,h.G)("userProfile.mfaTOTPPage.authenticatorApp.infoText__unableToScan"),children:[!u&&(0,i.Y)(eN.K,{}),u&&(0,i.FD)(i.FK,{children:[(0,i.FD)(y.fv,{gap:4,children:["qr"==f&&(0,i.Y)(rP.r,{justify:"center",url:u.uri||""}),"uri"==f&&(0,i.FD)(i.FK,{children:[(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,h.G)("userProfile.mfaTOTPPage.authenticatorApp.inputLabel__unableToScan1")}),(0,i.Y)(rv.r,{value:u.secret}),(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,h.G)("userProfile.mfaTOTPPage.authenticatorApp.inputLabel__unableToScan2")}),(0,i.Y)(rv.r,{value:u.uri})]})]}),(0,i.FD)(y.so,{justify:"between",align:"center",sx:{width:"100%"},children:["qr"==f&&(0,i.Y)(y.$n,{variant:"link",textVariant:"buttonLarge",onClick:()=>p("uri"),localizationKey:(0,h.G)("userProfile.mfaTOTPPage.authenticatorApp.buttonUnableToScan__nonPrimary")}),"uri"==f&&(0,i.Y)(y.$n,{variant:"link",textVariant:"buttonLarge",onClick:()=>p("qr"),localizationKey:(0,h.G)("userProfile.mfaTOTPPage.authenticatorApp.buttonAbleToScan__nonPrimary")}),(0,i.FD)(es.c,{children:[(0,i.Y)(y.$n,{onClick:t,localizationKey:(0,h.G)("userProfile.formButtonPrimary__continue"),elementDescriptor:S.$z.formButtonPrimary}),(0,i.Y)(y.$n,{variant:"ghost",onClick:o,localizationKey:(0,h.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})]})]})]})]})});var ry=t(3356);let rS=(0,l.dm)(e=>{let{onSuccess:r,onReset:t,resourceRef:n}=e,{user:l}=(0,v.Jd)(),o=(0,ry.xM)({onCodeEntryFinished:(e,r,t)=>{l?.verifyTOTP({code:e}).then(e=>r(e)).catch(t)},onResolve:e=>{n.current=e,r()}});return(0,i.FD)(ec.M,{headerTitle:(0,h.G)("userProfile.mfaTOTPPage.title"),children:[(0,i.Y)(y.fv,{children:(0,i.Y)(ea.l.OTPInput,{...o,label:(0,h.G)("userProfile.mfaTOTPPage.verifyTitle"),description:(0,h.G)("userProfile.mfaTOTPPage.verifySubtitle")})}),(0,i.Y)(es.c,{sx:{marginTop:0},children:(0,i.Y)(y.$n,{onClick:t,variant:"ghost",isDisabled:o.isLoading,localizationKey:(0,h.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})})]})}),r_=(0,l.dm)(e=>{let{onReset:r}=e,t=(0,eu.X)(),l=n.useRef();return(0,i.FD)(eu.s,{...t.props,children:[(0,i.Y)(rb,{title:(0,h.G)("userProfile.mfaTOTPPage.title"),onSuccess:t.nextStep,onReset:r}),(0,i.Y)(rS,{onSuccess:t.nextStep,onReset:r,resourceRef:l}),(0,i.Y)(rh.B,{title:(0,h.G)("userProfile.mfaTOTPPage.title"),text:(0,h.G)("userProfile.mfaTOTPPage.successMessage"),onFinish:r,contents:(0,i.Y)(ra,{subtitle:(0,h.G)("userProfile.backupCodePage.successSubtitle"),backupCodes:l.current?.backupCodes})})]})}),rD=(0,l.dm)(e=>{let{onSuccess:r,onReset:t,selectedStrategy:o}=e,a=(0,l.f0)(),{userSettings:{attributes:s}}=(0,Y.O)(),{user:c}=(0,v.Jd)();if(!c)return null;let d=(0,h.G)("userProfile.mfaPage.title"),u=n.useMemo(()=>H(s,c),[]);return(n.useEffect(()=>{0===u.length&&a.setError("There are no second factors available to add")},[]),a.error)?(0,i.Y)(ec.M,{headerTitle:d}):0!==u.length||o?(0,i.Y)(rR,{onSuccess:r,onReset:t,method:o||u[0]}):null}),rR=e=>{let{method:r,onSuccess:t,onReset:n}=e;switch(r){case"phone_code":return(0,i.Y)(rf,{onSuccess:t,onReset:n});case"totp":return(0,i.Y)(r_,{onSuccess:t,onReset:n});case"backup_code":return(0,i.Y)(rc,{onSuccess:t,onReset:n});default:return null}},rG=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(M,{onSuccess:e,onReset:e})},rC=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(K,{onSuccess:r,onReset:r,...e})},rF=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(rs,{onSuccess:e,onReset:e})},r$=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(rD,{onSuccess:r,onReset:r,selectedStrategy:e.selectedStrategy})},rw=()=>{let{userSettings:{attributes:e}}=(0,Y.O)(),{user:r}=(0,v.Jd)(),[t,l]=(0,n.useState)(null);if(!r)return null;let o=V(e),a=H(e,r),s=o.includes("totp")&&r.totpEnabled,c=o.includes("backup_code")&&r.backupCodeEnabled,d=r.phoneNumbers.filter(e=>"verified"===e.verification.status).filter(e=>e.reservedForSecondFactor).sort(j);return(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.mfaSection.title"),centered:!1,id:"mfa",children:(0,i.Y)(F.r.Root,{value:t,onChange:l,children:(0,i.FD)(D.rd.ItemList,{id:"mfa",children:[s&&(0,i.FD)(i.FK,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e3.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.start.mfaSection.totp.headerTitle")}),(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__default")})]}),(0,i.Y)(rk,{})]}),(0,i.Y)(F.r.Open,{value:"remove-totp",children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(rG,{})})})]}),o.includes("phone_code")&&d.map(e=>{let r=!s&&e.defaultSecondFactor,t=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e6.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.FD)(y.EY,{children:["SMS Code ",(0,i.Y)(e4.R,{value:e.phoneNumber})]}),r&&(0,i.Y)(y.Ex,{localizationKey:(0,h.G)("badge__default")})]}),(0,i.Y)(rx,{phone:e,showTOTP:s})]}),(0,i.Y)(F.r.Open,{value:`remove-${t}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(rC,{phoneId:t})})})]},t)}),c&&(0,i.FD)(i.FK,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e8.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.Y)(y.EY,{localizationKey:(0,h.G)("userProfile.start.mfaSection.backupCodes.headerTitle")})]}),(0,i.Y)(rI,{})]}),(0,i.Y)(F.r.Open,{value:"regenerate",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(rF,{})})})]}),(0,i.Y)(rA,{secondFactorsAvailableToAdd:a,onClick:()=>l(null)})]})})})},rx=({phone:e,showTOTP:r})=>{let{open:t}=(0,$.D5)(),n=(0,l.f0)(),o=e.id,a=[!r&&!e.defaultSecondFactor?{label:(0,h.G)("userProfile.start.mfaSection.phoneCode.actionLabel__setDefault"),onClick:()=>e.makeDefaultSecondFactor().catch(e=>(0,G.H4)(e,[],n.setError))}:null,{label:(0,h.G)("userProfile.start.mfaSection.phoneCode.destructiveActionLabel"),isDestructive:!0,onClick:()=>t(`remove-${o}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:a})},rI=()=>{let{open:e}=(0,$.D5)(),r=[{label:(0,h.G)("userProfile.start.mfaSection.backupCodes.actionLabel__regenerate"),onClick:()=>e("regenerate")}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})},rk=()=>{let{open:e}=(0,$.D5)(),r=[{label:(0,h.G)("userProfile.start.mfaSection.totp.destructiveActionTitle"),isDestructive:!0,onClick:()=>e("remove-totp")}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})},rA=e=>{let{open:r}=(0,$.D5)(),{secondFactorsAvailableToAdd:t,onClick:l}=e,[o,a]=(0,n.useState)(),s=n.useMemo(()=>t.map(e=>"phone_code"===e?{icon:e6.A,text:"SMS code",key:"phone_code"}:"totp"===e?{icon:e3.A,text:"Authenticator application",key:"totp"}:"backup_code"===e?{icon:e8.A,text:"Backup code",key:"backup_code"}:null).filter(e=>null!==e),[t]);return(0,i.FD)(i.FK,{children:[t.length>0&&(0,i.Y)(F.r.Closed,{value:"multi-factor",children:(0,i.Y)(D.rd.ActionMenu,{id:"mfa",triggerLocalizationKey:(0,h.G)("userProfile.start.mfaSection.primaryButton"),onClick:l,children:s.map(e=>e&&(0,i.Y)(D.rd.ActionMenuItem,{id:e.key,localizationKey:e.text,leftIcon:e.icon,onClick:()=>{a(e.key),r("multi-factor")}},e.key))})}),(0,i.Y)(F.r.Open,{value:"multi-factor",children:(0,i.Y)(F.r.Card,{children:o&&(0,i.Y)(r$,{selectedStrategy:o})})})]})},rz=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(N,{onSuccess:r,onReset:r,...e})},rT=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(rE,{onSuccess:r,onReset:r,passkey:e.passkey})},rE=(0,l.dm)(e=>{let{onSuccess:r,onReset:t,passkey:n}=e,o=(0,l.f0)(),a=(0,ed.tJ)("passkeyName",n.name||"",{type:"text",label:(0,h.G)("formFieldLabel__passkeyName"),isRequired:!0}),s=a.value.length>1&&n.name!==a.value,c=async e=>(e.preventDefault(),n.update({name:a.value}).then(r).catch(e=>(0,G.H4)(e,[a],o.setError)));return(0,i.Y)(ec.M,{headerTitle:(0,h.G)("userProfile.passkeyScreen.title__rename"),headerSubtitle:(0,h.G)("userProfile.passkeyScreen.subtitle__rename"),children:(0,i.FD)(ea.l.Root,{onSubmit:c,children:[(0,i.Y)(ea.l.ControlRow,{elementId:a.id,children:(0,i.Y)(ea.l.PlainInput,{...a.props,autoComplete:"off"})}),(0,i.Y)(es.G,{submitLabel:(0,h.G)("userProfile.formButtonPrimary__save"),isDisabled:!s,onReset:t})]})})}),rL=()=>{let{user:e}=(0,v.Jd)(),[r,t]=(0,n.useState)(null);return e?(0,i.Y)(D.rd.Root,{title:(0,h.G)("userProfile.start.passkeysSection.title"),centered:!1,id:"passkeys",children:(0,i.Y)(F.r.Root,{value:r,onChange:t,children:(0,i.FD)(D.rd.ItemList,{id:"passkeys",children:[e.passkeys.map(e=>{let r=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.Y)(rO,{...e},r),(0,i.Y)(F.r.Open,{value:`remove-${r}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(rz,{passkey:e})})}),(0,i.Y)(F.r.Open,{value:`rename-${r}`,children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(rT,{passkey:e})})})]},r)}),(0,i.Y)(rN,{onClick:()=>t(null)})]})})}):null},rO=e=>(0,i.FD)(D.rd.Item,{id:"passkeys",hoverable:!0,sx:{alignItems:"flex-start"},children:[(0,i.Y)(rK,{...e}),(0,i.Y)(rM,{passkey:e})]}),rK=e=>{let{name:r,createdAt:t,lastUsedAt:n}=e,{t:l}=(0,eS._)();return(0,i.Y)(y.so,{sx:e=>({width:"100%",overflow:"hidden",gap:e.space.$4,[eb.g.sm]:{gap:e.space.$2}}),children:(0,i.FD)(y.fv,{align:"start",gap:1,children:[(0,i.Y)(y.EY,{children:r}),(0,i.FD)(y.EY,{colorScheme:"secondary",children:["Created: ",l((0,eB.T)(t))]}),n&&(0,i.FD)(y.EY,{colorScheme:"secondary",children:["Last used: ",l((0,eB.T)(n))]})]})})},rM=({passkey:e})=>{let{open:r}=(0,$.D5)(),t=e.id,n=[{label:(0,h.G)("userProfile.start.passkeysSection.menuAction__rename"),onClick:()=>r(`rename-${t}`)},{label:(0,h.G)("userProfile.start.passkeysSection.menuAction__destructive"),isDestructive:!0,onClick:()=>r(`remove-${t}`)}];return(0,i.Y)(R.o,{actions:n})},rN=({onClick:e})=>{let r=(0,l.f0)(),{isSatellite:t}=(0,v.ho)(),{user:n}=(0,v.Jd)(),o=(0,v.Wp)(()=>n?.createPasskey()),a=async()=>{if(e?.(),n)try{await o()}catch(e){(0,G.H4)(e,[],r.setError)}};return t?null:(0,i.Y)(D.rd.ArrowButton,{id:"passkeys",localizationKey:(0,h.G)("userProfile.start.passkeysSection.primaryButton"),onClick:a})};var rB=t(3990),rW=t(8282);let rJ=(0,l.dm)(e=>{let{t:r,locale:t}=(0,eS._)(),{onSuccess:o,onReset:a}=e,{user:s}=(0,v.Jd)(),c=(0,v.Wp)((e,r)=>e.updatePassword(...r));if(!s)return null;let{userSettings:{passwordSettings:d},authConfig:{reverification:u}}=(0,Y.O)(),{session:m}=(0,v.wV)(),f=s.passwordEnabled?(0,h.G)("userProfile.passwordPage.title__update"):(0,h.G)("userProfile.passwordPage.title__set"),p=(0,l.f0)(),g=s.enterpriseAccounts.some(e=>e.active),P=s.passwordEnabled&&!u,b=(0,n.useRef)({title:(0,h.G)("userProfile.passwordPage.title__set")}),y=(0,ed.tJ)("currentPassword","",{type:"password",label:(0,h.G)("formFieldLabel__currentPassword"),isRequired:!0}),S=(0,ed.tJ)("newPassword","",{type:"password",label:(0,h.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,rB.C5)(e,{t:r,locale:t,passwordSettings:d})}),_=(0,ed.tJ)("confirmPassword","",{type:"password",label:(0,h.G)("formFieldLabel__confirmPassword"),isRequired:!0}),D=(0,ed.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,h.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:R,isPasswordMatch:C}=(0,rW.Z)({passwordField:S,confirmPasswordField:_}),F=(P?y.value&&C:C)&&S.value&&_.value,$=async()=>{if(F)try{var e,r;let t;b.current={title:s.passwordEnabled?(0,h.G)("userProfile.passwordPage.title__update"):(0,h.G)("userProfile.passwordPage.title__set"),text:(e=s.passwordEnabled,r=!!D.checked,t=[],e?t.push((0,h.G)("userProfile.passwordPage.successMessage__update")):t.push((0,h.G)("userProfile.passwordPage.successMessage__set")),r&&t.push((0,h.G)("userProfile.passwordPage.successMessage__signOutOfOtherSessions")),t)};let i={newPassword:S.value,signOutOfOtherSessions:D.checked,currentPassword:P?y.value:void 0};await c(s,[i]),o()}catch(e){(0,G.H4)(e,[y,S,_],p.setError)}};return(0,i.FD)(ec.M,{headerTitle:f,children:[g&&(0,i.Y)(eC.k,{message:(0,h.G)("userProfile.passwordPage.readonly")}),(0,i.FD)(ea.l.Root,{onSubmit:$,onBlur:()=>{S.value&&R(_.value)},children:[(0,i.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:m?.publicUserData.identifier||"",style:{display:"none"}}),P&&(0,i.Y)(ea.l.ControlRow,{elementId:y.id,children:(0,i.Y)(ea.l.PasswordInput,{...y.props,minLength:6,isRequired:!0,autoFocus:!0,isDisabled:g})}),(0,i.Y)(ea.l.ControlRow,{elementId:S.id,children:(0,i.Y)(ea.l.PasswordInput,{...S.props,minLength:6,isRequired:!0,autoFocus:!s.passwordEnabled,isDisabled:g})}),(0,i.Y)(ea.l.ControlRow,{elementId:_.id,children:(0,i.Y)(ea.l.PasswordInput,{..._.props,onChange:e=>(e.target.value&&R(e.target.value),_.props.onChange(e)),isRequired:!0,isDisabled:g})}),(0,i.Y)(ea.l.ControlRow,{elementId:D.id,children:(0,i.Y)(ea.l.Checkbox,{...D.props,description:(0,h.G)("userProfile.passwordPage.checkboxInfoText__signOutOfOtherSessions"),isDisabled:g})}),g?(0,i.Y)(es.c,{children:(0,i.Y)(ea.l.ResetButton,{localizationKey:(0,h.G)("userProfile.formButtonReset"),block:!1,onClick:a})}):(0,i.Y)(es.G,{isDisabled:!F,onReset:a})]})]})}),rq=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(rJ,{onSuccess:e,onReset:e})},rU=()=>{let{user:e}=(0,v.Jd)();if(!e)return null;let{passwordEnabled:r}=e;return(0,i.Y)(D.rd.Root,{centered:!1,title:(0,h.G)("userProfile.start.passwordSection.title"),id:"password",children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"password",sx:e=>({paddingLeft:r?void 0:"0",paddingTop:e.space.$0x25,paddingBottom:e.space.$0x25}),children:[r&&(0,i.Y)(y.EY,{variant:"h2",children:"••••••••••"}),(0,i.Y)(F.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"password",localizationKey:r?(0,h.G)("userProfile.start.passwordSection.primaryButton__updatePassword"):(0,h.G)("userProfile.start.passwordSection.primaryButton__setPassword")})})]})}),(0,i.Y)(F.r.Open,{value:"edit",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(rq,{})})})]})})},rj=(0,l.dm)(()=>{let{attributes:e,instanceIsPasswordBased:r}=(0,Y.O)().userSettings,t=(0,l.f0)(),{user:n}=(0,v.Jd)(),{shouldAllowIdentificationCreation:o}=(0,d.B)(),a=e.passkey?.enabled&&o,s=V(e).length>0,c=n?.deleteSelfEnabled;return(0,i.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8}),children:(0,i.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("security"),children:[(0,i.Y)(b.Y.Root,{children:(0,i.Y)(b.Y.Title,{localizationKey:(0,h.G)("userProfile.start.headerTitle__security"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,i.Y)(P.Z.Alert,{children:t.error}),r&&(0,i.Y)(rU,{}),a&&(0,i.Y)(rL,{}),s&&(0,i.Y)(rw,{}),(0,i.Y)(ej,{}),c&&(0,i.Y)(e5,{})]})})}),rV=(0,n.lazy)(()=>Promise.all([t.e("666"),t.e("207"),t.e("259")]).then(t.bind(t,1608)).then(e=>({default:e.BillingPage}))),rH=(0,n.lazy)(()=>Promise.all([t.e("666"),t.e("326"),t.e("817")]).then(t.bind(t,8201)).then(e=>({default:e.APIKeysPage}))),rZ=(0,n.lazy)(()=>Promise.all([t.e("666"),t.e("970"),t.e("110")]).then(t.bind(t,7437)).then(e=>({default:e.PlansPage}))),rX=(0,n.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("627")]).then(t.bind(t,1666)).then(e=>({default:e.StatementPage}))),rQ=(0,n.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("122")]).then(t.bind(t,4856)).then(e=>({default:e.PaymentAttemptPage}))),r0=()=>{let{pages:e,shouldShowBilling:r,apiKeysProps:t}=(0,d.B)(),{apiKeysSettings:l,commerceSettings:o}=(0,Y.O)(),a=e.routes[0].id===s.j2.ACCOUNT,c=e.routes[0].id===s.j2.SECURITY,u=e.routes[0].id===s.j2.BILLING,h=e.routes[0].id===s.j2.API_KEYS,p=e.contents?.map((e,r)=>{let t=!a&&!c&&0===r;return(0,i.Y)(f.q,{index:t,path:t?void 0:e.url,children:(0,i.Y)(g.H,{mount:e.mount,unmount:e.unmount})},`custom-page-${e.url}`)});return(0,i.FD)(m.d,{children:[p,(0,i.FD)(f.q,{children:[(0,i.Y)(f.q,{path:a?void 0:"account",children:(0,i.Y)(m.d,{children:(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(eM,{})})})}),(0,i.Y)(f.q,{path:c?void 0:"security",children:(0,i.Y)(m.d,{children:(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(rj,{})})})}),o.billing.user.enabled&&r?(0,i.Y)(f.q,{path:u?void 0:"billing",children:(0,i.FD)(m.d,{children:[(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rV,{})})}),o.billing.user.hasPaidPlans?(0,i.Y)(f.q,{path:"plans",children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rZ,{})})}):null,(0,i.Y)(f.q,{path:"statement/:statementId",children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rX,{})})}),(0,i.Y)(f.q,{path:"payment-attempt/:paymentAttemptId",children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rQ,{})})})]})}):null,l.user_api_keys_enabled&&!t?.hide&&(0,i.Y)(f.q,{path:h?void 0:"api-keys",children:(0,i.Y)(m.d,{children:(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rH,{})})})})})]})]})};var r1=t(393);let r2=(0,c.G)(()=>{let e=n.useRef(null);return(0,i.Y)(a.a.Root,{children:(0,i.FD)(p,{contentRef:e,children:[(0,i.Y)(o.oT,{navbarTitleLocalizationKey:(0,h.G)("userProfile.navbar.title")}),(0,i.Y)(a.a.Content,{contentRef:e,scrollBoxId:s.AG,children:(0,i.Y)(r0,{})})]})})}),r5=(0,l.dm)(e=>(0,i.Y)(u.n.Root,{flow:"userProfile",children:(0,i.Y)(u.n.Part,{children:(0,i.FD)(m.d,{children:[(0,i.Y)(f.q,{path:"verify",children:(0,i.Y)(r1.G,{})}),(0,i.Y)(f.q,{children:(0,i.Y)(r2,{})})]})})})),r4=e=>{let r={...e,routing:"virtual",componentName:"UserProfile",mode:"modal"};return(0,i.Y)(f.q,{path:"user",children:(0,i.Y)(d.M.Provider,{value:r,children:(0,i.Y)("div",{children:(0,i.Y)(r5,{...r})})})})}},9599:function(e,r,t){t.d(r,{g:()=>l});var i=t(5543),n=t(4964);let l=()=>{let{navigate:e}=(0,n.r)(),r=(0,i.ho)();return{navigateAfterSignOut:()=>e(r.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(r.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:r.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:r.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
4
+ ${l}`)],{type:"text/plain"});o.href=URL.createObjectURL(a),o.download=`${n}_backup_codes.txt`,document.body.appendChild(o),o.click()},children:(0,i.Y)(y.In,{icon:rt.A})}),(0,i.Y)(y.$n,{variant:"ghost",sx:e=>({width:"100%",padding:`${e.space.$2} 0`,borderRadius:0}),onClick:o,children:(0,i.Y)(y.In,{icon:ri.A})}),(0,i.Y)(y.$n,{variant:"ghost",onClick:s,sx:e=>({width:"100%",padding:`${e.space.$2} 0`,borderRadius:0}),children:(0,i.Y)(y.In,{icon:d?rn.A:rl.A})})]})]}),(0,i.FD)(re.L,{...a,children:[(0,i.FD)(y.DZ,{children:["Your backup codes for ",n," account ",u,":"]}),(0,i.Y)(y.fv,{gap:2,children:t.map((e,r)=>(0,i.Y)(ro,{code:e},r))})]})]}):null},rs=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,{user:l}=(0,v.Jd)(),o=(0,d.f0)(),a=(0,v.Wp)(()=>l?.createBackupCode()),[s,u]=n.useState(void 0);return(n.useEffect(()=>{!s&&l&&a().then(e=>u(e)).catch(e=>{if((0,e7.I3)(e))return t();(0,G.H4)(e,[],o.setError)})},[]),o.error)?(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.backupCodePage.title")}):(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.backupCodePage.title"),children:s?(0,i.FD)(i.FK,{children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.successMessage")}),(0,i.Y)(ra,{subtitle:(0,c.G)("userProfile.backupCodePage.subtitle__codelist"),backupCodes:s.codes}),(0,i.Y)(es.c,{children:(0,i.Y)(y.$n,{autoFocus:!0,onClick:r,localizationKey:(0,c.G)("userProfile.formButtonPrimary__finish"),elementDescriptor:S.$z.formButtonPrimary})})]}):(0,i.Y)(eN.K,{})})}),rc=(0,d.dm)(e=>{let{onSuccess:r,onReset:t}=e,n=(0,eu.X)();return(0,i.FD)(eu.s,{...n.props,children:[(0,i.Y)(rd,{onContinue:n.nextStep}),(0,i.Y)(rs,{onSuccess:r,onReset:t})]})}),rd=e=>{let{onContinue:r}=e,{close:t}=(0,$.D5)();return(0,i.FD)(ec.M,{headerTitle:(0,c.G)("userProfile.backupCodePage.title"),children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.infoText1")}),(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.backupCodePage.infoText2")}),(0,i.FD)(es.c,{sx:{marginTop:0},children:[(0,i.Y)(y.$n,{textVariant:"buttonSmall",onClick:r,localizationKey:(0,c.G)("userProfile.formButtonPrimary__finish"),elementDescriptor:S.$z.formButtonPrimary}),(0,i.Y)(y.$n,{variant:"ghost",onClick:t,localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})]})]})};var ru=t(155),rh=t(6370),rm=t(9679);let rf=(0,d.dm)(e=>{let{onReset:r,onSuccess:t}=e,l=n.useRef(),o=(0,eu.X)({defaultStep:2}),a=(0,Y.O)().userSettings.attributes.backup_code?.enabled;return(0,i.FD)(eu.s,{...o.props,children:[(0,i.Y)(ef,{title:(0,c.G)("userProfile.phoneNumberPage.title"),resourceRef:l,onSuccess:o.nextStep,onUseExistingNumberClick:()=>o.goToStep(2),onReset:r}),(0,i.Y)(rg,{title:(0,c.G)("userProfile.mfaPhoneCodePage.title"),resourceRef:l,onSuccess:()=>a?o.goToStep(3):t(),onReset:()=>o.goToStep(2)}),(0,i.Y)(rY,{onSuccess:a?o.nextStep:t,onReset:r,onAddPhoneClick:()=>o.goToStep(0),onUnverifiedPhoneClick:e=>{l.current=e,o.goToStep(1)},title:(0,c.G)("userProfile.mfaPhoneCodePage.title"),resourceRef:l}),a&&(0,i.Y)(rh.B,{title:(0,c.G)("userProfile.mfaPhoneCodePage.successTitle"),text:l.current?.backupCodes&&l.current?.backupCodes.length>0?[(0,c.G)("userProfile.mfaPhoneCodePage.successMessage1"),(0,c.G)("userProfile.mfaPhoneCodePage.successMessage2")]:[(0,c.G)("userProfile.mfaPhoneCodePage.successMessage1")],onFinish:r,contents:(0,i.Y)(ra,{backupCodes:l.current?.backupCodes})})]})}),rp=e=>{let{phone:r,onSuccess:t,onUnverifiedPhoneClick:n,resourceRef:l}=e,o=(0,d.f0)(),a=(0,v.Wp)(()=>r.setReservedForSecondFactor({reserved:!0})),{country:s}=(0,eo.Mz)(r.phoneNumber),c=(0,eo.Om)(r.phoneNumber),u=async()=>{if("verified"!==r.verification.status)return n(r);o.setLoading(r.id);try{await a(),l.current=r,t()}catch(e){(0,G.H4)(e,[],o.setError)}finally{o.setIdle()}};return(0,i.FD)(y.$n,{variant:"outline",colorScheme:"neutral",sx:{justifyContent:"start"},onClick:u,isLoading:o.loadingMetadata===r.id,isDisabled:o.isLoading,children:[s.iso.toUpperCase()," ",c]},r.id)},rg=e=>{let{title:r,onSuccess:t,resourceRef:n,onReset:l}=e,o=(0,d.f0)(),a=n.current,s=(0,v.Wp)(()=>a?.setReservedForSecondFactor({reserved:!0})),u=async()=>{o.setLoading(a?.id);try{await s(),n.current=a,t()}catch(e){(0,G.H4)(e,[],o.setError)}finally{o.setIdle()}};return(0,i.Y)(ec.M,{headerTitle:r,headerSubtitle:(0,c.G)("userProfile.phoneNumberPage.verifySubtitle",{identifier:n.current?.phoneNumber||""}),children:(0,i.Y)(eh.j,{nextStep:()=>{u()},identification:n.current,identifier:n.current?.phoneNumber,prepareVerification:n.current?.prepareVerification,onReset:l})})},rY=e=>{let{onSuccess:r,onReset:t,title:n,onAddPhoneClick:l,onUnverifiedPhoneClick:o,resourceRef:a}=e,{user:s}=(0,v.Jd)();if(!s)return null;let d=s.phoneNumbers.filter(e=>!e.reservedForSecondFactor);return(0,i.FD)(ec.M,{headerTitle:n,gap:1,children:[(0,i.Y)(y.EY,{localizationKey:(0,c.G)(d.length?"userProfile.mfaPhoneCodePage.subtitle__availablePhoneNumbers":"userProfile.mfaPhoneCodePage.subtitle__unavailablePhoneNumbers"),colorScheme:"secondary"}),d.length>0&&(0,i.Y)(y.fv,{gap:2,children:d.map(e=>(0,i.Y)(rp,{onSuccess:r,phone:e,onUnverifiedPhoneClick:o,resourceRef:a},e.id))}),(0,i.FD)(es.c,{sx:{flexDirection:"row",justifyContent:"space-between"},children:[(0,i.Y)(ru.K,{variant:"ghost","aria-label":"Add phone number",icon:(0,i.Y)(y.In,{icon:rm.A,sx:e=>({marginRight:e.space.$2})}),localizationKey:(0,c.G)("userProfile.mfaPhoneCodePage.primaryButton__addPhoneNumber"),onClick:l}),(0,i.Y)(y.$n,{variant:"ghost",localizationKey:(0,c.G)("userProfile.formButtonReset"),onClick:t})]})]})};var rv=t(5559),rP=t(2094);let rb=(0,d.dm)(e=>{let{title:r,onSuccess:t,onReset:l}=e,{user:o}=(0,v.Jd)(),a=(0,d.f0)(),s=(0,v.Wp)(()=>o?.createTOTP()),{close:u}=(0,$.D5)(),[h,m]=n.useState(void 0),[f,p]=n.useState("qr");return(n.useEffect(()=>{o&&s().then(e=>m(e)).catch(e=>(0,e7.Cm)(e)&&"reverification_cancelled"===e.code?u():(0,G.H4)(e,[],a.setError))},[]),a.error)?(0,i.Y)(ec.M,{headerTitle:r}):(0,i.FD)(ec.M,{headerTitle:r,headerSubtitle:"qr"==f?(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.infoText__ableToScan"):(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.infoText__unableToScan"),children:[!h&&(0,i.Y)(eN.K,{}),h&&(0,i.FD)(i.FK,{children:[(0,i.FD)(y.fv,{gap:4,children:["qr"==f&&(0,i.Y)(rP.r,{justify:"center",url:h.uri||""}),"uri"==f&&(0,i.FD)(i.FK,{children:[(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.inputLabel__unableToScan1")}),(0,i.Y)(rv.r,{value:h.secret}),(0,i.Y)(y.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.inputLabel__unableToScan2")}),(0,i.Y)(rv.r,{value:h.uri})]})]}),(0,i.FD)(y.so,{justify:"between",align:"center",sx:{width:"100%"},children:["qr"==f&&(0,i.Y)(y.$n,{variant:"link",textVariant:"buttonLarge",onClick:()=>p("uri"),localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.buttonUnableToScan__nonPrimary")}),"uri"==f&&(0,i.Y)(y.$n,{variant:"link",textVariant:"buttonLarge",onClick:()=>p("qr"),localizationKey:(0,c.G)("userProfile.mfaTOTPPage.authenticatorApp.buttonAbleToScan__nonPrimary")}),(0,i.FD)(es.c,{children:[(0,i.Y)(y.$n,{onClick:t,localizationKey:(0,c.G)("userProfile.formButtonPrimary__continue"),elementDescriptor:S.$z.formButtonPrimary}),(0,i.Y)(y.$n,{variant:"ghost",onClick:l,localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})]})]})]})]})});var ry=t(3356);let rS=(0,d.dm)(e=>{let{onSuccess:r,onReset:t,resourceRef:n}=e,{user:l}=(0,v.Jd)(),o=(0,ry.xM)({onCodeEntryFinished:(e,r,t)=>{l?.verifyTOTP({code:e}).then(e=>r(e)).catch(t)},onResolve:e=>{n.current=e,r()}});return(0,i.FD)(ec.M,{headerTitle:(0,c.G)("userProfile.mfaTOTPPage.title"),children:[(0,i.Y)(y.fv,{children:(0,i.Y)(ea.l.OTPInput,{...o,label:(0,c.G)("userProfile.mfaTOTPPage.verifyTitle"),description:(0,c.G)("userProfile.mfaTOTPPage.verifySubtitle")})}),(0,i.Y)(es.c,{sx:{marginTop:0},children:(0,i.Y)(y.$n,{onClick:t,variant:"ghost",isDisabled:o.isLoading,localizationKey:(0,c.G)("userProfile.formButtonReset"),elementDescriptor:S.$z.formButtonReset})})]})}),r_=(0,d.dm)(e=>{let{onReset:r}=e,t=(0,eu.X)(),l=n.useRef();return(0,i.FD)(eu.s,{...t.props,children:[(0,i.Y)(rb,{title:(0,c.G)("userProfile.mfaTOTPPage.title"),onSuccess:t.nextStep,onReset:r}),(0,i.Y)(rS,{onSuccess:t.nextStep,onReset:r,resourceRef:l}),(0,i.Y)(rh.B,{title:(0,c.G)("userProfile.mfaTOTPPage.title"),text:(0,c.G)("userProfile.mfaTOTPPage.successMessage"),onFinish:r,contents:(0,i.Y)(ra,{subtitle:(0,c.G)("userProfile.backupCodePage.successSubtitle"),backupCodes:l.current?.backupCodes})})]})}),rD=(0,d.dm)(e=>{let{onSuccess:r,onReset:t,selectedStrategy:l}=e,o=(0,d.f0)(),{userSettings:{attributes:a}}=(0,Y.O)(),{user:s}=(0,v.Jd)();if(!s)return null;let u=(0,c.G)("userProfile.mfaPage.title"),h=n.useMemo(()=>H(a,s),[]);return(n.useEffect(()=>{0===h.length&&o.setError("There are no second factors available to add")},[]),o.error)?(0,i.Y)(ec.M,{headerTitle:u}):0!==h.length||l?(0,i.Y)(rR,{onSuccess:r,onReset:t,method:l||h[0]}):null}),rR=e=>{let{method:r,onSuccess:t,onReset:n}=e;switch(r){case"phone_code":return(0,i.Y)(rf,{onSuccess:t,onReset:n});case"totp":return(0,i.Y)(r_,{onSuccess:t,onReset:n});case"backup_code":return(0,i.Y)(rc,{onSuccess:t,onReset:n});default:return null}},rG=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(M,{onSuccess:e,onReset:e})},rC=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(K,{onSuccess:r,onReset:r,...e})},rF=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(rs,{onSuccess:e,onReset:e})},r$=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(rD,{onSuccess:r,onReset:r,selectedStrategy:e.selectedStrategy})},rw=()=>{let{userSettings:{attributes:e}}=(0,Y.O)(),{user:r}=(0,v.Jd)(),[t,l]=(0,n.useState)(null);if(!r)return null;let o=V(e),a=H(e,r),s=o.includes("totp")&&r.totpEnabled,d=o.includes("backup_code")&&r.backupCodeEnabled,u=r.phoneNumbers.filter(e=>"verified"===e.verification.status).filter(e=>e.reservedForSecondFactor).sort(j);return(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.mfaSection.title"),centered:!1,id:"mfa",children:(0,i.Y)(F.r.Root,{value:t,onChange:l,children:(0,i.FD)(D.rd.ItemList,{id:"mfa",children:[s&&(0,i.FD)(i.FK,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e3.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.start.mfaSection.totp.headerTitle")}),(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__default")})]}),(0,i.Y)(rk,{})]}),(0,i.Y)(F.r.Open,{value:"remove-totp",children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(rG,{})})})]}),o.includes("phone_code")&&u.map(e=>{let r=!s&&e.defaultSecondFactor,t=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e6.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.FD)(y.EY,{children:["SMS Code ",(0,i.Y)(e4.R,{value:e.phoneNumber})]}),r&&(0,i.Y)(y.Ex,{localizationKey:(0,c.G)("badge__default")})]}),(0,i.Y)(rx,{phone:e,showTOTP:s})]}),(0,i.Y)(F.r.Open,{value:`remove-${t}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(rC,{phoneId:t})})})]},t)}),d&&(0,i.FD)(i.FK,{children:[(0,i.FD)(D.rd.Item,{id:"mfa",hoverable:!0,children:[(0,i.FD)(y.so,{sx:e=>({gap:e.space.$2,alignItems:"center"}),children:[(0,i.Y)(y.In,{icon:e8.A,sx:e=>({color:e.colors.$neutralAlpha700})}),(0,i.Y)(y.EY,{localizationKey:(0,c.G)("userProfile.start.mfaSection.backupCodes.headerTitle")})]}),(0,i.Y)(rI,{})]}),(0,i.Y)(F.r.Open,{value:"regenerate",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(rF,{})})})]}),(0,i.Y)(rA,{secondFactorsAvailableToAdd:a,onClick:()=>l(null)})]})})})},rx=({phone:e,showTOTP:r})=>{let{open:t}=(0,$.D5)(),n=(0,d.f0)(),l=e.id,o=[!r&&!e.defaultSecondFactor?{label:(0,c.G)("userProfile.start.mfaSection.phoneCode.actionLabel__setDefault"),onClick:()=>e.makeDefaultSecondFactor().catch(e=>(0,G.H4)(e,[],n.setError))}:null,{label:(0,c.G)("userProfile.start.mfaSection.phoneCode.destructiveActionLabel"),isDestructive:!0,onClick:()=>t(`remove-${l}`)}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:o})},rI=()=>{let{open:e}=(0,$.D5)(),r=[{label:(0,c.G)("userProfile.start.mfaSection.backupCodes.actionLabel__regenerate"),onClick:()=>e("regenerate")}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})},rk=()=>{let{open:e}=(0,$.D5)(),r=[{label:(0,c.G)("userProfile.start.mfaSection.totp.destructiveActionTitle"),isDestructive:!0,onClick:()=>e("remove-totp")}].filter(e=>null!==e);return(0,i.Y)(R.o,{actions:r})},rA=e=>{let{open:r}=(0,$.D5)(),{secondFactorsAvailableToAdd:t,onClick:l}=e,[o,a]=(0,n.useState)(),s=n.useMemo(()=>t.map(e=>"phone_code"===e?{icon:e6.A,text:"SMS code",key:"phone_code"}:"totp"===e?{icon:e3.A,text:"Authenticator application",key:"totp"}:"backup_code"===e?{icon:e8.A,text:"Backup code",key:"backup_code"}:null).filter(e=>null!==e),[t]);return(0,i.FD)(i.FK,{children:[t.length>0&&(0,i.Y)(F.r.Closed,{value:"multi-factor",children:(0,i.Y)(D.rd.ActionMenu,{id:"mfa",triggerLocalizationKey:(0,c.G)("userProfile.start.mfaSection.primaryButton"),onClick:l,children:s.map(e=>e&&(0,i.Y)(D.rd.ActionMenuItem,{id:e.key,localizationKey:e.text,leftIcon:e.icon,onClick:()=>{a(e.key),r("multi-factor")}},e.key))})}),(0,i.Y)(F.r.Open,{value:"multi-factor",children:(0,i.Y)(F.r.Card,{children:o&&(0,i.Y)(r$,{selectedStrategy:o})})})]})},rz=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(N,{onSuccess:r,onReset:r,...e})},rT=e=>{let{close:r}=(0,$.D5)();return(0,i.Y)(rE,{onSuccess:r,onReset:r,passkey:e.passkey})},rE=(0,d.dm)(e=>{let{onSuccess:r,onReset:t,passkey:n}=e,l=(0,d.f0)(),o=(0,ed.tJ)("passkeyName",n.name||"",{type:"text",label:(0,c.G)("formFieldLabel__passkeyName"),isRequired:!0}),a=o.value.length>1&&n.name!==o.value,s=async e=>(e.preventDefault(),n.update({name:o.value}).then(r).catch(e=>(0,G.H4)(e,[o],l.setError)));return(0,i.Y)(ec.M,{headerTitle:(0,c.G)("userProfile.passkeyScreen.title__rename"),headerSubtitle:(0,c.G)("userProfile.passkeyScreen.subtitle__rename"),children:(0,i.FD)(ea.l.Root,{onSubmit:s,children:[(0,i.Y)(ea.l.ControlRow,{elementId:o.id,children:(0,i.Y)(ea.l.PlainInput,{...o.props,autoComplete:"off"})}),(0,i.Y)(es.G,{submitLabel:(0,c.G)("userProfile.formButtonPrimary__save"),isDisabled:!a,onReset:t})]})})}),rL=()=>{let{user:e}=(0,v.Jd)(),[r,t]=(0,n.useState)(null);return e?(0,i.Y)(D.rd.Root,{title:(0,c.G)("userProfile.start.passkeysSection.title"),centered:!1,id:"passkeys",children:(0,i.Y)(F.r.Root,{value:r,onChange:t,children:(0,i.FD)(D.rd.ItemList,{id:"passkeys",children:[e.passkeys.map(e=>{let r=e.id;return(0,i.FD)(n.Fragment,{children:[(0,i.Y)(rO,{...e},r),(0,i.Y)(F.r.Open,{value:`remove-${r}`,children:(0,i.Y)(F.r.Card,{variant:"destructive",children:(0,i.Y)(rz,{passkey:e})})}),(0,i.Y)(F.r.Open,{value:`rename-${r}`,children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(rT,{passkey:e})})})]},r)}),(0,i.Y)(rN,{onClick:()=>t(null)})]})})}):null},rO=e=>(0,i.FD)(D.rd.Item,{id:"passkeys",hoverable:!0,sx:{alignItems:"flex-start"},children:[(0,i.Y)(rK,{...e}),(0,i.Y)(rM,{passkey:e})]}),rK=e=>{let{name:r,createdAt:t,lastUsedAt:n}=e,{t:l}=(0,eS._)();return(0,i.Y)(y.so,{sx:e=>({width:"100%",overflow:"hidden",gap:e.space.$4,[eb.g.sm]:{gap:e.space.$2}}),children:(0,i.FD)(y.fv,{align:"start",gap:1,children:[(0,i.Y)(y.EY,{children:r}),(0,i.FD)(y.EY,{colorScheme:"secondary",children:["Created: ",l((0,eB.T)(t))]}),n&&(0,i.FD)(y.EY,{colorScheme:"secondary",children:["Last used: ",l((0,eB.T)(n))]})]})})},rM=({passkey:e})=>{let{open:r}=(0,$.D5)(),t=e.id,n=[{label:(0,c.G)("userProfile.start.passkeysSection.menuAction__rename"),onClick:()=>r(`rename-${t}`)},{label:(0,c.G)("userProfile.start.passkeysSection.menuAction__destructive"),isDestructive:!0,onClick:()=>r(`remove-${t}`)}];return(0,i.Y)(R.o,{actions:n})},rN=({onClick:e})=>{let r=(0,d.f0)(),{isSatellite:t}=(0,v.ho)(),{user:n}=(0,v.Jd)(),l=(0,v.Wp)(()=>n?.createPasskey()),o=async()=>{if(e?.(),n)try{await l()}catch(e){(0,G.H4)(e,[],r.setError)}};return t?null:(0,i.Y)(D.rd.ArrowButton,{id:"passkeys",localizationKey:(0,c.G)("userProfile.start.passkeysSection.primaryButton"),onClick:o})};var rB=t(3990),rW=t(8282);let rJ=(0,d.dm)(e=>{let{t:r,locale:t}=(0,eS._)(),{onSuccess:l,onReset:o}=e,{user:a}=(0,v.Jd)(),s=(0,v.Wp)((e,r)=>e.updatePassword(...r));if(!a)return null;let{userSettings:{passwordSettings:u},authConfig:{reverification:h}}=(0,Y.O)(),{session:m}=(0,v.wV)(),f=a.passwordEnabled?(0,c.G)("userProfile.passwordPage.title__update"):(0,c.G)("userProfile.passwordPage.title__set"),p=(0,d.f0)(),g=a.enterpriseAccounts.some(e=>e.active),P=a.passwordEnabled&&!h,b=(0,n.useRef)({title:(0,c.G)("userProfile.passwordPage.title__set")}),y=(0,ed.tJ)("currentPassword","",{type:"password",label:(0,c.G)("formFieldLabel__currentPassword"),isRequired:!0}),S=(0,ed.tJ)("newPassword","",{type:"password",label:(0,c.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,rB.C5)(e,{t:r,locale:t,passwordSettings:u})}),_=(0,ed.tJ)("confirmPassword","",{type:"password",label:(0,c.G)("formFieldLabel__confirmPassword"),isRequired:!0}),D=(0,ed.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,c.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:R,isPasswordMatch:C}=(0,rW.Z)({passwordField:S,confirmPasswordField:_}),F=(P?y.value&&C:C)&&S.value&&_.value,$=async()=>{if(F)try{var e,r;let t;b.current={title:a.passwordEnabled?(0,c.G)("userProfile.passwordPage.title__update"):(0,c.G)("userProfile.passwordPage.title__set"),text:(e=a.passwordEnabled,r=!!D.checked,t=[],e?t.push((0,c.G)("userProfile.passwordPage.successMessage__update")):t.push((0,c.G)("userProfile.passwordPage.successMessage__set")),r&&t.push((0,c.G)("userProfile.passwordPage.successMessage__signOutOfOtherSessions")),t)};let i={newPassword:S.value,signOutOfOtherSessions:D.checked,currentPassword:P?y.value:void 0};await s(a,[i]),l()}catch(e){(0,G.H4)(e,[y,S,_],p.setError)}};return(0,i.FD)(ec.M,{headerTitle:f,children:[g&&(0,i.Y)(eC.k,{message:(0,c.G)("userProfile.passwordPage.readonly")}),(0,i.FD)(ea.l.Root,{onSubmit:$,onBlur:()=>{S.value&&R(_.value)},children:[(0,i.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:m?.publicUserData.identifier||"",style:{display:"none"}}),P&&(0,i.Y)(ea.l.ControlRow,{elementId:y.id,children:(0,i.Y)(ea.l.PasswordInput,{...y.props,minLength:6,isRequired:!0,autoFocus:!0,isDisabled:g})}),(0,i.Y)(ea.l.ControlRow,{elementId:S.id,children:(0,i.Y)(ea.l.PasswordInput,{...S.props,minLength:6,isRequired:!0,autoFocus:!a.passwordEnabled,isDisabled:g})}),(0,i.Y)(ea.l.ControlRow,{elementId:_.id,children:(0,i.Y)(ea.l.PasswordInput,{..._.props,onChange:e=>(e.target.value&&R(e.target.value),_.props.onChange(e)),isRequired:!0,isDisabled:g})}),(0,i.Y)(ea.l.ControlRow,{elementId:D.id,children:(0,i.Y)(ea.l.Checkbox,{...D.props,description:(0,c.G)("userProfile.passwordPage.checkboxInfoText__signOutOfOtherSessions"),isDisabled:g})}),g?(0,i.Y)(es.c,{children:(0,i.Y)(ea.l.ResetButton,{localizationKey:(0,c.G)("userProfile.formButtonReset"),block:!1,onClick:o})}):(0,i.Y)(es.G,{isDisabled:!F,onReset:o})]})]})}),rq=()=>{let{close:e}=(0,$.D5)();return(0,i.Y)(rJ,{onSuccess:e,onReset:e})},rU=()=>{let{user:e}=(0,v.Jd)();if(!e)return null;let{passwordEnabled:r}=e;return(0,i.Y)(D.rd.Root,{centered:!1,title:(0,c.G)("userProfile.start.passwordSection.title"),id:"password",children:(0,i.FD)(F.r.Root,{children:[(0,i.Y)(F.r.Closed,{value:"edit",children:(0,i.FD)(D.rd.Item,{id:"password",sx:e=>({paddingLeft:r?void 0:"0",paddingTop:e.space.$0x25,paddingBottom:e.space.$0x25}),children:[r&&(0,i.Y)(y.EY,{variant:"h2",children:"••••••••••"}),(0,i.Y)(F.r.Trigger,{value:"edit",children:(0,i.Y)(D.rd.Button,{id:"password",localizationKey:r?(0,c.G)("userProfile.start.passwordSection.primaryButton__updatePassword"):(0,c.G)("userProfile.start.passwordSection.primaryButton__setPassword")})})]})}),(0,i.Y)(F.r.Open,{value:"edit",children:(0,i.Y)(F.r.Card,{children:(0,i.Y)(rq,{})})})]})})},rj=(0,d.dm)(()=>{let{attributes:e,instanceIsPasswordBased:r}=(0,Y.O)().userSettings,t=(0,d.f0)(),{user:n}=(0,v.Jd)(),{shouldAllowIdentificationCreation:l}=(0,a.B)(),o=e.passkey?.enabled&&l,s=V(e).length>0,u=n?.deleteSelfEnabled;return(0,i.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8}),children:(0,i.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("security"),children:[(0,i.Y)(b.Y.Root,{children:(0,i.Y)(b.Y.Title,{localizationKey:(0,c.G)("userProfile.start.headerTitle__security"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,i.Y)(P.Z.Alert,{children:t.error}),r&&(0,i.Y)(rU,{}),o&&(0,i.Y)(rL,{}),s&&(0,i.Y)(rw,{}),(0,i.Y)(ej,{}),u&&(0,i.Y)(e5,{})]})})}),rV=(0,n.lazy)(()=>Promise.all([t.e("666"),t.e("207"),t.e("259")]).then(t.bind(t,1608)).then(e=>({default:e.BillingPage}))),rH=(0,n.lazy)(()=>Promise.all([t.e("666"),t.e("326"),t.e("817")]).then(t.bind(t,8201)).then(e=>({default:e.APIKeysPage}))),rZ=(0,n.lazy)(()=>Promise.all([t.e("666"),t.e("970"),t.e("110")]).then(t.bind(t,7437)).then(e=>({default:e.PlansPage}))),rX=(0,n.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("627")]).then(t.bind(t,1666)).then(e=>({default:e.StatementPage}))),rQ=(0,n.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("122")]).then(t.bind(t,4856)).then(e=>({default:e.PaymentAttemptPage}))),r0=()=>{let{pages:e,shouldShowBilling:r,apiKeysProps:t}=(0,a.B)(),{apiKeysSettings:o,commerceSettings:s}=(0,Y.O)(),c=e.routes[0].id===l.j2.ACCOUNT,d=e.routes[0].id===l.j2.SECURITY,u=e.routes[0].id===l.j2.BILLING,h=e.routes[0].id===l.j2.API_KEYS,p=e.contents?.map((e,r)=>{let t=!c&&!d&&0===r;return(0,i.Y)(f.q,{index:t,path:t?void 0:e.url,children:(0,i.Y)(g.H,{mount:e.mount,unmount:e.unmount})},`custom-page-${e.url}`)});return(0,i.FD)(m.d,{children:[p,(0,i.FD)(f.q,{children:[(0,i.Y)(f.q,{path:c?void 0:"account",children:(0,i.Y)(m.d,{children:(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(eM,{})})})}),(0,i.Y)(f.q,{path:d?void 0:"security",children:(0,i.Y)(m.d,{children:(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(rj,{})})})}),s.billing.user.enabled&&r?(0,i.Y)(f.q,{path:u?void 0:"billing",children:(0,i.FD)(m.d,{children:[(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rV,{})})}),s.billing.user.hasPaidPlans?(0,i.Y)(f.q,{path:"plans",children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rZ,{})})}):null,(0,i.Y)(f.q,{path:"statement/:statementId",children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rX,{})})}),(0,i.Y)(f.q,{path:"payment-attempt/:paymentAttemptId",children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rQ,{})})})]})}):null,o.user_api_keys_enabled&&!t?.hide&&(0,i.Y)(f.q,{path:h?void 0:"api-keys",children:(0,i.Y)(m.d,{children:(0,i.Y)(f.q,{index:!0,children:(0,i.Y)(n.Suspense,{fallback:"",children:(0,i.Y)(rH,{})})})})})]})]})};var r1=t(393);let r2=()=>(0,i.Y)(s.n.Root,{flow:"userProfile",children:(0,i.Y)(s.n.Part,{children:(0,i.FD)(m.d,{children:[(0,i.Y)(f.q,{path:"verify",children:(0,i.Y)(r1.G,{})}),(0,i.Y)(f.q,{children:(0,i.Y)(r5,{})})]})})}),r5=(0,o.G)(()=>{let e=n.useRef(null);return(0,i.Y)(h.a.Root,{children:(0,i.FD)(p,{contentRef:e,children:[(0,i.Y)(u.oT,{navbarTitleLocalizationKey:(0,c.G)("userProfile.navbar.title")}),(0,i.Y)(h.a.Content,{contentRef:e,scrollBoxId:l.AG,children:(0,i.Y)(r0,{})})]})})}),r4=(0,d.dm)(r2),r3=(0,d.dm)(r2),r6=e=>{let r={...e,routing:"virtual",componentName:"UserProfile",mode:"modal"};return(0,i.Y)(f.q,{path:"user",children:(0,i.Y)(a.M.Provider,{value:r,children:(0,i.Y)("div",{children:(0,i.Y)(r3,{...r})})})})}},9599:function(e,r,t){t.d(r,{g:()=>l});var i=t(1210),n=t(4964);let l=()=>{let{navigate:e}=(0,n.r)(),r=(0,i.ho)();return{navigateAfterSignOut:()=>e(r.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(r.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:r.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:r.buildAfterMultiSessionSingleSignOutUrl()}}}}]);