@clerk/ui 1.0.0-snapshot.v20251218183643 → 1.0.0-snapshot.v20251224145055
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.
- package/dist/207_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/217_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/360_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/444_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/573_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/970_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/ClerkUi.js +2 -2
- package/dist/apiKeys_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/blankcaptcha_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/checkout_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/{checkout_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → checkout_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +1 -1
- package/dist/components/Checkout/CheckoutPage.js +1 -1
- package/dist/components/Checkout/CheckoutPage.js.map +1 -1
- package/dist/components/Checkout/parts.js +1 -1
- package/dist/components/Checkout/parts.js.map +1 -1
- package/dist/components/UserProfile/Web3Form.js +32 -45
- package/dist/components/UserProfile/Web3Form.js.map +1 -1
- package/dist/components/UserProfile/Web3Section.js +6 -3
- package/dist/components/UserProfile/Web3Section.js.map +1 -1
- package/dist/copy-api-key-modal_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/createorganization_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/enableOrganizationsPrompt_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/foundations/defaultFoundations.d.ts +153 -153
- package/dist/framework_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/impersonationfab_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/index.js +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/keylessPrompt_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/lazyModules/components.d.ts +20 -20
- package/dist/oauthConsent_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/onetap_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/op-api-keys-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/op-billing-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/op-plans-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/organizationlist_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/organizationprofile_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/organizationswitcher_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/payment-attempt-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/planDetails_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/prefetchorganizationlist_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/pricingTable_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/revoke-api-key-modal_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/sessionTasks_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/signin_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/signup_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/statement-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/subscriptionDetails_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/taskChooseOrganization_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/taskResetPassword_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/ui-common_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/{ui-common_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → ui-common_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +7 -7
- package/dist/ui.browser.js +1 -1
- package/dist/ui.legacy.browser.js +1 -0
- package/dist/up-api-keys-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/up-billing-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/up-plans-page_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/useravatar_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/userbutton_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/userprofile_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/{userprofile_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → userprofile_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +2 -2
- package/dist/userverification_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/utils/errorHandler.js +1 -7
- package/dist/utils/errorHandler.js.map +1 -1
- package/dist/vendors_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/{vendors_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → vendors_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +1 -1
- package/dist/waitlist_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/web3-solana-wallet-buttons_ui_d60088_1.0.0-snapshot.v20251224145055.js +1 -0
- package/dist/{web3-solana-wallet-buttons_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → web3-solana-wallet-buttons_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +3 -3
- package/package.json +8 -5
- /package/dist/{207_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 207_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{217_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 217_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{360_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 360_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{444_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 444_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{573_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 573_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{970_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → 970_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{apiKeys_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → apiKeys_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{blankcaptcha_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → blankcaptcha_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{copy-api-key-modal_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → copy-api-key-modal_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{createorganization_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → createorganization_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{enableOrganizationsPrompt_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → enableOrganizationsPrompt_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{framework_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → framework_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{impersonationfab_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → impersonationfab_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{keylessPrompt_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → keylessPrompt_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{oauthConsent_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → oauthConsent_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{onetap_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → onetap_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{op-api-keys-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → op-api-keys-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{op-billing-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → op-billing-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{op-plans-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → op-plans-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{organizationlist_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → organizationlist_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{organizationprofile_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → organizationprofile_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{organizationswitcher_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → organizationswitcher_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{payment-attempt-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → payment-attempt-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{planDetails_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → planDetails_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{prefetchorganizationlist_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → prefetchorganizationlist_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{pricingTable_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → pricingTable_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{revoke-api-key-modal_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → revoke-api-key-modal_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{sessionTasks_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → sessionTasks_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{signin_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → signin_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{signup_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → signup_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{statement-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → statement-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{subscriptionDetails_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → subscriptionDetails_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{taskChooseOrganization_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → taskChooseOrganization_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{taskResetPassword_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → taskResetPassword_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{up-api-keys-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → up-api-keys-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{up-billing-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → up-billing-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{up-plans-page_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → up-plans-page_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{useravatar_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → useravatar_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{userbutton_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → userbutton_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{userverification_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → userverification_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
- /package/dist/{waitlist_ui_b31bc8_1.0.0-snapshot.v20251218183643.js → waitlist_ui_fb7cb6_1.0.0-snapshot.v20251224145055.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["310"],{6568:function(e,i,n){n.r(i),n.d(i,{OrganizationProfileModal:()=>e0,OrganizationProfile:()=>eW});var a=n(14518),t=n(21210),o=n(35074),r=n(21227),l=n(46256),d=n(43264),s=n(15892),c=n(44607),u=n(22861),g=n(63269),m=n(9764),p=n(65396),h=n(80212),f=n(42265);n(19161),n(95055);var v=n(57477);let b=e=>{let{organization:i}=(0,t.Z5)(),{apiKeysProps:n,pages:o}=(0,s.V)(),l=(0,v.Fd)(e=>e({permission:"org:sys_memberships:read"})||e({permission:"org:sys_memberships:manage"})),d=(0,v.Fd)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),c=o.routes.filter(e=>e.id!==r.jc.MEMBERS||e.id===r.jc.MEMBERS&&l).filter(e=>e.id!==r.jc.BILLING||e.id===r.jc.BILLING&&d).filter(e=>e.id!==r.jc.API_KEYS||!(null==n?void 0:n.hide));return i?(0,a.FD)(m.XM,{contentRef:e.contentRef,children:[(0,a.Y)(m.jq,{title:(0,u.G)("organizationProfile.navbar.title"),description:(0,u.G)("organizationProfile.navbar.description"),routes:c,contentRef:e.contentRef}),e.children]}):null};n(50036),n(22239);var Y=n(50540),P=n(97697),z=n(76153),D=n(89001),_=n(44003),y=n(18272),S=n(58920),G=n(93453),T=n(92513),x=n(52454),C=n(11475),I=n(23549),F=n(26370),R=n(4468),L=n(8640),$=n(46245),w=n(23689);let k=e=>{let i=(0,g.f0)(),{navigateAfterLeaveOrganization:n}=(0,s.V)(),{userMemberships:a,userInvitations:o}=(0,t.D_)({userMemberships:w.mu.userMemberships,userInvitations:w.mu.userInvitations});return()=>i.runAsync(async()=>{await (null==e?void 0:e())}).then(()=>{var e,i;null==(e=a.revalidate)||e.call(a),null==(i=o.revalidate)||i.call(o),n()})},A=e=>{let{organization:i}=(0,t.Z5)(),{user:n}=(0,t.Jd)(),o=k(()=>n.leaveOrganization(i.id));return i&&n?(0,a.Y)(M,{organizationName:i.name,title:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),messageLine1:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.messageLine1"),messageLine2:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.messageLine2"),actionDescription:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.actionDescription",{organizationName:i.name}),submitLabel:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),successMessage:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.successMessage"),onConfirmation:o,...e}):null},E=e=>{let{organization:i,membership:n}=(0,t.Z5)(),o=k(null==i?void 0:i.destroy);return i&&n?(0,a.Y)(M,{organizationName:i.name,title:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),messageLine1:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.messageLine1"),messageLine2:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.messageLine2"),actionDescription:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.actionDescription",{organizationName:i.name}),submitLabel:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),successMessage:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.successMessage"),onConfirmation:o,...e}):null},M=(0,g.dm)(e=>{let{title:i,messageLine1:n,messageLine2:t,actionDescription:o,organizationName:r,successMessage:l,submitLabel:d,onSuccess:s,onReset:c,onConfirmation:m,colorScheme:p="danger"}=e,h=(0,$.X)(),f=(0,g.f0)(),v=(0,L.tJ)("deleteOrganizationConfirmation","",{type:"text",label:o,isRequired:!0,placeholder:r}),b=!o||v.value===r,Y=async()=>{if(b)try{await m().then(()=>h.nextStep())}catch(e){(0,R.H4)(e,[],f.setError)}};return(0,a.FD)($.s,{...h.props,children:[(0,a.Y)(I.M,{headerTitle:i,gap:1,children:(0,a.FD)(x.l.Root,{onSubmit:Y,children:[(0,a.FD)(y.fv,{children:[(0,a.Y)(y.EY,{localizationKey:n,colorScheme:"secondary"}),(0,a.Y)(y.EY,{localizationKey:t,colorScheme:"danger"})]}),(0,a.Y)(x.l.ControlRow,{elementId:v.id,children:(0,a.Y)(x.l.PlainInput,{...v.props})}),(0,a.FD)(C.c,{children:[(0,a.Y)(x.l.SubmitButton,{block:!1,colorScheme:p,localizationKey:d,isDisabled:!b}),(0,a.Y)(x.l.ResetButton,{localizationKey:(0,u.G)("userProfile.formButtonReset"),block:!1,onClick:c})]})]})}),(0,a.Y)(F.B,{title:i,text:l,onFinish:s})]})});n(88711);var O=n(63356),K=n(67896);n(30945),n(10676);var B=n(84916),q=n(89068);let H=(0,g.dm)(e=>{let{domainId:i,mode:n="edit",onSuccess:r,onReset:l}=e,d=(0,g.f0)(),{organizationSettings:s}=(0,P.O)(),{membership:c,organization:m,domains:p}=(0,t.Z5)({domains:{infinite:!0}}),h="edit"===n,f=(()=>{let e,{organizationSettings:i}=(0,P.O)();return e=[],i.domains.enrollmentModes.includes("manual_invitation")&&e.push({value:"manual_invitation",label:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.manualInvitationOption__label"),description:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.manualInvitationOption__description")}),i.domains.enrollmentModes.includes("automatic_invitation")&&e.push({value:"automatic_invitation",label:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticInvitationOption__label"),description:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticInvitationOption__description")}),i.domains.enrollmentModes.includes("automatic_suggestion")&&e.push({value:"automatic_suggestion",label:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticSuggestionOption__label"),description:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.automaticSuggestionOption__description")}),e})(),v=(0,L.tJ)("enrollmentMode","",{type:"radio",radioOptions:f,isRequired:!0}),b=(0,L.tJ)("deleteExistingInvitationsSuggestions","",{label:(0,u.G)("formFieldLabel__organizationDomainDeletePending"),type:"checkbox"}),{data:Y,isLoading:D}=(0,K.s)(null==m?void 0:m.getDomain,{domainId:i});(0,o.useEffect)(()=>{Y&&v.setValue(Y.enrollmentMode)},[null==Y?void 0:Y.id]);let _=(0,u.G)("organizationProfile.verifiedDomainPage.title",{domain:(null==Y?void 0:Y.name)||""}),G=(0,u.G)("organizationProfile.verifiedDomainPage.subtitle",{domain:(null==Y?void 0:Y.name)||""}),T=((e,i)=>{let{infoLabel:n}=i,a=(null==e?void 0:e.totalPendingInvitations)||0;return 0===((null==e?void 0:e.totalPendingSuggestions)||0)+a?[]:[n,(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutInvitationCountLabel",{count:a}),(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutSuggestionCountLabel",{count:a})]})(Y,{infoLabel:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.calloutInfoLabel")}),F=async()=>{if(Y&&m&&c&&p)try{await Y.updateEnrollmentMode({enrollmentMode:v.value,deletePending:b.checked}),await p.revalidate(),r()}catch(e){(0,R.H4)(e,[v],d.setError)}};return m&&s?D||!Y?(0,a.Y)(y.so,{direction:"row",align:"center",justify:"center",sx:{height:"100%"},children:(0,a.Y)(y.y$,{size:"lg",colorScheme:"primary",elementDescriptor:S.$z.spinner})}):(Y.verification&&"verified"===Y.verification.status||l(),(0,a.Y)(I.M,{headerTitle:_,headerSubtitle:h?void 0:G,gap:4,children:(0,a.FD)(y.fv,{gap:6,children:[T.length>0&&(0,a.Y)(B.D,{icon:q.A,children:T.map((e,i)=>(0,a.Y)(y.EY,{as:"span",sx:{display:"block"},localizationKey:e},i))}),(0,a.Y)(z.Y.Root,{children:(0,a.Y)(z.Y.Subtitle,{localizationKey:(0,u.G)("organizationProfile.verifiedDomainPage.enrollmentTab.subtitle"),variant:"subtitle"})}),(0,a.FD)(x.l.Root,{onSubmit:F,gap:6,children:[(0,a.Y)(x.l.ControlRow,{elementId:v.id,children:(0,a.Y)(x.l.RadioGroup,{...v.props})}),h&&"manual_invitation"===v.value&&(0,a.Y)(x.l.ControlRow,{elementId:b.id,children:(0,a.Y)(x.l.Checkbox,{...b.props})}),(0,a.Y)(C.G,{isDisabled:D||!Y,onReset:l})]})]})})):null}),V=(0,g.dm)(e=>{var i;let{domainId:n,onSuccess:r,onReset:l,skipToVerified:d}=e,s=(0,g.f0)(),{organizationSettings:c}=(0,P.O)(),{organization:m}=(0,t.Z5)(),{data:p,isLoading:h}=(0,K.s)(d||null==m?void 0:m.getDomain,{domainId:n}),f=(0,u.G)("organizationProfile.verifyDomainPage.title"),v=(0,u.G)("organizationProfile.verifyDomainPage.subtitle",{domainName:null!=(i=null==p?void 0:p.name)?i:""}),b=(0,$.X)({defaultStep:2*!!d,onNextStep:()=>s.setError(void 0)}),Y=(0,L.tJ)("affiliationEmailAddress","",{type:"text",label:(0,u.G)("formFieldLabel__organizationDomainEmailAddress"),placeholder:(0,u.G)("formFieldInputPlaceholder__organizationDomainEmailAddress"),infoText:(0,u.G)("formFieldLabel__organizationDomainEmailAddressDescription"),isRequired:!0}),z=(0,o.useRef)(),D=(0,u.G)("organizationProfile.verifyDomainPage.subtitleVerificationCodeScreen",{emailAddress:z.current||""}),_=(0,O.xM)({onCodeEntryFinished:(e,i,n)=>{var a;null==p||null==(a=p.attemptAffiliationVerification)||a.call(p,{code:e}).then(async e=>{var n;await i(),(null==(n=e.verification)?void 0:n.status)==="verified"?b.nextStep():null==r||r()}).catch(e=>n(e))},onResendCodeClicked:()=>{null==p||p.prepareAffiliationVerification({affiliationEmailAddress:Y.value}).catch(e=>{(0,R.H4)(e,[Y],s.setError)})}});if(!m||!c)return null;let G=m.name!==Y.value,T="@".concat(null==p?void 0:p.name);return!h&&p||d?(0,a.FD)($.s,{...b.props,children:[(0,a.Y)(I.M,{headerTitle:f,headerSubtitle:v,children:(0,a.FD)(x.l.Root,{onSubmit:e=>{if(e.preventDefault(),p)return z.current="".concat(Y.value).concat(T),p.prepareAffiliationVerification({affiliationEmailAddress:z.current}).then(b.nextStep).catch(e=>{(0,R.H4)(e,[Y],s.setError)})},children:[(0,a.Y)(x.l.ControlRow,{elementId:Y.id,children:(0,a.Y)(x.l.InputGroup,{...Y.props,autoFocus:!0,groupSuffix:T,ignorePasswordManager:!0})}),(0,a.Y)(C.G,{isDisabled:!G,onReset:l})]})}),(0,a.FD)(I.M,{headerTitle:f,headerSubtitle:D,children:[(0,a.Y)(x.l.OTPInput,{..._,label:(0,u.G)("organizationProfile.verifyDomainPage.formTitle"),description:(0,u.G)("organizationProfile.verifyDomainPage.formSubtitle"),resendButton:(0,u.G)("organizationProfile.verifyDomainPage.resendButton")}),(0,a.Y)(C.c,{children:(0,a.Y)(y.$n,{elementDescriptor:S.$z.formButtonReset,block:!1,variant:"ghost",textVariant:"buttonSmall",type:"reset",isDisabled:_.isLoading||"success"===_.otpControl.otpInputProps.feedbackType,onClick:()=>{_.otpControl.otpInputProps.clearFeedback(),_.otpControl.reset(),b.prevStep()},localizationKey:(0,u.G)("userProfile.formButtonReset")})})]}),(0,a.Y)(H,{domainId:n,mode:"select",onSuccess:r,onReset:l})]}):(0,a.Y)(y.so,{direction:"row",align:"center",justify:"center",children:(0,a.Y)(y.y$,{size:"lg",colorScheme:"primary",elementDescriptor:S.$z.spinner})})}),j=(0,g.dm)(e=>{let{onSuccess:i,onReset:n}=e,{organizationSettings:r}=(0,P.O)(),{domains:l}=(0,t.Z5)({domains:{infinite:!0}}),d=(0,$.X)({onNextStep:()=>v.setError(void 0)}),[s,c]=(0,o.useState)(""),[m,p]=(0,o.useState)(!1),h=(0,u.G)("organizationProfile.createDomainPage.title"),f=(0,u.G)("organizationProfile.createDomainPage.subtitle"),v=(0,g.f0)(),{organization:b}=(0,t.Z5)(),Y=(0,L.tJ)("name","",{type:"text",label:(0,u.G)("formFieldLabel__organizationDomain"),placeholder:(0,u.G)("formFieldInputPlaceholder__organizationDomain")});if(!b||!r)return null;let z=""!==Y.value.trim();return(0,a.FD)($.s,{...d.props,children:[(0,a.Y)(I.M,{headerTitle:h,headerSubtitle:f,children:(0,a.FD)(x.l.Root,{onSubmit:e=>(Y.clearFeedback(),e.preventDefault(),b.createDomain(Y.value).then(async e=>{var i;c(e.id),null==l||null==(i=l.revalidate)||i.call(l),e.verification&&"verified"===e.verification.status&&p(!0),d.nextStep()}).catch(e=>{(0,R.H4)(e,[Y],v.setError)})),children:[(0,a.Y)(x.l.ControlRow,{elementId:Y.id,children:(0,a.Y)(x.l.PlainInput,{...Y.props,autoFocus:!0,ignorePasswordManager:!0,isRequired:!0})}),(0,a.Y)(C.G,{isDisabled:!z,onReset:n})]})}),(0,a.Y)(V,{domainId:s,onSuccess:()=>{var e;null==l||null==(e=l.revalidate)||e.call(l),null==i||i()},skipToVerified:m,onReset:n})]})});var Z=n(48080),N=n(82364);let X={manual_invitation:(0,u.G)("organizationProfile.badge__manualInvitation"),automatic_invitation:(0,u.G)("organizationProfile.badge__automaticInvitation"),automatic_suggestion:(0,u.G)("organizationProfile.badge__automaticSuggestion")},J=e=>{let{organizationDomain:i}=e;return i?i.verification&&"verified"===i.verification.status?(0,a.Y)(y.Ex,{localizationKey:X[i.enrollmentMode],colorScheme:"manual_invitation"===i.enrollmentMode?"primary":"success"}):(0,a.Y)(y.Ex,{localizationKey:(0,u.G)("organizationProfile.badge__unverified"),colorScheme:"warning"}):null};var U=n(88046);let W=e=>{var i;let{organizationSettings:n}=(0,P.O)(),{organization:r}=(0,t.Z5)(),{domainId:l,onSuccess:d,onReset:s}=e,c=o.useRef(),{data:g,isLoading:m}=(0,K.s)(null==r?void 0:r.getDomain,{domainId:l},{onSuccess(e){c.current={...e}}}),{domains:p}=(0,t.Z5)({domains:{infinite:!0}});return r&&n?m||!g?(0,a.Y)(y.so,{direction:"row",align:"center",justify:"center",children:(0,a.Y)(y.y$,{size:"lg",colorScheme:"primary",elementDescriptor:S.$z.spinner})}):(0,a.Y)(U.P,{title:(0,u.G)("organizationProfile.removeDomainPage.title"),messageLine1:(0,u.G)("organizationProfile.removeDomainPage.messageLine1",{domain:(null==(i=c.current)?void 0:i.name)||""}),messageLine2:(0,u.G)("organizationProfile.removeDomainPage.messageLine2"),deleteResource:()=>null==g?void 0:g.delete().then(async()=>{var e;await (null==p||null==(e=p.revalidate)?void 0:e.call(p)),d()}),onSuccess:d,onReset:s}):null},Q=e=>{let{close:i}=(0,T.D5)();return(0,a.Y)(W,{onSuccess:i,onReset:i,...e})},ee=e=>{let{close:i}=(0,T.D5)();return(0,a.Y)(H,{onSuccess:i,onReset:i,...e})},ei=e=>{let{close:i}=(0,T.D5)();return(0,a.Y)(V,{onSuccess:i,onReset:i,skipToVerified:!1,...e})},en=e=>{let{domain:i}=e,n=(e=>{let{open:i}=(0,T.D5)(),n=[];return e.verification&&"verified"===e.verification.status?n.push({label:(0,u.G)("organizationProfile.profilePage.domainSection.menuAction__manage"),onClick:()=>i("manage")}):n.push({label:(0,u.G)("organizationProfile.profilePage.domainSection.menuAction__verify"),onClick:()=>i("verify")}),n.push({label:(0,u.G)("organizationProfile.profilePage.domainSection.menuAction__remove"),isDestructive:!0,onClick:()=>i("remove")}),n})(i);return(0,a.Y)(Z.o,{actions:n})},ea=(0,v.cb)(e=>{let{verificationStatus:i,enrollmentMode:n,fallback:r,...l}=e,{organization:d,domains:s}=(0,t.Z5)({domains:{infinite:!0,...l}}),{ref:c}=(0,N.W)({threshold:0,onChange:e=>{if(e){var i;null==s||null==(i=s.fetchNext)||i.call(s)}}}),u=(0,o.useMemo)(()=>(null==s?void 0:s.data)?s.data.filter(e=>{let a=!0,t=!0;return i&&(a=!!e.verification&&e.verification.status===i),n&&(t=e.enrollmentMode===n),a&&t}):[],[null==s?void 0:s.data]);if(!d)return null;let g=(null==s?void 0:s.hasNextPage)||(null==s?void 0:s.isFetching);return 0!==u.length||(null==s?void 0:s.isLoading)||r?(0,a.FD)(_.rd.ItemList,{id:"organizationDomains",children:[0===u.length&&!(null==s?void 0:s.isLoading)&&r,u.map(e=>(0,a.FD)(G.r.Root,{children:[(0,a.FD)(_.rd.Item,{id:"organizationDomains",hoverable:!0,children:[(0,a.FD)(y.so,{sx:e=>({gap:e.space.$1}),children:[(0,a.Y)(y.EY,{children:e.name}),(0,a.Y)(J,{organizationDomain:e})]}),(0,a.Y)(v.EH,{permission:"org:sys_domains:manage",children:(0,a.Y)(en,{domain:e})})]}),(0,a.Y)(G.r.Open,{value:"remove",children:(0,a.Y)(G.r.Card,{variant:"destructive",children:(0,a.Y)(Q,{domainId:e.id})})}),(0,a.Y)(G.r.Open,{value:"verify",children:(0,a.Y)(G.r.Card,{children:(0,a.Y)(ei,{domainId:e.id})})}),(0,a.Y)(G.r.Open,{value:"manage",children:(0,a.Y)(G.r.Card,{children:(0,a.Y)(ee,{domainId:e.id})})})]},e.id)),(0,a.Y)(y.az,{ref:(null==s?void 0:s.hasNextPage)&&!s.isFetching?c:void 0,sx:{visibility:"hidden"}}),g&&0===s.data.length&&(0,a.Y)(y.az,{sx:[e=>({width:"100%",height:e.space.$10,position:"relative"})],children:(0,a.Y)(y.az,{sx:{display:"flex",margin:"auto",position:"absolute",left:"50%",top:"50%",transform:"translateY(-50%) translateX(-50%)"},children:(0,a.Y)(y.y$,{size:"sm",colorScheme:"primary",elementDescriptor:S.$z.spinner})})})]}):null},{permission:"org:sys_domains:read"});var et=n(80396),eo=n(75377);let er=(0,g.dm)(e=>{let{onSuccess:i,onReset:n}=e,o=(0,u.G)("organizationProfile.profilePage.title"),r=(0,g.f0)(),{organization:l}=(0,t.Z5)(),{organizationSettings:d}=(0,P.O)(),s=(0,L.tJ)("name",(null==l?void 0:l.name)||"",{type:"text",label:(0,u.G)("formFieldLabel__organizationName"),placeholder:(0,u.G)("formFieldInputPlaceholder__organizationName")}),c=(0,L.tJ)("slug",(null==l?void 0:l.slug)||"",{type:"text",label:(0,u.G)("formFieldLabel__organizationSlug"),placeholder:(0,u.G)("formFieldInputPlaceholder__organizationSlug")});if(!l)return null;let m=(l.name!==s.value||l.slug!==c.value)&&"error"!==c.feedbackType,p=!d.slug.disabled,h=async e=>{e.preventDefault();let n={name:s.value};return p&&(n.slug=c.value),(m?l.update(n):Promise.resolve()).then(i).catch(e=>{(0,R.H4)(e,[s,c],r.setError)})};return(0,a.Y)(I.M,{headerTitle:o,children:(0,a.FD)(x.l.Root,{onSubmit:h,children:[(0,a.Y)(eo.i,{organization:l,onAvatarChange:e=>l.setLogo({file:e}).then(()=>{r.setIdle(),null==i||i()}).catch(e=>(0,R.H4)(e,[],r.setError)),onAvatarRemove:(0,et.p)(l.imageUrl)?null:()=>{l.setLogo({file:null}).then(()=>{r.setIdle(),null==i||i()}).catch(e=>(0,R.H4)(e,[],r.setError))}}),(0,a.Y)(x.l.ControlRow,{elementId:s.id,children:(0,a.Y)(x.l.PlainInput,{...s.props,autoFocus:!0,isRequired:!0,ignorePasswordManager:!0})}),p&&(0,a.Y)(x.l.ControlRow,{elementId:c.id,children:(0,a.Y)(x.l.PlainInput,{...c.props,onChange:e=>{var i;i=e.target.value,c.setValue(i),c.clearFeedback()},ignorePasswordManager:!0})}),(0,a.Y)(C.G,{isDisabled:!m,onReset:n})]})})}),el=()=>{let{close:e}=(0,T.D5)();return(0,a.Y)(er,{onSuccess:e,onReset:e})},ed=()=>{let{close:e}=(0,T.D5)();return(0,a.Y)(j,{onSuccess:e,onReset:e})},es=()=>{let{close:e}=(0,T.D5)();return(0,a.Y)(A,{onSuccess:e,onReset:e})},ec=()=>{let{close:e}=(0,T.D5)();return(0,a.Y)(E,{onSuccess:e,onReset:e})},eu=()=>(0,a.Y)(y.fv,{elementDescriptor:S.$z.page,sx:e=>({gap:e.space.$8}),children:(0,a.FD)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("organizationGeneral"),children:[(0,a.Y)(z.Y.Root,{children:(0,a.Y)(z.Y.Title,{localizationKey:(0,u.G)("organizationProfile.start.headerTitle__general"),sx:e=>({marginBottom:e.space.$4}),textVariant:"h2"})}),(0,a.Y)(eg,{}),(0,a.Y)(v.EH,{permission:"org:sys_domains:read",children:(0,a.Y)(em,{})}),(0,a.Y)(ep,{}),(0,a.Y)(eh,{})]})}),eg=()=>{let{organization:e}=(0,t.Z5)();if(!e)return null;let i=(0,a.Y)(D.Q,{size:"lg",mainIdentifierVariant:"subtitle",organization:e});return(0,a.Y)(_.rd.Root,{title:(0,u.G)("organizationProfile.start.profileSection.title"),id:"organizationProfile",children:(0,a.FD)(G.r.Root,{children:[(0,a.Y)(v.EH,{permission:"org:sys_profile:manage",fallback:i,children:(0,a.Y)(G.r.Closed,{value:"edit",children:(0,a.FD)(_.rd.Item,{id:"organizationProfile",children:[i,(0,a.Y)(G.r.Trigger,{value:"edit",children:(0,a.Y)(_.rd.Button,{id:"organizationProfile",localizationKey:(0,u.G)("organizationProfile.start.profileSection.primaryButton")})})]})})}),(0,a.Y)(G.r.Open,{value:"edit",children:(0,a.Y)(G.r.Card,{children:(0,a.Y)(el,{})})})]})})},em=()=>{let{organizationSettings:e}=(0,P.O)(),{organization:i}=(0,t.Z5)();return e&&i&&e.domains.enabled?(0,a.Y)(_.rd.Root,{title:(0,u.G)("organizationProfile.profilePage.domainSection.title"),id:"organizationDomains",centered:!1,children:(0,a.FD)(G.r.Root,{children:[(0,a.Y)(ea,{}),(0,a.FD)(v.EH,{permission:"org:sys_domains:manage",children:[(0,a.Y)(G.r.Trigger,{value:"add",children:(0,a.FD)(y.fv,{children:[(0,a.Y)(_.rd.ArrowButton,{localizationKey:(0,u.G)("organizationProfile.profilePage.domainSection.primaryButton"),id:"organizationDomains"}),(0,a.Y)(y.EY,{localizationKey:(0,u.G)("organizationProfile.profilePage.domainSection.subtitle"),sx:e=>({paddingLeft:e.space.$9}),colorScheme:"secondary"})]})}),(0,a.Y)(G.r.Open,{value:"add",children:(0,a.Y)(G.r.Card,{children:(0,a.Y)(ed,{})})})]})]})}):null},ep=()=>{let{organization:e}=(0,t.Z5)();return e?(0,a.Y)(_.rd.Root,{id:"organizationDanger",title:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.title"),children:(0,a.FD)(G.r.Root,{children:[(0,a.Y)(G.r.Closed,{value:"leave",children:(0,a.Y)(_.rd.Item,{sx:e=>({paddingTop:0,paddingBottom:0,paddingLeft:e.space.$1}),id:"organizationDanger",children:(0,a.Y)(G.r.Trigger,{value:"leave",children:(0,a.Y)(_.rd.Button,{id:"organizationDanger",variant:"ghost",colorScheme:"danger",textVariant:"buttonLarge",localizationKey:(0,u.G)("organizationProfile.profilePage.dangerSection.leaveOrganization.title")})})})}),(0,a.Y)(G.r.Open,{value:"leave",children:(0,a.Y)(G.r.Card,{variant:"destructive",children:(0,a.Y)(es,{})})})]})}):null},eh=()=>{let{organization:e}=(0,t.Z5)(),i=(0,v.Fd)({permission:"org:sys_profile:delete"});if(!e)return null;let n=e.adminDeleteEnabled;return i&&n?(0,a.Y)(_.rd.Root,{id:"organizationDanger",title:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.title"),sx:e=>({marginBottom:e.space.$4}),children:(0,a.FD)(G.r.Root,{children:[(0,a.Y)(G.r.Closed,{value:"delete",children:(0,a.Y)(_.rd.Item,{sx:e=>({paddingTop:0,paddingBottom:0,paddingLeft:e.space.$1}),id:"organizationDanger",children:(0,a.Y)(G.r.Trigger,{value:"delete",children:(0,a.Y)(_.rd.Button,{id:"organizationDanger",variant:"ghost",colorScheme:"danger",textVariant:"buttonLarge",localizationKey:(0,u.G)("organizationProfile.profilePage.dangerSection.deleteOrganization.title")})})})}),(0,a.Y)(G.r.Open,{value:"delete",children:(0,a.Y)(G.r.Card,{variant:"destructive",children:(0,a.Y)(ec,{})})})]})}):null};var ef=n(30579),ev=n(23707),eb=n(69835),eY=n(41703),eP=n(37591);n(85074);var ez=n(29345),eD=n(33486),e_=n(94482);let ey=e=>{let{memberships:i,pageSize:n}=e,o=(0,g.f0)(),{organization:r}=(0,t.Z5)(),{options:l,isLoading:d}=(0,eD.x)();return r?(0,a.Y)(e_.bQ,{page:(null==i?void 0:i.page)||1,onPageChange:e=>{var n;return null==i||null==(n=i.fetchPage)?void 0:n.call(i,e)},itemCount:(null==i?void 0:i.count)||0,pageCount:(null==i?void 0:i.pageCount)||0,itemsPerPage:n,isLoading:(null==i?void 0:i.isLoading)&&!(null==i?void 0:i.data.length)||d,emptyStateLocalizationKey:(0,u.G)("organizationProfile.membersPage.detailsTitle__emptyRow"),headers:[(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__joined"),(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__role"),(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:((null==i?void 0:i.data)||[]).map(e=>(0,a.Y)(eS,{membership:e,options:l,onRoleChange:i=>o.runAsync(()=>e.update({role:i})).catch(e=>(0,R.H4)(e,[],o.setError)),onRemove:async()=>o.runAsync(async()=>{var n;let a=await e.destroy();return await (null==i||null==(n=i.revalidate)?void 0:n.call(i)),a}).catch(e=>(0,R.H4)(e,[],o.setError))},e.id))}):null},eS=e=>{var i,n,o;let{membership:r,onRemove:l,onRoleChange:d,options:s}=e,{localizeCustomRole:c}=(0,eD.l)(),m=(0,g.f0)(),{user:p}=(0,t.Jd)(),h=(null==p?void 0:p.id)===(null==(i=r.publicUserData)?void 0:i.userId),f=null==s||null==(n=s.find(e=>e.value===r.role))?void 0:n.label;return(0,a.FD)(e_.Yq,{children:[(0,a.Y)(y.Td,{children:(0,a.Y)(ez.c,{sx:{maxWidth:"30ch"},user:r.publicUserData,subtitle:null==(o=r.publicUserData)?void 0:o.identifier,subtitleProps:{variant:"caption"},badge:h&&(0,a.Y)(y.Ex,{localizationKey:(0,u.G)("badge__you")})})}),(0,a.Y)(y.Td,{children:(0,a.Y)(y.az,{as:"span",elementDescriptor:S.$z.formattedDate,elementId:S.$z.formattedDate.setId("tableCell"),children:r.createdAt.toLocaleDateString()})}),(0,a.Y)(y.Td,{children:(0,a.Y)(v.EH,{permission:"org:sys_memberships:manage",fallback:(0,a.Y)(y.EY,{sx:e=>({opacity:e.opacity.$inactive}),children:c(r.role)||f}),children:(0,a.Y)(e_.Vo,{isDisabled:m.isLoading||!d,value:r.role,fallbackLabel:r.roleName,onChange:d,roles:s})})}),(0,a.Y)(y.Td,{children:(0,a.Y)(v.EH,{permission:"org:sys_memberships:manage",children:(0,a.Y)(Z.o,{actions:[{label:(0,u.G)("organizationProfile.membersPage.activeMembersTab.menuAction__remove"),isDestructive:!0,onClick:l,isDisabled:h}],elementId:"member"})})})]})};var eG=n(53100);let eT=e=>{let{actionSlot:i}=e,n=(0,v.Fd)({permission:"org:sys_memberships:manage"});return(0,a.FD)(G.r.Root,{animate:!1,children:[(0,a.Y)(ef.k,{asChild:!0,children:(0,a.FD)(y.so,{justify:i?"between":"end",sx:e=>({width:"100%",marginLeft:"auto",padding:"".concat(e.space.$none," ").concat(e.space.$1)}),gap:i?2:void 0,children:[i,n&&(0,a.Y)(G.r.Trigger,{value:"invite",hideOnActive:!i,children:(0,a.Y)(y.$n,{elementDescriptor:S.$z.membersPageInviteButton,"aria-label":"Invite",localizationKey:(0,u.G)("organizationProfile.membersPage.action__invite")})})]})}),n&&(0,a.Y)(ef.k,{children:(0,a.Y)(G.r.Open,{value:"invite",children:(0,a.Y)(y.so,{sx:e=>({paddingBottom:e.space.$6,padding:"".concat(e.space.$none," ").concat(e.space.$1," ").concat(e.space.$6," ").concat(e.space.$1)}),children:(0,a.Y)(G.r.Card,{sx:{width:"100%"},children:(0,a.Y)(eG.D,{})})})})})]})};var ex=n(10078),eC=n(34439),eI=n(37852),eF=n(15013);let eR=e=>{var i;let{query:n,value:t,memberships:r,onSearchChange:l,onQueryTrigger:d}=e,{t:s}=(0,ex._)(),c=(0,o.useRef)(null);(0,o.useEffect)(()=>{var e,i;n&&(null==r?void 0:r.data)&&(null!=(e=null==r?void 0:r.count)?e:0)<=eB&&(null==r||null==(i=r.fetchPage)||i.call(r,1))},[n,r]);let g=t&&!!(null==r?void 0:r.isLoading)&&!!(null==(i=r.data)?void 0:i.length);return(0,a.Y)(ef.k,{asChild:!0,children:(0,a.Y)(y.so,{sx:{width:"50%",[eP.g.sm]:{width:"auto"}},children:(0,a.Y)(eF.e,{value:t,type:"search",autoCapitalize:"none",spellCheck:!1,"aria-label":"Search",placeholder:s((0,u.G)("organizationProfile.membersPage.action__search")),leftIcon:g?(0,a.Y)(eI.y,{size:"xs"}):(0,a.Y)(y.In,{icon:eC.A,elementDescriptor:S.$z.organizationProfileMembersSearchInputIcon,sx:e=>({color:e.colors.$colorMutedForeground})}),onKeyUp:function(){c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d(t.trim())},500)},onChange:e=>{let i=e.target.value;l(i),""===i&&d(i)},elementDescriptor:S.$z.organizationProfileMembersSearchInput})})})},eL={invitations:{pageSize:10,keepPreviousData:!0}},e$=()=>{let e=(0,g.f0)(),{organization:i,invitations:n}=(0,t.Z5)(eL),{options:o,isLoading:r}=(0,eD.x)();return i?(0,a.Y)(e_.bQ,{page:(null==n?void 0:n.page)||1,onPageChange:(null==n?void 0:n.fetchPage)||(()=>null),itemCount:(null==n?void 0:n.count)||0,pageCount:(null==n?void 0:n.pageCount)||0,itemsPerPage:eL.invitations.pageSize,isLoading:(null==n?void 0:n.isLoading)||r,emptyStateLocalizationKey:(0,u.G)("organizationProfile.membersPage.invitationsTab.table__emptyRow"),headers:[(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,u.G)("organizationProfile.membersPage.invitedMembersTab.tableHeader__invited"),(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__role"),(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:((null==n?void 0:n.data)||[]).map(i=>(0,a.Y)(ew,{options:o,invitation:i,onRevoke:async()=>e.runAsync(async()=>{var e;return await i.revoke(),await (null==n||null==(e=n.revalidate)?void 0:e.call(n)),i}).catch(i=>(0,R.H4)(i,[],e.setError))},i.id))}):null},ew=e=>{var i;let{invitation:n,onRevoke:t,options:o}=e,{localizeCustomRole:r}=(0,eD.l)(),l=null==o||null==(i=o.find(e=>e.value===n.role))?void 0:i.label;return(0,a.FD)(e_.Yq,{children:[(0,a.Y)(y.Td,{children:(0,a.Y)(ez.c,{sx:{maxWidth:"30ch"},user:{primaryEmailAddress:{emailAddress:n.emailAddress}},subtitleProps:{variant:"caption"}})}),(0,a.Y)(y.Td,{children:(0,a.Y)(y.az,{as:"span",elementDescriptor:S.$z.formattedDate,elementId:S.$z.formattedDate.setId("tableCell"),children:n.createdAt.toLocaleDateString()})}),(0,a.Y)(y.Td,{children:(0,a.Y)(y.EY,{colorScheme:"secondary",localizationKey:r(n.role)||l})}),(0,a.Y)(y.Td,{children:(0,a.Y)(Z.o,{actions:[{label:(0,u.G)("organizationProfile.membersPage.invitedMembersTab.menuAction__revoke"),isDestructive:!0,onClick:t}],elementId:"invitation"})})]})},ek=(0,g.dm)(()=>{var e;let{organizationSettings:i}=(0,P.O)(),{navigateToGeneralPageRoot:n}=(0,s.V)(),t=null==i||null==(e=i.domains)?void 0:e.enabled;return(0,a.FD)(y.fv,{gap:4,sx:{width:"100%"},children:[t&&(0,a.Y)(v.EH,{permission:"org:sys_domains:manage",children:(0,a.FD)(y.so,{sx:e=>({width:"100%",gap:e.space.$8,paddingBottom:e.space.$4,paddingLeft:e.space.$1,paddingRight:e.space.$1,borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,[eP.g.md]:{flexDirection:"column",gap:e.space.$2}}),children:[(0,a.Y)(y.fv,{sx:e=>({width:e.space.$66,marginTop:e.space.$2}),children:(0,a.Y)(z.Y.Root,{children:(0,a.Y)(z.Y.Title,{localizationKey:(0,u.G)("organizationProfile.membersPage.invitationsTab.autoInvitations.headerTitle"),textVariant:"h3"})})}),(0,a.Y)(y.fv,{sx:{width:"100%"},children:(0,a.Y)(ea,{fallback:(0,a.FD)(a.FK,{children:[(0,a.Y)(_.rd.ArrowButton,{localizationKey:(0,u.G)("organizationProfile.membersPage.invitationsTab.autoInvitations.primaryButton"),id:"manageVerifiedDomains",sx:e=>({gap:e.space.$2}),onClick:n}),(0,a.Y)(y.EY,{localizationKey:(0,u.G)("organizationProfile.membersPage.invitationsTab.autoInvitations.headerSubtitle"),sx:e=>({paddingLeft:e.space.$10,color:e.colors.$colorMutedForeground,[eP.g.md]:{paddingLeft:0}})})]}),verificationStatus:"verified",enrollmentMode:"automatic_invitation"})})]})}),(0,a.FD)(y.so,{direction:"col",gap:2,sx:{width:"100%"},children:[(0,a.Y)(eT,{}),(0,a.Y)(e$,{})]})]})}),eA={membershipRequests:{pageSize:10,keepPreviousData:!0}},eE=()=>{var e;let i=(0,g.f0)(),{organization:n,membershipRequests:o}=(0,t.Z5)(eA);return n?(0,a.Y)(e_.bQ,{page:(null==o?void 0:o.page)||1,onPageChange:null!=(e=null==o?void 0:o.fetchPage)?e:()=>null,itemCount:(null==o?void 0:o.count)||0,pageCount:(null==o?void 0:o.pageCount)||0,itemsPerPage:eA.membershipRequests.pageSize,isLoading:null==o?void 0:o.isLoading,emptyStateLocalizationKey:(0,u.G)("organizationProfile.membersPage.requestsTab.table__emptyRow"),headers:[(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__user"),(0,u.G)("organizationProfile.membersPage.requestsTab.tableHeader__requested"),(0,u.G)("organizationProfile.membersPage.activeMembersTab.tableHeader__actions")],rows:((null==o?void 0:o.data)||[]).map(e=>(0,a.Y)(eM,{request:e,onError:i.setError},e.id))}):null},eM=(0,g.dm)(e=>{let{request:i,onError:n}=e,o=(0,g.f0)(),{membership:r,membershipRequests:l}=(0,t.Z5)(eA);return(0,a.FD)(e_.Yq,{children:[(0,a.Y)(y.Td,{children:(0,a.Y)(ez.c,{sx:{maxWidth:"30ch"},showAvatar:!1,user:{primaryEmailAddress:{emailAddress:i.publicUserData.identifier}},subtitleProps:{variant:"caption"}})}),(0,a.Y)(y.Td,{children:(0,a.Y)(y.az,{as:"span",elementDescriptor:S.$z.formattedDate,elementId:S.$z.formattedDate.setId("tableCell"),children:i.createdAt.toLocaleDateString()})}),(0,a.Y)(y.Td,{children:(0,a.Y)(eO,{onAccept:()=>{if(r&&l)return o.runAsync(async()=>{await i.accept(),await l.revalidate()},"accept").catch(e=>(0,R.H4)(e,[],n))},onReject:()=>{if(r&&l)return o.runAsync(async()=>{await i.reject(),await l.revalidate()},"reject").catch(e=>(0,R.H4)(e,[],n))}})})]})}),eO=e=>{let i=(0,g.f0)();return(0,a.FD)(y.so,{gap:2,children:[(0,a.Y)(y.$n,{textVariant:"buttonSmall",variant:"ghost",isLoading:i.isLoading&&"reject"===i.loadingMetadata,isDisabled:i.isLoading&&"reject"!==i.loadingMetadata,onClick:e.onReject,localizationKey:(0,u.G)("organizationProfile.membersPage.requestsTab.menuAction__reject")}),(0,a.Y)(y.$n,{textVariant:"buttonSmall",isLoading:i.isLoading&&"accept"===i.loadingMetadata,isDisabled:i.isLoading&&"accept"!==i.loadingMetadata,onClick:e.onAccept,localizationKey:(0,u.G)("organizationProfile.membersPage.requestsTab.menuAction__approve")})]})},eK=()=>{var e;let{organizationSettings:i}=(0,P.O)(),{navigateToGeneralPageRoot:n}=(0,s.V)(),t=null==i||null==(e=i.domains)?void 0:e.enabled;return(0,a.FD)(y.fv,{gap:4,sx:{width:"100%"},children:[t&&(0,a.Y)(v.EH,{permission:"org:sys_domains:manage",children:(0,a.FD)(y.so,{sx:e=>({width:"100%",gap:e.space.$8,paddingBottom:e.space.$4,paddingLeft:e.space.$1,paddingRight:e.space.$1,borderBottomWidth:e.borderWidths.$normal,borderBottomStyle:e.borderStyles.$solid,borderBottomColor:e.colors.$borderAlpha100,[eP.g.md]:{flexDirection:"column",gap:e.space.$2}}),children:[(0,a.Y)(y.fv,{sx:e=>({width:e.space.$66,marginTop:e.space.$2}),children:(0,a.Y)(z.Y.Root,{children:(0,a.Y)(z.Y.Title,{localizationKey:(0,u.G)("organizationProfile.membersPage.requestsTab.autoSuggestions.headerTitle"),textVariant:"h3"})})}),(0,a.Y)(y.fv,{sx:{width:"100%"},children:(0,a.Y)(ea,{fallback:(0,a.FD)(a.FK,{children:[(0,a.Y)(_.rd.ArrowButton,{localizationKey:(0,u.G)("organizationProfile.membersPage.requestsTab.autoSuggestions.primaryButton"),sx:e=>({gap:e.space.$2}),id:"manageVerifiedDomains",onClick:n}),(0,a.Y)(y.EY,{localizationKey:(0,u.G)("organizationProfile.membersPage.requestsTab.autoSuggestions.headerSubtitle"),sx:e=>({paddingLeft:e.space.$10,color:e.colors.$colorMutedForeground,[eP.g.md]:{paddingLeft:0}})})]}),verificationStatus:"verified",enrollmentMode:"automatic_suggestion"})})]})}),(0,a.FD)(y.so,{direction:"col",gap:2,sx:{width:"100%"},children:[(0,a.Y)(eT,{}),(0,a.Y)(eE,{})]})]})},eB=10,eq=(0,g.dm)(()=>{var e;let{organizationSettings:i}=(0,P.O)(),n=(0,g.f0)(),r=(0,v.Fd)({permission:"org:sys_memberships:manage"}),l=(0,v.Fd)({permission:"org:sys_memberships:read"}),d=(null==i||null==(e=i.domains)?void 0:e.enabled)&&r,[s,c]=(0,o.useState)(""),[m,p]=(0,o.useState)(""),{membershipRequests:h,memberships:f,invitations:b}=(0,t.Z5)({membershipRequests:d||void 0,invitations:r||void 0,memberships:l?{keepPreviousData:!0,query:s||void 0}:void 0});return null===r?null:(0,a.Y)(y.fv,{elementDescriptor:S.$z.page,gap:2,children:(0,a.Y)(y.fv,{elementDescriptor:S.$z.profilePage,elementId:S.$z.profilePage.setId("organizationMembers"),gap:4,children:(0,a.FD)(G.r.Root,{animate:!1,children:[(0,a.Y)(ef.k,{asChild:!0,children:(0,a.Y)(z.Y.Root,{contentSx:{[eP.g.md]:{flexDirection:"row",width:"100%",justifyContent:"space-between"}},children:(0,a.Y)(z.Y.Title,{localizationKey:(0,u.G)("organizationProfile.start.headerTitle__members"),textVariant:"h2"})})}),(0,a.Y)(ev.Z.Alert,{children:n.error}),(0,a.FD)(eb.tU,{children:[(0,a.FD)(eb.j7,{sx:e=>({gap:e.space.$2}),children:[l&&(0,a.Y)(eb.oz,{localizationKey:(0,u.G)("organizationProfile.membersPage.start.headerTitle__members"),children:!!(null==f?void 0:f.count)&&(0,a.Y)(eY.a,{shouldAnimate:!s,notificationCount:f.count,colorScheme:"outline"})}),r&&(0,a.Y)(eb.oz,{localizationKey:(0,u.G)("organizationProfile.membersPage.start.headerTitle__invitations"),children:(null==b?void 0:b.data)&&!b.isLoading&&(0,a.Y)(eY.a,{notificationCount:b.count,colorScheme:"outline"})}),r&&d&&(0,a.Y)(eb.oz,{localizationKey:(0,u.G)("organizationProfile.membersPage.start.headerTitle__requests"),children:(null==h?void 0:h.data)&&!h.isLoading&&(0,a.Y)(eY.a,{notificationCount:h.count,colorScheme:"outline"})})]}),(0,a.FD)(eb.T2,{children:[l&&(0,a.Y)(eb.Kp,{sx:{width:"100%"},children:(0,a.Y)(y.so,{gap:4,direction:"col",sx:{width:"100%"},children:(0,a.FD)(y.so,{gap:2,direction:"col",sx:{width:"100%"},children:[(0,a.Y)(eT,{actionSlot:(0,a.Y)(eR,{query:s,value:m,memberships:f,onSearchChange:e=>p(e),onQueryTrigger:e=>c(e)})}),(0,a.Y)(ey,{pageSize:eB,memberships:f})]})})}),r&&(0,a.Y)(eb.Kp,{sx:{width:"100%"},children:(0,a.Y)(ek,{})}),r&&d&&(0,a.Y)(eb.Kp,{sx:{width:"100%"},children:(0,a.Y)(eK,{})})]})]})]})})})}),eH=(0,o.lazy)(()=>Promise.all([n.e("545"),n.e("666"),n.e("207"),n.e("289")]).then(n.bind(n,80343)).then(e=>({default:e.OrganizationBillingPage}))),eV=(0,o.lazy)(()=>Promise.all([n.e("666"),n.e("326"),n.e("223")]).then(n.bind(n,6518)).then(e=>({default:e.OrganizationAPIKeysPage}))),ej=(0,o.lazy)(()=>Promise.all([n.e("666"),n.e("970"),n.e("264")]).then(n.bind(n,22754)).then(e=>({default:e.OrganizationPlansPage}))),eZ=(0,o.lazy)(()=>Promise.all([n.e("545"),n.e("666"),n.e("627")]).then(n.bind(n,54425)).then(e=>({default:e.OrganizationStatementPage}))),eN=(0,o.lazy)(()=>Promise.all([n.e("545"),n.e("666"),n.e("122")]).then(n.bind(n,54447)).then(e=>({default:e.OrganizationPaymentAttemptPage}))),eX=()=>{var e;let{pages:i,isMembersPageRoot:n,isGeneralPageRoot:t,isBillingPageRoot:r,isAPIKeysPageRoot:l,shouldShowBilling:d,apiKeysProps:c}=(0,s.V)(),{apiKeysSettings:u,commerceSettings:g}=(0,P.O)(),m=null==(e=i.contents)?void 0:e.map((e,i)=>{let o=!t&&!n&&0===i;return(0,a.Y)(f.q,{index:o,path:o?void 0:e.url,children:(0,a.Y)(Y.H,{mount:e.mount,unmount:e.unmount})},"custom-page-".concat(e.url))});return(0,a.FD)(h.d,{children:[m,(0,a.FD)(f.q,{children:[(0,a.Y)(f.q,{path:t?void 0:"organization-general",children:(0,a.Y)(h.d,{children:(0,a.Y)(f.q,{index:!0,children:(0,a.Y)(eu,{})})})}),(0,a.Y)(f.q,{path:n?void 0:"organization-members",children:(0,a.Y)(h.d,{children:(0,a.Y)(f.q,{index:!0,children:(0,a.Y)(v.EH,{condition:e=>e({permission:"org:sys_memberships:read"})||e({permission:"org:sys_memberships:manage"}),redirectTo:t?"../":"./organization-general",children:(0,a.Y)(eq,{})})})})}),g.billing.organization.enabled&&d?(0,a.Y)(v.EH,{condition:e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"}),children:(0,a.Y)(f.q,{path:r?void 0:"organization-billing",children:(0,a.FD)(h.d,{children:[(0,a.Y)(f.q,{index:!0,children:(0,a.Y)(o.Suspense,{fallback:"",children:(0,a.Y)(eH,{})})}),g.billing.organization.hasPaidPlans?(0,a.Y)(f.q,{path:"plans",children:(0,a.Y)(o.Suspense,{fallback:"",children:(0,a.Y)(ej,{})})}):null,(0,a.Y)(f.q,{path:"statement/:statementId",children:(0,a.Y)(o.Suspense,{fallback:"",children:(0,a.Y)(eZ,{})})}),(0,a.Y)(f.q,{path:"payment-attempt/:paymentAttemptId",children:(0,a.Y)(o.Suspense,{fallback:"",children:(0,a.Y)(eN,{})})})]})})}):null,u.orgs_api_keys_enabled&&!(null==c?void 0:c.hide)&&(0,a.Y)(v.EH,{condition:e=>e({permission:"org:sys_api_keys:read"})||e({permission:"org:sys_api_keys:manage"}),children:(0,a.Y)(f.q,{path:l?void 0:"organization-api-keys",children:(0,a.Y)(h.d,{children:(0,a.Y)(f.q,{index:!0,children:(0,a.Y)(o.Suspense,{fallback:"",children:(0,a.Y)(eV,{})})})})})})]})]})},eJ=()=>{let{organization:e}=(0,t.Z5)();return e?(0,a.Y)(c.n.Root,{flow:"organizationProfile",children:(0,a.Y)(c.n.Part,{children:(0,a.Y)(h.d,{children:(0,a.Y)(f.q,{children:(0,a.Y)(l.m$.Provider,{value:"organization",children:(0,a.Y)(eU,{})})})})})}):null},eU=(0,d.G)(()=>{let e=o.useRef(null);return(0,a.Y)(p.a.Root,{sx:e=>({display:"grid",gridTemplateColumns:"1fr 3fr",height:e.sizes.$176,overflow:"hidden"}),children:(0,a.FD)(b,{contentRef:e,children:[(0,a.Y)(m.oT,{navbarTitleLocalizationKey:(0,u.G)("organizationProfile.navbar.title")}),(0,a.Y)(p.a.Content,{contentRef:e,scrollBoxId:r.qJ,children:(0,a.Y)(eX,{})})]})})}),eW=(0,g.dm)(eJ),eQ=(0,g.dm)(eJ),e0=e=>{let i={...e,routing:"virtual",componentName:"OrganizationProfile",mode:"modal"};return(0,a.Y)(f.q,{path:"organizationProfile",children:(0,a.Y)(s.o.Provider,{value:i,children:(0,a.Y)("div",{children:(0,a.Y)(eQ,{...i})})})})}},15892:function(e,i,n){n.d(i,{V:()=>u,o:()=>c}),n(98114),n(19161),n(89305);var a=n(21210),t=n(35074),o=n(93121),r=n(21227),l=n(4964),d=n(97697),s=n(97288);let c=(0,t.createContext)(null),u=()=>{var e;let i=(0,t.useContext)(c),{navigate:n}=(0,l.r)(),u=(0,d.O)(),g=(0,a.ho)();if(!i||"OrganizationProfile"!==i.componentName)throw Error("Clerk: useOrganizationProfileContext called outside OrganizationProfile.");let{componentName:m,customPages:p,...h}=i,f=(0,s.Rs)(),v=(0,s.eT)(),b=null==(e=f.data)?void 0:e.subscriptionItems.some(e=>e.plan.hasBaseFee),Y=u.commerceSettings.billing.organization.hasPaidPlans||b||v.data.length>0,P=(0,t.useMemo)(()=>(0,o.q)(p||[],g,Y,u),[p,Y]),z=P.routes[0].id===r.jc.MEMBERS,D=P.routes[0].id===r.jc.GENERAL,_=P.routes[0].id===r.jc.BILLING,y=P.routes[0].id===r.jc.API_KEYS;return{...h,pages:P,navigateAfterLeaveOrganization:()=>n(h.afterLeaveOrganizationUrl||u.displayConfig.afterLeaveOrganizationUrl),componentName:m,navigateToGeneralPageRoot:()=>n(D?"../":z?"./organization-general":"../organization-general"),isMembersPageRoot:z,isGeneralPageRoot:D,isBillingPageRoot:_,isAPIKeysPageRoot:y,shouldShowBilling:Y}}},97288:function(e,i,n){n.d(i,{A$:()=>h,D:()=>f,Ij:()=>s,Rs:()=>p,eT:()=>m,mu:()=>u,wD:()=>g}),n(19161),n(89305),n(85074),n(95055);var a=n(21210),t=n(35074),o=n(57477),r=n(65424),l=n(22861),d=n(46256);function s(e){return e.endsWith(".00")?e.slice(0,-3):e}let c=()=>{let e=(0,d.XX)(),i=(0,o.Fd)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),n=(0,a.Wf)();return{for:e,keepPreviousData:!0,enabled:"organization"!==e||!!(null==n?void 0:n.organization)&&i}},u=()=>{let e=c();return(0,a.X$)(e)},g=()=>{let e=c();return(0,a.t7)(e)},m=e=>{let i=c();return(0,a.tr)({...i,__experimental_mode:null==e?void 0:e.mode})},p=()=>{var e;let i=c(),n=(0,a.kH)(i),o=(0,t.useMemo)(()=>{var e;return(null==(e=n.data)?void 0:e.subscriptionItems)||[]},[null==(e=n.data)?void 0:e.subscriptionItems]);return{...n,subscriptionItems:o}},h=e=>{let i=(0,d.XX)();return(0,a.rg)({for:i,initialPage:1,pageSize:50,keepPreviousData:!0,enabled:!0,__experimental_mode:null==e?void 0:e.mode})},f=()=>{let e=(0,a.ho)(),{session:i}=(0,a.wV)(),n=(0,d.XX)(),o=(0,t.useMemo)(()=>{var i;return!!(!e.session||(null==e||null==(i=e.session)?void 0:i.checkAuthorization({permission:"org:sys_billing:manage"}))||"user"===n)},[e,n]),{subscriptionItems:s,revalidate:c,data:g}=p(),{data:f,revalidate:v}=h({mode:"cache"}),{revalidate:b}=m({mode:"cache"}),{revalidate:Y}=u(),P=(0,t.useCallback)(()=>{c(),v(),b(),Y()},[c,v,b,Y]),z=(0,t.useMemo)(()=>0===s.length||!s.some(e=>!e.canceledAt),[s]),D=(0,t.useCallback)(e=>s.find(i=>i.plan.id===e.id),[s]),_=(0,t.useCallback)(e=>s.filter(i=>i.plan.id===e.id),[s]),y=(0,t.useCallback)(function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"month",n=_(e);if(n.length>1){let e=n.find(e=>e.planPeriod===i);return e||n[0]}if(1===n.length)return n[0]},[_]),S=(0,t.useCallback)(e=>{let{plan:i,subscription:n}=e,a=null!=n?n:i?D(i):void 0;return!a||!a.canceledAt},[D]),G=(0,t.useCallback)(e=>{let{plan:n,subscription:a,isCompact:t=!1,selectedPlanPeriod:r="annual"}=e,d=null!=a?a:n?y(n,r):void 0,c=r,u=!!(null==n?void 0:n.annualMonthlyFee);"annual"!==c||u||(c="month");let m=e=>{if(null==n?void 0:n.freeTrialEnabled){let e=!i,t=null==g?void 0:g.eligibleForFreeTrial;if(e||t){var a;return(0,l.G)("billing.startFreeTrial__days",{days:null!=(a=n.freeTrialDays)?a:0})}}return e};return{localizationKey:m((()=>{if(d){if(c!==d.planPeriod&&d.canceledAt){if("month"===c)return(0,l.G)("billing.switchToMonthly");if(u)return(0,l.G)("billing.switchToAnnual")}if(d.canceledAt)return(0,l.G)("billing.reSubscribe");if(c!==d.planPeriod){if("month"===c)return(0,l.G)("billing.switchToMonthly");if(u)return(0,l.G)("billing.switchToAnnual")}return(0,l.G)("billing.manageSubscription")}return s.filter(e=>!e.plan.isDefault).length>0?(0,l.G)("billing.switchPlan"):m((0,l.G)("billing.subscribe"))})()),variant:t?"bordered":"solid",colorScheme:t?"secondary":"primary",isDisabled:!o,disabled:!o}},[y,o,s,g]),T=(0,t.useCallback)(e=>e.pastDueAt?(0,l.G)("badge__pastDueAt",{date:e.pastDueAt}):"upcoming"===e.status?(0,l.G)("badge__startsAt",{date:e.periodStart}):e.canceledAt?(0,l.G)("badge__canceledEndsAt",{date:e.periodEnd}):e.periodEnd?(0,l.G)(e.isFreeTrial?"badge__trialEndsAt":"badge__renewsAt",{date:e.periodEnd}):void 0,[]),x=(0,t.useCallback)(i=>{let a=(0,r.J)("modal",i);e.__internal_openSubscriptionDetails({for:n,onSubscriptionCancel:()=>{P()},portalRoot:a})},[e,n,P]);return{activeOrUpcomingSubscription:D,activeAndUpcomingSubscriptions:_,activeOrUpcomingSubscriptionBasedOnPlanPeriod:y,isDefaultPlanImplicitlyActiveOrUpcoming:z,handleSelectPlan:(0,t.useCallback)(a=>{let{plan:t,planPeriod:o,mode:l="mounted",event:d,appearance:s,newSubscriptionRedirectUrl:c}=a,u=(0,r.J)(l,d);e.__internal_openCheckout({planId:t.id,planPeriod:"annual"!==o||t.annualMonthlyFee?o:"month",for:n,onSubscriptionComplete:()=>{P()},onClose:()=>{(null==i?void 0:i.id)&&e.setActive({session:i.id})},appearance:s,portalRoot:u,newSubscriptionRedirectUrl:c})},[e,P,n,null==i?void 0:i.id]),openSubscriptionDetails:x,buttonPropsForPlan:G,canManageSubscription:S,captionForSubscription:T,defaultFreePlan:(0,t.useMemo)(()=>null==f?void 0:f.find(e=>e.isDefault),[f]),revalidateAll:P}}},46256:function(e,i,n){n.d(i,{N7:()=>l,XX:()=>r,m$:()=>o});var a=n(35074);let t="user",o=(0,a.createContext)(t),r=()=>(0,a.useContext)(o)||t,l=()=>"user"===r()?"userProfile":"organizationProfile"}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["364"],{77498:function(e,n,t){t.r(n),t.d(n,{OrganizationSwitcher:()=>j});var i=t(14518),o=t(35074),r=t(63269),a=t(74373),l=t(2826),c=t(32467),s=t(43264),d=t(44607),g=t(11577),u=t(21210),z=t(62531),h=t(89001),p=t(80781),m=t(67591),v=t(57477),S=t(41703),f=t(97697),w=t(58920),$=t(22861),x=t(18272),O=t(31005),P=t(58813);t(19161),t(85074),t(88711),t(95055),t(22239);var Y=t(80750),I=t(4468),b=t(52157),D=t(82364),A=t(29366),B=t(41464),_=t(23689);let C=e=>{let n=(0,r.f0)(),{userSuggestions:t}=(0,u.D_)({userSuggestions:_.mu.userSuggestions});return"accepted"===e.status?(0,i.Y)(x.EY,{colorScheme:"secondary",localizationKey:(0,$.G)("organizationSwitcher.suggestionsAcceptedLabel")}):(0,i.Y)(x.$n,{elementDescriptor:w.$z.organizationSwitcherInvitationAcceptButton,textVariant:"buttonSmall",variant:"outline",colorScheme:"neutral",size:"sm",isLoading:n.isLoading,onClick:()=>n.runAsync(e.accept).then(e=>{var n;return null==t||null==(n=t.setData)?void 0:n.call(t,n=>(0,_.l_)(e,n))}).catch(e=>(0,I.H4)(e,[],n.setError)),localizationKey:(0,$.G)("organizationSwitcher.action__suggestionsAccept")})},k=e=>{let n=(0,r.f0)();return(0,i.Y)(x.$n,{elementDescriptor:w.$z.organizationSwitcherInvitationAcceptButton,textVariant:"buttonSmall",variant:"outline",colorScheme:"neutral",size:"xs",isLoading:n.isLoading,onClick:e.onAccept,localizationKey:(0,$.G)("organizationSwitcher.action__invitationAccept")})},U=e=>{let{children:n,publicOrganizationData:t}=e;return(0,i.FD)(x.so,{align:"center",gap:2,sx:e=>({justifyContent:"space-between",padding:"".concat(e.space.$4," ").concat(e.space.$5)}),elementDescriptor:w.$z.organizationSwitcherPopoverInvitationActionsBox,children:[(0,i.Y)(h.Q,{elementId:"organizationSwitcherListedOrganization",organization:t,sx:e=>({color:e.colors.$colorMutedForeground,":hover":{color:e.colors.$colorMutedForeground}})}),n]})},y=(0,r.dm)(e=>{var n;let{invitation:t,onOrganizationClick:o}=e,{accept:a,publicOrganizationData:l,status:s}=t,d=(0,r.f0)(),{getOrganization:g}=(0,u.ho)(),{organization:z}=(0,u.Z5)(),{userInvitations:p}=(0,u.D_)({userInvitations:_.mu.userInvitations,userMemberships:_.mu.userMemberships}),{acceptedInvitations:m,setAcceptedInvitations:v}=(0,c.b)(),S=null==(n=m.find(e=>e.invitation.id===t.id))?void 0:n.organization;return"accepted"===s?t.publicOrganizationData.id===(null==z?void 0:z.id)||(null==S?void 0:S.id)&&(null==z?void 0:z.id)===S.id?null:(0,i.Y)(Y.P,{elementDescriptor:w.$z.organizationSwitcherPreviewButton,icon:A.A,onClick:S?()=>o(S):void 0,role:"menuitem",children:(0,i.Y)(h.Q,{elementId:"organizationSwitcherListedOrganization",organization:l,sx:e=>({color:e.colors.$colorMutedForeground,":hover":{color:e.colors.$colorMutedForeground}})})}):(0,i.Y)(U,{publicOrganizationData:l,children:(0,i.Y)(k,{onAccept:()=>d.runAsync(async()=>[await a(),await g(l.id)]).then(e=>{var n;let[t,i]=e;null==p||null==(n=p.setData)||n.call(p,e=>(0,_.l_)(t,e,"negative")),v(e=>[...e,{organization:i,invitation:t}])}).catch(e=>(0,I.H4)(e,[],d.setError))})})}),F=e=>{let{showBorder:n,...t}=e;return(0,i.Y)(z.En,{role:"menu",...t})},M=(0,r.dm)(e=>(0,i.Y)(U,{publicOrganizationData:e.publicOrganizationData,children:(0,i.Y)(C,{...e})})),E=e=>{var n,t;let{onOrganizationClick:o}=e,{ref:r,userSuggestions:a,userInvitations:l}=(()=>{let{userInvitations:e,userSuggestions:n}=(0,u.D_)(_.mu),{ref:t}=(0,D.W)({threshold:0,onChange:t=>{var i,o;t&&(e.hasNextPage?null==(i=e.fetchNext)||i.call(e):null==(o=n.fetchNext)||o.call(n))}});return{userInvitations:e,userSuggestions:n,ref:t}})(),c=l.isLoading||a.isLoading,s=l.hasNextPage||a.hasNextPage,d=(null==(n=l.data)?void 0:n.filter(e=>!!e))||[],g=(null==(t=a.data)?void 0:t.filter(e=>!!e))||[],z=d.length>0||g.length>0;return z||c?(0,i.Y)(F,{showBorder:z||c,elementDescriptor:w.$z.organizationSwitcherPopoverInvitationActions,children:(0,i.FD)(x.az,{sx:e=>({maxHeight:"calc(4 * ".concat(e.sizes.$17," + 4px)"),overflowY:"auto",...B.s.unstyledScrollbar(e)}),children:[null==d?void 0:d.map(e=>(0,i.Y)(y,{invitation:e,onOrganizationClick:o},e.id)),!l.hasNextPage&&(null==g?void 0:g.map(e=>(0,i.Y)(M,{...e},e.id))),(s||c)&&(0,i.Y)(b.U,{ref:r})]})}):null},L=e=>{let{onPersonalWorkspaceClick:n,onOrganizationClick:t}=e,{hidePersonal:o}=(0,l.l)(),{organization:r}=(0,u.Z5)(),{ref:a,userMemberships:c}=(()=>{let{userMemberships:e}=(0,u.D_)({userMemberships:_.mu.userMemberships}),{ref:n}=(0,D.W)({threshold:0,onChange:n=>{if(n&&e.hasNextPage){var t;null==(t=e.fetchNext)||t.call(e)}}});return{userMemberships:e,ref:n}})(),{user:s}=(0,u.Jd)(),d=((c.count||0)>0&&c.data||[]).map(e=>e.organization).filter(e=>e.id!==(null==r?void 0:r.id));if(!s)return null;let{username:g,primaryEmailAddress:z,primaryPhoneNumber:m,...v}=s,{isLoading:S,hasNextPage:f}=c;return(0,i.FD)(x.az,{sx:e=>({maxHeight:"calc((4 * ".concat(e.sizes.$17,") + 4px)"),overflowY:"auto","> button,div":{border:"0 solid ".concat(e.colors.$borderAlpha100)},">:not([hidden])~:not([hidden])":{borderTopWidth:"1px",borderBottomWidth:"0"},...B.s.unstyledScrollbar(e)}),role:"group","aria-label":o?"List of all organization memberships":"List of all accounts",children:[r&&!o&&(0,i.Y)(Y.P,{elementDescriptor:w.$z.organizationSwitcherPreviewButton,elementId:w.$z.organizationSwitcherPreviewButton.setId("personal"),icon:A.A,onClick:n,role:"menuitem",children:(0,i.Y)(p.i,{user:v,mainIdentifierVariant:"buttonLarge",title:(0,$.G)("organizationSwitcher.personalWorkspace")})}),d.map(e=>(0,i.Y)(Y.P,{elementDescriptor:w.$z.organizationSwitcherPreviewButton,elementId:w.$z.organizationSwitcherPreviewButton.setId("organization"),icon:A.A,onClick:()=>t(e),role:"menuitem",sx:e=>({border:"0 solid ".concat(e.colors.$borderAlpha100)}),children:(0,i.Y)(h.Q,{elementId:"organizationSwitcherListedOrganization",organization:e})},e.id)),(f||S)&&(0,i.Y)(b.U,{ref:a})]})};var G=t(82223);let R=e=>{let{onCreateOrganizationClick:n}=e;return(0,i.Y)(G._,{elementDescriptor:w.$z.organizationSwitcherPopoverActionButton,elementId:w.$z.organizationSwitcherPopoverActionButton.setId("createOrganization"),iconBoxElementDescriptor:w.$z.organizationSwitcherPopoverActionButtonIconBox,iconBoxElementId:w.$z.organizationSwitcherPopoverActionButtonIconBox.setId("createOrganization"),iconElementDescriptor:w.$z.organizationSwitcherPopoverActionButtonIcon,iconElementId:w.$z.organizationSwitcherPopoverActionButtonIcon.setId("createOrganization"),label:(0,$.G)("organizationSwitcher.action__createOrganization"),onClick:n,sx:e=>({padding:"".concat(e.space.$5," ").concat(e.space.$5)}),iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),spinnerSize:"sm"})},W=e=>{let{onCreateOrganizationClick:n,onPersonalWorkspaceClick:t,onOrganizationClick:o}=e;return(0,i.FD)(i.FK,{children:[(0,i.Y)(E,{onOrganizationClick:o}),(0,i.Y)(L,{onPersonalWorkspaceClick:t,onOrganizationClick:o}),(0,i.Y)(R,{onCreateOrganizationClick:n})]})},N=o.forwardRef((e,n)=>{let{close:t,...o}=e,a=()=>null==t?void 0:t(!1),c=(0,r.f0)(),{__experimental_asStandalone:s}=(0,l.l)(),{openOrganizationProfile:d,openCreateOrganization:g}=(0,u.ho)(),{organization:v}=(0,u.Z5)(),{isLoaded:S,setActive:f}=(0,u.D_)(),{hidePersonal:Y,createOrganizationMode:I,organizationProfileMode:b,afterLeaveOrganizationUrl:D,afterCreateOrganizationUrl:A,navigateCreateOrganization:B,navigateOrganizationProfile:_,afterSelectOrganizationUrl:C,afterSelectPersonalUrl:k,organizationProfileProps:U,skipInvitationScreen:y}=(0,l.l)(),{user:F}=(0,u.Jd)();if(!F)return null;let{username:M,primaryEmailAddress:E,primaryPhoneNumber:L,...G}=F;if(!S)return null;let R=(0,i.Y)(z.K5,{elementDescriptor:w.$z.organizationSwitcherPopoverActionButton,elementId:w.$z.organizationSwitcherPopoverActionButton.setId("manageOrganization"),iconBoxElementDescriptor:w.$z.organizationSwitcherPopoverActionButtonIconBox,iconBoxElementId:w.$z.organizationSwitcherPopoverActionButtonIconBox.setId("manageOrganization"),iconElementDescriptor:w.$z.organizationSwitcherPopoverActionButtonIcon,iconElementId:w.$z.organizationSwitcherPopoverActionButtonIcon.setId("manageOrganization"),icon:P.A,label:(0,$.G)("organizationSwitcher.action__manageOrganization"),onClick:()=>(a(),"navigation"===b)?_():d({...U,afterLeaveOrganizationUrl:D}),trailing:(0,i.Y)(T,{}),focusRing:!0});return(0,i.Y)(O.M,{elementDescriptor:w.$z.organizationSwitcherPopoverRootBox,children:(0,i.FD)(m.Y.Root,{elementDescriptor:w.$z.organizationSwitcherPopoverCard,ref:n,role:"dialog","aria-label":"".concat(null==v?void 0:v.name," is active"),shouldEntryAnimate:!s,...o,children:[(0,i.Y)(m.Y.Content,{elementDescriptor:w.$z.organizationSwitcherPopoverMain,children:(0,i.FD)(z.En,{elementDescriptor:w.$z.organizationSwitcherPopoverActions,role:"menu",children:[v?(0,i.FD)(x.so,{justify:"between",align:"center",sx:e=>({width:"100%",paddingRight:e.space.$5}),children:[(0,i.Y)(h.Q,{elementId:"organizationSwitcherActiveOrganization",organization:v,user:F,mainIdentifierVariant:"buttonLarge",sx:e=>({padding:"".concat(e.space.$4," ").concat(e.space.$5)})}),(0,i.Y)(z.En,{role:"menu",children:R})]}):!Y&&(0,i.Y)(p.i,{user:G,sx:e=>({padding:"".concat(e.space.$4," ").concat(e.space.$5),width:"100%"}),title:(0,$.G)("organizationSwitcher.personalWorkspace")}),(0,i.Y)(W,{onCreateOrganizationClick:()=>(a(),"navigation"===I)?B():g({afterCreateOrganizationUrl:A,skipInvitationScreen:y}),onPersonalWorkspaceClick:()=>c.runAsync(()=>f({organization:null,redirectUrl:k(F)})).then(a),onOrganizationClick:e=>c.runAsync(()=>f({organization:e,redirectUrl:C(e)})).then(a)})]})}),(0,i.Y)(m.Y.Footer,{elementDescriptor:w.$z.organizationSwitcherPopoverFooter})]})})}),T=(0,v.cb)(e=>{var n;let{sx:t}=e,{organizationSettings:o}=(0,f.O)(),r=null==o||null==(n=o.domains)?void 0:n.enabled,{membershipRequests:a}=(0,u.Z5)({membershipRequests:r||void 0});return(null==a?void 0:a.count)?(0,i.Y)(S.a,{notificationCount:a.count,containerSx:t}):null},{permission:"org:sys_memberships:manage"});var K=t(31778),Z=t(10078),H=t(67649);let Q=(0,K.H)((0,o.forwardRef)((e,n)=>{let{sx:t,...o}=e,{user:r}=(0,u.Jd)(),{organization:a}=(0,u.Z5)(),{hidePersonal:c}=(0,l.l)(),{t:s}=(0,Z._)();if(!r)return null;let{username:d,primaryEmailAddress:g,primaryPhoneNumber:z,...m}=r;return(0,i.FD)(x.$n,{elementDescriptor:w.$z.organizationSwitcherTrigger,elementId:w.$z.organizationSwitcherTrigger.setId(a?"organization":"personal"),variant:"ghost",colorScheme:"neutral",hoverAsFocus:!0,focusRing:!1,sx:[e=>({padding:"".concat(e.space.$1," ").concat(e.space.$2),position:"relative"}),t],ref:n,"aria-label":"".concat(s(e.isOpen?(0,$.G)("organizationSwitcher.action__closeOrganizationSwitcher"):(0,$.G)("organizationSwitcher.action__openOrganizationSwitcher"))),"aria-expanded":e.isOpen,"aria-haspopup":"dialog",...o,children:[a&&(0,i.Y)(h.Q,{elementId:"organizationSwitcherTrigger",gap:3,size:"xs",organization:a,sx:{maxWidth:"30ch"}}),!a&&(0,i.Y)(p.i,{size:"xs",gap:3,user:m,showAvatar:!c,sx:e=>({color:e.colors.$colorMutedForeground}),title:c?(0,$.G)("organizationSwitcher.notSelected"):(0,$.G)("organizationSwitcher.personalWorkspace")}),(0,i.Y)(V,{}),(0,i.Y)(x.In,{elementDescriptor:w.$z.organizationSwitcherTriggerIcon,icon:H.A,sx:e=>({marginLeft:"".concat(e.space.$2)})})]})})),V=()=>{var e;let{userInvitations:n,userSuggestions:t}=(0,u.D_)(_.mu),{organizationSettings:o}=(0,f.O)(),r=(0,v.Fd)({permission:"org:sys_memberships:manage"}),a=null==o||null==(e=o.domains)?void 0:e.enabled,{membershipRequests:l}=(0,u.Z5)({membershipRequests:a&&r||void 0}),c=(n.count||0)+(t.count||0)+((null==l?void 0:l.count)||0);return c?(0,i.Y)(S.a,{containerSx:e=>({position:"absolute",top:"calc(".concat(e.space.$2," * -1)"),right:"calc(".concat(e.space.$2," * -1)")}),notificationCount:c}):null},J=(0,r.P4)(e=>{let{children:n}=e,{defaultOpen:t}=(0,l.l)(),{floating:r,reference:c,styles:s,toggle:d,isOpen:u,nodeId:z,context:h}=(0,g.f)({defaultOpen:t,placement:"bottom-start",offset:8}),p=(0,o.useId)();return(0,i.FD)(i.FK,{children:[(0,i.Y)(Q,{ref:c,onClick:d,isOpen:u,"aria-controls":u?p:void 0,"aria-expanded":u}),(0,i.Y)(a.A,{nodeId:z,context:h,isOpen:u,children:(0,o.cloneElement)(n,{id:p,close:d,ref:r,style:s})})]})}),j=(0,s.G)((0,r.dm)(()=>{let{__experimental_asStandalone:e}=(0,l.l)();return(0,i.Y)(d.n.Root,{flow:"organizationSwitcher",sx:{display:"inline-flex"},children:(0,i.Y)(c.h,{children:e?(0,i.Y)(N,{close:"function"==typeof e?e:void 0}):(0,i.Y)(J,{children:(0,i.Y)(N,{})})})})}))},23689:function(e,n,t){t.d(n,{l_:()=>o,mu:()=>i}),t(19161),t(22239),t(95055);let i={userMemberships:{infinite:!0},userInvitations:{infinite:!0},userSuggestions:{infinite:!0,status:["pending","accepted"]}},o=(e,n,t)=>{var i;if(void 0===n)return[{data:[e],total_count:1}];let o=(null==n||null==(i=n[n.length-1])?void 0:i.total_count)||1;return n.map(n=>{if(void 0===n)return n;let i=n.data.map(n=>n.id===e.id?{...e}:n);return{...n,data:i,total_count:"negative"===t?o-1:o}})}},2826:function(e,n,t){t.d(n,{U:()=>l,l:()=>c}),t(98114),t(50036);var i=t(35074),o=t(97697),r=t(4964),a=t(42117);let l=(0,i.createContext)(null),c=()=>{let e=(0,i.useContext)(l),{navigate:n}=(0,r.r)(),{displayConfig:t,organizationSettings:c}=(0,o.O)();if(!e||"OrganizationSwitcher"!==e.componentName)throw Error("Clerk: useOrganizationSwitcherContext called outside OrganizationSwitcher.");let{componentName:s,...d}=e,g=d.afterCreateOrganizationUrl||t.afterCreateOrganizationUrl,u=d.afterLeaveOrganizationUrl||t.afterLeaveOrganizationUrl,z=e=>{let{organization:t,user:i}=e,o=h({organization:t,user:i});return o?n(o):Promise.resolve()},h=e=>{let{organization:n,user:t}=e;return"function"==typeof d.afterSelectPersonalUrl&&t?d.afterSelectPersonalUrl(t):"function"==typeof d.afterSelectOrganizationUrl&&n?d.afterSelectOrganizationUrl(n):d.afterSelectPersonalUrl&&t?(0,a.tR)({urlWithParam:d.afterSelectPersonalUrl,entity:t}):d.afterSelectOrganizationUrl&&n?(0,a.tR)({urlWithParam:d.afterSelectOrganizationUrl,entity:n}):void 0},p=d.organizationProfileUrl&&!d.organizationProfileMode?"navigation":d.organizationProfileMode,m=d.createOrganizationUrl&&!d.createOrganizationMode?"navigation":d.createOrganizationMode;return{...d,hidePersonal:c.forceOrganizationSelection||d.hidePersonal||!1,organizationProfileMode:p||"modal",createOrganizationMode:m||"modal",skipInvitationScreen:d.skipInvitationScreen||!1,afterCreateOrganizationUrl:g,afterLeaveOrganizationUrl:u,navigateOrganizationProfile:()=>n(d.organizationProfileUrl||t.organizationProfileUrl),navigateCreateOrganization:()=>n(d.createOrganizationUrl||t.createOrganizationUrl),navigateAfterSelectOrganization:e=>z({organization:e}),navigateAfterSelectPersonal:e=>z({user:e}),afterSelectOrganizationUrl:e=>h({organization:e}),afterSelectPersonalUrl:e=>h({user:e}),componentName:s}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["122"],{54447:function(e,t,r){r.d(t,{OrganizationPaymentAttemptPage:()=>i});var n=r(14518),a=r(46256),o=r(46130);let i=()=>(0,n.Y)(a.m$.Provider,{value:"organization",children:(0,n.Y)(o.T,{})})},46130:function(e,t,r){r.d(t,{T:()=>x}),r(88711),r(60486),r(25089),r(61244),r(77895);var n=r(14518),a=r(21210),o=r(78036),i=r(76153),l=r(29436),c=r(80137),d=r(89606),p=r(46256),s=r(10078),m=r(18272),u=r(58920),y=r(22861),h=r(27782),b=r(92405),g=r(42852),$=r(4964);let x=()=>{let{params:e,navigate:t}=(0,$.r)(),r=(0,p.XX)(),l=(0,p.N7)(),{t:h,translateError:b}=(0,s._)(),{data:g,isLoading:x,error:z}=(0,a.hl)({paymentAttemptId:e.paymentAttemptId,for:"organization"===r?"organization":"user",enabled:!!e.paymentAttemptId}),f=null==g?void 0:g.subscriptionItem;return x?(0,n.Y)(m.az,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,n.Y)(m.y$,{colorScheme:"primary",sx:{margin:"auto",display:"block"},elementDescriptor:u.$z.spinner})}):(0,n.FD)(n.FK,{children:[(0,n.Y)(i.Y.Root,{sx:e=>({borderBlockEndWidth:e.borderWidths.$normal,borderBlockEndStyle:e.borderStyles.$solid,borderBlockEndColor:e.colors.$borderAlpha100,marginBlockEnd:e.space.$4,paddingBlockEnd:e.space.$4}),children:(0,n.Y)(i.Y.BackLink,{onClick:()=>void t("../../",{searchParams:new URLSearchParams("tab=payments")}),children:(0,n.Y)(i.Y.Title,{localizationKey:(0,y.G)("".concat(l,".billingPage.start.headerTitle__payments")),textVariant:"h2"})})}),g?(0,n.FD)(m.az,{elementDescriptor:u.$z.paymentAttemptRoot,as:"article",sx:e=>({borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"clip"}),children:[(0,n.FD)(m.az,{elementDescriptor:u.$z.paymentAttemptHeader,as:"header",sx:e=>({padding:e.space.$4,background:e.colors.$neutralAlpha25,display:"flex",justifyContent:"space-between",alignItems:"flex-start"}),children:[(0,n.FD)(m.L9,{elementDescriptor:u.$z.paymentAttemptHeaderTitleContainer,children:[(0,n.Y)(m.DZ,{elementDescriptor:u.$z.paymentAttemptHeaderTitle,textVariant:"h2",localizationKey:(0,c.Y)(g.paidAt||g.failedAt||g.updatedAt,"long")}),(0,n.FD)(m.L9,{sx:e=>({display:"flex",alignItems:"center",gap:e.space.$0x25,color:e.colors.$colorMutedForeground}),children:[(0,n.Y)(D,{copyLabel:"Copy payment attempt ID",text:g.id}),(0,n.Y)(m.EY,{colorScheme:"secondary",variant:"subtitle",children:(0,d.W)(g.id)})]})]}),(0,n.Y)(m.Ex,{elementDescriptor:u.$z.paymentAttemptHeaderBadge,colorScheme:"paid"===g.status?"success":"failed"===g.status?"danger":"primary",sx:{textTransform:"capitalize"},children:g.status})]}),(0,n.Y)(Y,{subscriptionItem:f}),(0,n.FD)(m.az,{elementDescriptor:u.$z.paymentAttemptFooter,as:"footer",sx:e=>({paddingInline:e.space.$4,paddingBlock:e.space.$3,background:e.colors.$neutralAlpha25,borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100,display:"flex",justifyContent:"space-between"}),children:[(0,n.Y)(m.EY,{variant:"h3",localizationKey:(0,y.G)("billing.totalDue"),elementDescriptor:u.$z.paymentAttemptFooterLabel}),(0,n.FD)(m.L9,{elementDescriptor:u.$z.paymentAttemptFooterValueContainer,sx:e=>({display:"flex",alignItems:"center",gap:e.space.$2x5}),children:[(0,n.Y)(m.EY,{variant:"caption",colorScheme:"secondary",elementDescriptor:u.$z.paymentAttemptFooterCurrency,sx:{textTransform:"uppercase"},children:g.amount.currency}),(0,n.FD)(m.EY,{variant:"h3",elementDescriptor:u.$z.paymentAttemptFooterValue,children:[g.amount.currencySymbol,g.amount.amountFormatted]})]})]})]}):(0,n.Y)(m.az,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,n.Y)(o.F,{variant:"danger",colorScheme:"danger",children:z?b(z.errors[0]):h((0,y.G)("".concat(l,".billingPage.paymentHistorySection.notFound")))})})]})};function Y(e){var t,r;let{subscriptionItem:a}=e;if(!a)return null;let o="month"===a.planPeriod?a.plan.fee:a.plan.annualMonthlyFee;return(0,n.Y)(m.az,{elementDescriptor:u.$z.paymentAttemptBody,sx:e=>({padding:e.space.$4}),children:(0,n.FD)(l.p.Root,{children:[(0,n.FD)(l.p.Group,{children:[(0,n.Y)(l.p.Title,{title:a.plan.name}),(0,n.Y)(l.p.Description,{prefix:"annual"===a.planPeriod?"x12":void 0,text:"".concat(o.currencySymbol).concat(o.amountFormatted)})]}),(0,n.FD)(l.p.Group,{borderTop:!0,variant:"tertiary",children:[(0,n.Y)(l.p.Title,{title:(0,y.G)("billing.subtotal")}),(0,n.Y)(l.p.Description,{text:"".concat(null==(t=a.amount)?void 0:t.currencySymbol).concat(null==(r=a.amount)?void 0:r.amountFormatted)})]}),a.credit&&a.credit.amount.amount>0&&(0,n.FD)(l.p.Group,{variant:"tertiary",children:[(0,n.Y)(l.p.Title,{title:(0,y.G)("billing.credit")}),(0,n.Y)(l.p.Description,{text:"- ".concat(a.credit.amount.currencySymbol).concat(a.credit.amount.amountFormatted)})]})]})})}function D(e){let{text:t,copyLabel:r="Copy"}=e,{onCopy:a,hasCopied:o}=(0,h.i)(t);return(0,n.Y)(m.$n,{elementDescriptor:u.$z.paymentAttemptCopyButton,variant:"unstyled",onClick:a,sx:e=>({color:"inherit",width:e.sizes.$4,height:e.sizes.$4,padding:0,borderRadius:e.radii.$sm,"&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),focusRing:!1,"aria-label":o?"Copied":r,children:(0,n.Y)(m.In,{size:"sm",icon:o?b.A:g.A,"aria-hidden":!0})})}},64856:function(e,t,r){r.d(t,{PaymentAttemptPage:()=>n.T});var n=r(46130)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["841"],{61217:function(e,l,n){n.r(l),n.d(l,{PlanDetails:()=>D}),n(88711),n(19161),n(22239);var a=n(14518),i=n(21210),t=n(35074),r=n(78036),o=n(66195),s=n(78532),d=n(28511),c=n(46256),u=n(97288),p=n(44607),m=n(10078),h=n(18272),g=n(58920),b=n(22861);let D=e=>(0,a.Y)(p.n.Root,{flow:"planDetails",children:(0,a.Y)(p.n.Part,{children:(0,a.Y)(s.Drawer.Content,{children:(0,a.Y)(y,{...e})})})}),f=e=>{let{children:l}=e;return(0,a.Y)(s.Drawer.Body,{sx:e=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,overflowY:"auto",padding:e.space.$4,gap:e.space.$4}),children:l})},v=e=>{let{error:l}=e,{translateError:n}=(0,m._)();return(0,a.Y)(f,{children:(0,a.Y)(r.F,{variant:"danger",colorScheme:"danger",children:n(l.errors[0])})})},y=e=>{let{planId:l,plan:n,initialPlanPeriod:r="month"}=e,[d,u]=(0,t.useState)(r),{data:p,isLoading:m,error:D}=(0,i.Dc)({planId:l,initialPlan:n,enabled:!!(l||(null==n?void 0:n.id))});if(m&&!n)return(0,a.Y)(f,{children:(0,a.Y)(h.y$,{})});if(!p&&D)return(0,a.Y)(v,{error:D});if(!p)return null;let y=p.features,F=y.length>0;return(0,a.FD)(c.m$.Provider,{value:"org"===p.forPayerType?"organization":"user",children:[(0,a.Y)(s.Drawer.Header,{sx:e=>F?null:{flex:1,borderBottomWidth:0,background:e.colors.$colorBackground},children:(0,a.Y)($,{plan:p,planPeriod:d,setPlanPeriod:u,closeSlot:(0,a.Y)(s.Drawer.Close,{})})}),F?(0,a.FD)(s.Drawer.Body,{children:[(0,a.Y)(h.EY,{elementDescriptor:g.$z.planDetailCaption,variant:"caption",localizationKey:(0,b.G)("billing.availableFeatures"),colorScheme:"secondary",sx:e=>({padding:e.space.$4,paddingBottom:0})}),(0,a.Y)(h.az,{elementDescriptor:g.$z.planDetailFeaturesList,as:"ul",role:"list",sx:e=>({display:"grid",rowGap:e.space.$6,padding:e.space.$4,margin:0}),children:y.map(e=>(0,a.FD)(h.az,{elementDescriptor:g.$z.planDetailFeaturesListItem,as:"li",sx:e=>({display:"flex",alignItems:"baseline",gap:e.space.$3}),children:[e.avatarUrl?(0,a.Y)(o.e,{size:e=>24,title:e.name,initials:e.name[0],rounded:!1,imageUrl:e.avatarUrl}):null,(0,a.FD)(h.L9,{elementDescriptor:g.$z.planDetailFeaturesListItemContent,children:[(0,a.Y)(h.EY,{elementDescriptor:g.$z.planDetailFeaturesListItemTitle,colorScheme:"body",sx:e=>({fontWeight:e.fontWeights.$medium}),children:e.name}),e.description?(0,a.Y)(h.EY,{elementDescriptor:g.$z.planDetailFeaturesListItemDescription,colorScheme:"secondary",sx:e=>({marginBlockStart:e.space.$0x25}),children:e.description}):null]})]},e.id))})]}):null]})},$=t.forwardRef((e,l)=>{let{plan:n,closeSlot:i,planPeriod:r,setPlanPeriod:s}=e,c=(0,t.useMemo)(()=>n.annualMonthlyFee&&"annual"===r?n.annualMonthlyFee:n.fee,[n,r]),p=t.useMemo(()=>(0,u.Ij)(c.amountFormatted),[c.amountFormatted]);return(0,a.FD)(h.az,{ref:l,elementDescriptor:g.$z.planDetailHeader,sx:e=>({width:"100%",padding:e.space.$4,position:"relative"}),children:[i?(0,a.Y)(h.az,{sx:e=>({position:"absolute",top:e.space.$2,insetInlineEnd:e.space.$2}),children:i}):null,(0,a.FD)(h.fv,{gap:3,elementDescriptor:g.$z.planDetailBadgeAvatarTitleDescriptionContainer,children:[n.avatarUrl?(0,a.Y)(o.e,{boxElementDescriptor:g.$z.planDetailAvatar,size:e=>40,title:n.name,initials:n.name[0],rounded:!1,imageUrl:n.avatarUrl,sx:e=>({marginBlockEnd:e.space.$3})}):null,(0,a.FD)(h.fv,{gap:1,elementDescriptor:g.$z.planDetailTitleDescriptionContainer,children:[(0,a.Y)(h.DZ,{elementDescriptor:g.$z.planDetailTitle,as:"h2",textVariant:"h2",children:n.name}),n.description?(0,a.Y)(h.EY,{elementDescriptor:g.$z.planDetailDescription,variant:"subtitle",colorScheme:"secondary",children:n.description}):null]})]}),(0,a.Y)(h.so,{elementDescriptor:g.$z.planDetailFeeContainer,align:"center",wrap:"wrap",sx:e=>({marginTop:e.space.$3,columnGap:e.space.$1x5}),children:(0,a.FD)(a.FK,{children:[(0,a.FD)(h.EY,{elementDescriptor:g.$z.planDetailFee,variant:"h1",colorScheme:"body",children:[c.currencySymbol,p]}),(0,a.Y)(h.EY,{elementDescriptor:g.$z.planDetailFeePeriod,variant:"caption",colorScheme:"secondary",sx:e=>({textTransform:"lowercase",":before":{content:'"/"',marginInlineEnd:e.space.$1}}),localizationKey:(0,b.G)("billing.month")})]})}),n.annualMonthlyFee?(0,a.Y)(h.az,{elementDescriptor:g.$z.planDetailPeriodToggle,sx:e=>({display:"flex",marginTop:e.space.$3}),children:(0,a.Y)(d.d,{isChecked:"annual"===r,onChange:e=>s(e?"annual":"month"),label:(0,b.G)("billing.billedAnnually")})}):(0,a.Y)(h.EY,{elementDescriptor:g.$z.pricingTableCardFeePeriodNotice,variant:"caption",colorScheme:"secondary",localizationKey:n.isDefault?(0,b.G)("billing.alwaysFree"):(0,b.G)("billing.billedMonthlyOnly"),sx:e=>({justifySelf:"flex-start",alignSelf:"center",marginTop:e.space.$3})})]})})},97288:function(e,l,n){n.d(l,{A$:()=>g,D:()=>b,Ij:()=>d,Rs:()=>h,eT:()=>m,mu:()=>u,wD:()=>p}),n(19161),n(89305),n(85074),n(95055);var a=n(21210),i=n(35074),t=n(57477),r=n(65424),o=n(22861),s=n(46256);function d(e){return e.endsWith(".00")?e.slice(0,-3):e}let c=()=>{let e=(0,s.XX)(),l=(0,t.Fd)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),n=(0,a.Wf)();return{for:e,keepPreviousData:!0,enabled:"organization"!==e||!!(null==n?void 0:n.organization)&&l}},u=()=>{let e=c();return(0,a.X$)(e)},p=()=>{let e=c();return(0,a.t7)(e)},m=e=>{let l=c();return(0,a.tr)({...l,__experimental_mode:null==e?void 0:e.mode})},h=()=>{var e;let l=c(),n=(0,a.kH)(l),t=(0,i.useMemo)(()=>{var e;return(null==(e=n.data)?void 0:e.subscriptionItems)||[]},[null==(e=n.data)?void 0:e.subscriptionItems]);return{...n,subscriptionItems:t}},g=e=>{let l=(0,s.XX)();return(0,a.rg)({for:l,initialPage:1,pageSize:50,keepPreviousData:!0,enabled:!0,__experimental_mode:null==e?void 0:e.mode})},b=()=>{let e=(0,a.ho)(),{session:l}=(0,a.wV)(),n=(0,s.XX)(),t=(0,i.useMemo)(()=>{var l;return!!(!e.session||(null==e||null==(l=e.session)?void 0:l.checkAuthorization({permission:"org:sys_billing:manage"}))||"user"===n)},[e,n]),{subscriptionItems:d,revalidate:c,data:p}=h(),{data:b,revalidate:D}=g({mode:"cache"}),{revalidate:f}=m({mode:"cache"}),{revalidate:v}=u(),y=(0,i.useCallback)(()=>{c(),D(),f(),v()},[c,D,f,v]),$=(0,i.useMemo)(()=>0===d.length||!d.some(e=>!e.canceledAt),[d]),F=(0,i.useCallback)(e=>d.find(l=>l.plan.id===e.id),[d]),Y=(0,i.useCallback)(e=>d.filter(l=>l.plan.id===e.id),[d]),z=(0,i.useCallback)(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"month",n=Y(e);if(n.length>1){let e=n.find(e=>e.planPeriod===l);return e||n[0]}if(1===n.length)return n[0]},[Y]),_=(0,i.useCallback)(e=>{let{plan:l,subscription:n}=e,a=null!=n?n:l?F(l):void 0;return!a||!a.canceledAt},[F]),x=(0,i.useCallback)(e=>{let{plan:n,subscription:a,isCompact:i=!1,selectedPlanPeriod:r="annual"}=e,s=null!=a?a:n?z(n,r):void 0,c=r,u=!!(null==n?void 0:n.annualMonthlyFee);"annual"!==c||u||(c="month");let m=e=>{if(null==n?void 0:n.freeTrialEnabled){let e=!l,i=null==p?void 0:p.eligibleForFreeTrial;if(e||i){var a;return(0,o.G)("billing.startFreeTrial__days",{days:null!=(a=n.freeTrialDays)?a:0})}}return e};return{localizationKey:m((()=>{if(s){if(c!==s.planPeriod&&s.canceledAt){if("month"===c)return(0,o.G)("billing.switchToMonthly");if(u)return(0,o.G)("billing.switchToAnnual")}if(s.canceledAt)return(0,o.G)("billing.reSubscribe");if(c!==s.planPeriod){if("month"===c)return(0,o.G)("billing.switchToMonthly");if(u)return(0,o.G)("billing.switchToAnnual")}return(0,o.G)("billing.manageSubscription")}return d.filter(e=>!e.plan.isDefault).length>0?(0,o.G)("billing.switchPlan"):m((0,o.G)("billing.subscribe"))})()),variant:i?"bordered":"solid",colorScheme:i?"secondary":"primary",isDisabled:!t,disabled:!t}},[z,t,d,p]),C=(0,i.useCallback)(e=>e.pastDueAt?(0,o.G)("badge__pastDueAt",{date:e.pastDueAt}):"upcoming"===e.status?(0,o.G)("badge__startsAt",{date:e.periodStart}):e.canceledAt?(0,o.G)("badge__canceledEndsAt",{date:e.periodEnd}):e.periodEnd?(0,o.G)(e.isFreeTrial?"badge__trialEndsAt":"badge__renewsAt",{date:e.periodEnd}):void 0,[]),k=(0,i.useCallback)(l=>{let a=(0,r.J)("modal",l);e.__internal_openSubscriptionDetails({for:n,onSubscriptionCancel:()=>{y()},portalRoot:a})},[e,n,y]);return{activeOrUpcomingSubscription:F,activeAndUpcomingSubscriptions:Y,activeOrUpcomingSubscriptionBasedOnPlanPeriod:z,isDefaultPlanImplicitlyActiveOrUpcoming:$,handleSelectPlan:(0,i.useCallback)(a=>{let{plan:i,planPeriod:t,mode:o="mounted",event:s,appearance:d,newSubscriptionRedirectUrl:c}=a,u=(0,r.J)(o,s);e.__internal_openCheckout({planId:i.id,planPeriod:"annual"!==t||i.annualMonthlyFee?t:"month",for:n,onSubscriptionComplete:()=>{y()},onClose:()=>{(null==l?void 0:l.id)&&e.setActive({session:l.id})},appearance:d,portalRoot:u,newSubscriptionRedirectUrl:c})},[e,y,n,null==l?void 0:l.id]),openSubscriptionDetails:k,buttonPropsForPlan:x,canManageSubscription:_,captionForSubscription:C,defaultFreePlan:(0,i.useMemo)(()=>null==b?void 0:b.find(e=>e.isDefault),[b]),revalidateAll:y}}},46256:function(e,l,n){n.d(l,{N7:()=>o,XX:()=>r,m$:()=>t});var a=n(35074);let i="user",t=(0,a.createContext)(i),r=()=>(0,a.useContext)(t)||i,o=()=>"user"===r()?"userProfile":"organizationProfile"}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["608"],{23689:function(t,n,i){i.d(n,{l_:()=>u,mu:()=>e}),i(19161),i(22239),i(95055);let e={userMemberships:{infinite:!0},userInvitations:{infinite:!0},userSuggestions:{infinite:!0,status:["pending","accepted"]}},u=(t,n,i)=>{var e;if(void 0===n)return[{data:[t],total_count:1}];let u=(null==n||null==(e=n[n.length-1])?void 0:e.total_count)||1;return n.map(n=>{if(void 0===n)return n;let e=n.data.map(n=>n.id===t.id?{...t}:n);return{...n,data:e,total_count:"negative"===i?u-1:u}})}},44817:function(t,n,i){i.d(n,{OrganizationSwitcherPrefetch:()=>a});var e=i(21210),u=i(23689);function a(){return(0,e.D_)(u.mu),null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["30"],{46334:function(e,l,n){n.r(l),n.d(l,{PricingTable:()=>i.n});var i=n(11217)},97288:function(e,l,n){n.d(l,{A$:()=>m,D:()=>f,Ij:()=>s,Rs:()=>g,eT:()=>p,mu:()=>c,wD:()=>b}),n(19161),n(89305),n(85074),n(95055);var i=n(21210),a=n(35074),t=n(57477),r=n(65424),o=n(22861),u=n(46256);function s(e){return e.endsWith(".00")?e.slice(0,-3):e}let d=()=>{let e=(0,u.XX)(),l=(0,t.Fd)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),n=(0,i.Wf)();return{for:e,keepPreviousData:!0,enabled:"organization"!==e||!!(null==n?void 0:n.organization)&&l}},c=()=>{let e=d();return(0,i.X$)(e)},b=()=>{let e=d();return(0,i.t7)(e)},p=e=>{let l=d();return(0,i.tr)({...l,__experimental_mode:null==e?void 0:e.mode})},g=()=>{var e;let l=d(),n=(0,i.kH)(l),t=(0,a.useMemo)(()=>{var e;return(null==(e=n.data)?void 0:e.subscriptionItems)||[]},[null==(e=n.data)?void 0:e.subscriptionItems]);return{...n,subscriptionItems:t}},m=e=>{let l=(0,u.XX)();return(0,i.rg)({for:l,initialPage:1,pageSize:50,keepPreviousData:!0,enabled:!0,__experimental_mode:null==e?void 0:e.mode})},f=()=>{let e=(0,i.ho)(),{session:l}=(0,i.wV)(),n=(0,u.XX)(),t=(0,a.useMemo)(()=>{var l;return!!(!e.session||(null==e||null==(l=e.session)?void 0:l.checkAuthorization({permission:"org:sys_billing:manage"}))||"user"===n)},[e,n]),{subscriptionItems:s,revalidate:d,data:b}=g(),{data:f,revalidate:h}=m({mode:"cache"}),{revalidate:v}=p({mode:"cache"}),{revalidate:_}=c(),k=(0,a.useCallback)(()=>{d(),h(),v(),_()},[d,h,v,_]),A=(0,a.useMemo)(()=>0===s.length||!s.some(e=>!e.canceledAt),[s]),C=(0,a.useCallback)(e=>s.find(l=>l.plan.id===e.id),[s]),P=(0,a.useCallback)(e=>s.filter(l=>l.plan.id===e.id),[s]),y=(0,a.useCallback)(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"month",n=P(e);if(n.length>1){let e=n.find(e=>e.planPeriod===l);return e||n[0]}if(1===n.length)return n[0]},[P]),G=(0,a.useCallback)(e=>{let{plan:l,subscription:n}=e,i=null!=n?n:l?C(l):void 0;return!i||!i.canceledAt},[C]),T=(0,a.useCallback)(e=>{let{plan:n,subscription:i,isCompact:a=!1,selectedPlanPeriod:r="annual"}=e,u=null!=i?i:n?y(n,r):void 0,d=r,c=!!(null==n?void 0:n.annualMonthlyFee);"annual"!==d||c||(d="month");let p=e=>{if(null==n?void 0:n.freeTrialEnabled){let e=!l,a=null==b?void 0:b.eligibleForFreeTrial;if(e||a){var i;return(0,o.G)("billing.startFreeTrial__days",{days:null!=(i=n.freeTrialDays)?i:0})}}return e};return{localizationKey:p((()=>{if(u){if(d!==u.planPeriod&&u.canceledAt){if("month"===d)return(0,o.G)("billing.switchToMonthly");if(c)return(0,o.G)("billing.switchToAnnual")}if(u.canceledAt)return(0,o.G)("billing.reSubscribe");if(d!==u.planPeriod){if("month"===d)return(0,o.G)("billing.switchToMonthly");if(c)return(0,o.G)("billing.switchToAnnual")}return(0,o.G)("billing.manageSubscription")}return s.filter(e=>!e.plan.isDefault).length>0?(0,o.G)("billing.switchPlan"):p((0,o.G)("billing.subscribe"))})()),variant:a?"bordered":"solid",colorScheme:a?"secondary":"primary",isDisabled:!t,disabled:!t}},[y,t,s,b]),D=(0,a.useCallback)(e=>e.pastDueAt?(0,o.G)("badge__pastDueAt",{date:e.pastDueAt}):"upcoming"===e.status?(0,o.G)("badge__startsAt",{date:e.periodStart}):e.canceledAt?(0,o.G)("badge__canceledEndsAt",{date:e.periodEnd}):e.periodEnd?(0,o.G)(e.isFreeTrial?"badge__trialEndsAt":"badge__renewsAt",{date:e.periodEnd}):void 0,[]),w=(0,a.useCallback)(l=>{let i=(0,r.J)("modal",l);e.__internal_openSubscriptionDetails({for:n,onSubscriptionCancel:()=>{k()},portalRoot:i})},[e,n,k]);return{activeOrUpcomingSubscription:C,activeAndUpcomingSubscriptions:P,activeOrUpcomingSubscriptionBasedOnPlanPeriod:y,isDefaultPlanImplicitlyActiveOrUpcoming:A,handleSelectPlan:(0,a.useCallback)(i=>{let{plan:a,planPeriod:t,mode:o="mounted",event:u,appearance:s,newSubscriptionRedirectUrl:d}=i,c=(0,r.J)(o,u);e.__internal_openCheckout({planId:a.id,planPeriod:"annual"!==t||a.annualMonthlyFee?t:"month",for:n,onSubscriptionComplete:()=>{k()},onClose:()=>{(null==l?void 0:l.id)&&e.setActive({session:l.id})},appearance:s,portalRoot:c,newSubscriptionRedirectUrl:d})},[e,k,n,null==l?void 0:l.id]),openSubscriptionDetails:w,buttonPropsForPlan:T,canManageSubscription:G,captionForSubscription:D,defaultFreePlan:(0,a.useMemo)(()=>null==f?void 0:f.find(e=>e.isDefault),[f]),revalidateAll:k}}},46256:function(e,l,n){n.d(l,{N7:()=>o,XX:()=>r,m$:()=>t});var i=n(35074);let a="user",t=(0,i.createContext)(a),r=()=>(0,i.useContext)(t)||a,o=()=>"user"===r()?"userProfile":"organizationProfile"}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["505"],{17396:function(e,o,t){t.d(o,{n:()=>l});var i=t(14518);t(35074);var n=t(86705);let l=e=>{let{modalRoot:o,containerSx:t,...l}=e;return(0,i.Y)(n.Modal,{...l,portalRoot:o,containerSx:[[{alignItems:"center"},o?e=>({position:"absolute",right:0,bottom:0,backgroundColor:"inherit",backdropFilter:"blur(".concat(e.sizes.$2,")"),display:"flex",justifyContent:"center",minHeight:"100%",height:"100%",width:"100%",borderRadius:e.radii.$lg}):{}],t]})}},78195:function(e,o,t){t.d(o,{RevokeAPIKeyConfirmationModal:()=>m});var i=t(14518),n=t(21210),l=t(58920),a=t(23707),r=t(52454),s=t(11475),c=t(23549),d=t(10078),p=t(22861),u=t(8640),h=t(17396);let m=e=>{let{isOpen:o,onOpen:t,onClose:m,apiKeyID:k,apiKeyName:v,onRevokeSuccess:b,modalRoot:f}=e,y=(0,n.ho)(),{t:R}=(0,d._)(),C=(0,u.tJ)("apiKeyRevokeConfirmation","",{type:"text",label:'Type "Revoke" to confirm',placeholder:"Revoke",isRequired:!0}),g=C.value===R((0,p.G)("apiKeys.revokeConfirmation.confirmationText")),K=()=>{m(),C.setValue("")},$=async e=>{e.preventDefault(),k&&g&&(await y.apiKeys.revoke({apiKeyID:k}),null==b||b(),K())};return o?(0,i.Y)(h.n,{handleOpen:t,handleClose:K,canCloseModal:!1,modalRoot:f,children:(0,i.Y)(a.Z.Root,{role:"alertdialog",elementDescriptor:l.$z.apiKeysRevokeModal,children:(0,i.Y)(a.Z.Content,{sx:e=>({textAlign:"left",padding:"".concat(e.sizes.$4," ").concat(e.sizes.$5," ").concat(e.sizes.$4," ").concat(e.sizes.$6)}),children:(0,i.Y)(c.M,{headerTitle:(0,p.G)("apiKeys.revokeConfirmation.formTitle",{apiKeyName:v}),headerSubtitle:(0,p.G)("apiKeys.revokeConfirmation.formHint"),children:(0,i.FD)(r.l.Root,{onSubmit:$,children:[(0,i.Y)(r.l.ControlRow,{elementId:C.id,elementDescriptor:l.$z.apiKeysRevokeModalInput,children:(0,i.Y)(r.l.PlainInput,{...C.props})}),(0,i.Y)(s.G,{submitLabel:(0,p.G)("apiKeys.revokeConfirmation.formButtonPrimary__revoke"),colorScheme:"danger",isDisabled:!g,onReset:K,elementDescriptor:l.$z.apiKeysRevokeModalSubmitButton})]})})})})}):null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["390"],{61662:function(e,r,s){s.r(r),s.d(r,{SessionTasks:()=>g});var t=s(14518),i=s(5580),n=s(21210),l=s(34525),o=s(35074),a=s(44607),d=s(23707),u=s(63269),c=s(56980),h=s(81616),p=s(4964),m=s(80212),w=s(42265),Y=s(19024),k=s(57959);let v=()=>{let e=(0,n.ho)(),{navigate:r}=(0,p.r)(),{redirectUrlComplete:s}=(0,h.z1)();return(0,o.useEffect)(()=>{let s=setTimeout(()=>{var s,t;let n=null==(t=e.session)||null==(s=t.currentTask)?void 0:s.key;n&&r("./".concat(i.tk[n]))},500);return()=>clearTimeout(s)},[r,e,s]),(0,t.Y)(a.n.Part,{part:"start",children:(0,t.FD)(d.Z.Root,{children:[(0,t.Y)(d.Z.Content,{children:(0,t.Y)(c.W,{})}),(0,t.Y)(d.Z.Footer,{})]})})};function f(){let e=(0,h.z1)();return(0,t.Y)(a.n.Root,{flow:"tasks",children:(0,t.FD)(m.d,{children:[(0,t.Y)(w.q,{path:i.tk["choose-organization"],children:(0,t.Y)(h.lY.Provider,{value:{componentName:"TaskChooseOrganization",redirectUrlComplete:e.redirectUrlComplete},children:(0,t.Y)(Y.TaskChooseOrganization,{})})}),(0,t.Y)(w.q,{path:i.tk["reset-password"],children:(0,t.Y)(h.pq.Provider,{value:{componentName:"TaskResetPassword",redirectUrlComplete:e.redirectUrlComplete},children:(0,t.Y)(k.TaskResetPassword,{})})}),(0,t.Y)(w.q,{index:!0,children:(0,t.Y)(v,{})})]})})}let g=(0,u.dm)(e=>{var r;let{redirectUrlComplete:s}=e,i=(0,n.ho)(),{navigate:a}=(0,p.r)(),u=(0,o.useRef)(null);return((0,o.useEffect)(()=>{var e,r,t;let n=null==(e=i.session)?void 0:e.currentTask;n&&(null==(r=i.session)?void 0:r.status)!=="active"?null==(t=i.telemetry)||t.record((0,l.we)("SessionTask",{task:n.key})):a(s)},[i,a,s]),null==(r=i.session)?void 0:r.currentTask)?(0,t.Y)(h.qx.Provider,{value:{redirectUrlComplete:s},children:(0,t.Y)(f,{})}):(0,t.FD)(d.Z.Root,{sx:()=>{var e;return{minHeight:u?null==(e=u.current)?void 0:e.offsetHeight:void 0}},children:[(0,t.Y)(d.Z.Content,{sx:()=>({flex:1}),children:(0,t.Y)(c.W,{})}),(0,t.Y)(d.Z.Footer,{})]})})},57959:function(e,r,s){s.r(r),s.d(r,{TaskResetPassword:()=>b}),s(88711);var t=s(14518),i=s(21210),n=s(97697),l=s(49599),o=s(85577),a=s(81616),d=s(10078),u=s(22861),c=s(44607),h=s(18272),p=s(58920),m=s(23707),w=s(63269),Y=s(52454),k=s(76153),v=s(23468),f=s(38691),g=s(4468),P=s(23990),R=s(8640),y=s(80179);let b=(0,o.Z)((0,y.d)((0,w.dm)(()=>{var e,r,s,o,y,b,C;let O=(0,i.ho)(),F=(0,w.f0)(),{userSettings:{passwordSettings:T}}=(0,n.O)(),{t:Z,locale:z}=(0,d._)(),{redirectUrlComplete:x}=(0,a.O_)(),{otherSessions:_}=(0,f.z)({user:O.user}),{navigateAfterSignOut:D,navigateAfterMultiSessionSingleSignOutUrl:A}=(0,l.g)(),S=(0,i.Wp)((e,r)=>e.updatePassword(...r)),{navigateOnSetActive:L}=(0,a.z1)(),q=(0,R.tJ)("newPassword","",{type:"password",label:(0,u.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,P.C5)(e,{t:Z,locale:z,passwordSettings:T})}),G=(0,R.tJ)("confirmPassword","",{type:"password",label:(0,u.G)("formFieldLabel__confirmPassword"),isRequired:!0}),I=(0,R.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,u.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:E,isPasswordMatch:K}=(0,v.Z)({passwordField:q,confirmPasswordField:G}),U=null!=(C=null==(r=O.user)||null==(e=r.primaryEmailAddress)?void 0:e.emailAddress)?C:null==(s=O.user)?void 0:s.username;return(0,t.Y)(c.n.Root,{flow:"taskResetPassword",children:(0,t.Y)(c.n.Part,{part:"resetPassword",children:(0,t.FD)(m.Z.Root,{children:[(0,t.FD)(m.Z.Content,{children:[(0,t.FD)(k.Y.Root,{showLogo:!0,children:[(0,t.Y)(k.Y.Title,{localizationKey:(0,u.G)("taskResetPassword.title")}),(0,t.Y)(k.Y.Subtitle,{localizationKey:(0,u.G)("taskResetPassword.subtitle")})]}),(0,t.Y)(m.Z.Alert,{children:F.error}),(0,t.Y)(h.fv,{elementDescriptor:p.$z.main,gap:8,children:(0,t.FD)(Y.l.Root,{onSubmit:()=>{F.runAsync(async()=>{if(K&&O.user){q.clearFeedback(),G.clearFeedback();try{await S(O.user,[{newPassword:q.value,signOutOfOtherSessions:I.checked}]),await O.setActive({session:O.session,navigate:async e=>{let{session:r}=e;await (null==L?void 0:L({session:r,redirectUrlComplete:x}))}})}catch(e){return(0,g.H4)(e,[q,G],F.setError)}}})},onBlur:()=>{q.value&&E(G.value)},gap:8,children:[(0,t.FD)(h.fv,{gap:6,children:[(0,t.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:(null==(y=O.user)||null==(o=y.primaryEmailAddress)?void 0:o.emailAddress)||(null==(b=O.user)?void 0:b.username)||"",style:{display:"none"}}),(0,t.Y)(Y.l.ControlRow,{elementId:q.id,children:(0,t.Y)(Y.l.PasswordInput,{...q.props,isRequired:!0,minLength:6})}),(0,t.Y)(Y.l.ControlRow,{elementId:G.id,children:(0,t.Y)(Y.l.PasswordInput,{...G.props,onChange:e=>(e.target.value&&E(e.target.value),G.props.onChange(e))})}),(0,t.Y)(Y.l.ControlRow,{elementId:I.id,children:(0,t.Y)(Y.l.Checkbox,{...I.props})})]}),(0,t.Y)(h.fv,{gap:3,children:(0,t.Y)(Y.l.SubmitButton,{isLoading:F.isLoading,isDisabled:!K,localizationKey:(0,u.G)("taskResetPassword.formButtonPrimary")})})]})})]}),(0,t.Y)(m.Z.Footer,{children:(0,t.FD)(m.Z.Action,{elementId:"signOut",gap:2,justify:"center",sx:()=>({width:"100%"}),children:[U&&(0,t.Y)(m.Z.ActionText,{truncate:!0,localizationKey:(0,u.G)("taskResetPassword.signOut.actionText",{identifier:U})}),(0,t.Y)(m.Z.ActionLink,{sx:()=>({flexShrink:0}),onClick:()=>{var e;0===_.length?null==O||O.signOut(D):null==O||O.signOut(A,{sessionId:null==(e=O.session)?void 0:e.id})},localizationKey:(0,u.G)("taskResetPassword.signOut.actionLink")})]})})]})})})}),"reset-password"))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["10"],{19090:function(e,t,r){r.d(t,{n:()=>a});var n=r(14518),i=r(45170),o=r(22861);let a=e=>{let{onBackLinkClick:t}=e;return(0,n.Y)(i.J,{cardTitle:(0,o.G)("signIn.alternativeMethods.getHelp.title"),cardSubtitle:(0,o.G)("signIn.alternativeMethods.getHelp.content"),onBackLinkClick:t})}},35717:function(e,t,r){let n,i;r.r(t),r.d(t,{SignIn:()=>tb,SignInModal:()=>tk});var o,a=r(14518),l=r(21210),s=r(35074),c=r(55873),d=r(80004),u=r(75350),h=r(85577),p=r(44607),f=r(67896),g=r(17607),m=r(54096),v=r(80212),I=r(42265),_=r(54132);r(50036);var w=r(9075),S=r(22861),b=r(18272),Y=r(58920),k=r(29),C=r(23707),A=r(63269),F=r(76153),y=r(49236),U=r(4964);let P=(0,s.lazy)(()=>Promise.all([r.e("545"),r.e("666"),r.e("188")]).then(r.bind(r,66464)).then(e=>({default:e.Web3SolanaWalletButtons}))),E=(0,w.RL)((0,w.SY)((0,A.dm)(()=>{let e=(0,l.ho)(),t=(0,A.f0)(),r=(0,U.r)(),n=(0,d.r)();return(0,a.Y)(p.n.Part,{part:"chooseWallet",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.web3Solana.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.web3Solana.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:t.error}),(0,a.FD)(b.so,{direction:"col",gap:4,children:[(0,a.Y)(s.Suspense,{fallback:(0,a.Y)(b.so,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$32}),children:(0,a.Y)(b.y$,{size:"lg",colorScheme:"primary",elementDescriptor:Y.$z.spinner})}),children:(0,a.Y)(P,{web3AuthCallback:i=>{let{walletName:o}=i;return e.authenticateWithWeb3({customNavigate:r.navigate,redirectUrl:n.afterSignInUrl||"/",secondFactorUrl:"factor-two",signUpContinueUrl:n.isCombinedFlow?"create/continue":n.signUpContinueUrl,strategy:"web3_solana_signature",walletName:o}).catch(e=>(0,y.f)(e,t.setError))}})}),(0,a.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:()=>{r.navigate("../")}})]})]}),(0,a.Y)(C.Z.Footer,{})]})})})));var D=r(42311);let L=()=>Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,84753)),M=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpVerifyPhone}))),T=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpVerifyEmail}))),G=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpStart}))),R=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpSSOCallback}))),B=(0,s.lazy)(()=>L().then(e=>({default:e.SignUpContinue})));r(88711),r(60486),r(25089),r(61244),r(77895);var z=r(31475),O=r(52454),N=r(4468),Z=r(23990),$=r(8640),x=r(56324),K=r(97697),W=r(10078),V=r(23468),q=r(19426);let H=(0,A.dm)(()=>{let e=(0,x.n)(),t=(0,A.f0)(),{navigate:r}=(0,U.r)(),n=(0,q.p)(),{userSettings:{passwordSettings:i}}=(0,K.O)(),{t:o,locale:l}=(0,W._)(),c="needs_new_password"===e.status&&"reset_password_email_code"!==e.firstFactorVerification.strategy&&"reset_password_phone_code"!==e.firstFactorVerification.strategy;s.useEffect(()=>{c&&t.setError(o((0,S.G)("signIn.resetPassword.requiredMessage")))},[]);let d=(0,$.tJ)("password","",{type:"password",label:(0,S.G)("formFieldLabel__newPassword"),isRequired:!0,validatePassword:!0,buildErrorMessage:e=>(0,Z.C5)(e,{t:o,locale:l,passwordSettings:i})}),u=(0,$.tJ)("confirmPassword","",{type:"password",label:(0,S.G)("formFieldLabel__confirmPassword"),isRequired:!0}),h=(0,$.tJ)("signOutOfOtherSessions","",{type:"checkbox",label:(0,S.G)("formFieldLabel__signOutOfOtherSessions"),defaultChecked:!0}),{setConfirmPasswordFeedback:p,isPasswordMatch:f}=(0,V.Z)({passwordField:d,confirmPasswordField:u}),g=async()=>{if(f){d.clearFeedback(),u.clearFeedback();try{let{status:t,createdSessionId:i}=await e.resetPassword({password:d.value,signOutOfOtherSessions:h.checked});switch(t){case"complete":if(i){let e=new URLSearchParams;return e.set("createdSessionId",i),r("../reset-password-success?".concat(e.toString()))}return console.error((0,z.wv)(t,n));case"needs_second_factor":return r("../factor-two");default:return console.error((0,z.wv)(t,n))}}catch(e){return(0,N.H4)(e,[d,u],t.setError)}}};return(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.Y)(F.Y.Root,{showLogo:!0,children:(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.resetPassword.title")})}),(0,a.Y)(C.Z.Alert,{children:t.error}),(0,a.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,a.FD)(O.l.Root,{onSubmit:g,onBlur:()=>{d.value&&p(u.value)},gap:8,children:[(0,a.FD)(b.fv,{gap:6,children:[(0,a.Y)("input",{readOnly:!0,"data-testid":"hidden-identifier",id:"identifier-field",name:"identifier",value:e.identifier||"",style:{display:"none"}}),(0,a.Y)(O.l.ControlRow,{elementId:d.id,children:(0,a.Y)(O.l.PasswordInput,{...d.props,isRequired:!0,autoFocus:!0})}),(0,a.Y)(O.l.ControlRow,{elementId:u.id,children:(0,a.Y)(O.l.PasswordInput,{...u.props,onChange:e=>(e.target.value&&p(e.target.value),u.props.onChange(e))})}),!c&&(0,a.Y)(O.l.ControlRow,{elementId:h.id,children:(0,a.Y)(O.l.Checkbox,{...h.props})})]}),(0,a.FD)(b.fv,{gap:3,children:[(0,a.Y)(O.l.SubmitButton,{isDisabled:!f,localizationKey:(0,S.G)("signIn.resetPassword.formButtonPrimary")}),(0,a.Y)(C.Z.Action,{elementId:"alternativeMethods",children:(0,a.Y)(C.Z.ActionLink,{elementDescriptor:Y.$z.backLink,localizationKey:(0,S.G)("backButton"),onClick:()=>r("../")})})]})]})})]}),(0,a.Y)(C.Z.Footer,{})]})});var j=r(9107),J=r(56488);let X=(0,A.dm)(()=>{let e=(0,A.f0)();return(0,j.h)(),(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.Y)(F.Y.Root,{showLogo:!0,children:(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.resetPassword.title")})}),(0,a.Y)(C.Z.Alert,{children:e.error}),(0,a.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:[(0,a.Y)(b.EY,{localizationKey:(0,S.G)("signIn.resetPassword.successMessage")}),(0,a.Y)(J.s,{direction:"row",center:!0,children:(0,a.Y)(b.y$,{size:"xl",colorScheme:"primary",elementDescriptor:Y.$z.spinner})})]})]}),(0,a.Y)(C.Z.Footer,{})]})});r(19161),r(22239);var Q=r(62531),ee=r(80750),et=r(29345),er=r(49599),en=r(29366),ei=r(26932),eo=r(61052),ea=r(2540);let el=(0,w.SY)((0,A.dm)(()=>{let e=(0,A.f0)(),{userProfileUrl:t}=(0,K.O)().displayConfig,{afterSignInUrl:r,path:n,signInUrl:i,taskUrl:o}=(0,d.r)(),{navigateAfterSignOut:l}=(0,er.g)(),{handleSignOutAllClicked:s,handleSessionClicked:c,signedInSessions:u,handleAddAccountClicked:h}=(0,ea.u)({taskUrl:o,navigateAfterSignOut:l,afterSwitchSessionUrl:r,userProfileUrl:t,signInUrl:null!=n?n:i,user:void 0});return(0,a.Y)(p.n.Part,{part:"accountSwitcher",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{sx:e=>({padding:"".concat(e.space.$8," ").concat(e.space.$none," ").concat(e.space.$none)}),children:[(0,a.FD)(F.Y.Root,{children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.accountSwitcher.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.accountSwitcher.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:e.error}),(0,a.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,sx:e=>({borderTopWidth:e.borderWidths.$normal,borderTopStyle:e.borderStyles.$solid,borderTopColor:e.colors.$borderAlpha100}),children:(0,a.FD)(Q.En,{role:"menu",children:[u.map(e=>(0,a.Y)(ee.P,{onClick:c(e),sx:e=>({height:e.sizes.$16,justifyContent:"flex-start",borderRadius:0}),icon:en.A,children:(0,a.Y)(et.c,{user:e.user,sx:{width:"100%"}})},e.id)),(0,a.Y)(Q.rc,{elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("addAccount"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("addAccount"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("addAccount"),icon:ei.A,label:(0,S.G)("signIn.accountSwitcher.action__addAccount"),onClick:h,iconSx:e=>({width:e.sizes.$9,height:e.sizes.$6}),iconBoxSx:e=>({minHeight:e.sizes.$9,minWidth:e.sizes.$6,alignItems:"center"}),spinnerSize:"md"})]})})]}),(0,a.Y)(C.Z.Footer,{sx:e=>({">:first-of-type":{padding:"".concat(e.space.$1),width:"100%"}}),children:(0,a.Y)(C.Z.Action,{sx:{width:"100%",">:first-of-type":{width:"100%",borderBottomWidth:0}},children:(0,a.Y)(eo.ww,{handleSignOutAllClicked:s,elementDescriptor:Y.$z.accountSwitcherActionButton,elementId:Y.$z.accountSwitcherActionButton.setId("signOutAll"),iconBoxElementDescriptor:Y.$z.accountSwitcherActionButtonIconBox,iconBoxElementId:Y.$z.accountSwitcherActionButtonIconBox.setId("signOutAll"),iconElementDescriptor:Y.$z.accountSwitcherActionButtonIcon,iconElementId:Y.$z.accountSwitcherActionButtonIcon.setId("signOutAll"),label:(0,S.G)("signIn.accountSwitcher.action__signOutAll"),actionSx:e=>({padding:"".concat(e.space.$2," ").concat(e.space.$2)})})})})]})})}));var es=r(56980);r(98114);var ec=r(38738),ed=r(68289),eu=r(99835),eh=r(19090);let ep=e=>{let[t,r]=s.useState(!1),n=s.useCallback(()=>r(e=>!e),[r]);return t?(0,a.Y)(eh.n,{onBackLinkClick:n}):(0,a.Y)(ef,{onBackLinkClick:e.onBackLinkClick,onFactorSelected:e.onFactorSelected,onHavingTroubleClick:n})},ef=e=>{let{onHavingTroubleClick:t,onFactorSelected:r,onBackLinkClick:n}=e,i=(0,A.f0)(),{supportedSecondFactors:o}=(0,x.n)();return(0,a.Y)(p.n.Part,{part:"alternativeMethods",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.alternativeMethods.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.alternativeMethods.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:i.error}),(0,a.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:3,children:[(0,a.Y)(b.fv,{gap:2,children:o&&o.sort(ed.Wy).map((e,t)=>(0,a.Y)(ec.X,{textLocalizationKey:function(e){switch(e.strategy){case"phone_code":return(0,S.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"totp":return(0,S.G)("signIn.alternativeMethods.blockButton__totp");case"backup_code":return(0,S.G)("signIn.alternativeMethods.blockButton__backupCode");case"email_code":return(0,S.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_link":return(0,S.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});default:throw Error("Invalid sign in strategy")}}(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,isDisabled:i.isLoading,onClick:()=>r(e)},t))}),(0,a.Y)(C.Z.Action,{elementId:"alternativeMethods",children:n&&(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("backButton"),onClick:e.onBackLinkClick})})]})]}),(0,a.Y)(C.Z.Footer,{children:(0,a.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionText")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionLink"),onClick:t})]})})]})})};r(89305);var eg=r(73610),em=r(27912),ev=r(55763);let eI=e=>{var t,r;return(0,ev.Kw)(null==(t=e.firstFactorVerification)?void 0:t.strategy)&&(null==(r=e.firstFactorVerification)?void 0:r.status)==="verified"},e_=e=>{let t=(0,K.O)(),r=(0,x.n)(),n=(0,A.f0)(),{afterSignInUrl:i,navigateOnSetActive:o}=(0,d.r)(),{setActive:c}=(0,l.ho)(),{navigate:u}=(0,U.r)(),h=(0,q.p)(),p=(0,l.ho)(),f=(0,s.useMemo)(()=>{let e=Object.values(t.userSettings.attributes).some(e=>e.used_for_second_factor);return"new"===r.clientTrustState&&!e},[r.clientTrustState,t.userSettings.attributes]);s.useEffect(()=>{e.factorAlreadyPrepared||null==g||g()},[]);let g=e.prepare?()=>{var t;return null==(t=e.prepare)?void 0:t.call(e).then(()=>e.onFactorPrepare()).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[],n.setError)})}:void 0;return(0,a.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:eI(r)?(0,S.G)("signIn.forgotPassword.subtitle"):e.cardSubtitle,cardNotice:e.showClientTrustNotice||f?(0,S.G)("signIn.newDeviceVerificationNotice"):void 0,resendButton:e.resendButton,inputLabel:e.inputLabel,onCodeEntryFinishedAction:(t,n,a)=>{r.attemptSecondFactor({strategy:e.factor.strategy,code:t}).then(async e=>{if(await n(),"complete"!==e.status)return console.error((0,z.wv)(e.status,h));if(eI(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),u("../reset-password-success?".concat(t.toString()))}return c({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await o({session:t,redirectUrl:i})}})}).catch(e=>(0,eg._d)(e)?p.__internal_navigateWithError("..",e.errors[0]):a(e))},onResendCodeClicked:g,safeIdentifier:"safeIdentifier"in e.factor?e.factor.safeIdentifier:void 0,profileImageUrl:r.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,children:eI(r)&&(0,a.Y)(b.EY,{localizationKey:(0,S.G)("signIn.resetPasswordMfa.detailsLabel"),colorScheme:"secondary"})})},ew=e=>{let t=(0,x.n)();return(0,a.Y)(p.n.Part,{part:"emailCode2Fa",children:(0,a.Y)(e_,{...e,cardTitle:(0,S.G)("signIn.emailCodeMfa.title"),cardSubtitle:(0,S.G)("signIn.emailCodeMfa.subtitle"),inputLabel:(0,S.G)("signIn.emailCodeMfa.formTitle"),resendButton:(0,S.G)("signIn.emailCodeMfa.resendButton"),prepare:()=>{let{emailAddressId:r,strategy:n}=e.factor;return t.prepareSecondFactor({emailAddressId:r,strategy:n})}})})};var eS=r(72027),eb=r(14979),eY=r(78051),ek=r(12992);let eC=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:o}=i,{afterSignInUrl:c}=(0,d.r)(),{setActive:u}=(0,l.ho)(),{startEmailLinkFlow:h,cancelEmailLinkFlow:f}=(0,ek.u)(n),[g,m]=s.useState(!1),v=(0,l.ho)();s.useEffect(()=>{I()},[]);let I=()=>{h({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:o,intent:"sign-in"})}).then(e=>_(e)).catch(e=>{if((0,eg._d)(e))return v.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[],r.setError)})},_=async e=>{let n=e.secondFactorVerification;"expired"===n.status?r.setError(t((0,S.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?m(!0):await u({session:e.createdSessionId,redirectUrl:c})};return g?(0,a.Y)(eb.$,{title:(0,S.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,S.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,a.Y)(p.n.Part,{part:"emailLink",children:(0,a.Y)(eS._,{cardTitle:(0,S.G)("signIn.emailLinkMfa.title"),cardSubtitle:(0,S.G)("signIn.emailLinkMfa.subtitle"),cardNotice:e.showClientTrustNotice||"new"===n.clientTrustState?(0,S.G)("signIn.newDeviceVerificationNotice"):void 0,formSubtitle:(0,S.G)("signIn.emailLinkMfa.formSubtitle"),resendButton:(0,S.G)("signIn.emailLinkMfa.resendButton"),onResendCodeClicked:()=>{f(),I()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})},eA=e=>{let t=(0,x.n)();return(0,a.Y)(p.n.Part,{part:"phoneCode2Fa",children:(0,a.Y)(e_,{...e,cardTitle:(0,S.G)("signIn.phoneCodeMfa.title"),cardSubtitle:(0,S.G)("signIn.phoneCodeMfa.subtitle"),inputLabel:(0,S.G)("signIn.phoneCodeMfa.formTitle"),resendButton:(0,S.G)("signIn.phoneCodeMfa.resendButton"),prepare:()=>{let{phoneNumberId:r,strategy:n}=e.factor;return t.prepareSecondFactor({phoneNumberId:r,strategy:n})}})})};var eF=r(22690);let ey=(0,w.RL)((0,w.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:o,toggleAllStrategies:l}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,a.Y)(es.B,{});if(o)return(0,a.Y)(ep,{onBackLinkClick:l,onFactorSelected:i});switch(null==t?void 0:t.strategy){case"phone_code":return(0,a.Y)(eA,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"email_code":return(0,a.Y)(ew,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"email_link":return(0,a.Y)(eC,{showClientTrustNotice:!0,factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});default:return(0,a.Y)(es.B,{})}})));var eU=r(45170),eP=r(83474),eE=r(66505),eD=r(85763),eL=r(74421),eM=r(11051),eT=r(92181),eG=r(30743),eR=r(16889);r(85074);var eB=r(22166),ez=r(60044),eO=r(33226);let eN=s.memo(e=>{let t=(0,l.ho)(),{navigate:r}=(0,U.r)(),n=(0,A.f0)(),{displayConfig:i}=(0,K.O)(),o=(0,d.r)(),s=(0,x.n)(),c=(0,eY.uP)(o,i.signInUrl),u=o.afterSignInUrl||"/",h="popup"===o.oauthFlow||"auto"===o.oauthFlow&&(0,ez.C)(),{onAlternativePhoneCodeProviderClick:p,...f}=e,g=e=>(0,eg.$R)(e)&&e.errors.find(e=>e.code===eB.c.SESSION_EXISTS)?t.setActive({session:t.client.lastActiveSessionId,navigate:async e=>{let{session:t}=e;await o.navigateOnSetActive({session:t,redirectUrl:o.afterSignInUrl})}}):(0,N.H4)(e,[],n.setError);return(0,a.Y)(eO.V,{...f,showLastAuthenticationStrategy:!0,idleAfterDelay:!h,oauthCallback:e=>{if(h){let t=window.open("about:blank","","width=600,height=800"),r=setInterval(()=>{(!t||t.closed)&&(clearInterval(r),n.setIdle())},500);return s.authenticateWithPopup({strategy:e,redirectUrl:c,redirectUrlComplete:u,popup:t,oidcPrompt:o.oidcPrompt}).catch(e=>g(e))}return s.authenticateWithRedirect({strategy:e,redirectUrl:c,redirectUrlComplete:u,oidcPrompt:o.oidcPrompt}).catch(e=>g(e))},web3Callback:e=>"web3_solana_signature"===e?r("choose-wallet?strategy=".concat(e)):t.authenticateWithWeb3({customNavigate:r,redirectUrl:u,signUpContinueUrl:o.isCombinedFlow?"create/continue":o.signUpContinueUrl,strategy:e,secondFactorUrl:"factor-two"}).catch(e=>(0,y.f)(e,n.setError)),alternativePhoneCodeCallback:e=>{null==p||p(e)}})});function eZ(){var e;return null==(e=(0,x.n)().supportedFirstFactors)?void 0:e.find(e=>{let{strategy:t}=e;return(0,ev.Kw)(t)})}let e$=e=>((e,t)=>{let[r,n]=s.useState(!1),i=s.useCallback(()=>n(e=>!e),[n]);return r?(0,a.Y)(eh.n,{onBackLinkClick:i}):(0,a.Y)(e,{...t,onHavingTroubleClick:i})})(ex,{...e}),ex=e=>{let{onBackLinkClick:t,onHavingTroubleClick:r,onFactorSelected:n,mode:i="default"}=e,o=(0,A.f0)(),l=eZ(),{supportedFirstFactors:s}=(0,x.n)(),{firstPartyFactors:c,hasAnyStrategy:d}=(0,eP.y)({filterOutFactor:null==e?void 0:e.currentFactor,supportedFirstFactors:s}),u=function(e){switch(e){case"forgot":return"forgotPasswordMethods";case"pwned":return"passwordPwnedMethods";case"passwordCompromised":return"passwordCompromisedMethods";default:return"alternativeMethods"}}(i),h=function(e){switch(e){case"forgot":return(0,S.G)("signIn.forgotPasswordAlternativeMethods.title");case"pwned":return(0,S.G)("signIn.passwordPwned.title");case"passwordCompromised":return(0,S.G)("signIn.passwordCompromised.title");default:return(0,S.G)("signIn.alternativeMethods.title")}}(i),f=function(e){switch(e){case"forgot":case"pwned":return!0;default:return!1}}(i);return(0,a.Y)(p.n.Part,{part:u,children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:h}),!f&&"passwordCompromised"!==i&&(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.alternativeMethods.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:o.error}),(0,a.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:[f&&l&&(0,a.Y)(b.$n,{localizationKey:eK(l),elementDescriptor:Y.$z.alternativeMethodsBlockButton,isDisabled:o.isLoading,onClick:()=>{o.setError(void 0),n(l)}}),f&&d&&(0,a.Y)(eE.c,{dividerText:(0,S.G)("signIn.forgotPasswordAlternativeMethods.label__alternativeMethods")}),(0,a.FD)(b.fv,{gap:4,children:[d&&(0,a.FD)(b.so,{elementDescriptor:Y.$z.alternativeMethods,direction:"col",gap:2,children:[(0,a.Y)(eN,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:!1}),c&&c.map((e,t)=>{var r;return(0,a.Y)(ec.X,{leftIcon:(r=e,({email_link:eD.A,email_code:eL.A,phone_code:eM.A,reset_password_email_code:eT.A,reset_password_phone_code:eT.A,password:eG.A,passkey:eR.A})[r.strategy]),textLocalizationKey:eK(e),elementDescriptor:Y.$z.alternativeMethodsBlockButton,textElementDescriptor:Y.$z.alternativeMethodsBlockButtonText,arrowElementDescriptor:Y.$z.alternativeMethodsBlockButtonArrow,textVariant:"buttonLarge",isDisabled:o.isLoading,onClick:()=>{o.setError(void 0),n(e)}},t)})]}),t&&(0,a.Y)(k.E,{boxElementDescriptor:Y.$z.backRow,linkElementDescriptor:Y.$z.backLink,onClick:t})]})]})]}),(0,a.Y)(C.Z.Footer,{children:(0,a.FD)(C.Z.Action,{elementId:"havingTrouble",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionText")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.alternativeMethods.actionLink"),onClick:r})]})})]})})};function eK(e){switch(e.strategy){case"email_link":return(0,S.G)("signIn.alternativeMethods.blockButton__emailLink",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"email_code":return(0,S.G)("signIn.alternativeMethods.blockButton__emailCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"phone_code":return(0,S.G)("signIn.alternativeMethods.blockButton__phoneCode",{identifier:(0,eu.u)(e.safeIdentifier)||""});case"password":return(0,S.G)("signIn.alternativeMethods.blockButton__password");case"passkey":return(0,S.G)("signIn.alternativeMethods.blockButton__passkey");case"reset_password_email_code":case"reset_password_phone_code":return(0,S.G)("signIn.forgotPasswordAlternativeMethods.blockButton__resetPassword");default:throw Error('Invalid sign in strategy: "'.concat(e.strategy,'"'))}}r(95055);var eW=r(35653);function eV(e){let t=(0,A.f0)(),{setActive:r,__internal_navigateWithError:n}=(0,l.ho)(),i=(0,q.p)(),{afterSignInUrl:o,navigateOnSetActive:a}=(0,d.r)(),{authenticateWithPasskey:c}=(0,x.n)();return(0,s.useEffect)(()=>()=>{eW.sv.abort()},[]),(0,s.useCallback)(async function(){for(var l=arguments.length,s=Array(l),d=0;d<l;d++)s[d]=arguments[d];try{let t=await c(...s);switch(t.status){case"complete":return r({session:t.createdSessionId,navigate:async e=>{let{session:t}=e;await a({session:t,redirectUrl:o})}});case"needs_second_factor":return e();default:return console.error((0,z.wv)(t.status,i))}}catch(r){let{flow:e}=s[0]||{};if((0,eg.Cm)(r)&&("passkey_operation_aborted"===r.code||"autofill"===e&&"passkey_retrieval_cancelled"===r.code))return;if((0,eg._d)(r))return n("..",r.errors[0]);(0,N.H4)(r,[],t.setError)}},[])}function eq(e){return!!(null==e?void 0:e.length)&&e.filter(e=>"enterprise_sso"===e.strategy&&"enterpriseConnectionId"in e&&"enterpriseConnectionName"in e).length>1}var eH=r(81652);let ej=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:o}=(0,d.r)(),{setActive:s}=(0,l.ho)(),c=(0,q.p)(),u=(0,l.ho)(),h=e.factor.channel,p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared;return(0,a.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,a,l)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await a(),e.status){case"complete":return s({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await o({session:t,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.wv)(e.status,c))}}).catch(e=>(0,eg._d)(e)?u.__internal_navigateWithError("..",e.errors[0]):l(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor({...e.factor,channel:h}).then(()=>e.onFactorPrepare()).catch(e=>(0,N.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,alternativeMethodsLabel:(0,S.G)("footerActionLink__alternativePhoneCodeProvider"),onShowAlternativeMethodsClicked:()=>{r.setError(void 0),e.onChangePhoneCodeChannel({...e.factor,channel:void 0})},showAlternativeMethods:!0,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eJ=e=>{var t;return(0,a.Y)(p.n.Part,{part:"phoneCode",children:(0,a.Y)(ej,{...e,cardTitle:(0,S.G)("signIn.alternativePhoneCodeProvider.title",{provider:(null==(t=(0,eH.y)(e.factor.channel))?void 0:t.name)||""}),cardSubtitle:(0,S.G)("signIn.alternativePhoneCodeProvider.subtitle"),inputLabel:(0,S.G)("signIn.alternativePhoneCodeProvider.formTitle"),resendButton:(0,S.G)("signIn.alternativePhoneCodeProvider.resendButton")})})},eX=e=>{let t=(0,x.n)(),r=(0,A.f0)(),{navigate:n}=(0,U.r)(),{afterSignInUrl:i,navigateOnSetActive:o}=(0,d.r)(),{setActive:c}=(0,l.ho)(),u=(0,q.p)(),h=(0,l.ho)(),p="verified"===t.firstFactorVerification.status&&e.factorAlreadyPrepared,g=(0,s.useMemo)(()=>{let t=e.factor,r=t.strategy;return"emailAddressId"in t&&(r+="_".concat(t.emailAddressId)),"phoneNumberId"in t&&(r+="_".concat(t.phoneNumberId)),"channel"in t&&t.channel&&(r+="_".concat(t.channel)),{name:"signIn.prepareFirstFactor",factorKey:r}},[e.factor.strategy,"emailAddressId"in e.factor?e.factor.emailAddressId:void 0,"phoneNumberId"in e.factor?e.factor.phoneNumberId:void 0,"channel"in e.factor?e.factor.channel:void 0]);return(0,f.s)(p?void 0:()=>null==t?void 0:t.prepareFirstFactor(e.factor),g,{staleTime:100,onSuccess:()=>e.onFactorPrepare(),onError:e=>(0,N.H4)(e,[],r.setError)}),(0,a.Y)(em.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,inputLabel:e.inputLabel,resendButton:e.resendButton,onCodeEntryFinishedAction:(r,a,l)=>{t.attemptFirstFactor({strategy:e.factor.strategy,code:r}).then(async e=>{switch(await a(),e.status){case"complete":return c({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await o({session:t,redirectUrl:i})}});case"needs_second_factor":return n("../factor-two");case"needs_new_password":return n("../reset-password");default:return console.error((0,z.wv)(e.status,u))}}).catch(e=>(0,eg._d)(e)?h.__internal_navigateWithError("..",e.errors[0]):l(e))},onResendCodeClicked:()=>{p||t.prepareFirstFactor(e.factor).then(()=>e.onFactorPrepare()).catch(e=>(0,N.H4)(e,[],r.setError))},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:t.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods,onIdentityPreviewEditClicked:()=>n("../"),onBackLinkClicked:e.onBackLinkClicked})},eQ=e=>(0,a.Y)(p.n.Part,{part:"emailCode",children:(0,a.Y)(eX,{...e,cardTitle:(0,S.G)("signIn.emailCode.title"),cardSubtitle:(0,S.G)("signIn.emailCode.subtitle"),inputLabel:(0,S.G)("signIn.emailCode.formTitle"),resendButton:(0,S.G)("signIn.emailCode.resendButton")})}),e0=e=>{let{t}=(0,W._)(),r=(0,A.f0)(),n=(0,x.n)(),i=(0,d.r)(),{signInUrl:o}=i,{navigate:c}=(0,U.r)(),{afterSignInUrl:u}=(0,d.r)(),{setActive:h}=(0,l.ho)(),{startEmailLinkFlow:f,cancelEmailLinkFlow:g}=(0,ek.u)(n),[m,v]=s.useState(!1),I=(0,l.ho)();s.useEffect(()=>{_()},[]);let _=()=>{f({emailAddressId:e.factor.emailAddressId,redirectUrl:(0,eY.lA)({ctx:i,baseUrl:o,intent:"sign-in"})}).then(e=>w(e)).catch(e=>{if((0,eg._d)(e))return I.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[],r.setError)})},w=async e=>{let n=e.firstFactorVerification;"expired"===n.status?r.setError(t((0,S.G)("formFieldError__verificationLinkExpired"))):n.verifiedFromTheSameClient()?v(!0):await b(e)},b=async e=>"complete"===e.status?h({session:e.createdSessionId,redirectUrl:u}):"needs_second_factor"===e.status?c("../factor-two"):void 0;return m?(0,a.Y)(eb.$,{title:(0,S.G)("signIn.emailLink.verifiedSwitchTab.titleNewTab"),subtitle:(0,S.G)("signIn.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,a.Y)(p.n.Part,{part:"emailLink",children:(0,a.Y)(eS._,{cardTitle:(0,S.G)("signIn.emailLink.title"),cardSubtitle:(0,S.G)("signIn.emailLink.subtitle"),formTitle:(0,S.G)("signIn.emailLink.formTitle"),formSubtitle:(0,S.G)("signIn.emailLink.formSubtitle"),resendButton:(0,S.G)("signIn.emailLink.resendButton"),onResendCodeClicked:()=>{g(),_()},safeIdentifier:e.factor.safeIdentifier,profileImageUrl:n.userData.imageUrl,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked})})};var e1=r(77420);let e6=(0,A.dm)((n=(o=()=>{let e=(0,d.r)(),{displayConfig:t}=(0,K.O)(),r=(0,l.ho)().client.signIn;if(!eq(r.supportedFirstFactors))return null;let n=r.supportedFirstFactors.map(e=>({id:e.enterpriseConnectionId,name:e.enterpriseConnectionName}));return(0,a.Y)(p.n.Part,{part:"enterpriseConnections",children:(0,a.Y)(e1.l,{title:(0,S.G)("signIn.enterpriseConnections.title"),subtitle:(0,S.G)("signIn.enterpriseConnections.subtitle"),onClick:n=>{let i=(0,eY.uP)(e,t.signInUrl),o=e.afterSignInUrl||"/";return r.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:i,redirectUrlComplete:o,oidcPrompt:e.oidcPrompt,continueSignIn:!0,enterpriseConnectionId:n})},enterpriseConnections:n})})}).displayName||o.name||"Component",o.displayName=n,(i=e=>{let t=(0,x.n)(),r=(0,d.r)();return(0,w.RE)(o,()=>!eq(t.supportedFirstFactors),e=>{let{clerk:t}=e;return r.signInUrl||t.buildSignInUrl()},"There are no enterprise connections available to sign-in. Clerk is redirecting to the `signInUrl` instead.")(e)}).displayName="withEnterpriseConnectionsGuard(".concat(n,")"),i)),e2=e=>(0,a.Y)(p.n.Part,{part:"resetPassword",children:(0,a.Y)(eX,{...e,showAlternativeMethods:!1,cardTitle:(0,S.G)("signIn.forgotPassword.title"),inputLabel:(0,S.G)("signIn.forgotPassword.formTitle"),resendButton:(0,S.G)("signIn.forgotPassword.resendButton")})});var e4=r(196);let e5=e=>{let{onShowAlternativeMethodsClick:t}=e,r=(0,A.f0)(),n=(0,x.n)(),{navigate:i}=(0,U.r)(),[o,l]=s.useState(!1),c=s.useCallback(()=>l(e=>!e),[l]),d=eV(()=>i("../factor-two"));return o?(0,a.Y)(eh.n,{onBackLinkClick:c}):(0,a.Y)(p.n.Part,{part:"password",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(b.In,{elementDescriptor:Y.$z.passkeyIcon,icon:eR.A,sx:e=>({color:e.colors.$neutralAlpha500,marginInline:"auto",paddingBottom:e.sizes.$1,width:e.sizes.$12,height:e.sizes.$12})}),(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.passkey.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.passkey.subtitle")}),(0,a.Y)(e4.$,{identifier:n.identifier,avatarUrl:n.userData.imageUrl,onClick:()=>i("../")})]}),(0,a.Y)(C.Z.Alert,{children:r.error}),(0,a.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,a.Y)(O.l.Root,{onSubmit:e=>(e.preventDefault(),d()),gap:8,children:(0,a.Y)(O.l.SubmitButton,{hasArrow:!0})}),(0,a.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)(t?"footerActionLink__useAnotherMethod":"signIn.alternativeMethods.actionLink"),onClick:t||c})})]})]}),(0,a.Y)(C.Z.Footer,{})]})})},e8=e=>{let{onShowAlternativeMethodsClick:t,onPasswordError:r}=e,n=s.useRef(null),i=(0,A.f0)(),{setActive:o}=(0,l.ho)(),c=(0,x.n)(),{afterSignInUrl:u,navigateOnSetActive:h}=(0,d.r)(),f=(0,q.p)(),g=(e=>{let{onForgotPasswordMethodClick:t,onShowAlternativeMethodsClick:r}=e,n=eZ(),i=(0,$.tJ)("password","",{type:"password",label:(0,S.G)("formFieldLabel__password"),placeholder:(0,S.G)("formFieldInputPlaceholder__password")});return{...i,props:{...i.props,actionLabel:n||r?(0,S.G)("formFieldAction__forgotPassword"):"",onActionClicked:t||r||(()=>null)}}})(e),{navigate:m}=(0,U.r)(),[v,I]=s.useState(!1),_=s.useCallback(()=>I(e=>!e),[I]),w=(0,l.ho)();return v?(0,a.Y)(eh.n,{onBackLinkClick:_}):(0,a.Y)(p.n.Part,{part:"password",children:(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.password.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.password.subtitle")}),(0,a.Y)(e4.$,{identifier:c.identifier,avatarUrl:c.userData.imageUrl,onClick:()=>{m("../")}})]}),(0,a.Y)(C.Z.Alert,{children:i.error}),(0,a.FD)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:4,children:[(0,a.FD)(O.l.Root,{onSubmit:e=>{e.preventDefault(),c.attemptFirstFactor({strategy:"password",password:g.value}).then(e=>{switch(e.status){case"complete":return o({session:e.createdSessionId,navigate:e=>{let{session:t}=e;return h({session:t,redirectUrl:u})}});case"needs_second_factor":return m("../factor-two");case"needs_client_trust":return m("../client-trust");default:return console.error((0,z.wv)(e.status,f))}}).catch(e=>{if((0,eg._d)(e))return w.__internal_navigateWithError("..",e.errors[0]);if(r){if((0,eg.Au)(e)){i.setError({...e.errors[0],code:"form_password_pwned__sign_in"}),r("pwned");return}if((0,eg.qY)(e)){i.setError({...e.errors[0],code:"form_password_compromised__sign_in"}),r("compromised");return}}(0,N.H4)(e,[g],i.setError),setTimeout(()=>{var e;return null==(e=n.current)?void 0:e.focus()},0)})},gap:8,children:[(0,a.Y)("input",{readOnly:!0,id:"identifier-field",name:"identifier",value:c.identifier||"",style:{display:"none"}}),(0,a.Y)(O.l.ControlRow,{elementId:g.id,children:(0,a.Y)(O.l.PasswordInput,{...g.props,ref:n,autoFocus:!0})}),(0,a.Y)(O.l.SubmitButton,{hasArrow:!0})]}),(0,a.Y)(C.Z.Action,{elementId:t?"alternativeMethods":"havingTrouble",children:(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)(t?"signIn.password.actionLink":"signIn.alternativeMethods.actionLink"),onClick:t||_})})]})]}),(0,a.Y)(C.Z.Footer,{})]})})},e9=e=>(0,a.Y)(p.n.Part,{part:"phoneCode",children:(0,a.Y)(eX,{...e,cardTitle:(0,S.G)("signIn.phoneCode.title"),cardSubtitle:(0,S.G)("signIn.phoneCode.subtitle"),inputLabel:(0,S.G)("signIn.phoneCode.formTitle"),resendButton:(0,S.G)("signIn.phoneCode.resendButton")})}),e3=e=>{if(!e)return"";let t=e.strategy;return"emailAddressId"in e&&(t+=e.emailAddressId),"phoneNumberId"in e&&(t+=e.phoneNumberId),"channel"in e&&(t+=e.channel),t},e7=(0,w.RL)((0,w.SY)((0,A.dm)(function(){let{__internal_setActiveInProgress:e}=(0,l.ho)(),t=(0,x.n)(),{preferredSignInStrategy:r}=(0,K.O)().displayConfig,n=t.supportedFirstFactors,i=(0,U.r)(),o=(0,A.f0)(),{supportedFirstFactors:c,firstFactorVerification:d}=(0,x.n)(),u=s.useRef(""),[{currentFactor:h},p]=s.useState(()=>{let e=(0,ev.xf)(n,t.identifier,r);return(null==e?void 0:e.strategy)==="phone_code"&&d.channel&&"sms"!==d.channel&&(e.channel=d.channel),{currentFactor:e,prevCurrentFactor:void 0}}),{hasAnyStrategy:f}=(0,eP.y)({filterOutFactor:h,supportedFirstFactors:c}),[g,m]=s.useState(()=>!h||!(0,ev.Cm)(h)),v=eZ(),[I,_]=s.useState(!1),[w,b]=s.useState(null);if(s.useEffect(()=>{e||("needs_identifier"===t.status||null===t.status)&&i.navigate("../")},[e]),!h)return t.status?(0,a.Y)(eU.J,{cardTitle:(0,S.G)("signIn.noAvailableMethods.title"),cardSubtitle:(0,S.G)("signIn.noAvailableMethods.subtitle"),message:(0,S.G)("signIn.noAvailableMethods.message")}):(0,a.Y)(es.B,{});let Y=f?()=>m(e=>!e):void 0,k=()=>_(e=>!e),C=()=>{u.current=e3(h)},F=e=>{p(t=>({currentFactor:e,prevCurrentFactor:t.currentFactor}))};if(eq(t.supportedFirstFactors))return(0,a.Y)(e6,{});if(g||I){let e=(0,ev.Cm)(h),t=g?Y:k;return(0,a.Y)(e$,{mode:I?"pwned"===w?"pwned":"compromised"===w?"passwordCompromised":"forgot":"default",onBackLinkClick:e?()=>{o.setError(void 0),b(null),null==t||t()}:void 0,onFactorSelected:e=>{F(e),null==t||t()},currentFactor:h})}if(!h)return(0,a.Y)(es.B,{});switch(null==h?void 0:h.strategy){case"passkey":return(0,a.Y)(e5,{onFactorPrepare:C,onShowAlternativeMethodsClick:Y});case"password":return(0,a.Y)(e8,{onForgotPasswordMethodClick:v?k:Y,onShowAlternativeMethodsClick:Y,onPasswordError:e=>{b(e),k()}});case"email_code":return(0,a.Y)(eQ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"phone_code":if(h.channel&&"sms"!==h.channel)return(0,a.Y)(eJ,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onChangePhoneCodeChannel:F});return(0,a.Y)(e9,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"email_link":return(0,a.Y)(e0,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y});case"reset_password_phone_code":return(0,a.Y)(e2,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,S.G)("signIn.forgotPassword.subtitle_phone")});case"reset_password_email_code":return(0,a.Y)(e2,{factorAlreadyPrepared:u.current===e3(h),onFactorPrepare:C,factor:h,onShowAlternativeMethodsClicked:Y,onBackLinkClicked:()=>{p(e=>({currentFactor:e.prevCurrentFactor,prevCurrentFactor:e.currentFactor})),k()},cardSubtitle:(0,S.G)("signIn.forgotPassword.subtitle_email")});default:return(0,a.Y)(es.B,{})}}))),te=e=>{let{onShowAlternativeMethodsClicked:t}=e,r=(0,x.n)(),{afterSignInUrl:n,navigateOnSetActive:i}=(0,d.r)(),{setActive:o}=(0,l.ho)(),{navigate:s}=(0,U.r)(),c=(0,q.p)(),u=(0,A.f0)(),h=(0,$.tJ)("code","",{type:"text",label:(0,S.G)("formFieldLabel__backupCode"),isRequired:!0}),p=(0,l.ho)(),f=e=>{var t,r;return(0,ev.Kw)(null==(t=e.firstFactorVerification)?void 0:t.strategy)&&(null==(r=e.firstFactorVerification)?void 0:r.status)==="verified"};return(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.backupCodeMfa.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:f(r)?(0,S.G)("signIn.forgotPassword.subtitle"):(0,S.G)("signIn.backupCodeMfa.subtitle")})]}),(0,a.Y)(C.Z.Alert,{children:u.error}),(0,a.Y)(b.fv,{elementDescriptor:Y.$z.main,gap:8,children:(0,a.FD)(O.l.Root,{onSubmit:e=>(e.preventDefault(),r.attemptSecondFactor({strategy:"backup_code",code:h.value}).then(e=>{if("complete"!==e.status)return console.error((0,z.wv)(e.status,c));if(f(e)&&e.createdSessionId){let t=new URLSearchParams;return t.set("createdSessionId",e.createdSessionId),s("../reset-password-success?".concat(t.toString()))}return o({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await i({session:t,redirectUrl:n})}})}).catch(e=>{if((0,eg._d)(e))return p.__internal_navigateWithError("..",e.errors[0]);(0,N.H4)(e,[h],u.setError)})),children:[(0,a.Y)(O.l.ControlRow,{elementId:h.id,children:(0,a.Y)(O.l.PlainInput,{...h.props,autoFocus:!0,onActionClicked:t})}),(0,a.FD)(b.fv,{gap:3,children:[(0,a.Y)(O.l.SubmitButton,{hasArrow:!0}),(0,a.Y)(C.Z.Action,{elementId:"alternativeMethods",children:t&&(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("footerActionLink__useAnotherMethod"),onClick:t})})]})]})})]}),(0,a.Y)(C.Z.Footer,{})]})},tt=e=>(0,a.Y)(p.n.Part,{part:"totp2Fa",children:(0,a.Y)(e_,{...e,cardTitle:(0,S.G)("signIn.totpMfa.title"),cardSubtitle:(0,S.G)("signIn.totpMfa.subtitle"),inputLabel:(0,S.G)("signIn.totpMfa.formTitle")})}),tr=(0,w.RL)((0,w.SY)((0,A.dm)(function(){let e=(0,x.n)(),{currentFactor:t,factorAlreadyPrepared:r,handleFactorPrepare:n,selectFactor:i,showAllStrategies:o,toggleAllStrategies:l}=(0,eF.j)(e.supportedSecondFactors);if(!t)return(0,a.Y)(es.B,{});if(o)return(0,a.Y)(ep,{onBackLinkClick:l,onFactorSelected:i});switch(null==t?void 0:t.strategy){case"phone_code":return(0,a.Y)(eA,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"totp":return(0,a.Y)(tt,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"backup_code":return(0,a.Y)(te,{onShowAlternativeMethodsClicked:l});case"email_code":return(0,a.Y)(ew,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});case"email_link":return(0,a.Y)(eC,{factorAlreadyPrepared:r,onFactorPrepare:n,factor:t,onShowAlternativeMethodsClicked:l});default:return(0,a.Y)(es.B,{})}})));var tn=r(16126);let ti=(0,w.RL)((0,w.SY)(tn.F));r(30945),r(1589),r(10676),r(52678);var to=r(25848),ta=r(62620),tl=r(26760),ts=r(30958),tc=r(1959),td=r(6142),tu=r(84901),th=r(42229),tp=r(19835);let tf=e=>{var t;let{handleSubmit:r,phoneNumberFormState:n,onUseAnotherMethod:i,phoneCodeProvider:o}=e,{providerToDisplayData:l,strategyToDisplayData:s}=(0,tp.k)(),c=o.name,d=o.channel,u=(0,A.f0)();return(0,a.Y)(C.Z.Root,{children:(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,showDivider:!0,children:[(0,a.Y)(b.fv,{center:!0,children:(0,a.Y)(b._V,{src:null==(t=l[d])?void 0:t.iconUrl,alt:"".concat(s[d].name," logo"),sx:e=>({width:e.sizes.$7,height:e.sizes.$7,maxWidth:"100%",marginBottom:e.sizes.$6})})}),(0,a.Y)(F.Y.Title,{localizationKey:(0,S.G)("signIn.start.alternativePhoneCodeProvider.title",{provider:c})}),(0,a.Y)(F.Y.Subtitle,{localizationKey:(0,S.G)("signIn.start.alternativePhoneCodeProvider.subtitle",{provider:c})})]}),(0,a.Y)(C.Z.Alert,{children:u.error}),(0,a.Y)(b.so,{direction:"col",elementDescriptor:Y.$z.main,gap:6,children:(0,a.FD)(O.l.Root,{onSubmit:r,gap:8,children:[(0,a.Y)(b.fv,{gap:6,children:(0,a.Y)(O.l.ControlRow,{elementId:"phoneNumber",children:(0,a.Y)(O.l.PhoneInput,{...n.props,label:(0,S.G)("signIn.start.alternativePhoneCodeProvider.label",{provider:c}),isRequired:!0,isOptional:!1,actionLabel:void 0,onActionClicked:void 0})})}),(0,a.FD)(b.fv,{center:!0,children:[(0,a.Y)(td.j,{}),(0,a.Y)(b.fv,{gap:6,sx:{width:"100%"},children:(0,a.Y)(O.l.SubmitButton,{hasArrow:!0,localizationKey:(0,S.G)("formButtonPrimary")})})]}),(0,a.Y)(b.fv,{center:!0,children:(0,a.Y)(b.$n,{variant:"link",colorScheme:"neutral",onClick:i,localizationKey:(0,S.G)("signIn.start.alternativePhoneCodeProvider.actionLink")})})]})})]})})},tg=e=>{var t;return!!(null==(t=e.supportedFirstFactors)?void 0:t.length)&&e.supportedFirstFactors.every(e=>"enterprise_sso"===e.strategy)},tm=e=>{let{field:t}=e,[r,n]=(0,s.useState)(!1),i=(0,s.useRef)(null),o=!!(r||(null==t?void 0:t.value));return((0,s.useLayoutEffect)(()=>{let e=setInterval(()=>{if(null==i?void 0:i.current){var t;let r="onAutoFillStart"===window.getComputedStyle(i.current,":autofill").animationName||!!(null==(t=i.current)?void 0:t.matches("*:-webkit-autofill"));r&&(n(r),clearInterval(e))}},500);return()=>{clearInterval(e)}},[]),(0,s.useEffect)(()=>{(null==t?void 0:t.value)&&""!==t.value&&n(!1)},[null==t?void 0:t.value]),t)?(0,a.Y)(O.l.ControlRow,{elementId:t.id,sx:o?void 0:{position:"absolute",opacity:0,height:0,pointerEvents:"none",marginTop:"-1rem"},children:(0,a.Y)(O.l.PasswordInput,{...t.props,ref:i,tabIndex:o?void 0:-1})}):null},tv=(0,w.RL)((0,w.SY)((0,A.dm)(function(){var e,t,n;let i=(0,A.f0)(),o=(0,l.ho)(),c=(0,tu.m)(),{displayConfig:u,userSettings:h,authConfig:f}=(0,K.O)(),g=(0,x.n)(),{navigate:m}=(0,U.r)(),v=(0,d.r)(),{afterSignInUrl:I,signUpUrl:_,waitlistUrl:w,isCombinedFlow:k,navigateOnSetActive:y}=v,P=(0,q.p)(),E=(0,th.F)(),D=(0,s.useMemo)(()=>(0,tc.E9)(h.enabledFirstFactorIdentifiers),[h.enabledFirstFactorIdentifiers]),L=h.alternativePhoneCodeChannels,{isWebAuthnAutofillSupported:M}=(()=>{let[e,t]=(0,s.useState)(!1),{navigate:r}=(0,U.r)(),n=eV(()=>r("factor-two")),{userSettings:i}=(0,K.O)(),{passkeySettings:o,attributes:a}=i;return(0,s.useEffect)(()=>{var e;async function r(){let e=await (0,ta.nn)();t(e),e&&await n({flow:"autofill"})}o.allow_autofill&&(null==(e=a.passkey)?void 0:e.enabled)&&r()},[]),{isWebAuthnAutofillSupported:e}})(),T=eV(()=>m("factor-two")),G=(0,ta.Bz)(),R=!!(null==(e=v.initialValues)?void 0:e.phoneNumber)&&!(v.initialValues.emailAddress||v.initialValues.username)&&D.includes("phone_number"),[B,Z]=(0,s.useState)(R?"phone_number":D[0]||""),[W,V]=(0,s.useState)(!1),H=(0,to.hI)("__clerk_ticket")||"",j=(0,to.hI)("__clerk_status")||"",J=h.enabledFirstFactorIdentifiers,X=h.web3FirstFactors,Q=h.authenticatableSocialStrategies,ee=h.instanceIsPasswordBased,{currentIdentifier:et,nextIdentifier:er}=(0,tc.ZN)(D,B),en=(0,$.tJ)("password","",{type:"password",label:(0,S.G)("formFieldLabel__password"),placeholder:(0,S.G)("formFieldInputPlaceholder__password")}),[ei,eo]=(0,s.useState)(null),ea=h.alternativePhoneCodeChannels.length>0,el=v.initialValues||{},ec=(0,s.useMemo)(()=>({email_address:el.emailAddress,email_address_username:el.emailAddress||el.username,username:el.username,phone_number:el.phoneNumber}),[v.initialValues]),ed=!!Q.length||!!X.length||!!L.length,[eu,eh]=(0,s.useState)(!(0,ts.X)()&&!ed),ep=(0,$.tJ)("identifier",ec[B]||"",{...et,isRequired:!0,transformer:e=>e.trim()}),ef=(0,$.tJ)("identifier",ec.phone_number||"",{...et,isRequired:!0}),eg="phone_number"===B?ef:ep;(0,s.useLayoutEffect)(()=>{if(eg.value.startsWith("+")&&D.includes("phone_number")&&"phone_number"!==B&&!W){var e;e=eg.value,ep.setValue(ec[B]||""),ef.setValue(e),Z("phone_number"),eh(!0),V(!0)}},[eg.value,D]),(0,s.useEffect)(()=>{if(H){if("sign_up"===j){let e=new URLSearchParams;H&&e.set("__clerk_ticket",H),m(k?"create":_,{searchParams:e});return}c.setLoading(),i.setLoading(),g.create({strategy:"ticket",ticket:H}).then(e=>{switch(e.status){case"needs_first_factor":if(!tg(e)||eq(e.supportedFirstFactors))return m("factor-one");return eI();case"needs_second_factor":return m("factor-two");case"needs_client_trust":return m("client-trust");case"complete":return(0,to.rw)("__clerk_ticket"),o.setActive({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}});default:return void console.error((0,z.wv)(e.status,P))}}).catch(e=>e_(e)).finally(()=>{tg(g)||(c.setIdle(),i.setIdle())})}},[]),(0,s.useEffect)(()=>{!async function(){var e;let t=null==g||null==(e=g.firstFactorVerification)?void 0:e.error;if(t){switch(t.code){case eB.c.NOT_ALLOWED_TO_SIGN_UP:case eB.c.OAUTH_ACCESS_DENIED:case eB.c.NOT_ALLOWED_ACCESS:case eB.c.SAML_USER_ATTRIBUTE_MISSING:case eB.c.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:case eB.c.USER_LOCKED:case eB.c.EXTERNAL_ACCOUNT_NOT_FOUND:case eB.c.SIGN_UP_MODE_RESTRICTED:case eB.c.SIGN_UP_MODE_RESTRICTED_WAITLIST:case eB.c.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:case eB.c.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:case eB.c.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:case eB.c.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:case eB.c.CAPTCHA_INVALID:case eB.c.FRAUD_DEVICE_BLOCKED:case eB.c.FRAUD_ACTION_BLOCKED:case eB.c.SIGNUP_RATE_LIMIT_EXCEEDED:case eB.c.USER_BANNED:i.setError(t);break;default:i.setError("Unable to complete action at this time. If the problem persists please contact support.")}await g.create({})}}()},[]);let em=async function(){for(var e,t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];let a=(null==ei?void 0:ei.channel)||(0,ev.oj)(n,f.preferredChannels,"identifier");if(a){let e=()=>{};n.push({id:"strategy",value:"phone_code",clearFeedback:e,setValue:e,onChange:e,setError:e}),n.push({id:"channel",value:a,clearFeedback:e,setValue:e,onChange:e,setError:e})}try{let r,i,a=await (i=g.create(((!(r=(e=n).some(e=>"password"===e.name&&!!e.value))||h.enterpriseSSO.enabled)&&(e=e.filter(e=>"password"!==e.name)),{...(0,$.mK)(e),...r&&!h.enterpriseSSO.enabled&&{strategy:"password"}})),i.then(e=>{var t,r;if(!h.enterpriseSSO.enabled)return e;let i=null==(t=n.find(e=>"password"===e.name))?void 0:t.value;return!i||(null==(r=e.supportedFirstFactors)?void 0:r.some(e=>"enterprise_sso"===e.strategy))?e:e.attemptFirstFactor({strategy:"password",password:i})}));switch(a.status){case"needs_identifier":(null==(t=a.supportedFirstFactors)?void 0:t.some(e=>"enterprise_sso"===e.strategy))&&await eI();break;case"needs_first_factor":if(!tg(a)||eq(a.supportedFirstFactors))return m("factor-one");return eI();case"needs_second_factor":return m("factor-two");case"needs_client_trust":return m("client-trust");case"complete":return o.setActive({session:a.createdSessionId,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}});default:return void console.error((0,z.wv)(a.status,P))}}catch(e){return e_(e)}},eI=async()=>{let e=(0,eY.uP)(v,u.signInUrl),t=v.afterSignInUrl||"/";return g.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:e,redirectUrlComplete:t,oidcPrompt:v.oidcPrompt,continueSignIn:!0})},e_=async e=>{if(!e.errors)return;let t=e.errors.find(e=>e.code===eB.c.INVALID_STRATEGY_FOR_USER||e.code===eB.c.FORM_PASSWORD_INCORRECT||e.code===eB.c.FORM_PASSWORD_PWNED),n=e.errors.find(e=>e.code===eB.c.SESSION_EXISTS),a=e.errors.find(e=>"identifier_already_signed_in"===e.code),l=e.errors.find(e=>e.code===eB.c.INVITATION_ACCOUNT_NOT_EXISTS||e.code===eB.c.FORM_IDENTIFIER_NOT_FOUND);if(t)await em(eg);else if(n)await o.setActive({session:o.client.lastActiveSessionId,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}});else if(a){let e=a.meta.sessionId;await o.setActive({session:e,navigate:async e=>{let{session:t}=e;await y({session:t,redirectUrl:I})}})}else if(k&&l){var s,c;let e=(0,ev.UY)(eg);if(h.signUp.mode===eB.f.WAITLIST)return m(o.buildWaitlistUrl("emailAddress"===e?{initialValues:{[e]:eg.value}}:{}));o.client.signUp[e]=eg.value;let t=(0,eY.uP)(v,u.signUpUrl),n=v.afterSignUpUrl||"/";return function(e){var t,n;let{identifierAttribute:i,identifierValue:o,signUpMode:a,navigate:l,organizationTicket:s,afterSignUpUrl:c,clerk:d,handleError:u,redirectUrl:h,redirectUrlComplete:p,passwordEnabled:f,navigateOnSetActive:g,alternativePhoneCodeChannel:m}=e;if(a===eB.f.WAITLIST)return l(d.buildWaitlistUrl("emailAddress"===i?{initialValues:{[i]:o}}:{}));d.client.signUp[i]=o;let v=new URLSearchParams;return(s&&v.set("__clerk_ticket",s),f||(t=d.client.signUp,n=i,t.optionalFields.filter(e=>!(e.startsWith("oauth_")||e.startsWith("web3_"))&&"enterprise_sso"!==e&&"password"!==e&&("phoneNumber"!==n||"phone_number"!==e)).length>0)||"emailAddress"!==i&&"phoneNumber"!==i)?l("create",{searchParams:v}):d.client.signUp.create({[i]:o,...m?{strategy:"phone_code",channel:m}:{}}).then(async e=>(await Promise.all([r.e("545"),r.e("666"),r.e("472")]).then(r.bind(r,88722)).then(e=>e.completeSignUpFlow))({signUp:e,verifyEmailPath:"create/verify-email-address",verifyPhonePath:"create/verify-phone-number",handleComplete:()=>d.setActive({session:e.createdSessionId,navigate:async e=>{let{session:t}=e;await g({session:t,redirectUrl:c})}}),navigate:l,redirectUrl:h,redirectUrlComplete:p})).catch(e=>u(e))}({afterSignUpUrl:v.afterSignUpUrl||"/",clerk:o,handleError:e=>(0,N.H4)(e,[eg,en],i.setError),identifierAttribute:e,identifierValue:eg.value,navigate:m,organizationTicket:H,signUpMode:h.signUp.mode,redirectUrl:t,redirectUrlComplete:n,navigateOnSetActive:y,passwordEnabled:null!=(c=null==(s=h.attributes.password)?void 0:s.required)&&c,alternativePhoneCodeChannel:(null==ei?void 0:ei.channel)||(0,ev.iy)(f.preferredChannels,e,eg.value)})}else(0,N.H4)(e,[eg,en],i.setError)},ew=async e=>(e.preventDefault(),em(eg,en)),eS=(0,s.useMemo)(()=>({tel:O.l.PhoneInput,password:O.l.PasswordInput,text:O.l.PlainInput,email:O.l.PlainInput})[eg.type],[eg.type]);if(c.isLoading||"sign_up"===j)return(0,a.Y)(es.B,{});let{action:eb,validLastAuthenticationStrategies:ek,...eC}=eg.props,eA=null==(t=o.client)?void 0:t.lastAuthenticationStrategy,eF=!!eA&&E>1&&(null==ek?void 0:ek.has(eA));return(0,a.Y)(p.n.Part,{part:"start",children:ei?(0,a.Y)(tf,{handleSubmit:ew,phoneNumberFormState:ef,onUseAnotherMethod:()=>{eo(null)},phoneCodeProvider:ei}):(0,a.FD)(C.Z.Root,{children:[(0,a.FD)(C.Z.Content,{children:[(0,a.FD)(F.Y.Root,{showLogo:!0,children:[(0,a.Y)(F.Y.Title,{localizationKey:k?(0,S.G)("signIn.start.titleCombined"):(0,S.G)("signIn.start.title")}),(0,a.Y)(F.Y.Subtitle,{localizationKey:k?(0,S.G)("signIn.start.subtitleCombined"):(0,S.G)("signIn.start.subtitle"),sx:{"&:empty":{display:"none"}}})]}),(0,a.Y)(C.Z.Alert,{children:i.error}),(0,a.FD)(b.fv,{elementDescriptor:Y.$z.main,gap:6,children:[(0,a.FD)(tl.U,{children:[ed&&(0,a.Y)(eN,{enableWeb3Providers:!0,enableOAuthProviders:!0,enableAlternativePhoneCodeProviders:ea,onAlternativePhoneCodeProviderClick:e=>{eo((0,eH.y)(e)||null)}}),J.length?(0,a.FD)(O.l.Root,{onSubmit:ew,gap:8,children:[(0,a.FD)(b.fv,{gap:6,children:[(0,a.Y)(O.l.ControlRow,{elementId:eg.id,children:(0,a.Y)(eS,{actionLabel:null==er?void 0:er.action,onActionClicked:()=>{Z(e=>D[(D.indexOf(e)+1)%D.length]),eh(!0),V(!1)},...eC,autoFocus:eu,autoComplete:M?"webauthn":void 0,isLastAuthenticationStrategy:eF})}),(0,a.Y)(tm,{field:ee?en:void 0})]}),(0,a.FD)(b.fv,{center:!0,children:[(0,a.Y)(td.j,{}),(0,a.Y)(O.l.SubmitButton,{hasArrow:!0})]})]}):null]}),!J.length&&(0,a.Y)(td.j,{}),(null==(n=h.attributes.passkey)?void 0:n.enabled)&&h.passkeySettings.show_sign_in_button&&G&&(0,a.Y)(C.Z.Action,{elementId:"usePasskey",children:(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.start.actionLink__use_passkey"),onClick:()=>T({flow:"discoverable"})})})]})]}),(0,a.FD)(C.Z.Footer,{children:[h.signUp.mode===eB.f.PUBLIC&&!k&&(0,a.FD)(C.Z.Action,{elementId:"signIn",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.start.actionText")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.start.actionLink"),to:o.buildUrlWithAuth(_)})]}),h.signUp.mode===eB.f.WAITLIST&&(0,a.FD)(C.Z.Action,{elementId:"signIn",children:[(0,a.Y)(C.Z.ActionText,{localizationKey:(0,S.G)("signIn.start.actionText__join_waitlist")}),(0,a.Y)(C.Z.ActionLink,{localizationKey:(0,S.G)("signIn.start.actionLink__join_waitlist"),to:o.buildUrlWithAuth(w)})]})]})]})})})));function tI(){let e=(0,l.ho)();return s.useEffect(()=>{e.redirectToSignIn()},[]),null}function t_(){let e=(0,d.r)(),t=(0,u.X)();return(0,a.Y)(p.n.Root,{flow:"signIn",children:(0,a.FD)(v.d,{children:[(0,a.Y)(I.q,{path:"factor-one",children:(0,a.Y)(e7,{})}),(0,a.Y)(I.q,{path:"factor-two",children:(0,a.Y)(tr,{})}),(0,a.Y)(I.q,{path:"client-trust",children:(0,a.Y)(ey,{})}),(0,a.Y)(I.q,{path:"reset-password",children:(0,a.Y)(H,{})}),(0,a.Y)(I.q,{path:"reset-password-success",children:(0,a.Y)(X,{})}),(0,a.Y)(I.q,{path:"sso-callback",children:(0,a.Y)(ti,{signUpUrl:e.signUpUrl,signInUrl:e.signInUrl,signInForceRedirectUrl:e.afterSignInUrl,signUpForceRedirectUrl:e.afterSignUpUrl,continueSignUpUrl:e.signUpContinueUrl,transferable:e.transferable,firstFactorUrl:"../factor-one",secondFactorUrl:"../factor-two",resetPasswordUrl:"../reset-password"})}),(0,a.Y)(I.q,{path:"choose",children:(0,a.Y)(el,{})}),(0,a.Y)(I.q,{path:"choose-wallet",children:(0,a.Y)(E,{})}),(0,a.Y)(I.q,{path:"verify",children:(0,a.Y)(c.Y,{redirectUrlComplete:e.afterSignInUrl,redirectUrl:"../factor-two"})}),e.isCombinedFlow&&(0,a.FD)(I.q,{path:"create",children:[(0,a.Y)(I.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,a.Y)(T,{})}),(0,a.Y)(I.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,a.Y)(M,{})}),(0,a.Y)(I.q,{path:"sso-callback",children:(0,a.Y)(R,{signUpUrl:t.signUpUrl,signInUrl:t.signInUrl,signUpForceRedirectUrl:t.afterSignUpUrl,signInForceRedirectUrl:t.afterSignInUrl,secondFactorUrl:t.secondFactorUrl,continueSignUpUrl:"../continue",verifyEmailAddressUrl:"../verify-email-address",verifyPhoneNumberUrl:"../verify-phone-number"})}),(0,a.Y)(I.q,{path:"verify",children:(0,a.Y)(c.M,{redirectUrlComplete:t.afterSignUpUrl,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",continuePath:"../continue"})}),(0,a.FD)(I.q,{path:"continue",children:[(0,a.Y)(I.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,a.Y)(T,{})}),(0,a.Y)(I.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,a.Y)(M,{})}),(0,a.Y)(I.q,{index:!0,children:(0,a.Y)(B,{})})]}),(0,a.Y)(I.q,{path:"tasks",children:(0,a.Y)(m.JJ,{redirectUrlComplete:e.afterSignUpUrl})}),(0,a.Y)(I.q,{index:!0,children:(0,a.Y)(G,{})})]}),(0,a.Y)(I.q,{path:"tasks",children:(0,a.Y)(m.JJ,{redirectUrlComplete:e.afterSignInUrl})}),(0,a.Y)(I.q,{index:!0,children:(0,a.Y)(tv,{})}),(0,a.Y)(I.q,{children:(0,a.Y)(tI,{})})]})})}let tw=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,f.s)(e?L:void 0,"preloadComponent",{staleTime:1/0})};function tS(){let e=(0,d.r)(),t={componentName:"SignUp",emailLinkRedirectUrl:e.emailLinkRedirectUrl,ssoCallbackUrl:e.ssoCallbackUrl,forceRedirectUrl:e.signUpForceRedirectUrl,fallbackRedirectUrl:e.signUpFallbackRedirectUrl,signInUrl:e.signInUrl,unsafeMetadata:e.unsafeMetadata,...(0,D.C)({routing:null==e?void 0:e.routing,path:null==e?void 0:e.path})};return tw(e.isCombinedFlow),(0,g.Z)(),(0,a.Y)(u.g.Provider,{value:t,children:(0,a.Y)(t_,{})})}t_.displayName="SignIn";let tb=(0,h.Z)(tS),tY=(0,h.Z)(tS),tk=e=>{let t={signUpUrl:"/".concat(_.I,"/sign-up"),waitlistUrl:"/".concat(_.I,"/waitlist"),...e};return(0,a.Y)(I.q,{path:"sign-in",children:(0,a.Y)(d.Q.Provider,{value:{componentName:"SignIn",...t,routing:"virtual",mode:"modal"},children:(0,a.Y)("div",{children:(0,a.Y)(tY,{...t,routing:"virtual"})})})})}},22690:function(e,t,r){r.d(t,{j:()=>a}),r(88711);var n=r(35074),i=r(55763);let o=e=>{if(!e)return"";let t=e.strategy;return"phoneNumberId"in e&&(t+=e.phoneNumberId),t};function a(e){let t=n.useRef(""),[r,a]=n.useState(()=>(0,i.R5)(e)),[l,s]=n.useState(!r),c=t.current===o(r);return{currentFactor:r,factorAlreadyPrepared:c,handleFactorPrepare:()=>{t.current=o(r)},selectFactor:e=>{a(e),s(!1)},showAllStrategies:l,toggleAllStrategies:()=>s(e=>!e)}}},55763:function(e,t,r){r.d(t,{Cm:()=>u,Kw:()=>f,R5:()=>h,UY:()=>g,iy:()=>v,oj:()=>m,xf:()=>c}),r(19161),r(85074),r(30945),r(22501),r(21044);var n=r(62620),i=r(87651),o=r(1959),a=r(68289);let l=e=>t=>"safeIdentifier"in t&&t.safeIdentifier===e;function s(e){if((0,n.Bz)()){let t=e.find(e=>{let{strategy:t}=e;return"passkey"===t});if(t)return t}return null}function c(e,t,r){return e&&0!==e.length?r===o._o.Password?function(e,t){let r=s(e);if(r)return r;let n=e.sort(a.Kn)[0];return"password"===n.strategy?n:e.find(l(t))||n||null}(e,t):function(e,t){let r=s(e);if(r)return r;let n=e.sort(a.Ih),i=n.find(l(t));if(i)return i;let o=n[0];return"email_link"===o.strategy?o:e.find(l(t))||o||null}(e,t):null}let d=["passkey","email_code","password","phone_code","email_link"];function u(e){return!!e&&d.includes(e.strategy)}function h(e){if(!e||0===e.length)return null;let t=e.find(e=>"totp"===e.strategy);if(t)return t;let r=e.find(e=>"phone_code"===e.strategy);return r||e[0]}let p=["reset_password_phone_code","reset_password_email_code"],f=e=>!!e&&p.includes(e);function g(e){let t;return"tel"===e.type?"phoneNumber":(t=e.value,/^\S+@\S+\.\S+$/.test(t))?"emailAddress":"username"}let m=(e,t,r)=>{var n,o;if(!t)return null;let a=null==(n=e.find(e=>"strategy"===e.id))?void 0:n.value;if(a&&"phone_code"!==a)return null;let l=null==(o=e.find(e=>e.id===r))?void 0:o.value;if(!l||!(null==l?void 0:l.startsWith("+")))return null;let s=(0,i.TV)(l,t);return"sms"===s?null:s},v=(e,t,r)=>{if(!e||!t||"phoneNumber"!==t||!r||!(null==r?void 0:r.startsWith("+")))return null;let n=(0,i.TV)(r,e);return"sms"===n?null:n}},80004:function(e,t,r){r.d(t,{Q:()=>g,r:()=>m}),r(98114);var n=r(22166),i=r(48380),o=r(5580),a=r(14173),l=r(21210),s=r(62543),c=r(35074),d=r(78051),u=r(97697),h=r(62366),p=r(4964),f=r(42117);let g=(0,c.createContext)(null),m=()=>{var e,t,r,m,v,I,_;let w=(0,c.useContext)(g),{navigate:S,basePath:b,startPath:Y}=(0,p.r)(),{displayConfig:k,userSettings:C}=(0,u.O)(),{queryParams:A,queryString:F}=(0,p.r)(),y=C.signUp.mode,U=(0,h.II)(),P=(0,l.ho)();if(null===w||"SignIn"!==w.componentName)throw Error("Clerk: useSignInContext called outside of the mounted SignIn component.");let E="restricted"!==y&&!!(!U.signUpUrl&&U.signInUrl&&!(0,s.vh)(U.signInUrl))&&!1!==w.withSignUp||w.withSignUp||!1,{componentName:D,mode:L,...M}=w,T=(0,c.useMemo)(()=>(0,f.tf)(F,n.u),[]),G=new i.n(U,{...M,signInFallbackRedirectUrl:M.signInFallbackRedirectUrl||M.fallbackRedirectUrl,signInForceRedirectUrl:M.signInForceRedirectUrl||M.forceRedirectUrl},A,L);delete M.fallbackRedirectUrl,delete M.forceRedirectUrl;let R=P.buildUrlWithAuth(G.getAfterSignInUrl()),B=P.buildUrlWithAuth(G.getAfterSignUpUrl()),z="path"===M.routing&&M.path||U.signInUrl||k.signInUrl,O=E?"path"===M.routing&&M.path||U.signUpUrl||k.signUpUrl:M.signUpUrl||U.signUpUrl||k.signUpUrl,N=M.waitlistUrl||U.waitlistUrl||k.waitlistUrl,Z=G.getPreservedSearchParams();z=(0,a.kZ)({base:z,hashSearchParams:[A,Z]},{stringify:!0}),O=(0,a.kZ)({base:O,hashSearchParams:[A,Z]},{stringify:!0}),N=(0,a.kZ)({base:N,hashSearchParams:[A,Z]},{stringify:!0});let $=G.toSearchParams().toString(),x=(0,d.aQ)({routing:M.routing,baseUrl:O,authQueryString:$,path:M.path,endpoint:E?"/create"+d.Vu:d.Vu}),K=(0,d.aQ)({routing:M.routing,baseUrl:O,authQueryString:$,path:M.path,endpoint:E?"/create"+d.aB:d.aB});E&&(O=(0,a.kZ)({base:z,hashPath:"/create",hashSearchParams:[A,Z]},{stringify:!0}));let W=(0,a.kZ)({base:O,hashPath:"/continue"},{stringify:!0}),V=async e=>{let{session:t,redirectUrl:r}=e,n=t.currentTask;if(!n)return S(r);let i=(0,o.ru)(n);return S("/".concat(b+Y+(E?"/create"+i:i)))},q=(null==(e=P.session)?void 0:e.currentTask)?null!=(I=null==(r=P.__internal_getOption("taskUrls"))?void 0:r[null==(t=P.session)?void 0:t.currentTask.key])?I:(0,d.aQ)({routing:M.routing,baseUrl:z,authQueryString:$,path:M.path,endpoint:E?"/create"+(0,o.ru)(null==(m=P.session)?void 0:m.currentTask):(0,o.ru)(null==(v=P.session)?void 0:v.currentTask)}):null;return{...M,transferable:null==(_=M.transferable)||_,oauthFlow:M.oauthFlow||"auto",componentName:D,signUpUrl:O,signInUrl:z,waitlistUrl:N,afterSignInUrl:R,afterSignUpUrl:B,emailLinkRedirectUrl:x,ssoCallbackUrl:K,navigateAfterSignIn:()=>S(R),signUpContinueUrl:W,queryParams:A,initialValues:{...M.initialValues,...T},authQueryString:$,isCombinedFlow:E,navigateOnSetActive:V,taskUrl:q}}},49599:function(e,t,r){r.d(t,{g:()=>o});var n=r(21210),i=r(4964);let o=()=>{let{navigate:e}=(0,i.r)(),t=(0,n.ho)();return{navigateAfterSignOut:()=>e(t.buildAfterSignOutUrl()),navigateAfterMultiSessionSingleSignOutUrl:()=>e(t.buildAfterMultiSessionSingleSignOutUrl()),afterSignOutUrl:t.buildAfterSignOutUrl(),afterMultiSessionSingleSignOutUrl:t.buildAfterMultiSessionSingleSignOutUrl()}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["472"],{55763:function(e,r,t){t.d(r,{Cm:()=>c,Kw:()=>m,R5:()=>p,UY:()=>f,iy:()=>v,oj:()=>g,xf:()=>d}),t(19161),t(85074),t(30945),t(22501),t(21044);var i=t(62620),n=t(87651),l=t(1959),a=t(68289);let s=e=>r=>"safeIdentifier"in r&&r.safeIdentifier===e;function o(e){if((0,i.Bz)()){let r=e.find(e=>{let{strategy:r}=e;return"passkey"===r});if(r)return r}return null}function d(e,r,t){return e&&0!==e.length?t===l._o.Password?function(e,r){let t=o(e);if(t)return t;let i=e.sort(a.Kn)[0];return"password"===i.strategy?i:e.find(s(r))||i||null}(e,r):function(e,r){let t=o(e);if(t)return t;let i=e.sort(a.Ih),n=i.find(s(r));if(n)return n;let l=i[0];return"email_link"===l.strategy?l:e.find(s(r))||l||null}(e,r):null}let u=["passkey","email_code","password","phone_code","email_link"];function c(e){return!!e&&u.includes(e.strategy)}function p(e){if(!e||0===e.length)return null;let r=e.find(e=>"totp"===e.strategy);if(r)return r;let t=e.find(e=>"phone_code"===e.strategy);return t||e[0]}let h=["reset_password_phone_code","reset_password_email_code"],m=e=>!!e&&h.includes(e);function f(e){let r;return"tel"===e.type?"phoneNumber":(r=e.value,/^\S+@\S+\.\S+$/.test(r))?"emailAddress":"username"}let g=(e,r,t)=>{var i,l;if(!r)return null;let a=null==(i=e.find(e=>"strategy"===e.id))?void 0:i.value;if(a&&"phone_code"!==a)return null;let s=null==(l=e.find(e=>e.id===t))?void 0:l.value;if(!s||!(null==s?void 0:s.startsWith("+")))return null;let o=(0,n.TV)(s,r);return"sms"===o?null:o},v=(e,r,t)=>{if(!e||!r||"phoneNumber"!==r||!t||!(null==t?void 0:t.startsWith("+")))return null;let i=(0,n.TV)(t,e);return"sms"===i?null:i}},84753:function(e,r,t){t.r(r),t.d(r,{SignUp:()=>eN,SignUpContinue:()=>Q,SignUpModal:()=>eE,SignUpSSOCallback:()=>en,SignUpVerifyEmail:()=>ey,SignUpVerifyPhone:()=>eP,SignUpStart:()=>ev});var i=t(14518),n=t(21210),l=t(35074),a=t(55873),s=t(75350),o=t(85577),d=t(44607),u=t(17607),c=t(54096),p=t(80212),h=t(42265),m=t(54132);t(50036);var f=t(9075),g=t(22861),v=t(18272),b=t(58920),_=t(29),U=t(23707),A=t(63269),S=t(76153),k=t(49236),Y=t(4964);let y=(0,l.lazy)(()=>Promise.all([t.e("545"),t.e("666"),t.e("188")]).then(t.bind(t,66464)).then(e=>({default:e.Web3SolanaWalletButtons}))),C=(0,f.p)((0,f.Ai)((0,A.dm)(()=>{let e=(0,n.ho)(),r=(0,A.f0)(),t=(0,Y.r)(),a=(0,s.X)();return(0,i.Y)(d.n.Part,{part:"chooseWallet",children:(0,i.FD)(U.Z.Root,{children:[(0,i.FD)(U.Z.Content,{children:[(0,i.FD)(S.Y.Root,{showLogo:!0,children:[(0,i.Y)(S.Y.Title,{localizationKey:(0,g.G)("signUp.web3Solana.title")}),(0,i.Y)(S.Y.Subtitle,{localizationKey:(0,g.G)("signUp.web3Solana.subtitle")})]}),(0,i.Y)(U.Z.Alert,{children:r.error}),(0,i.FD)(v.so,{direction:"col",gap:4,children:[(0,i.Y)(l.Suspense,{fallback:(0,i.Y)(v.so,{direction:"row",align:"center",justify:"center",sx:e=>({height:"100%",minHeight:e.sizes.$32}),children:(0,i.Y)(v.y$,{size:"lg",colorScheme:"primary",elementDescriptor:b.$z.spinner})}),children:(0,i.Y)(y,{web3AuthCallback:i=>{let{walletName:n}=i;return e.authenticateWithWeb3({customNavigate:t.navigate,redirectUrl:a.afterSignUpUrl||"/",signUpContinueUrl:"continue",strategy:"web3_solana_signature",unsafeMetadata:a.unsafeMetadata,walletName:n}).catch(e=>(0,k.f)(e,r.setError))}})}),(0,i.Y)(_.E,{boxElementDescriptor:b.$z.backRow,linkElementDescriptor:b.$z.backLink,onClick:()=>{t.navigate("../")}})]})]}),(0,i.Y)(U.Z.Footer,{})]})})})));t(88711),t(58814),t(19161),t(8451),t(10676),t(85074),t(30945),t(1589);var P=t(56980),I=t(26760),w=t(4468),N=t(8640),F=t(94557),E=t(97697),R=t(56324),q=t(80004),G=t(10078),T=t(52454),L=t(33832),D=t(16580),M=t(6142),B=t(37591);let O=e=>{var r,t,n,l,a,s,o,d,u,c,p,h,m,f;let{handleSubmit:b,fields:_,formState:U,canToggleEmailPhone:A,onlyLegalAcceptedMissing:S=!1,handleEmailPhoneToggle:k}=e,{showOptionalFields:Y}=(0,D.K)().parsedOptions,y=e=>{var r;return("emailAddress"===e||"phoneNumber"===e)&&A?!!_[e]:!!_[e]&&(Y||(null==(r=_[e])?void 0:r.required))};return(0,i.FD)(T.l.Root,{onSubmit:b,gap:8,children:[!S&&(0,i.FD)(v.fv,{gap:6,children:[(y("firstName")||y("lastName"))&&(0,i.FD)(T.l.ControlRow,{elementId:"name",sx:{[B.g.sm]:{flexWrap:"wrap"}},children:[y("firstName")&&(0,i.Y)(T.l.PlainInput,{...U.firstName.props,isRequired:null==(r=_.firstName)?void 0:r.required,isOptional:!(null==(t=_.firstName)?void 0:t.required)}),y("lastName")&&(0,i.Y)(T.l.PlainInput,{...U.lastName.props,isRequired:null==(n=_.lastName)?void 0:n.required,isOptional:!(null==(l=_.lastName)?void 0:l.required)})]}),y("username")&&(0,i.Y)(T.l.ControlRow,{elementId:"username",children:(0,i.Y)(T.l.PlainInput,{...U.username.props,isRequired:null==(a=_.username)?void 0:a.required,isOptional:!(null==(s=_.username)?void 0:s.required)})}),y("emailAddress")&&(0,i.Y)(T.l.ControlRow,{elementId:"emailAddress",children:(0,i.Y)(T.l.PlainInput,{...U.emailAddress.props,isRequired:null==(o=_.emailAddress)?void 0:o.required,isOptional:!(null==(d=_.emailAddress)?void 0:d.required),isDisabled:null==(u=_.emailAddress)?void 0:u.disabled,actionLabel:A?(0,g.G)("signUp.start.actionLink__use_phone"):void 0,onActionClicked:A?()=>k("phoneNumber"):void 0})}),y("phoneNumber")&&(0,i.Y)(T.l.ControlRow,{elementId:"phoneNumber",children:(0,i.Y)(T.l.PhoneInput,{...U.phoneNumber.props,isRequired:null==(c=_.phoneNumber)?void 0:c.required,isOptional:!(null==(p=_.phoneNumber)?void 0:p.required),actionLabel:A?(0,g.G)("signUp.start.actionLink__use_email"):void 0,onActionClicked:A?()=>k("emailAddress"):void 0})}),y("password")&&(0,i.Y)(T.l.ControlRow,{elementId:"password",children:(0,i.Y)(T.l.PasswordInput,{...U.password.props,isRequired:null==(h=_.password)?void 0:h.required,isOptional:!(null==(m=_.password)?void 0:m.required)})})]}),(0,i.FD)(v.fv,{center:!0,children:[(0,i.Y)(M.j,{}),(0,i.FD)(v.fv,{gap:6,sx:{width:"100%"},children:[y("legalAccepted")&&(0,i.Y)(T.l.ControlRow,{elementId:"legalAccepted",children:(0,i.Y)(L.d,{...U.legalAccepted.props,isRequired:null==(f=_.legalAccepted)?void 0:f.required})}),(0,i.Y)(T.l.SubmitButton,{hasArrow:!0,localizationKey:(0,g.G)("formButtonPrimary")})]})]})]})};t(41730),t(89305);var Z=t(21044);let x=["emailAddress","phoneNumber","username","firstName","lastName","password","ticket","legalAccepted"];function V(e){return x.reduce((r,t)=>{let i=function(e,r){switch(e){case"emailAddress":return function(e){var r,t,i;let{attributes:n,hasTicket:l,hasEmail:a,activeCommIdentifierType:s,isProgressiveSignUp:o}=e;if(o){if(!((!l||l&&a)&&(null==(i=n.email_address)?void 0:i.enabled))||K(n,o)&&"emailAddress"!==s)return;let{emailShouldBeRequired:e}=H(n);return{required:e,disabled:!!l&&!!a}}if((!l||l&&a)&&(null==(r=n.email_address)?void 0:r.enabled)&&(null==(t=n.email_address)?void 0:t.used_for_first_factor)&&"emailAddress"===s)return{required:!0,disabled:!!l&&!!a}}(r);case"phoneNumber":return function(e){var r,t;let{attributes:i,hasTicket:n,activeCommIdentifierType:l,isProgressiveSignUp:a}=e;if(a){if(!(null==(t=i.phone_number)?void 0:t.enabled)||K(i,a)&&"phoneNumber"!==l)return;let{phoneShouldBeRequired:e}=H(i);return{required:e}}if(!n&&(null==(r=i.phone_number)?void 0:r.enabled)&&i.phone_number.used_for_first_factor&&"phoneNumber"===l)return{required:!0}}(r);case"password":var t,i,n=r.attributes;if((null==(t=n.password)?void 0:t.enabled)&&n.password.required)return{required:!!(null==(i=n.password)?void 0:i.required)};return;case"ticket":var l=r.hasTicket;if(l)return{required:!0};return;case"legalAccepted":var a=r.legalConsentRequired;if(a)return{required:!0};return;case"username":case"firstName":case"lastName":return function(e,r){var t,i;let n=(0,Z.C8)(e);if(null==(t=r[n])?void 0:t.enabled)return{required:null==(i=r[n])?void 0:i.required}}(e,r.attributes);default:return}}(t,e);return i&&(r[t]=i),r},{})}let z=(e,r,t)=>{if(null==t?void 0:t.emailAddress)return"emailAddress";if(null==t?void 0:t.phoneNumber)return"phoneNumber";if(K(e,r))return"emailAddress";let{email_address:i,phone_number:n}=e;return((null==i?void 0:i.enabled)&&r?i.required:null==i?void 0:i.used_for_first_factor)?"emailAddress":((null==n?void 0:n.enabled)&&r?n.required:null==n?void 0:n.used_for_first_factor)?"phoneNumber":null};function K(e,r){let{email_address:t,phone_number:i}=e;return!!(r?(null==t?void 0:t.enabled)&&(null==i?void 0:i.enabled)&&!t.required&&!i.required:(null==t?void 0:t.used_for_first_factor)&&(null==i?void 0:i.used_for_first_factor))}let W={mirrorServer:[e=>!e.passwordRequired,e=>e.email.required||e.phone.required||e.username.required&&e.username.firstFactor],none:[e=>!e.email.enabled&&!e.phone.enabled&&!e.username.enabled],email:[e=>e.email.enabled&&!e.phone.enabled&&!e.username.enabled,e=>e.email.enabled&&!e.email.required&&e.phone.enabled&&!e.phone.required,e=>e.username.firstFactor&&!e.username.required&&e.email.enabled&&!e.email.required,e=>e.username.required&&!e.username.firstFactor&&e.email.enabled&&e.phone.enabled],phone:[e=>e.phone.enabled&&!e.email.required&&!e.phone.required,e=>e.username.firstFactor&&!e.username.required&&e.phone.enabled&&!e.phone.required,e=>e.phone.firstFactor&&!e.email.firstFactor&&!e.username.firstFactor,e=>e.username.required&&!e.username.firstFactor&&e.phone.enabled&&e.email.enabled,e=>!e.email.enabled&&e.phone.enabled&&e.username.enabled],username:[e=>e.username.enabled&&e.username.firstFactor&&!e.email.enabled&&!e.phone.enabled,e=>e.username.required&&!e.username.firstFactor&&e.email.enabled&&e.phone.enabled]};function H(e){var r,t,i,n,l,a,s,o,d,u;let c={passwordRequired:!!((null==(r=e.password)?void 0:r.enabled)&&e.password.required),email:{enabled:!!(null==(t=e.email_address)?void 0:t.enabled),required:!!(null==(i=e.email_address)?void 0:i.required),firstFactor:!!(null==(n=e.email_address)?void 0:n.used_for_first_factor)},phone:{enabled:!!(null==(l=e.phone_number)?void 0:l.enabled),required:!!(null==(a=e.phone_number)?void 0:a.required),firstFactor:!!(null==(s=e.phone_number)?void 0:s.used_for_first_factor)},username:{enabled:!!(null==(o=e.username)?void 0:o.enabled),required:!!(null==(d=e.username)?void 0:d.required),firstFactor:!!(null==(u=e.username)?void 0:u.used_for_first_factor)}},p=e=>W[e].some(e=>e(c));if(p("mirrorServer"))return{emailShouldBeRequired:c.email.required,phoneShouldBeRequired:c.phone.required,usernameShouldBeRequired:c.username.required};if(p("none"))return{emailShouldBeRequired:!1,phoneShouldBeRequired:!1,usernameShouldBeRequired:!1};let h=p("email"),m=p("phone"),f=p("username");return!c.passwordRequired||h||m||f?{emailShouldBeRequired:h,phoneShouldBeRequired:m,usernameShouldBeRequired:f}:{emailShouldBeRequired:!0,phoneShouldBeRequired:!1,usernameShouldBeRequired:!1}}var $=t(60044),J=t(33226);let X=l.memo(e=>{let r=(0,n.ho)(),{navigate:t}=(0,Y.r)(),l=(0,A.f0)(),a=(0,s.X)(),o=(0,R.B)(),d=a.ssoCallbackUrl,u=a.afterSignUpUrl||"/",c="popup"===a.oauthFlow||"auto"===a.oauthFlow&&(0,$.C)(),{continueSignUp:p=!1,onAlternativePhoneCodeProviderClick:h,...m}=e;return(0,i.Y)(J.V,{...m,showLastAuthenticationStrategy:!1,idleAfterDelay:!c,oauthCallback:r=>{if(c){let t=window.open("about:blank","","width=600,height=800"),i=setInterval(()=>{(!t||t.closed)&&(clearInterval(i),l.setIdle())},500);return o.authenticateWithPopup({strategy:r,redirectUrl:d,redirectUrlComplete:u,popup:t,continueSignUp:p,unsafeMetadata:a.unsafeMetadata,legalAccepted:e.legalAccepted,oidcPrompt:a.oidcPrompt}).catch(e=>(0,w.H4)(e,[],l.setError))}return o.authenticateWithRedirect({continueSignUp:p,redirectUrl:d,redirectUrlComplete:u,strategy:r,unsafeMetadata:a.unsafeMetadata,legalAccepted:e.legalAccepted,oidcPrompt:a.oidcPrompt}).catch(e=>(0,w.H4)(e,[],l.setError))},web3Callback:i=>"web3_solana_signature"===i?t("choose-wallet?strategy=".concat(i)):r.authenticateWithWeb3({customNavigate:t,redirectUrl:u,signUpContinueUrl:"continue",unsafeMetadata:a.unsafeMetadata,strategy:i,legalAccepted:e.legalAccepted}).catch(e=>(0,k.f)(e,l.setError)),alternativePhoneCodeCallback:e=>{null==h||h(e)}})});var j=t(1687);let Q=(0,A.dm)(function(){var e,r;let t=(0,A.f0)(),a=(0,n.ho)(),{navigate:o}=(0,Y.r)(),{displayConfig:u,userSettings:c}=(0,E.O)(),{attributes:p,usernameSettings:h}=c,{t:m,locale:f}=(0,G._)(),{afterSignUpUrl:_,signInUrl:k,unsafeMetadata:y,initialValues:C={},isCombinedFlow:T,navigateOnSetActive:L}=(0,s.X)(),D=(0,R.B)(),M=!!l.useContext(q.Q),B=!!(T&&M),Z=c.signUp.progressive,[x,W]=l.useState(z(p,c.signUp.progressive)),H=(0,s.X)(),$={firstName:(0,N.tJ)("firstName",C.firstName||"",{type:"text",label:(0,g.G)("formFieldLabel__firstName"),placeholder:(0,g.G)("formFieldInputPlaceholder__firstName")}),lastName:(0,N.tJ)("lastName",C.lastName||"",{type:"text",label:(0,g.G)("formFieldLabel__lastName"),placeholder:(0,g.G)("formFieldInputPlaceholder__lastName")}),emailAddress:(0,N.tJ)("emailAddress",C.emailAddress||D.emailAddress||"",{type:"email",label:(0,g.G)("formFieldLabel__emailAddress"),placeholder:(0,g.G)("formFieldInputPlaceholder__emailAddress")}),username:(0,N.tJ)("username",C.username||"",{type:"text",label:(0,g.G)("formFieldLabel__username"),placeholder:(0,g.G)("formFieldInputPlaceholder__username"),transformer:e=>e.trim(),buildErrorMessage:e=>(0,F.Z)(e,{t:m,locale:f,usernameSettings:h})}),phoneNumber:(0,N.tJ)("phoneNumber",C.phoneNumber||"",{type:"tel",label:(0,g.G)("formFieldLabel__phoneNumber"),placeholder:(0,g.G)("formFieldInputPlaceholder__phoneNumber")}),password:(0,N.tJ)("password","",{type:"password",label:(0,g.G)("formFieldLabel__password"),placeholder:(0,g.G)("formFieldInputPlaceholder__password"),validatePassword:!0}),legalAccepted:(0,N.tJ)("legalAccepted","",{type:"checkbox",label:"",defaultChecked:!1,isRequired:c.signUp.legal_consent_enabled||!1})},J=(0,l.useMemo)(()=>D.missingFields&&1===D.missingFields.length&&"legal_accepted"===D.missingFields[0]&&D.unverifiedFields&&0===D.unverifiedFields.length,[D.missingFields,D.unverifiedFields]);if((0,l.useEffect)(()=>{D.id||!0===a.__internal_setActiveInProgress||o(u.signUpUrl)},[]),!D.id)return(0,i.Y)(P.B,{});let Q=!!$.emailAddress.value,ee=(null==(r=D.verifications)||null==(e=r.externalAccount)?void 0:e.status)=="verified",er=V({attributes:p,hasEmail:Q,activeCommIdentifierType:x,signUp:D,isProgressiveSignUp:Z,legalConsentRequired:c.signUp.legal_consent_enabled});!function(e,r){if(r){var t,i,n,l,a,s,o,d;let u=!!r.emailAddress,c=(null==(i=r.verifications)||null==(t=i.emailAddress)?void 0:t.status)==="verified",p=(null==(l=r.verifications)||null==(n=l.phoneNumber)?void 0:n.status)==="verified",h=(null==(s=r.verifications)||null==(a=s.externalAccount)?void 0:a.status)==="verified",m=(null==(d=r.verifications)||null==(o=d.web3Wallet)?void 0:o.status)==="verified",f=null!==r.legalAcceptedAt;u&&c&&delete e.emailAddress,p&&delete e.phoneNumber,(h||m)&&delete e.password,r.firstName&&delete e.firstName,r.lastName&&delete e.lastName,r.username&&delete e.username,f&&delete e.legalAccepted,Object.entries(e).forEach(r=>{let[t,i]=r;i&&!i.required&&delete e[t]})}}(er,D);let et=c.authenticatableSocialStrategies,ei=async e=>{var r,i;e.preventDefault();let n=Object.entries(er).reduce((e,r)=>{let[t,i]=r;return[...e,...i&&$[t]?[$[t]]:[]]},[]);y&&n.push({id:"unsafeMetadata",value:y});let l=!!(null==(r=n.find(e=>"emailAddress"===e.id))?void 0:r.value),s=!!(null==(i=n.find(e=>"phoneNumber"===e.id))?void 0:i.value);return D.missingFields.includes("email_address")&&D.missingFields.includes("phone_number")&&!l&&!s&&K(p,Z)&&(n.push($.emailAddress),n.push($.phoneNumber)),t.setLoading(),t.setError(void 0),D.update((0,N.mK)(n)).then(e=>(0,j.A)({signUp:e,verifyEmailPath:"./verify-email-address",verifyPhonePath:"./verify-phone-number",handleComplete:()=>a.setActive({session:e.createdSessionId,navigate:async e=>{let{session:r}=e;await L({session:r,redirectUrl:_})}}),navigate:o,oidcPrompt:H.oidcPrompt})).catch(e=>(0,w.H4)(e,n,t.setError)).finally(()=>t.setIdle())},en=K(p,Z),el=!ee&&et.length>0,ea=J?(0,g.G)("signUp.legalConsent.continue.title"):(0,g.G)("signUp.continue.title"),es=J?(0,g.G)("signUp.legalConsent.continue.subtitle"):(0,g.G)("signUp.continue.subtitle");return(0,i.Y)(d.n.Part,{part:"complete",children:(0,i.FD)(U.Z.Root,{children:[(0,i.FD)(U.Z.Content,{children:[(0,i.FD)(S.Y.Root,{showLogo:!0,children:[(0,i.Y)(S.Y.Title,{localizationKey:ea}),(0,i.Y)(S.Y.Subtitle,{localizationKey:es})]}),(0,i.Y)(U.Z.Alert,{children:t.error}),(0,i.Y)(v.so,{direction:"col",elementDescriptor:b.$z.main,gap:8,children:(0,i.FD)(I.U,{children:[el&&!J&&(0,i.Y)(X,{enableOAuthProviders:el,enableWeb3Providers:!1,enableAlternativePhoneCodeProviders:!1,continueSignUp:!0}),(0,i.Y)(O,{handleSubmit:ei,fields:er,formState:$,onlyLegalAcceptedMissing:J,canToggleEmailPhone:en,handleEmailPhoneToggle:e=>{K(p,Z)&&W(e)}})]})})]}),(0,i.Y)(U.Z.Footer,{children:B?null:(0,i.FD)(U.Z.Action,{elementId:"signUp",children:[(0,i.Y)(U.Z.ActionText,{localizationKey:(0,g.G)("signUp.continue.actionText")}),(0,i.Y)(U.Z.ActionLink,{localizationKey:(0,g.G)("signUp.continue.actionLink"),to:B?"../../":a.buildUrlWithAuth(k)})]})})]})})});var ee=t(77420),er=t(67896);let et=(0,f.Ai)((0,A.dm)(()=>{let e=(0,n.ho)(),r=(0,s.X)(),t=e.client.signUp,{data:l,isLoading:a}=(0,er.s)(null==t?void 0:t.__experimental_getEnterpriseConnections,{signUpId:t.id});return a||(null==l?void 0:l.length)?(0,i.Y)(d.n.Part,{part:"enterpriseConnections",children:(null==l?void 0:l.length)?(0,i.Y)(ee.l,{title:(0,g.G)("signUp.enterpriseConnections.title"),subtitle:(0,g.G)("signUp.enterpriseConnections.subtitle"),onClick:e=>{let i=r.ssoCallbackUrl,n=r.afterSignUpUrl||"/";return t.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:i,redirectUrlComplete:n,continueSignUp:!0,enterpriseConnectionId:e})},enterpriseConnections:l}):a?(0,i.Y)(P.B,{}):null}):null}));var ei=t(16126);let en=(0,f.p)((0,f.Ai)(ei.F));t(95055);var el=t(81652),ea=t(73610),es=t(22166),eo=t(25848),ed=t(23990),eu=t(84901),ec=t(55763),ep=t(19426),eh=t(2782);let em=()=>{let e=(0,n.ho)(),r=(0,A.f0)(),{navigate:t}=(0,Y.r)(),{signInUrl:l,waitlistUrl:a}=(0,s.X)(),o=(0,ep.p)(),{userSettings:d}=(0,E.O)(),{mode:u}=d.signUp,c=async()=>{await t(e.buildUrlWithAuth(a))},p=u===es.f.RESTRICTED?(0,g.G)("signUp.restrictedAccess.subtitle"):(0,g.G)("signUp.restrictedAccess.subtitleWaitlist");return(0,i.FD)(U.Z.Root,{children:[(0,i.FD)(U.Z.Content,{children:[(0,i.FD)(S.Y.Root,{showLogo:!0,children:[(0,i.Y)(v.In,{icon:eh.A,sx:e=>({margin:"auto",width:e.sizes.$10,height:e.sizes.$10})}),(0,i.Y)(S.Y.Title,{localizationKey:(0,g.G)("signUp.restrictedAccess.title")}),(0,i.Y)(S.Y.Subtitle,{localizationKey:p})]}),(0,i.Y)(U.Z.Alert,{children:r.error}),u===es.f.RESTRICTED&&o&&(0,i.Y)(v.so,{direction:"col",gap:4,children:(0,i.Y)(v.$n,{localizationKey:(0,g.G)("signUp.restrictedAccess.blockButton__emailSupport"),onClick:()=>{window.location.href="mailto:".concat(o)}})}),u===es.f.WAITLIST&&(0,i.Y)(v.so,{direction:"col",gap:4,children:(0,i.Y)(v.$n,{localizationKey:(0,g.G)("signUp.restrictedAccess.blockButton__joinWaitlist"),onClick:c})})]}),(0,i.Y)(U.Z.Footer,{children:(0,i.FD)(U.Z.Action,{elementId:"signUp",children:[(0,i.Y)(U.Z.ActionText,{localizationKey:(0,g.G)("signUp.restrictedAccess.actionText")}),(0,i.Y)(U.Z.ActionLink,{localizationKey:(0,g.G)("signUp.restrictedAccess.actionLink"),to:e.buildUrlWithAuth(l)})]})})]})};var ef=t(19835);let eg=e=>{var r,t,n;let{handleSubmit:l,fields:a,formState:s,onUseAnotherMethod:o,phoneCodeProvider:d}=e,{providerToDisplayData:u,strategyToDisplayData:c}=(0,ef.k)(),p=d.name,h=d.channel,m=(0,A.f0)();return(0,i.Y)(U.Z.Root,{children:(0,i.FD)(U.Z.Content,{children:[(0,i.FD)(S.Y.Root,{showLogo:!0,showDivider:!0,children:[(0,i.Y)(v.fv,{center:!0,children:(0,i.Y)(v._V,{src:null==(r=u[d.channel])?void 0:r.iconUrl,alt:"".concat(c[h].name," logo"),sx:e=>({width:e.sizes.$7,height:e.sizes.$7,maxWidth:"100%",marginBottom:e.sizes.$6})})}),(0,i.Y)(S.Y.Title,{localizationKey:(0,g.G)("signUp.start.alternativePhoneCodeProvider.title",{provider:p})}),(0,i.Y)(S.Y.Subtitle,{localizationKey:(0,g.G)("signUp.start.alternativePhoneCodeProvider.subtitle",{provider:p})})]}),(0,i.Y)(U.Z.Alert,{children:m.error}),(0,i.Y)(v.so,{direction:"col",elementDescriptor:b.$z.main,gap:6,children:(0,i.FD)(T.l.Root,{onSubmit:l,gap:8,children:[(0,i.Y)(v.fv,{gap:6,children:(0,i.Y)(T.l.ControlRow,{elementId:"phoneNumber",children:(0,i.Y)(T.l.PhoneInput,{...s.phoneNumber.props,label:(0,g.G)("signUp.start.alternativePhoneCodeProvider.label",{provider:p||""}),isRequired:!0,isOptional:!1,actionLabel:void 0,onActionClicked:void 0})})}),(0,i.FD)(v.fv,{center:!0,children:[(0,i.Y)(M.j,{}),(0,i.FD)(v.fv,{gap:6,sx:{width:"100%"},children:[!!a.legalAccepted&&(null==(n=a.legalAccepted)?void 0:n.required)&&(0,i.Y)(T.l.ControlRow,{elementId:"legalAccepted",children:(0,i.Y)(L.d,{...s.legalAccepted.props,isRequired:null==(t=a.legalAccepted)?void 0:t.required})}),(0,i.Y)(T.l.SubmitButton,{hasArrow:!0,localizationKey:(0,g.G)("formButtonPrimary")})]})]}),(0,i.Y)(v.fv,{center:!0,children:(0,i.Y)(v.$n,{variant:"link",colorScheme:"neutral",onClick:o,localizationKey:(0,g.G)("signUp.start.alternativePhoneCodeProvider.actionLink")})})]})})]})})},ev=(0,f.p)((0,f.Ai)((0,A.dm)(function(){let e=(0,A.f0)(),r=(0,n.ho)(),t=(0,eu.m)(),a=(0,R.B)(),{showOptionalFields:o}=(0,D.K)().parsedOptions,{userSettings:u,authConfig:c}=(0,E.O)(),{navigate:p}=(0,Y.r)(),{attributes:h}=u,{setActive:m}=(0,n.ho)(),f=(0,s.X)(),_=!!l.useContext(q.Q),{afterSignUpUrl:k,signInUrl:y,unsafeMetadata:C,navigateOnSetActive:T}=f,L=!!(f.isCombinedFlow&&_),[B,Z]=l.useState(()=>{var e,r,t,i;return z(h,u.signUp.progressive,{phoneNumber:(null==(e=f.initialValues)?void 0:e.phoneNumber)===null||null==(r=f.initialValues)?void 0:r.phoneNumber,emailAddress:(null==(t=f.initialValues)?void 0:t.emailAddress)===null||null==(i=f.initialValues)?void 0:i.emailAddress,...L?{emailAddress:a.emailAddress,phoneNumber:a.phoneNumber}:{}})}),{t:x,locale:W}=(0,G._)(),H=f.initialValues||{},[$,J]=l.useState(null),[Q,ee]=l.useState(!1),{userSettings:{passwordSettings:er,usernameSettings:et}}=(0,E.O)(),{mode:ei}=u.signUp,en={firstName:(0,N.tJ)("firstName",a.firstName||H.firstName||"",{type:"text",label:(0,g.G)("formFieldLabel__firstName"),placeholder:(0,g.G)("formFieldInputPlaceholder__firstName")}),lastName:(0,N.tJ)("lastName",a.lastName||H.lastName||"",{type:"text",label:(0,g.G)("formFieldLabel__lastName"),placeholder:(0,g.G)("formFieldInputPlaceholder__lastName")}),emailAddress:(0,N.tJ)("emailAddress",a.emailAddress||H.emailAddress||"",{type:"email",label:(0,g.G)("formFieldLabel__emailAddress"),placeholder:(0,g.G)("formFieldInputPlaceholder__emailAddress")}),username:(0,N.tJ)("username",a.username||H.username||"",{type:"text",label:(0,g.G)("formFieldLabel__username"),placeholder:(0,g.G)("formFieldInputPlaceholder__username"),transformer:e=>e.trim(),buildErrorMessage:e=>(0,F.Z)(e,{t:x,locale:W,usernameSettings:et})}),phoneNumber:(0,N.tJ)("phoneNumber",a.phoneNumber||H.phoneNumber||"",{type:"tel",label:(0,g.G)("formFieldLabel__phoneNumber"),placeholder:(0,g.G)("formFieldInputPlaceholder__phoneNumber")}),legalAccepted:(0,N.tJ)("legalAccepted","",{type:"checkbox",label:"",defaultChecked:!1,isRequired:u.signUp.legal_consent_enabled||!1}),password:(0,N.tJ)("password","",{type:"password",label:(0,g.G)("formFieldLabel__password"),placeholder:(0,g.G)("formFieldInputPlaceholder__password"),validatePassword:!0,buildErrorMessage:e=>(0,ed.C5)(e,{t:x,locale:W,passwordSettings:er})}),ticket:(0,N.tJ)("ticket",(0,eo.hI)("__clerk_ticket")||(0,eo.hI)("__clerk_invitation_token")||"")},ep=!!en.ticket.value,eh=!!(a.id&&null!==a.status&&((0,eo.hI)("__clerk_ticket")||(0,eo.hI)("__clerk_invitation_token"))),ef=!!en.emailAddress.value,ev=u.signUp.progressive,eb=u.signUp.legal_consent_enabled,e_=f.oidcPrompt,eU=V({attributes:h,hasTicket:ep||eh,hasEmail:ef,activeCommIdentifierType:B,isProgressiveSignUp:ev,legalConsentRequired:eb});l.useLayoutEffect(()=>{en.ticket.value&&(t.setLoading(),e.setLoading(),a.create({strategy:"ticket",ticket:en.ticket.value}).then(e=>{en.emailAddress.setValue(e.emailAddress||""),"missing_requirements"===e.status&&ee(!0);let r=f.ssoCallbackUrl,t=f.afterSignUpUrl||"/";return(0,j.A)({signUp:e,redirectUrl:r,redirectUrlComplete:t,verifyEmailPath:"verify-email-address",verifyPhonePath:"verify-phone-number",continuePath:"continue",handleComplete:()=>((0,eo.rw)("__clerk_ticket"),(0,eo.rw)("__clerk_invitation_token"),m({session:e.createdSessionId,navigate:async e=>{let{session:r}=e;await T({session:r,redirectUrl:k})}})),navigate:p,oidcPrompt:e_})}).catch(r=>{en.ticket.setValue(""),(0,w.H4)(r,[],e.setError)}).finally(()=>{a.missingFields.some(e=>"enterprise_sso"===e)||(t.setIdle(),e.setIdle())}))},[]),l.useEffect(()=>{!async function(){let r=a.verifications.externalAccount.error;if(r){switch(r.code){case es.c.NOT_ALLOWED_TO_SIGN_UP:case es.c.OAUTH_ACCESS_DENIED:case es.c.NOT_ALLOWED_ACCESS:case es.c.SAML_USER_ATTRIBUTE_MISSING:case es.c.OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:case es.c.USER_LOCKED:case es.c.ENTERPRISE_SSO_USER_ATTRIBUTE_MISSING:case es.c.ENTERPRISE_SSO_EMAIL_ADDRESS_DOMAIN_MISMATCH:case es.c.ENTERPRISE_SSO_HOSTED_DOMAIN_MISMATCH:case es.c.SAML_EMAIL_ADDRESS_DOMAIN_MISMATCH:case es.c.ORGANIZATION_MEMBERSHIP_QUOTA_EXCEEDED_FOR_SSO:case es.c.CAPTCHA_INVALID:case es.c.FRAUD_DEVICE_BLOCKED:case es.c.FRAUD_ACTION_BLOCKED:case es.c.SIGNUP_RATE_LIMIT_EXCEEDED:case es.c.USER_BANNED:e.setError(r);break;default:e.setError("Unable to complete action at this time. If the problem persists please contact support.")}await a.create({})}}()},[]);let eA=async r=>{var t,i;r.preventDefault();let n=Object.entries(eU).reduce((e,r)=>{let[t,i]=r;return e.push(...i&&en[t]?[en[t]]:[]),e},[]);if(C&&n.push({id:"unsafeMetadata",value:C}),eU.ticket||eh){let e=()=>{};if(n.push({id:"strategy",value:"ticket",clearFeedback:e,setValue:e,onChange:e,setError:e}),!en.ticket.value&&eh){let r=(0,eo.hI)("__clerk_ticket")||(0,eo.hI)("__clerk_invitation_token");r&&n.push({id:"ticket",value:r,clearFeedback:e,setValue:e,onChange:e,setError:e})}}let l=(null==$?void 0:$.channel)||(0,ec.oj)(n,c.preferredChannels,"phoneNumber");if(l){let e=()=>{};n.push({id:"strategy",value:"phone_code",clearFeedback:e,setValue:e,onChange:e,setError:e}),n.push({id:"channel",value:l,clearFeedback:e,setValue:e,onChange:e,setError:e})}let s=!!(null==(t=n.find(e=>"emailAddress"===e.id))?void 0:t.value),o=!!(null==(i=n.find(e=>"phoneNumber"===e.id))?void 0:i.value);!s&&!o&&K(h,ev)&&(n.push(en.emailAddress),n.push(en.phoneNumber)),e.setLoading(),e.setError(void 0);let d=f.ssoCallbackUrl,u=f.afterSignUpUrl||"/";return(eU.ticket||eh?a.upsert((0,N.mK)(n)):a.create((0,N.mK)(n))).then(e=>(0,j.A)({signUp:e,verifyEmailPath:"verify-email-address",verifyPhonePath:"verify-phone-number",handleComplete:()=>m({session:e.createdSessionId,navigate:async e=>{let{session:r}=e;await T({session:r,redirectUrl:k})}}),navigate:p,redirectUrl:d,redirectUrlComplete:u,oidcPrompt:e_})).catch(r=>{var t,i;return(0,ea.$R)(r)&&(null==(i=r.errors)||null==(t=i[0])?void 0:t.code)==="enterprise_connection_id_is_required_with_multiple_connections"?p("./enterprise-connections"):(0,w.H4)(r,n,e.setError)}).finally(()=>e.setIdle())};if(t.isLoading)return(0,i.Y)(P.B,{});let eS=K(h,ev),ek=Object.entries(eU).filter(e=>{let[r,t]=e;return o||(null==t?void 0:t.required)}),eY=function(e){let{authenticatableSocialStrategies:r,web3FirstFactors:t}=e;return e.hasValidAuthFactor||!r.length&&!t.length}(u)&&ek.length>0,ey=(!(ep||eh)||Q)&&u.authenticatableSocialStrategies.length>0,eC=!(ep||eh)&&u.web3FirstFactors.length>0,eP=!(ep||eh)&&u.alternativePhoneCodeChannels.length>0;return ei===es.f.PUBLIC||ep||eh?(0,i.Y)(d.n.Part,{part:"start",children:$?(0,i.Y)(eg,{handleSubmit:eA,fields:eU,formState:en,onUseAnotherMethod:()=>{J(null)},phoneCodeProvider:$}):(0,i.FD)(U.Z.Root,{children:[(0,i.FD)(U.Z.Content,{children:[(0,i.FD)(S.Y.Root,{showLogo:!0,children:[(0,i.Y)(S.Y.Title,{localizationKey:L?(0,g.G)("signUp.start.titleCombined"):(0,g.G)("signUp.start.title")}),(0,i.Y)(S.Y.Subtitle,{localizationKey:L?(0,g.G)("signUp.start.subtitleCombined"):(0,g.G)("signUp.start.subtitle")})]}),(0,i.Y)(U.Z.Alert,{children:e.error}),(0,i.FD)(v.so,{direction:"col",elementDescriptor:b.$z.main,gap:6,children:[(0,i.FD)(I.U,{children:[(ey||eC||eP)&&(0,i.Y)(X,{enableOAuthProviders:ey,enableWeb3Providers:eC,enableAlternativePhoneCodeProviders:eP,onAlternativePhoneCodeProviderClick:e=>{J((0,el.y)(e)||null)},continueSignUp:Q,legalAccepted:!!en.legalAccepted.checked||void 0}),eY&&(0,i.Y)(O,{handleSubmit:eA,fields:eU,formState:en,canToggleEmailPhone:eS,handleEmailPhoneToggle:e=>{K(h,ev)&&Z(e)}})]}),!eY&&(0,i.Y)(M.j,{})]})]}),(0,i.Y)(U.Z.Footer,{children:(0,i.FD)(U.Z.Action,{elementId:"signUp",children:[(0,i.Y)(U.Z.ActionText,{localizationKey:(0,g.G)("signUp.start.actionText")}),(0,i.Y)(U.Z.ActionLink,{localizationKey:(0,g.G)("signUp.start.actionLink"),to:L?"../":r.buildUrlWithAuth(y)})]})})]})}):(0,i.Y)(em,{})})));var eb=t(27912);let e_=e=>{let{afterSignUpUrl:r,navigateOnSetActive:t,isCombinedFlow:a}=(0,s.X)(),{setActive:o}=(0,n.ho)(),{navigate:d}=(0,Y.r)(),u=!!(l.useContext(q.Q)&&a);return(0,i.Y)(eb.j,{cardTitle:e.cardTitle,cardSubtitle:e.cardSubtitle,resendButton:e.resendButton,onCodeEntryFinishedAction:(i,n,l)=>{e.attempt(i).then(async e=>(await n(),(0,j.A)({signUp:e,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",continuePath:"../continue",handleComplete:()=>o({session:e.createdSessionId,navigate:async e=>{let{session:i}=e;await t({session:i,redirectUrl:r})}}),navigate:d}))).catch(e=>l(e))},onResendCodeClicked:e.prepare,safeIdentifier:e.safeIdentifier,onIdentityPreviewEditClicked:()=>d(u?"../../":"../",{searchParams:(0,eo.hF)()}),alternativeMethodsLabel:e.alternativeMethodsLabel,onShowAlternativeMethodsClicked:e.onShowAlternativeMethodsClicked,showAlternativeMethods:e.showAlternativeMethods})},eU=()=>{let e=(0,R.B)(),r=(0,A.f0)(),t=e.verifications.emailAddress.status,n=!e.status||"verified"===t;return(0,er.s)(n?void 0:()=>e.prepareEmailAddressVerification({strategy:"email_code"}),{name:"prepare",strategy:"email_code",number:e.emailAddress},{staleTime:100,onError:e=>(0,w.H4)(e,[],r.setError)}),(0,i.Y)(d.n.Part,{part:"emailCode",children:(0,i.Y)(e_,{cardTitle:(0,g.G)("signUp.emailCode.title"),cardSubtitle:(0,g.G)("signUp.emailCode.subtitle"),inputLabel:(0,g.G)("signUp.emailCode.formSubtitle"),resendButton:(0,g.G)("signUp.emailCode.resendButton"),prepare:()=>{if(!n)return e.prepareEmailAddressVerification({strategy:"email_code"}).catch(e=>(0,w.H4)(e,[],r.setError))},attempt:r=>e.attemptEmailAddressVerification({code:r}),safeIdentifier:e.emailAddress})})};var eA=t(72027),eS=t(14979),ek=t(12992);let eY=()=>{let{t:e}=(0,G._)(),r=(0,R.B)(),t=(0,s.X)(),{afterSignUpUrl:a,navigateOnSetActive:o}=t,u=(0,A.f0)(),{navigate:c}=(0,Y.r)(),{setActive:p}=(0,n.ho)(),[h,m]=l.useState(!1),{startEmailLinkFlow:f,cancelEmailLinkFlow:v}=(0,ek.u)(r);l.useEffect(()=>{b()},[]);let b=()=>f({redirectUrl:t.emailLinkRedirectUrl}).then(e=>_(e)).catch(e=>{(0,w.H4)(e,[],u.setError)}),_=async r=>{let t=r.verifications.emailAddress;"expired"===t.status?u.setError(e((0,g.G)("formFieldError__verificationLinkExpired"))):t.verifiedFromTheSameClient()?m(!0):await (0,j.A)({signUp:r,continuePath:"../continue",verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number",handleComplete:()=>p({session:r.createdSessionId,navigate:async e=>{let{session:r}=e;await o({session:r,redirectUrl:a})}}),navigate:c})};return h?(0,i.Y)(eS.$,{title:(0,g.G)("signUp.emailLink.verifiedSwitchTab.title"),subtitle:(0,g.G)("signUp.emailLink.verifiedSwitchTab.subtitleNewTab"),status:"verified_switch_tab"}):(0,i.Y)(d.n.Part,{part:"emailLink",children:(0,i.Y)(eA._,{cardTitle:(0,g.G)("signUp.emailLink.title"),cardSubtitle:(0,g.G)("signUp.emailLink.subtitle"),formTitle:(0,g.G)("signUp.emailLink.formTitle"),formSubtitle:(0,g.G)("signUp.emailLink.formSubtitle"),resendButton:(0,g.G)("signUp.emailLink.resendButton"),onResendCodeClicked:()=>{v(),b()},safeIdentifier:r.emailAddress})})},ey=(0,A.dm)(()=>{var e,r;let{userSettings:t}=(0,E.O)(),{attributes:n}=t;return(null==(r=n.email_address)||null==(e=r.verifications)?void 0:e.includes("email_link"))?(0,i.Y)(eY,{}):(0,i.Y)(eU,{})}),eC=(0,A.dm)(()=>{let e=(0,R.B)(),r=(0,A.f0)(),t=e.verifications.phoneNumber.channel,n=e.verifications.phoneNumber.status,l=!e.status||"verified"===n,a=!!t&&"sms"!==t,s=a?t:void 0;(0,er.s)(l||a?void 0:()=>e.preparePhoneNumberVerification({strategy:"phone_code",channel:void 0}),{name:"signUp.preparePhoneNumberVerification",strategy:"phone_code",number:e.phoneNumber},{staleTime:100,onError:e=>(0,w.H4)(e,[],r.setError)});let o=(0,g.G)("signUp.phoneCode.title"),u=(0,g.G)("signUp.phoneCode.subtitle"),c=(0,g.G)("signUp.phoneCode.resendButton");if(a){var p;let e=null==(p=(0,el.y)(t))?void 0:p.name;o=(0,g.G)("signUp.alternativePhoneCodeProvider.title",{provider:e||""}),u=(0,g.G)("signUp.alternativePhoneCodeProvider.subtitle",{provider:e||""}),c=(0,g.G)("signUp.alternativePhoneCodeProvider.resendButton")}return r.isLoading?(0,i.Y)(P.B,{}):(0,i.Y)(d.n.Part,{part:"phoneCode",children:(0,i.Y)(e_,{cardTitle:o,cardSubtitle:u,resendButton:c,prepare:()=>{if(!l)return e.preparePhoneNumberVerification({strategy:"phone_code",channel:s}).catch(e=>(0,w.H4)(e,[],r.setError))},attempt:r=>e.attemptPhoneNumberVerification({code:r}),safeIdentifier:e.phoneNumber,alternativeMethodsLabel:a?(0,g.G)("footerActionLink__alternativePhoneCodeProvider"):void 0,onShowAlternativeMethodsClicked:a?()=>{r.setLoading(),r.setError(void 0),e.preparePhoneNumberVerification({strategy:"phone_code",channel:void 0}).catch(e=>(0,w.H4)(e,[],r.setError)).finally(()=>r.setIdle())}:void 0,showAlternativeMethods:!!a||void 0})})}),eP=()=>(0,i.Y)(eC,{});function eI(){let e=(0,n.ho)();return l.useEffect(()=>{e.redirectToSignUp()},[]),null}function ew(){(0,u.Z)();let e=(0,s.X)();return(0,i.Y)(d.n.Root,{flow:"signUp",children:(0,i.FD)(p.d,{children:[(0,i.Y)(h.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,i.Y)(ey,{})}),(0,i.Y)(h.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,i.Y)(eP,{})}),(0,i.Y)(h.q,{path:"sso-callback",children:(0,i.Y)(en,{signUpUrl:e.signUpUrl,signInUrl:e.signInUrl,signUpForceRedirectUrl:e.afterSignUpUrl,signInForceRedirectUrl:e.afterSignInUrl,secondFactorUrl:e.secondFactorUrl,continueSignUpUrl:"../continue",verifyEmailAddressUrl:"../verify-email-address",verifyPhoneNumberUrl:"../verify-phone-number"})}),(0,i.Y)(h.q,{path:"verify",children:(0,i.Y)(a.M,{redirectUrlComplete:e.afterSignUpUrl,verifyEmailPath:"../verify-email-address",verifyPhonePath:"../verify-phone-number"})}),(0,i.FD)(h.q,{path:"continue",children:[(0,i.Y)(h.q,{path:"verify-email-address",canActivate:e=>!!e.client.signUp.emailAddress,children:(0,i.Y)(ey,{})}),(0,i.Y)(h.q,{path:"verify-phone-number",canActivate:e=>!!e.client.signUp.phoneNumber,children:(0,i.Y)(eP,{})}),(0,i.Y)(h.q,{index:!0,children:(0,i.Y)(Q,{})})]}),(0,i.Y)(h.q,{path:"tasks",children:(0,i.Y)(c.JJ,{redirectUrlComplete:e.afterSignUpUrl})}),(0,i.Y)(h.q,{path:"enterprise-connections",children:(0,i.Y)(et,{})}),(0,i.Y)(h.q,{path:"choose-wallet",children:(0,i.Y)(C,{})}),(0,i.Y)(h.q,{index:!0,children:(0,i.Y)(ev,{})}),(0,i.Y)(h.q,{children:(0,i.Y)(eI,{})})]})})}ew.displayName="SignUp";let eN=(0,o.Z)(ew),eF=(0,o.Z)(ew),eE=e=>{let r={signInUrl:"/".concat(m.I,"/sign-in"),waitlistUrl:"/".concat(m.I,"/waitlist"),...e};return(0,i.Y)(h.q,{path:"sign-up",children:(0,i.Y)(s.g.Provider,{value:{componentName:"SignUp",...r,routing:"virtual",mode:"modal"},children:(0,i.Y)("div",{children:(0,i.Y)(eF,{...r,routing:"virtual"})})})})}},88722:function(e,r,t){t.d(r,{completeSignUpFlow:()=>i.A});var i=t(1687)},80004:function(e,r,t){t.d(r,{Q:()=>f,r:()=>g}),t(98114);var i=t(22166),n=t(48380),l=t(5580),a=t(14173),s=t(21210),o=t(62543),d=t(35074),u=t(78051),c=t(97697),p=t(62366),h=t(4964),m=t(42117);let f=(0,d.createContext)(null),g=()=>{var e,r,t,g,v,b,_;let U=(0,d.useContext)(f),{navigate:A,basePath:S,startPath:k}=(0,h.r)(),{displayConfig:Y,userSettings:y}=(0,c.O)(),{queryParams:C,queryString:P}=(0,h.r)(),I=y.signUp.mode,w=(0,p.II)(),N=(0,s.ho)();if(null===U||"SignIn"!==U.componentName)throw Error("Clerk: useSignInContext called outside of the mounted SignIn component.");let F="restricted"!==I&&!!(!w.signUpUrl&&w.signInUrl&&!(0,o.vh)(w.signInUrl))&&!1!==U.withSignUp||U.withSignUp||!1,{componentName:E,mode:R,...q}=U,G=(0,d.useMemo)(()=>(0,m.tf)(P,i.u),[]),T=new n.n(w,{...q,signInFallbackRedirectUrl:q.signInFallbackRedirectUrl||q.fallbackRedirectUrl,signInForceRedirectUrl:q.signInForceRedirectUrl||q.forceRedirectUrl},C,R);delete q.fallbackRedirectUrl,delete q.forceRedirectUrl;let L=N.buildUrlWithAuth(T.getAfterSignInUrl()),D=N.buildUrlWithAuth(T.getAfterSignUpUrl()),M="path"===q.routing&&q.path||w.signInUrl||Y.signInUrl,B=F?"path"===q.routing&&q.path||w.signUpUrl||Y.signUpUrl:q.signUpUrl||w.signUpUrl||Y.signUpUrl,O=q.waitlistUrl||w.waitlistUrl||Y.waitlistUrl,Z=T.getPreservedSearchParams();M=(0,a.kZ)({base:M,hashSearchParams:[C,Z]},{stringify:!0}),B=(0,a.kZ)({base:B,hashSearchParams:[C,Z]},{stringify:!0}),O=(0,a.kZ)({base:O,hashSearchParams:[C,Z]},{stringify:!0});let x=T.toSearchParams().toString(),V=(0,u.aQ)({routing:q.routing,baseUrl:B,authQueryString:x,path:q.path,endpoint:F?"/create"+u.Vu:u.Vu}),z=(0,u.aQ)({routing:q.routing,baseUrl:B,authQueryString:x,path:q.path,endpoint:F?"/create"+u.aB:u.aB});F&&(B=(0,a.kZ)({base:M,hashPath:"/create",hashSearchParams:[C,Z]},{stringify:!0}));let K=(0,a.kZ)({base:B,hashPath:"/continue"},{stringify:!0}),W=async e=>{let{session:r,redirectUrl:t}=e,i=r.currentTask;if(!i)return A(t);let n=(0,l.ru)(i);return A("/".concat(S+k+(F?"/create"+n:n)))},H=(null==(e=N.session)?void 0:e.currentTask)?null!=(b=null==(t=N.__internal_getOption("taskUrls"))?void 0:t[null==(r=N.session)?void 0:r.currentTask.key])?b:(0,u.aQ)({routing:q.routing,baseUrl:M,authQueryString:x,path:q.path,endpoint:F?"/create"+(0,l.ru)(null==(g=N.session)?void 0:g.currentTask):(0,l.ru)(null==(v=N.session)?void 0:v.currentTask)}):null;return{...q,transferable:null==(_=q.transferable)||_,oauthFlow:q.oauthFlow||"auto",componentName:E,signUpUrl:B,signInUrl:M,waitlistUrl:O,afterSignInUrl:L,afterSignUpUrl:D,emailLinkRedirectUrl:V,ssoCallbackUrl:z,navigateAfterSignIn:()=>A(L),signUpContinueUrl:K,queryParams:C,initialValues:{...q.initialValues,...G},authQueryString:x,isCombinedFlow:F,navigateOnSetActive:W,taskUrl:H}}},75350:function(e,r,t){t.d(r,{X:()=>g,g:()=>f}),t(98114);var i=t(22166),n=t(48380),l=t(5580),a=t(14173),s=t(21210),o=t(62543),d=t(35074),u=t(78051),c=t(97697),p=t(62366),h=t(4964),m=t(42117);let f=(0,d.createContext)(null),g=()=>{var e,r,t,g,v,b,_;let U=(0,d.useContext)(f),{navigate:A,basePath:S,startPath:k}=(0,h.r)(),{displayConfig:Y,userSettings:y}=(0,c.O)(),{queryParams:C,queryString:P}=(0,h.r)(),I=y.signUp.mode,w=(0,p.II)(),N=(0,s.ho)(),F="restricted"!==I&&!!(!w.signUpUrl&&w.signInUrl&&!(0,o.vh)(w.signInUrl)&&"public"===I),E=(0,d.useMemo)(()=>(0,m.tf)(P,i.d),[]);if(!U||"SignUp"!==U.componentName)throw Error("Clerk: useSignUpContext called outside of the mounted SignUp component.");let{componentName:R,mode:q,...G}=U,T=new n.n(w,{...G,signUpFallbackRedirectUrl:G.signUpFallbackRedirectUrl||G.fallbackRedirectUrl,signUpForceRedirectUrl:G.signUpForceRedirectUrl||G.forceRedirectUrl},C,q);delete G.fallbackRedirectUrl,delete G.forceRedirectUrl;let L=N.buildUrlWithAuth(T.getAfterSignUpUrl()),D=N.buildUrlWithAuth(T.getAfterSignInUrl()),M="path"===G.routing&&G.path||w.signUpUrl||Y.signUpUrl,B=G.signInUrl||w.signInUrl||Y.signInUrl,O=G.waitlistUrl||w.waitlistUrl||Y.waitlistUrl,Z=T.getPreservedSearchParams();B=(0,a.kZ)({base:B,hashSearchParams:[C,Z]},{stringify:!0}),M=(0,a.kZ)({base:M,hashSearchParams:[C,Z]},{stringify:!0}),O=(0,a.kZ)({base:O,hashSearchParams:[C,Z]},{stringify:!0});let x=T.toSearchParams().toString(),V=null!=(v=G.emailLinkRedirectUrl)?v:(0,u.aQ)({routing:G.routing,baseUrl:M,authQueryString:x,path:G.path,endpoint:F?"/create"+u.Vu:u.Vu}),z=null!=(b=G.ssoCallbackUrl)?b:(0,u.aQ)({routing:G.routing,baseUrl:M,authQueryString:x,path:G.path,endpoint:F?"/create"+u.aB:u.aB}),K=(0,a.kZ)({base:B,hashPath:"/factor-two"},{stringify:!0}),W=async e=>{let{session:r,redirectUrl:t}=e,i=r.currentTask;if(!i)return A(t);let n=(0,l.ru)(i);return A("/".concat(S+k+n))},H=(null==(e=N.session)?void 0:e.currentTask)?null!=(_=null==(t=N.__internal_getOption("taskUrls"))?void 0:t[null==(r=N.session)?void 0:r.currentTask.key])?_:(0,u.aQ)({routing:G.routing,baseUrl:B,authQueryString:x,path:G.path,endpoint:(0,l.ru)(null==(g=N.session)?void 0:g.currentTask)}):null;return{...G,oauthFlow:G.oauthFlow||"auto",componentName:R,signInUrl:B,signUpUrl:M,waitlistUrl:O,secondFactorUrl:K,afterSignUpUrl:L,afterSignInUrl:D,emailLinkRedirectUrl:V,ssoCallbackUrl:z,navigateAfterSignUp:()=>A(L),queryParams:C,initialValues:{...G.initialValues,...E},authQueryString:x,isCombinedFlow:F,navigateOnSetActive:W,taskUrl:H}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["627"],{54425:function(e,t,n){n.d(t,{OrganizationStatementPage:()=>i});var r=n(14518),o=n(46256),a=n(84170);let i=()=>(0,r.Y)(o.m$.Provider,{value:"organization",children:(0,r.Y)(a.z,{})})},84170:function(e,t,n){n.d(t,{z:()=>E}),n(88711),n(60486),n(25089),n(61244),n(77895),n(19161),n(22239);var r=n(14518),o=n(21210),a=n(78036),i=n(76153),l=n(80137),c=n(46256),s=n(10078),d=n(18272),m=n(58920),p=n(22861),u=n(82305),h=n(9679),b=n(92067),$=n(4964),g=n(35074),y=n(27782),S=n(12049),D=n(92405),z=n(42852),Y=n(89606);function x(e){let{text:t,copyLabel:n="Copy"}=e,{onCopy:o,hasCopied:a}=(0,y.i)(t);return(0,r.Y)(d.$n,{elementDescriptor:m.$z.statementCopyButton,variant:"unstyled",onClick:o,sx:e=>({color:"inherit",width:e.sizes.$4,height:e.sizes.$4,padding:0,borderRadius:e.radii.$sm,"&:focus-visible":{outline:"2px solid",outlineColor:e.colors.$colorRing}}),focusRing:!1,"aria-label":a?"Copied":n,children:(0,r.Y)(d.In,{size:"sm",icon:a?D.A:z.A,"aria-hidden":!0})})}let C=function(e){let{children:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementRoot,as:"article",sx:e=>({borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$lg,overflow:"clip"}),children:t})},f=function(e){let{title:t,id:n,status:o}=e;return(0,r.FD)(d.az,{elementDescriptor:m.$z.statementHeader,as:"header",sx:e=>({padding:e.space.$4,background:e.colors.$neutralAlpha25,display:"flex",justifyContent:"space-between",alignItems:"flex-start"}),children:[(0,r.FD)(d.L9,{elementDescriptor:m.$z.statementHeaderTitleContainer,children:[(0,r.Y)(d.DZ,{elementDescriptor:m.$z.statementHeaderTitle,textVariant:"h2",localizationKey:t}),(0,r.FD)(d.L9,{sx:e=>({display:"flex",alignItems:"center",gap:e.space.$0x25,color:e.colors.$colorMutedForeground}),children:[(0,r.Y)(x,{copyLabel:"Copy statement ID",text:n}),(0,r.Y)(d.EY,{colorScheme:"secondary",variant:"subtitle",children:(0,Y.W)(n)})]})]}),(0,r.Y)(d.Ex,{elementDescriptor:m.$z.statementHeaderBadge,colorScheme:"open"===o?"secondary":"primary",sx:{textTransform:"capitalize"},children:o})]})},I=function(e){let{children:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementBody,children:t})},k=function(e){let{children:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementSection,as:"section",children:t})},F=function(e){let{text:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementSectionHeader,sx:e=>({paddingInline:e.space.$4,paddingBlock:e.space.$1,background:e.colors.$neutralAlpha50,borderBlockWidth:e.borderWidths.$normal,borderBlockStyle:e.borderStyles.$solid,borderBlockColor:e.colors.$borderAlpha100}),children:(0,r.Y)(d.DZ,{elementDescriptor:m.$z.statementSectionHeaderTitle,textVariant:"h3",as:"h2",localizationKey:t,sx:e=>({fontWeight:e.fontWeights.$medium})})})},v=function(e){let{children:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementSectionContent,children:t})},B=function(e){let{children:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementSectionContentItem,sx:e=>({paddingInline:e.space.$4,paddingBlock:e.space.$3,"&:not(:first-child)":{borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100}}),children:t})},L=function(e){let{title:t,description:n,secondaryTitle:o,secondaryDescription:a}=e;return(0,r.FD)(d.az,{elementDescriptor:m.$z.statementSectionContentDetailsHeader,sx:e=>({marginBlockEnd:e.space.$2,display:"flex",justifyContent:"space-between"}),children:[(0,r.FD)(d.az,{elementDescriptor:m.$z.statementSectionContentDetailsHeaderItem,children:[(0,r.FD)(d.L9,{sx:e=>({display:"flex",alignItems:"center",gap:e.space.$1}),children:[(0,r.Y)(d.In,{elementDescriptor:m.$z.statementSectionContentDetailsHeaderItemIcon,icon:S.A,colorScheme:"neutral"}),(0,r.Y)(d.DZ,{elementDescriptor:m.$z.statementSectionContentDetailsHeaderTitle,as:"h3",textVariant:"h3",localizationKey:t})]}),(0,r.Y)(d.EY,{variant:"caption",colorScheme:"secondary",elementDescriptor:m.$z.statementSectionContentDetailsHeaderDescription,localizationKey:n,sx:{textTransform:"lowercase"}})]}),(0,r.FD)(d.az,{elementDescriptor:m.$z.statementSectionContentDetailsHeaderItem,sx:{textAlign:"right"},children:[o&&(0,r.Y)(d.EY,{variant:"h3",elementDescriptor:m.$z.statementSectionContentDetailsHeaderSecondaryTitle,localizationKey:o}),a&&(0,r.Y)(d.EY,{variant:"caption",colorScheme:"secondary",elementDescriptor:m.$z.statementSectionContentDetailsHeaderSecondaryDescription,localizationKey:a})]})]})},P=function(e){let{children:t}=e;return(0,r.Y)(d.az,{elementDescriptor:m.$z.statementSectionContentDetailsList,as:"ul",sx:e=>({margin:0,padding:0,borderWidth:e.borderWidths.$normal,borderStyle:e.borderStyles.$solid,borderColor:e.colors.$borderAlpha100,borderRadius:e.radii.$md,overflow:"hidden"}),children:t})},W=function(e){let{labelIcon:t,label:n,valueCopyable:o=!1,value:a,valueTruncated:i=!1}=e;return(0,r.FD)(d.az,{elementDescriptor:m.$z.statementSectionContentDetailsListItem,as:"li",sx:e=>({margin:0,paddingInline:e.space.$2,paddingBlock:e.space.$1x5,display:"flex",justifyContent:"space-between",flexWrap:"wrap",columnGap:e.space.$2,rowGap:e.space.$0x5,"&:not(:first-child)":{borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100}}),children:[(0,r.FD)(d.L9,{elementDescriptor:m.$z.statementSectionContentDetailsListItemLabelContainer,sx:e=>({display:"flex",alignItems:"center",gap:e.space.$1x5}),children:[t?(0,r.Y)(d.In,{icon:t,colorScheme:"neutral"}):null,(0,r.Y)(d.EY,{variant:"caption",colorScheme:"secondary",elementDescriptor:m.$z.statementSectionContentDetailsListItemLabel,localizationKey:n})]}),(0,r.Y)(d.L9,{sx:e=>({display:"flex",alignItems:"center",gap:e.space.$0x25,color:e.colors.$colorMutedForeground}),children:"string"==typeof a?(0,r.FD)(r.FK,{children:[o?(0,r.Y)(x,{copyLabel:"Copy statement ID",text:a}):null,(0,r.Y)(d.EY,{colorScheme:"secondary",variant:"caption",elementDescriptor:m.$z.statementSectionContentDetailsListItemValue,children:i?(0,Y.W)(a):a})]}):g.isValidElement(a)?a:(0,r.Y)(d.EY,{elementDescriptor:m.$z.statementSectionContentDetailsListItemValue,colorScheme:"secondary",variant:"caption",localizationKey:a})})]})},A=function(e){let{label:t,value:n}=e;return(0,r.FD)(d.az,{elementDescriptor:m.$z.statementFooter,as:"footer",sx:e=>({paddingInline:e.space.$4,paddingBlock:e.space.$3,background:e.colors.$neutralAlpha25,borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100,display:"flex",justifyContent:"space-between"}),children:[(0,r.Y)(d.EY,{variant:"h3",localizationKey:t,elementDescriptor:m.$z.statementFooterLabel}),(0,r.FD)(d.L9,{elementDescriptor:m.$z.statementFooterValueContainer,sx:e=>({display:"flex",alignItems:"center",gap:e.space.$2x5}),children:[(0,r.Y)(d.EY,{variant:"caption",colorScheme:"secondary",elementDescriptor:m.$z.statementFooterCurrency,children:"USD"}),(0,r.Y)(d.EY,{variant:"h3",elementDescriptor:m.$z.statementFooterValue,children:n})]})]})},E=()=>{let{params:e,navigate:t}=(0,$.r)(),n=(0,c.XX)(),g=(0,c.N7)(),{t:y,translateError:S}=(0,s._)(),{data:D,isLoading:z,error:Y}=(0,o.Fm)({statementId:e.statementId,for:"organization"===n?"organization":"user",enabled:!!e.statementId});return z?(0,r.Y)(d.az,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,r.Y)(d.y$,{colorScheme:"primary",sx:{margin:"auto",display:"block"},elementDescriptor:m.$z.spinner})}):(0,r.FD)(r.FK,{children:[(0,r.Y)(i.Y.Root,{sx:e=>({borderBlockEndWidth:e.borderWidths.$normal,borderBlockEndStyle:e.borderStyles.$solid,borderBlockEndColor:e.colors.$borderAlpha100,marginBlockEnd:e.space.$4,paddingBlockEnd:e.space.$4}),children:(0,r.Y)(i.Y.BackLink,{onClick:()=>void t("../../",{searchParams:new URLSearchParams("tab=statements")}),children:(0,r.Y)(i.Y.Title,{localizationKey:(0,p.G)("".concat(g,".billingPage.statementsSection.title")),textVariant:"h2"})})}),D?(0,r.FD)(C,{children:[(0,r.Y)(f,{title:(0,l.Y)(D.timestamp,"monthyear"),id:D.id,status:D.status}),(0,r.Y)(I,{children:D.groups.map(e=>(0,r.FD)(k,{children:[(0,r.Y)(F,{text:(0,l.Y)(e.timestamp,"long")}),(0,r.Y)(v,{children:e.items.map(e=>{var n,o;return(0,r.FD)(B,{children:[(0,r.Y)(L,{title:e.subscriptionItem.plan.name,description:"".concat(null==(n=e.subscriptionItem.amount)?void 0:n.currencySymbol).concat(null==(o=e.subscriptionItem.amount)?void 0:o.amountFormatted," / ").concat("month"===e.subscriptionItem.planPeriod?y((0,p.G)("billing.month")):y((0,p.G)("billing.year"))),secondaryTitle:"".concat(e.amount.currencySymbol).concat(e.amount.amountFormatted)}),(0,r.FD)(P,{children:[(0,r.Y)(W,{label:"recurring"===e.chargeType?(0,p.G)("".concat(g,".billingPage.statementsSection.itemCaption__paidForPlan"),{plan:e.subscriptionItem.plan.name,period:e.subscriptionItem.planPeriod}):(0,p.G)("".concat(g,".billingPage.statementsSection.itemCaption__subscribedAndPaidForPlan"),{plan:e.subscriptionItem.plan.name,period:e.subscriptionItem.planPeriod}),labelIcon:"recurring"===e.chargeType?u.A:h.A,value:(0,r.FD)(d.dF,{onClick:()=>void t("../../payment-attempt/".concat(e.id)),variant:"link",colorScheme:"primary",textVariant:"buttonSmall",sx:e=>({gap:e.space.$1}),children:[(0,r.Y)(d.L9,{localizationKey:(0,p.G)("billing.viewPayment")}),(0,r.Y)(d.In,{icon:b.A,size:"sm","aria-hidden":!0})]})}),e.subscriptionItem.credit&&e.subscriptionItem.credit.amount.amount>0?(0,r.Y)(W,{label:(0,p.G)("".concat(g,".billingPage.statementsSection.itemCaption__proratedCredit")),value:"(".concat(e.subscriptionItem.credit.amount.currencySymbol).concat(e.subscriptionItem.credit.amount.amountFormatted,")")}):null]})]},e.id)})})]},e.timestamp.toISOString()))}),(0,r.Y)(A,{label:(0,p.G)("".concat(g,".billingPage.statementsSection.totalPaid")),value:"".concat(D.totals.grandTotal.currencySymbol).concat(D.totals.grandTotal.amountFormatted)})]}):(0,r.Y)(d.az,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,r.Y)(a.F,{variant:"danger",colorScheme:"danger",children:Y?S(Y.errors[0]):y((0,p.G)("".concat(g,".billingPage.statementsSection.notFound")))})})]})}},91666:function(e,t,n){n.d(t,{StatementPage:()=>r.z});var r=n(84170)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["451"],{41461:function(e,i,n){n.r(i),n.d(i,{SubscriptionDetails:()=>_}),n(19161),n(85074),n(98114),n(88711),n(22239),n(50036),n(1589),n(95055);var l=n(14518),t=n(21210),a=n(35074),r=n(57477);let o=(0,a.createContext)(null),s=()=>{let e=(0,a.useContext)(o);if(!e||"SubscriptionDetails"!==e.componentName)throw Error("Clerk: useSubscriptionDetailsContext called outside SubscriptionDetails.");let{componentName:i,...n}=e;return{...n,componentName:i}};var c=n(66195),u=n(54523),d=n(63269),p=n(78532),b=n(29436),m=n(4468),g=n(80137),h=n(46256),D=n(97288),v=n(44607),f=n(18272),y=n(22861),S=n(58920),C=n(10078),F=n(13679);let Y=a.createContext({confirmationOpen:!1,setConfirmationOpen:()=>{},subscription:null,setSubscription:()=>{}}),_=e=>(0,l.Y)(v.n.Root,{flow:"subscriptionDetails",children:(0,l.Y)(v.n.Part,{children:(0,l.Y)(p.Drawer.Content,{children:(0,l.Y)(o.Provider,{value:{componentName:"SubscriptionDetails",...e},children:(0,l.Y)(h.m$.Provider,{value:e.for,children:(0,l.Y)(P,{...e})})})})})});function G(e){let{subscriptionItems:i,isLoading:n}=(0,D.Rs)(),l=null==i?void 0:i.find(e=>"active"===e.status),t=null==i?void 0:i.find(e=>"upcoming"===e.status),a=null==i?void 0:i.find(e=>"past_due"===e.status);if((null==e?void 0:e.or)==="throw"&&!l&&!a)throw Error("No active or past due subscription found");return{upcomingSubscription:t,pastDueSubscription:a,activeSubscription:l,anySubscription:t||l||a,isLoading:n}}let P=e=>{let[i,n]=(0,a.useState)(null),[t,r]=(0,a.useState)(!1),{subscriptionItems:o,isLoading:s}=(0,D.Rs)(),{activeSubscription:c,pastDueSubscription:u}=G();return s?(0,l.Y)(f.y$,{sx:{margin:"auto"}}):c||u?(0,l.FD)(Y.Provider,{value:{subscription:i,setSubscription:n,confirmationOpen:t,setConfirmationOpen:r},children:[(0,l.Y)(p.Drawer.Header,{title:(0,y.G)("billing.subscriptionDetails.title")}),(0,l.Y)(p.Drawer.Body,{sx:e=>({display:"flex",flexDirection:"column",flex:1,overflowY:"auto",padding:e.space.$4,gap:e.space.$4}),children:null==o?void 0:o.map(i=>(0,l.Y)(w,{subscription:i,...e},i.id))}),(0,l.Y)(x,{})]}):null},x=(0,d.dm)(()=>{var e;let i=(0,h.XX)(),{isLoading:n,error:r,setError:o,setLoading:c,setIdle:b}=(0,d.f0)(),{subscription:g,confirmationOpen:v,setConfirmationOpen:C}=(0,a.useContext)(Y),{data:F}=(0,D.Rs)(),{setIsOpen:_}=(0,p.g)(),{onSubscriptionCancel:G}=s(),P=(0,t.Wf)(),x=(0,a.useCallback)(e=>C(e),[C]),$=(0,a.useCallback)(async()=>{var e;g&&(o(void 0),c(),await g.cancel({orgId:"organization"===i?null==P||null==(e=P.organization)?void 0:e.id:void 0}).then(()=>{null==G||G(),_&&_(!1)}).catch(e=>{(0,m.H4)(e,[],o)}).finally(()=>{b()}))},[g,o,c,i,null==P||null==(e=P.organization)?void 0:e.id,G,_,b]);return(null==F?void 0:F.nextPayment)?(0,l.FD)(p.Drawer.Footer,{children:[(0,l.Y)(k,{}),(0,l.Y)(p.Drawer.Confirmation,{open:v,onOpenChange:x,actionsSlot:(0,l.FD)(l.FK,{children:[!n&&(0,l.Y)(f.$n,{variant:"ghost",size:"sm",textVariant:"buttonLarge",onClick:()=>{b(),o(void 0),x(!1)},localizationKey:(null==g?void 0:g.isFreeTrial)?(0,y.G)("billing.keepFreeTrial"):(0,y.G)("billing.keepSubscription")}),(0,l.Y)(f.$n,{variant:"solid",colorScheme:"danger",size:"sm",textVariant:"buttonLarge",isLoading:n,onClick:()=>void $(),localizationKey:(null==g?void 0:g.isFreeTrial)?(0,y.G)("billing.cancelFreeTrial",{plan:g.plan.name}):(0,y.G)("billing.cancelSubscription")})]}),children:g?(0,l.FD)(l.FK,{children:[(0,l.Y)(f.DZ,{elementDescriptor:S.$z.drawerConfirmationTitle,as:"h2",textVariant:"h3",localizationKey:(null==g?void 0:g.isFreeTrial)?(0,y.G)("billing.cancelFreeTrialTitle",{plan:g.plan.name}):(0,y.G)("billing.cancelSubscriptionTitle",{plan:"".concat("upcoming"===g.status?"upcoming ":"").concat(g.plan.name)})}),(0,l.Y)(f.EY,{elementDescriptor:S.$z.drawerConfirmationDescription,colorScheme:"secondary",localizationKey:(null==g?void 0:g.isFreeTrial)?(0,y.G)("billing.cancelFreeTrialAccessUntil",{plan:g.plan.name,date:g.periodEnd}):"upcoming"===g.status?(0,y.G)("billing.cancelSubscriptionNoCharge"):"past_due"===g.status?(0,y.G)("billing.cancelSubscriptionPastDue"):(0,y.G)("billing.cancelSubscriptionAccessUntil",{plan:g.plan.name,date:g.periodEnd})}),(0,l.Y)(u.v,{children:r})]}):null})]}):null});function k(){let{activeSubscription:e}=G({or:"throw"}),{data:i}=(0,D.Rs)();if(!(null==i?void 0:i.nextPayment)||!e)return null;let{isFreeTrial:n}=e;return(0,l.FD)(b.p.Root,{children:[(0,l.FD)(b.p.Group,{children:[(0,l.Y)(b.p.Title,{description:(0,y.G)("billing.subscriptionDetails.currentBillingCycle")}),(0,l.Y)(b.p.Description,{text:"month"===e.planPeriod?(0,y.G)("billing.monthly"):(0,y.G)("billing.annually")})]}),(0,l.FD)(b.p.Group,{children:[(0,l.Y)(b.p.Title,{description:(0,y.G)("billing.subscriptionDetails.".concat(n?"firstPaymentOn":"nextPaymentOn"))}),(0,l.Y)(b.p.Description,{text:(0,g.Y)(i.nextPayment.date)})]}),(0,l.FD)(b.p.Group,{children:[(0,l.Y)(b.p.Title,{description:(0,y.G)("billing.subscriptionDetails.".concat(n?"firstPaymentAmount":"nextPaymentAmount"))}),(0,l.Y)(b.p.Description,{prefix:i.nextPayment.amount.currency,text:"".concat(i.nextPayment.amount.currencySymbol).concat(i.nextPayment.amount.amountFormatted)})]})]})}let $=e=>{let{subscription:i}=e,{portalRoot:n}=s(),{__internal_openCheckout:o}=(0,t.ho)(),c=(0,h.XX)(),{setIsOpen:u}=(0,p.g)(),{revalidateAll:d}=(0,D.D)(),{setSubscription:b,setConfirmationOpen:m}=(0,a.useContext)(Y),g=(0,r.Fd)(e=>e({permission:"org:sys_billing:manage"})),v="user"===c||g,C=("month"===i.planPeriod&&!!i.plan.annualMonthlyFee||"annual"===i.planPeriod)&&"past_due"!==i.status,F=!i.plan.hasBaseFee,_=null===i.canceledAt&&!F,G=null!==i.canceledAt&&!F,P=(0,a.useCallback)(e=>{u&&u(!1),o({...e,onSubscriptionComplete:()=>{d()},portalRoot:n})},[o,d,n,u]),x=a.useMemo(()=>v?[C?{label:"month"===i.planPeriod?(0,y.G)("billing.switchToAnnualWithAnnualPrice",{price:(0,D.Ij)(i.plan.annualFee.amountFormatted),currency:i.plan.annualFee.currencySymbol}):(0,y.G)("billing.switchToMonthlyWithPrice",{price:(0,D.Ij)(i.plan.fee.amountFormatted),currency:i.plan.fee.currencySymbol}),onClick:()=>{P({planId:i.plan.id,planPeriod:"month"===i.planPeriod?"annual":"month",for:c})}}:null,_?{isDestructive:!0,label:i.isFreeTrial?(0,y.G)("billing.cancelFreeTrial",{plan:i.plan.name}):(0,y.G)("billing.cancelSubscription"),onClick:()=>{b(i),m(!0)}}:null,G?{label:(0,y.G)("billing.reSubscribe"),onClick:()=>{P({planId:i.plan.id,planPeriod:i.planPeriod,for:c})}}:null].filter(e=>null!==e):[],[C,i,_,P,c,b,v,G,m]);return 0===x.length?null:(0,l.Y)(f.so,{elementDescriptor:S.$z.subscriptionDetailsCardActions,gap:2,sx:e=>({paddingInline:e.space.$3,paddingBlock:e.space.$3,borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100}),children:x.map((e,i)=>(0,l.Y)(f.$n,{elementDescriptor:e.isDestructive?S.$z.subscriptionDetailsCancelButton:S.$z.subscriptionDetailsActionButton,variant:e.isDestructive?"ghost":"outline",colorScheme:e.isDestructive?"danger":void 0,size:"xs",textVariant:"buttonSmall",onClick:e.onClick,localizationKey:e.label},i))})},w=e=>{let{subscription:i}=e,{t:n}=(0,C._)(),t="month"===i.planPeriod?i.plan.fee:i.plan.annualFee;return(0,l.FD)(f.fv,{elementDescriptor:S.$z.subscriptionDetailsCard,sx:e=>({borderRadius:e.radii.$md,boxShadow:e.shadows.$tableBodyShadow}),children:[(0,l.FD)(f.fv,{elementDescriptor:S.$z.subscriptionDetailsCardBody,gap:3,sx:e=>({padding:e.space.$3}),children:[(0,l.FD)(f.so,{elementDescriptor:S.$z.subscriptionDetailsCardHeader,align:"center",gap:2,children:[i.plan.avatarUrl?(0,l.Y)(c.e,{boxElementDescriptor:S.$z.planDetailAvatar,size:e=>40,title:i.plan.name,rounded:!1,imageUrl:i.plan.avatarUrl}):null,(0,l.Y)(f.EY,{elementDescriptor:S.$z.subscriptionDetailsCardTitle,variant:"h2",sx:e=>({fontSize:e.fontSizes.$lg,fontWeight:e.fontWeights.$semibold,color:e.colors.$colorForeground,marginInlineEnd:"auto"}),children:i.plan.name}),(0,l.Y)(F.V,{subscription:i.isFreeTrial?{status:"free_trial"}:i,elementDescriptor:S.$z.subscriptionDetailsCardBadge})]}),(0,l.Y)(f.so,{justify:"between",align:"center",children:(0,l.FD)(f.EY,{variant:"body",colorScheme:"secondary",sx:e=>({fontWeight:e.fontWeights.$medium,textTransform:"lowercase"}),children:[t.currencySymbol,t.amountFormatted," /"," ",n((0,y.G)("billing.".concat("month"===i.planPeriod?"month":"year")))]})})]}),i.pastDueAt?(0,l.Y)(z,{label:(0,y.G)("billing.subscriptionDetails.pastDueAt"),value:(0,g.Y)(i.pastDueAt)}):null,"active"===i.status?(0,l.FD)(l.FK,{children:[(0,l.Y)(z,{label:i.isFreeTrial?(0,y.G)("billing.subscriptionDetails.trialStartedOn"):(0,y.G)("billing.subscriptionDetails.subscribedOn"),value:(0,g.Y)(i.createdAt)}),i.periodEnd&&(0,l.Y)(z,{label:i.canceledAt?(0,y.G)("billing.subscriptionDetails.endsOn"):i.isFreeTrial?(0,y.G)("billing.subscriptionDetails.trialEndsOn"):(0,y.G)("billing.subscriptionDetails.renewsAt"),value:(0,g.Y)(i.periodEnd)})]}):null,"upcoming"===i.status?(0,l.Y)(z,{label:(0,y.G)("billing.subscriptionDetails.beginsOn"),value:(0,g.Y)(i.periodStart)}):null,(0,l.Y)($,{subscription:i})]})},z=e=>{let{label:i,value:n}=e;return(0,l.FD)(f.so,{elementDescriptor:S.$z.subscriptionDetailsDetailRow,justify:"between",align:"center",sx:e=>({paddingInline:e.space.$3,paddingBlock:e.space.$3,borderBlockStartWidth:e.borderWidths.$normal,borderBlockStartStyle:e.borderStyles.$solid,borderBlockStartColor:e.colors.$borderAlpha100}),children:[(0,l.Y)(f.EY,{elementDescriptor:S.$z.subscriptionDetailsDetailRowLabel,localizationKey:i}),(0,l.Y)(f.EY,{elementDescriptor:S.$z.subscriptionDetailsDetailRowValue,colorScheme:"secondary",children:n})]})}},13679:function(e,i,n){n.d(i,{V:()=>s});var l=n(14518),t=n(18272),a=n(22861);let r={active:"badge__activePlan",upcoming:"badge__upcomingPlan",past_due:"badge__pastDuePlan",free_trial:"badge__freeTrial"},o={active:"secondary",upcoming:"primary",past_due:"warning",free_trial:"secondary"},s=e=>{let{subscription:i,elementDescriptor:n}=e;return(0,l.Y)(t.Ex,{elementDescriptor:n,colorScheme:o[i.status],localizationKey:(0,a.G)(r[i.status])})}},97288:function(e,i,n){n.d(i,{A$:()=>g,D:()=>h,Ij:()=>c,Rs:()=>m,eT:()=>b,mu:()=>d,wD:()=>p}),n(19161),n(89305),n(85074),n(95055);var l=n(21210),t=n(35074),a=n(57477),r=n(65424),o=n(22861),s=n(46256);function c(e){return e.endsWith(".00")?e.slice(0,-3):e}let u=()=>{let e=(0,s.XX)(),i=(0,a.Fd)(e=>e({permission:"org:sys_billing:read"})||e({permission:"org:sys_billing:manage"})),n=(0,l.Wf)();return{for:e,keepPreviousData:!0,enabled:"organization"!==e||!!(null==n?void 0:n.organization)&&i}},d=()=>{let e=u();return(0,l.X$)(e)},p=()=>{let e=u();return(0,l.t7)(e)},b=e=>{let i=u();return(0,l.tr)({...i,__experimental_mode:null==e?void 0:e.mode})},m=()=>{var e;let i=u(),n=(0,l.kH)(i),a=(0,t.useMemo)(()=>{var e;return(null==(e=n.data)?void 0:e.subscriptionItems)||[]},[null==(e=n.data)?void 0:e.subscriptionItems]);return{...n,subscriptionItems:a}},g=e=>{let i=(0,s.XX)();return(0,l.rg)({for:i,initialPage:1,pageSize:50,keepPreviousData:!0,enabled:!0,__experimental_mode:null==e?void 0:e.mode})},h=()=>{let e=(0,l.ho)(),{session:i}=(0,l.wV)(),n=(0,s.XX)(),a=(0,t.useMemo)(()=>{var i;return!!(!e.session||(null==e||null==(i=e.session)?void 0:i.checkAuthorization({permission:"org:sys_billing:manage"}))||"user"===n)},[e,n]),{subscriptionItems:c,revalidate:u,data:p}=m(),{data:h,revalidate:D}=g({mode:"cache"}),{revalidate:v}=b({mode:"cache"}),{revalidate:f}=d(),y=(0,t.useCallback)(()=>{u(),D(),v(),f()},[u,D,v,f]),S=(0,t.useMemo)(()=>0===c.length||!c.some(e=>!e.canceledAt),[c]),C=(0,t.useCallback)(e=>c.find(i=>i.plan.id===e.id),[c]),F=(0,t.useCallback)(e=>c.filter(i=>i.plan.id===e.id),[c]),Y=(0,t.useCallback)(function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"month",n=F(e);if(n.length>1){let e=n.find(e=>e.planPeriod===i);return e||n[0]}if(1===n.length)return n[0]},[F]),_=(0,t.useCallback)(e=>{let{plan:i,subscription:n}=e,l=null!=n?n:i?C(i):void 0;return!l||!l.canceledAt},[C]),G=(0,t.useCallback)(e=>{let{plan:n,subscription:l,isCompact:t=!1,selectedPlanPeriod:r="annual"}=e,s=null!=l?l:n?Y(n,r):void 0,u=r,d=!!(null==n?void 0:n.annualMonthlyFee);"annual"!==u||d||(u="month");let b=e=>{if(null==n?void 0:n.freeTrialEnabled){let e=!i,t=null==p?void 0:p.eligibleForFreeTrial;if(e||t){var l;return(0,o.G)("billing.startFreeTrial__days",{days:null!=(l=n.freeTrialDays)?l:0})}}return e};return{localizationKey:b((()=>{if(s){if(u!==s.planPeriod&&s.canceledAt){if("month"===u)return(0,o.G)("billing.switchToMonthly");if(d)return(0,o.G)("billing.switchToAnnual")}if(s.canceledAt)return(0,o.G)("billing.reSubscribe");if(u!==s.planPeriod){if("month"===u)return(0,o.G)("billing.switchToMonthly");if(d)return(0,o.G)("billing.switchToAnnual")}return(0,o.G)("billing.manageSubscription")}return c.filter(e=>!e.plan.isDefault).length>0?(0,o.G)("billing.switchPlan"):b((0,o.G)("billing.subscribe"))})()),variant:t?"bordered":"solid",colorScheme:t?"secondary":"primary",isDisabled:!a,disabled:!a}},[Y,a,c,p]),P=(0,t.useCallback)(e=>e.pastDueAt?(0,o.G)("badge__pastDueAt",{date:e.pastDueAt}):"upcoming"===e.status?(0,o.G)("badge__startsAt",{date:e.periodStart}):e.canceledAt?(0,o.G)("badge__canceledEndsAt",{date:e.periodEnd}):e.periodEnd?(0,o.G)(e.isFreeTrial?"badge__trialEndsAt":"badge__renewsAt",{date:e.periodEnd}):void 0,[]),x=(0,t.useCallback)(i=>{let l=(0,r.J)("modal",i);e.__internal_openSubscriptionDetails({for:n,onSubscriptionCancel:()=>{y()},portalRoot:l})},[e,n,y]);return{activeOrUpcomingSubscription:C,activeAndUpcomingSubscriptions:F,activeOrUpcomingSubscriptionBasedOnPlanPeriod:Y,isDefaultPlanImplicitlyActiveOrUpcoming:S,handleSelectPlan:(0,t.useCallback)(l=>{let{plan:t,planPeriod:a,mode:o="mounted",event:s,appearance:c,newSubscriptionRedirectUrl:u}=l,d=(0,r.J)(o,s);e.__internal_openCheckout({planId:t.id,planPeriod:"annual"!==a||t.annualMonthlyFee?a:"month",for:n,onSubscriptionComplete:()=>{y()},onClose:()=>{(null==i?void 0:i.id)&&e.setActive({session:i.id})},appearance:c,portalRoot:d,newSubscriptionRedirectUrl:u})},[e,y,n,null==i?void 0:i.id]),openSubscriptionDetails:x,buttonPropsForPlan:G,canManageSubscription:_,captionForSubscription:P,defaultFreePlan:(0,t.useMemo)(()=>null==h?void 0:h.find(e=>e.isDefault),[h]),revalidateAll:y}}},46256:function(e,i,n){n.d(i,{N7:()=>o,XX:()=>r,m$:()=>a});var l=n(35074);let t="user",a=(0,l.createContext)(t),r=()=>(0,l.useContext)(a)||t,o=()=>"user"===r()?"userProfile":"organizationProfile"}}]);
|