azirid-react 0.7.0 → 0.9.0
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/index.cjs +1016 -496
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +289 -6
- package/dist/index.d.ts +289 -6
- package/dist/index.js +1010 -499
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -59,6 +59,32 @@ var socialLoginSchema = zod.z.object({
|
|
|
59
59
|
acceptedTosVersion: zod.z.string().optional(),
|
|
60
60
|
acceptedPrivacyVersion: zod.z.string().optional()
|
|
61
61
|
});
|
|
62
|
+
function createForgotPasswordSchema(v) {
|
|
63
|
+
return zod.z.object({
|
|
64
|
+
email: zod.z.string({ required_error: v.emailRequired }).min(1, v.emailRequired).email(v.emailInvalid)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
var forgotPasswordSchema = zod.z.object({
|
|
68
|
+
email: zod.z.string({ required_error: "El correo es requerido" }).min(1, "El correo es requerido").email("Correo electr\xF3nico inv\xE1lido")
|
|
69
|
+
});
|
|
70
|
+
function createResetPasswordConfirmSchema(v) {
|
|
71
|
+
return zod.z.object({
|
|
72
|
+
token: zod.z.string({ required_error: v.tokenRequired }).min(1, v.tokenRequired),
|
|
73
|
+
newPassword: zod.z.string({ required_error: v.newPasswordRequired }).min(10, v.passwordMinLength),
|
|
74
|
+
confirmPassword: zod.z.string({ required_error: v.confirmPasswordRequired }).min(1, v.confirmPasswordRequired)
|
|
75
|
+
}).refine((data) => data.newPassword === data.confirmPassword, {
|
|
76
|
+
message: v.passwordsMismatch,
|
|
77
|
+
path: ["confirmPassword"]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
var resetPasswordConfirmSchema = zod.z.object({
|
|
81
|
+
token: zod.z.string({ required_error: "El token es requerido" }).min(1, "El token es requerido"),
|
|
82
|
+
newPassword: zod.z.string({ required_error: "La nueva contrase\xF1a es requerida" }).min(10, "La contrase\xF1a debe tener al menos 10 caracteres"),
|
|
83
|
+
confirmPassword: zod.z.string({ required_error: "Confirma tu contrase\xF1a" }).min(1, "Confirma tu contrase\xF1a")
|
|
84
|
+
}).refine((data) => data.newPassword === data.confirmPassword, {
|
|
85
|
+
message: "Las contrase\xF1as no coinciden",
|
|
86
|
+
path: ["confirmPassword"]
|
|
87
|
+
});
|
|
62
88
|
var passkeyRegisterStartSchema = zod.z.object({
|
|
63
89
|
deviceName: zod.z.string().optional()
|
|
64
90
|
});
|
|
@@ -96,6 +122,8 @@ var SUFFIXES = {
|
|
|
96
122
|
submitTransferProof: "billing/transfer-proof",
|
|
97
123
|
transferProofs: "billing/transfer-proofs",
|
|
98
124
|
payphoneConfirm: "billing/payphone/confirm",
|
|
125
|
+
passwordResetRequest: "password/reset/request",
|
|
126
|
+
passwordResetConfirm: "password/reset/confirm",
|
|
99
127
|
referralMe: "referrals/me",
|
|
100
128
|
referralStats: "referrals/stats",
|
|
101
129
|
userTenants: "tenants"
|
|
@@ -375,6 +403,14 @@ var es = {
|
|
|
375
403
|
cancel: "Cancelar",
|
|
376
404
|
processing: "Procesando..."
|
|
377
405
|
},
|
|
406
|
+
navigation: {
|
|
407
|
+
noAccountText: "\xBFNo tienes cuenta?",
|
|
408
|
+
signUpLink: "Reg\xEDstrate",
|
|
409
|
+
hasAccountText: "\xBFYa tienes cuenta?",
|
|
410
|
+
signInLink: "Inicia sesi\xF3n",
|
|
411
|
+
forgotPassword: "\xBFOlvidaste tu contrase\xF1a?",
|
|
412
|
+
backToLogin: "Volver a iniciar sesi\xF3n"
|
|
413
|
+
},
|
|
378
414
|
validation: {
|
|
379
415
|
emailRequired: "El correo es requerido",
|
|
380
416
|
emailInvalid: "Correo electr\xF3nico inv\xE1lido",
|
|
@@ -453,6 +489,14 @@ var en = {
|
|
|
453
489
|
cancel: "Cancel",
|
|
454
490
|
processing: "Processing..."
|
|
455
491
|
},
|
|
492
|
+
navigation: {
|
|
493
|
+
noAccountText: "Don't have an account?",
|
|
494
|
+
signUpLink: "Sign up",
|
|
495
|
+
hasAccountText: "Already have an account?",
|
|
496
|
+
signInLink: "Sign in",
|
|
497
|
+
forgotPassword: "Forgot your password?",
|
|
498
|
+
backToLogin: "Back to sign in"
|
|
499
|
+
},
|
|
456
500
|
validation: {
|
|
457
501
|
emailRequired: "Email is required",
|
|
458
502
|
emailInvalid: "Invalid email address",
|
|
@@ -481,6 +525,7 @@ function resolveMessages(locale = "es", overrides) {
|
|
|
481
525
|
signup: { ...base.signup, ...overrides.signup },
|
|
482
526
|
forgotPassword: { ...base.forgotPassword, ...overrides.forgotPassword },
|
|
483
527
|
resetPassword: { ...base.resetPassword, ...overrides.resetPassword },
|
|
528
|
+
navigation: { ...base.navigation, ...overrides.navigation },
|
|
484
529
|
social: { ...base.social, ...overrides.social },
|
|
485
530
|
passwordToggle: { ...base.passwordToggle, ...overrides.passwordToggle },
|
|
486
531
|
securedBy: overrides.securedBy ?? base.securedBy,
|
|
@@ -491,7 +536,7 @@ function resolveMessages(locale = "es", overrides) {
|
|
|
491
536
|
|
|
492
537
|
// src/styles/generated.ts
|
|
493
538
|
var css = `/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
|
|
494
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){[data-azirid] *,[data-azirid] :before,[data-azirid] :after,[data-azirid] ::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-content:""}}[data-azirid]{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-blue-500:oklch(62.3% .214 259.815);--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--leading-snug:1.375;--radius-md:calc(var(--aa-radius) - 2px);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--aa-font-sans,ui-sans-serif, system-ui, sans-serif);--default-mono-font-family:var(--font-mono)}.\\@container\\/card-header{container:card-header/inline-size}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.start{inset-inline-start:var(--spacing)}.z-10{z-index:10}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.w-4{width:calc(var(--spacing) * 4)}.w-auto{width:auto}.w-full{width:100%}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.auto-rows-min{grid-auto-rows:min-content}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-center{align-self:center}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-lg{border-radius:var(--aa-radius)}.rounded-md{border-radius:calc(var(--aa-radius) - 2px)}.rounded-xl{border-radius:calc(var(--aa-radius) + 4px)}.rounded-t-xl{border-top-left-radius:calc(var(--aa-radius) + 4px);border-top-right-radius:calc(var(--aa-radius) + 4px)}.rounded-b-xl{border-bottom-right-radius:calc(var(--aa-radius) + 4px);border-bottom-left-radius:calc(var(--aa-radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--aa-border)}.border-destructive,.border-destructive\\/50{border-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\/50{border-color:color-mix(in oklab, var(--aa-destructive) 50%, transparent)}}.border-input{border-color:var(--aa-input)}.border-transparent{border-color:#0000}.bg-background{background-color:var(--aa-background)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-border{background-color:var(--aa-border)}.bg-card{background-color:var(--aa-card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--aa-destructive) 10%, transparent)}}.bg-muted,.bg-muted\\/50{background-color:var(--aa-muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/50{background-color:color-mix(in oklab, var(--aa-muted) 50%, transparent)}}.bg-primary{background-color:var(--aa-primary)}.bg-secondary{background-color:var(--aa-secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-nowrap{white-space:nowrap}.text-card-foreground{color:var(--aa-card-foreground)}.text-destructive{color:var(--aa-destructive)}.text-muted-foreground{color:var(--aa-muted-foreground)}.text-primary{color:var(--aa-primary)}.text-primary-foreground{color:var(--aa-primary-foreground)}.text-secondary-foreground{color:var(--aa-secondary-foreground)}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-foreground,.ring-foreground\\/10{--tw-ring-color:var(--aa-foreground)}@supports (color:color-mix(in lab, red, red)){.ring-foreground\\/10{--tw-ring-color:color-mix(in oklab, var(--aa-foreground) 10%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[disabled\\=true\\]\\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\\[disabled\\=true\\]\\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\\[size\\=sm\\]\\/card\\:p-3:is(:where(.group\\/card)[data-size=sm] *){padding:calc(var(--spacing) * 3)}.group-data-\\[size\\=sm\\]\\/card\\:px-3:is(:where(.group\\/card)[data-size=sm] *){padding-inline:calc(var(--spacing) * 3)}.group-data-\\[size\\=sm\\]\\/card\\:text-sm:is(:where(.group\\/card)[data-size=sm] *){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\:text-foreground::file-selector-button{color:var(--aa-foreground)}.placeholder\\:text-muted-foreground::placeholder{color:var(--aa-muted-foreground)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-0:after{content:var(--tw-content);inset:calc(var(--spacing) * 0)}.after\\:top-1\\/2:after{content:var(--tw-content);top:50%}.after\\:z-0:after{content:var(--tw-content);z-index:0}.after\\:flex:after{content:var(--tw-content);display:flex}.after\\:items-center:after{content:var(--tw-content);align-items:center}.after\\:border-t:after{content:var(--tw-content);border-top-style:var(--tw-border-style);border-top-width:1px}.after\\:border-border:after{content:var(--tw-content);border-color:var(--aa-border)}@media (hover:hover){.hover\\:bg-destructive\\/20:hover{background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--aa-muted)}.hover\\:bg-secondary\\/80:hover{background-color:var(--aa-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--aa-secondary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--aa-foreground)}.hover\\:underline:hover{text-decoration-line:underline}}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--aa-destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--aa-ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--aa-ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--aa-ring) 50%, transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-input\\/50:disabled{background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.disabled\\:bg-input\\/50:disabled{background-color:color-mix(in oklab, var(--aa-input) 50%, transparent)}}.disabled\\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--aa-radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-end\\]\\:pr-3:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 3)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-3:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 3)}.has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\\[slot\\=card-description\\]\\:grid-rows-\\[auto_auto\\]:has([data-slot=card-description]){grid-template-rows:auto auto}.has-data-\\[slot\\=card-footer\\]\\:pb-0:has([data-slot=card-footer]){padding-bottom:calc(var(--spacing) * 0)}.has-\\[\\>img\\:first-child\\]\\:pt-0:has(>img:first-child){padding-top:calc(var(--spacing) * 0)}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--aa-muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--aa-secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--aa-foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--aa-secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--aa-destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.data-horizontal\\:h-px[data-horizontal]{height:1px}.data-horizontal\\:w-full[data-horizontal]{width:100%}.data-vertical\\:w-px[data-vertical]{width:1px}.data-vertical\\:self-stretch[data-vertical]{align-self:stretch}.data-\\[size\\=sm\\]\\:gap-3[data-size=sm]{gap:calc(var(--spacing) * 3)}.data-\\[size\\=sm\\]\\:py-3[data-size=sm]{padding-block:calc(var(--spacing) * 3)}.data-\\[size\\=sm\\]\\:has-data-\\[slot\\=card-footer\\]\\:pb-0[data-size=sm]:has([data-slot=card-footer]){padding-bottom:calc(var(--spacing) * 0)}@media (min-width:48rem){.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\\:border-input:is(.dark *){border-color:var(--aa-input)}.dark\\:bg-destructive\\/20:is(.dark *){background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20:is(.dark *){background-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab, var(--aa-input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:is(.dark *):hover{background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--aa-destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--aa-input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:is(.dark *):hover{background-color:var(--aa-muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--aa-muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 40%, transparent)}}.dark\\:disabled\\:bg-input\\/80:is(.dark *):disabled{background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.dark\\:disabled\\:bg-input\\/80:is(.dark *):disabled{background-color:color-mix(in oklab, var(--aa-input) 80%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50:is(.dark *)[aria-invalid=true]{border-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab, var(--aa-destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 40%, transparent)}}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_a\\]\\:underline-offset-4 a{text-underline-offset:4px}@media (hover:hover){.\\[\\&_a\\]\\:hover\\:text-primary a:hover{color:var(--aa-primary)}}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\.border-b\\]\\:pb-4.border-b{padding-bottom:calc(var(--spacing) * 4)}.group-data-\\[size\\=sm\\]\\/card\\:\\[\\.border-b\\]\\:pb-3:is(:where(.group\\/card)[data-size=sm] *).border-b{padding-bottom:calc(var(--spacing) * 3)}@media (hover:hover){.\\[a\\]\\:hover\\:bg-primary\\/80:is(a):hover{background-color:var(--aa-primary)}@supports (color:color-mix(in lab, red, red)){.\\[a\\]\\:hover\\:bg-primary\\/80:is(a):hover{background-color:color-mix(in oklab, var(--aa-primary) 80%, transparent)}}}:is(.\\*\\:\\[img\\:first-child\\]\\:rounded-t-xl>*):is(img:first-child){border-top-left-radius:calc(var(--aa-radius) + 4px);border-top-right-radius:calc(var(--aa-radius) + 4px)}:is(.\\*\\:\\[img\\:last-child\\]\\:rounded-b-xl>*):is(img:last-child){border-bottom-right-radius:calc(var(--aa-radius) + 4px);border-bottom-left-radius:calc(var(--aa-radius) + 4px)}[data-azirid]{--aa-radius:.625rem;--aa-background:oklch(100% 0 0);--aa-foreground:oklch(14.5% 0 0);--aa-card:oklch(100% 0 0);--aa-card-foreground:oklch(14.5% 0 0);--aa-popover:oklch(100% 0 0);--aa-popover-foreground:oklch(14.5% 0 0);--aa-primary:oklch(20.5% 0 0);--aa-primary-foreground:oklch(98.5% 0 0);--aa-secondary:oklch(97% 0 0);--aa-secondary-foreground:oklch(20.5% 0 0);--aa-muted:oklch(97% 0 0);--aa-muted-foreground:oklch(55.6% 0 0);--aa-accent:oklch(97% 0 0);--aa-accent-foreground:oklch(20.5% 0 0);--aa-destructive:oklch(57.7% .245 27.325);--aa-border:oklch(92.2% 0 0);--aa-input:oklch(92.2% 0 0);--aa-ring:oklch(70.8% 0 0);--aa-font-sans:ui-sans-serif, system-ui, sans-serif}@layer base{[data-azirid]{font-family:var(--aa-font-sans);color:var(--aa-foreground);background-color:var(--aa-background);-webkit-text-size-adjust:100%;tab-size:4;-webkit-font-smoothing:antialiased;line-height:1.5}[data-azirid] *,[data-azirid] :before,[data-azirid] :after{box-sizing:border-box;border:0 solid;border-color:var(--aa-border);margin:0;padding:0}[data-azirid] hr{height:0;color:inherit;border-top-width:1px}[data-azirid] h1,[data-azirid] h2,[data-azirid] h3,[data-azirid] h4,[data-azirid] h5,[data-azirid] h6{font-size:inherit;font-weight:inherit}[data-azirid] a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}[data-azirid] b,[data-azirid] strong{font-weight:bolder}[data-azirid] code,[data-azirid] kbd,[data-azirid] samp,[data-azirid] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}[data-azirid] small{font-size:80%}[data-azirid] table{text-indent:0;border-color:inherit;border-collapse:collapse}[data-azirid] button,[data-azirid] input,[data-azirid] optgroup,[data-azirid] select,[data-azirid] textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}[data-azirid] button,[data-azirid] select{text-transform:none}[data-azirid] button,[data-azirid] input[type=button],[data-azirid] input[type=reset],[data-azirid] input[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}[data-azirid] :-moz-focusring{outline:auto}[data-azirid] ::-moz-focus-inner{border-style:none;padding:0}[data-azirid] :-moz-ui-invalid{box-shadow:none}[data-azirid] progress{vertical-align:baseline}[data-azirid] ::-webkit-inner-spin-button{height:auto}[data-azirid] ::-webkit-outer-spin-button{height:auto}[data-azirid] [type=search]{-webkit-appearance:textfield;outline-offset:-2px}[data-azirid] ::-webkit-search-decoration{-webkit-appearance:none}[data-azirid] ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[data-azirid] summary{display:list-item}[data-azirid] ol,[data-azirid] ul,[data-azirid] menu{margin:0;padding:0;list-style:none}[data-azirid] textarea{resize:vertical}[data-azirid] ::placeholder{opacity:1;color:currentColor}@supports (color:color-mix(in lab, red, red)){[data-azirid] ::placeholder{color:color-mix(in oklch, currentColor 50%, transparent)}}[data-azirid] img,[data-azirid] svg,[data-azirid] video,[data-azirid] canvas,[data-azirid] audio,[data-azirid] iframe,[data-azirid] embed,[data-azirid] object{vertical-align:middle;display:block}[data-azirid] img,[data-azirid] video{max-width:100%;height:auto}[data-azirid] [hidden]:not([hidden=until-found]){display:none}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}`;
|
|
539
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){[data-azirid] *,[data-azirid] :before,[data-azirid] :after,[data-azirid] ::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-content:""}}[data-azirid]{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-800:oklch(44.8% .119 151.328);--color-green-950:oklch(26.6% .065 152.934);--color-blue-500:oklch(62.3% .214 259.815);--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--leading-snug:1.375;--radius-md:calc(var(--aa-radius) - 2px);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--aa-font-sans,ui-sans-serif, system-ui, sans-serif);--default-mono-font-family:var(--font-mono)}.\\@container\\/card-header{container:card-header/inline-size}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.start{inset-inline-start:var(--spacing)}.z-10{z-index:10}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.w-4{width:calc(var(--spacing) * 4)}.w-auto{width:auto}.w-full{width:100%}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.auto-rows-min{grid-auto-rows:min-content}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.self-center{align-self:center}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.rounded-\\[min\\(var\\(--radius-md\\)\\,10px\\)\\]{border-radius:min(var(--radius-md), 10px)}.rounded-\\[min\\(var\\(--radius-md\\)\\,12px\\)\\]{border-radius:min(var(--radius-md), 12px)}.rounded-lg{border-radius:var(--aa-radius)}.rounded-md{border-radius:calc(var(--aa-radius) - 2px)}.rounded-xl{border-radius:calc(var(--aa-radius) + 4px)}.rounded-t-xl{border-top-left-radius:calc(var(--aa-radius) + 4px);border-top-right-radius:calc(var(--aa-radius) + 4px)}.rounded-b-xl{border-bottom-right-radius:calc(var(--aa-radius) + 4px);border-bottom-left-radius:calc(var(--aa-radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--aa-border)}.border-destructive,.border-destructive\\/50{border-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\/50{border-color:color-mix(in oklab, var(--aa-destructive) 50%, transparent)}}.border-green-200{border-color:var(--color-green-200)}.border-input{border-color:var(--aa-input)}.border-transparent{border-color:#0000}.bg-background{background-color:var(--aa-background)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-border{background-color:var(--aa-border)}.bg-card{background-color:var(--aa-card)}.bg-destructive,.bg-destructive\\/10{background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--aa-destructive) 10%, transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-muted,.bg-muted\\/50{background-color:var(--aa-muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/50{background-color:color-mix(in oklab, var(--aa-muted) 50%, transparent)}}.bg-primary{background-color:var(--aa-primary)}.bg-secondary{background-color:var(--aa-secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-clip-padding{background-clip:padding-box}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-nowrap{white-space:nowrap}.text-card-foreground{color:var(--aa-card-foreground)}.text-destructive{color:var(--aa-destructive)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--aa-muted-foreground)}.text-primary{color:var(--aa-primary)}.text-primary-foreground{color:var(--aa-primary-foreground)}.text-secondary-foreground{color:var(--aa-secondary-foreground)}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-foreground,.ring-foreground\\/10{--tw-ring-color:var(--aa-foreground)}@supports (color:color-mix(in lab, red, red)){.ring-foreground\\/10{--tw-ring-color:color-mix(in oklab, var(--aa-foreground) 10%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[disabled\\=true\\]\\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\\[disabled\\=true\\]\\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\\[size\\=sm\\]\\/card\\:p-3:is(:where(.group\\/card)[data-size=sm] *){padding:calc(var(--spacing) * 3)}.group-data-\\[size\\=sm\\]\\/card\\:px-3:is(:where(.group\\/card)[data-size=sm] *){padding-inline:calc(var(--spacing) * 3)}.group-data-\\[size\\=sm\\]\\/card\\:text-sm:is(:where(.group\\/card)[data-size=sm] *){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\:text-foreground::file-selector-button{color:var(--aa-foreground)}.placeholder\\:text-muted-foreground::placeholder{color:var(--aa-muted-foreground)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-0:after{content:var(--tw-content);inset:calc(var(--spacing) * 0)}.after\\:top-1\\/2:after{content:var(--tw-content);top:50%}.after\\:z-0:after{content:var(--tw-content);z-index:0}.after\\:flex:after{content:var(--tw-content);display:flex}.after\\:items-center:after{content:var(--tw-content);align-items:center}.after\\:border-t:after{content:var(--tw-content);border-top-style:var(--tw-border-style);border-top-width:1px}.after\\:border-border:after{content:var(--tw-content);border-color:var(--aa-border)}@media (hover:hover){.hover\\:bg-destructive\\/20:hover{background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/20:hover{background-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--aa-muted)}.hover\\:bg-secondary\\/80:hover{background-color:var(--aa-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--aa-secondary) 80%, transparent)}}.hover\\:text-foreground:hover{color:var(--aa-foreground)}.hover\\:underline:hover{text-decoration-line:underline}}.focus-visible\\:border-destructive\\/40:focus-visible{border-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:border-destructive\\/40:focus-visible{border-color:color-mix(in oklab, var(--aa-destructive) 40%, transparent)}}.focus-visible\\:border-ring:focus-visible{border-color:var(--aa-ring)}.focus-visible\\:ring-3:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--aa-ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--aa-ring) 50%, transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-input\\/50:disabled{background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.disabled\\:bg-input\\/50:disabled{background-color:color-mix(in oklab, var(--aa-input) 50%, transparent)}}.disabled\\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\\[slot\\=button-group\\]\\:rounded-lg{border-radius:var(--aa-radius)}.has-data-\\[icon\\=inline-end\\]\\:pr-1\\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-end\\]\\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-end\\]\\:pr-3:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 3)}.has-data-\\[icon\\=inline-start\\]\\:pl-1\\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\\[icon\\=inline-start\\]\\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\\[icon\\=inline-start\\]\\:pl-3:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 3)}.has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\\[slot\\=card-description\\]\\:grid-rows-\\[auto_auto\\]:has([data-slot=card-description]){grid-template-rows:auto auto}.has-data-\\[slot\\=card-footer\\]\\:pb-0:has([data-slot=card-footer]){padding-bottom:calc(var(--spacing) * 0)}.has-\\[\\>img\\:first-child\\]\\:pt-0:has(>img:first-child){padding-top:calc(var(--spacing) * 0)}.aria-expanded\\:bg-muted[aria-expanded=true]{background-color:var(--aa-muted)}.aria-expanded\\:bg-secondary[aria-expanded=true]{background-color:var(--aa-secondary)}.aria-expanded\\:text-foreground[aria-expanded=true]{color:var(--aa-foreground)}.aria-expanded\\:text-secondary-foreground[aria-expanded=true]{color:var(--aa-secondary-foreground)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--aa-destructive)}.aria-invalid\\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.data-horizontal\\:h-px[data-horizontal]{height:1px}.data-horizontal\\:w-full[data-horizontal]{width:100%}.data-vertical\\:w-px[data-vertical]{width:1px}.data-vertical\\:self-stretch[data-vertical]{align-self:stretch}.data-\\[size\\=sm\\]\\:gap-3[data-size=sm]{gap:calc(var(--spacing) * 3)}.data-\\[size\\=sm\\]\\:py-3[data-size=sm]{padding-block:calc(var(--spacing) * 3)}.data-\\[size\\=sm\\]\\:has-data-\\[slot\\=card-footer\\]\\:pb-0[data-size=sm]:has([data-slot=card-footer]){padding-bottom:calc(var(--spacing) * 0)}@media (min-width:48rem){.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\\:border-green-800:is(.dark *){border-color:var(--color-green-800)}.dark\\:border-input:is(.dark *){border-color:var(--aa-input)}.dark\\:bg-destructive\\/20:is(.dark *){background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/20:is(.dark *){background-color:color-mix(in oklab, var(--aa-destructive) 20%, transparent)}}.dark\\:bg-green-950:is(.dark *){background-color:var(--color-green-950)}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab, var(--aa-input) 30%, transparent)}}.dark\\:text-green-200:is(.dark *){color:var(--color-green-200)}@media (hover:hover){.dark\\:hover\\:bg-destructive\\/30:is(.dark *):hover{background-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-destructive\\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--aa-destructive) 30%, transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--aa-input) 50%, transparent)}}.dark\\:hover\\:bg-muted\\/50:is(.dark *):hover{background-color:var(--aa-muted)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-muted\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--aa-muted) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 40%, transparent)}}.dark\\:disabled\\:bg-input\\/80:is(.dark *):disabled{background-color:var(--aa-input)}@supports (color:color-mix(in lab, red, red)){.dark\\:disabled\\:bg-input\\/80:is(.dark *):disabled{background-color:color-mix(in oklab, var(--aa-input) 80%, transparent)}}.dark\\:aria-invalid\\:border-destructive\\/50:is(.dark *)[aria-invalid=true]{border-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:border-destructive\\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab, var(--aa-destructive) 50%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--aa-destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--aa-destructive) 40%, transparent)}}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_a\\]\\:underline-offset-4 a{text-underline-offset:4px}@media (hover:hover){.\\[\\&_a\\]\\:hover\\:text-primary a:hover{color:var(--aa-primary)}}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3\\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\.border-b\\]\\:pb-4.border-b{padding-bottom:calc(var(--spacing) * 4)}.group-data-\\[size\\=sm\\]\\/card\\:\\[\\.border-b\\]\\:pb-3:is(:where(.group\\/card)[data-size=sm] *).border-b{padding-bottom:calc(var(--spacing) * 3)}@media (hover:hover){.\\[a\\]\\:hover\\:bg-primary\\/80:is(a):hover{background-color:var(--aa-primary)}@supports (color:color-mix(in lab, red, red)){.\\[a\\]\\:hover\\:bg-primary\\/80:is(a):hover{background-color:color-mix(in oklab, var(--aa-primary) 80%, transparent)}}}:is(.\\*\\:\\[img\\:first-child\\]\\:rounded-t-xl>*):is(img:first-child){border-top-left-radius:calc(var(--aa-radius) + 4px);border-top-right-radius:calc(var(--aa-radius) + 4px)}:is(.\\*\\:\\[img\\:last-child\\]\\:rounded-b-xl>*):is(img:last-child){border-bottom-right-radius:calc(var(--aa-radius) + 4px);border-bottom-left-radius:calc(var(--aa-radius) + 4px)}[data-azirid]{--aa-radius:.625rem;--aa-background:oklch(100% 0 0);--aa-foreground:oklch(14.5% 0 0);--aa-card:oklch(100% 0 0);--aa-card-foreground:oklch(14.5% 0 0);--aa-popover:oklch(100% 0 0);--aa-popover-foreground:oklch(14.5% 0 0);--aa-primary:oklch(20.5% 0 0);--aa-primary-foreground:oklch(98.5% 0 0);--aa-secondary:oklch(97% 0 0);--aa-secondary-foreground:oklch(20.5% 0 0);--aa-muted:oklch(97% 0 0);--aa-muted-foreground:oklch(55.6% 0 0);--aa-accent:oklch(97% 0 0);--aa-accent-foreground:oklch(20.5% 0 0);--aa-destructive:oklch(57.7% .245 27.325);--aa-border:oklch(92.2% 0 0);--aa-input:oklch(92.2% 0 0);--aa-ring:oklch(70.8% 0 0);--aa-font-sans:ui-sans-serif, system-ui, sans-serif}@layer base{[data-azirid]{font-family:var(--aa-font-sans);color:var(--aa-foreground);background-color:var(--aa-background);-webkit-text-size-adjust:100%;tab-size:4;-webkit-font-smoothing:antialiased;line-height:1.5}[data-azirid] *,[data-azirid] :before,[data-azirid] :after{box-sizing:border-box;border:0 solid;border-color:var(--aa-border);margin:0;padding:0}[data-azirid] hr{height:0;color:inherit;border-top-width:1px}[data-azirid] h1,[data-azirid] h2,[data-azirid] h3,[data-azirid] h4,[data-azirid] h5,[data-azirid] h6{font-size:inherit;font-weight:inherit}[data-azirid] a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}[data-azirid] b,[data-azirid] strong{font-weight:bolder}[data-azirid] code,[data-azirid] kbd,[data-azirid] samp,[data-azirid] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}[data-azirid] small{font-size:80%}[data-azirid] table{text-indent:0;border-color:inherit;border-collapse:collapse}[data-azirid] button,[data-azirid] input,[data-azirid] optgroup,[data-azirid] select,[data-azirid] textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}[data-azirid] button,[data-azirid] select{text-transform:none}[data-azirid] button,[data-azirid] input[type=button],[data-azirid] input[type=reset],[data-azirid] input[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}[data-azirid] :-moz-focusring{outline:auto}[data-azirid] ::-moz-focus-inner{border-style:none;padding:0}[data-azirid] :-moz-ui-invalid{box-shadow:none}[data-azirid] progress{vertical-align:baseline}[data-azirid] ::-webkit-inner-spin-button{height:auto}[data-azirid] ::-webkit-outer-spin-button{height:auto}[data-azirid] [type=search]{-webkit-appearance:textfield;outline-offset:-2px}[data-azirid] ::-webkit-search-decoration{-webkit-appearance:none}[data-azirid] ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}[data-azirid] summary{display:list-item}[data-azirid] ol,[data-azirid] ul,[data-azirid] menu{margin:0;padding:0;list-style:none}[data-azirid] textarea{resize:vertical}[data-azirid] ::placeholder{opacity:1;color:currentColor}@supports (color:color-mix(in lab, red, red)){[data-azirid] ::placeholder{color:color-mix(in oklch, currentColor 50%, transparent)}}[data-azirid] img,[data-azirid] svg,[data-azirid] video,[data-azirid] canvas,[data-azirid] audio,[data-azirid] iframe,[data-azirid] embed,[data-azirid] object{vertical-align:middle;display:block}[data-azirid] img,[data-azirid] video{max-width:100%;height:auto}[data-azirid] [hidden]:not([hidden=until-found]){display:none}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}`;
|
|
495
540
|
|
|
496
541
|
// src/utils/inject-styles.ts
|
|
497
542
|
var STYLE_ID = "azirid-access-styles";
|
|
@@ -513,6 +558,86 @@ function removeStyles() {
|
|
|
513
558
|
document.getElementById(STYLE_ID)?.remove();
|
|
514
559
|
injected = false;
|
|
515
560
|
}
|
|
561
|
+
function useAuthMutations(deps) {
|
|
562
|
+
const {
|
|
563
|
+
client,
|
|
564
|
+
props,
|
|
565
|
+
setUser,
|
|
566
|
+
setError,
|
|
567
|
+
updateAccessToken,
|
|
568
|
+
saveSessionTokens,
|
|
569
|
+
normalizeToken,
|
|
570
|
+
withAppContext,
|
|
571
|
+
clearSession
|
|
572
|
+
} = deps;
|
|
573
|
+
const queryClient = reactQuery.useQueryClient();
|
|
574
|
+
const loginMutation = reactQuery.useMutation({
|
|
575
|
+
mutationFn: (data) => client.post(client.paths.login, withAppContext(data)),
|
|
576
|
+
onSuccess: (data) => {
|
|
577
|
+
setUser(data.user);
|
|
578
|
+
updateAccessToken(normalizeToken(data));
|
|
579
|
+
saveSessionTokens(data);
|
|
580
|
+
setError(null);
|
|
581
|
+
props.onLoginSuccess?.(data);
|
|
582
|
+
},
|
|
583
|
+
onError: (err) => {
|
|
584
|
+
setError(err.message);
|
|
585
|
+
props.onError?.(err.message);
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
const signupMutation = reactQuery.useMutation({
|
|
589
|
+
mutationFn: (data) => {
|
|
590
|
+
const { confirmPassword: _, ...payload } = data;
|
|
591
|
+
return client.post(client.paths.signup, withAppContext({ ...payload }));
|
|
592
|
+
},
|
|
593
|
+
onSuccess: (data) => {
|
|
594
|
+
setUser(data.user);
|
|
595
|
+
updateAccessToken(normalizeToken(data));
|
|
596
|
+
saveSessionTokens(data);
|
|
597
|
+
setError(null);
|
|
598
|
+
props.onSignupSuccess?.(data);
|
|
599
|
+
},
|
|
600
|
+
onError: (err) => {
|
|
601
|
+
setError(err.message);
|
|
602
|
+
props.onError?.(err.message);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
const logoutMutation = reactQuery.useMutation({
|
|
606
|
+
mutationFn: () => client.post(client.paths.logout),
|
|
607
|
+
onSettled: () => {
|
|
608
|
+
clearSession();
|
|
609
|
+
setError(null);
|
|
610
|
+
queryClient.clear();
|
|
611
|
+
props.onLogoutSuccess?.();
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
const refreshFn = react.useCallback(async () => {
|
|
615
|
+
try {
|
|
616
|
+
await client.refreshSession();
|
|
617
|
+
updateAccessToken(client.getAccessToken());
|
|
618
|
+
} catch (err) {
|
|
619
|
+
clearSession();
|
|
620
|
+
queryClient.clear();
|
|
621
|
+
props.onSessionExpired?.();
|
|
622
|
+
throw err;
|
|
623
|
+
}
|
|
624
|
+
}, [client, queryClient, props, updateAccessToken, clearSession]);
|
|
625
|
+
const switchTenantFn = react.useCallback(
|
|
626
|
+
async (tenantId) => {
|
|
627
|
+
await client.refreshSession({ tenantId });
|
|
628
|
+
updateAccessToken(client.getAccessToken());
|
|
629
|
+
await queryClient.invalidateQueries({ queryKey: ["azirid-access"] });
|
|
630
|
+
},
|
|
631
|
+
[client, queryClient, updateAccessToken]
|
|
632
|
+
);
|
|
633
|
+
return {
|
|
634
|
+
loginMutation,
|
|
635
|
+
signupMutation,
|
|
636
|
+
logoutMutation,
|
|
637
|
+
refreshFn,
|
|
638
|
+
switchTenantFn
|
|
639
|
+
};
|
|
640
|
+
}
|
|
516
641
|
var AziridContext = react.createContext(null);
|
|
517
642
|
AziridContext.displayName = "AziridContext";
|
|
518
643
|
var ClientContext = react.createContext(null);
|
|
@@ -545,7 +670,6 @@ function AziridProviderInner({
|
|
|
545
670
|
client,
|
|
546
671
|
props
|
|
547
672
|
}) {
|
|
548
|
-
const queryClient = reactQuery.useQueryClient();
|
|
549
673
|
const [user, setUser] = react.useState(null);
|
|
550
674
|
const [accessToken, setAccessToken] = react.useState(null);
|
|
551
675
|
const [error, setError] = react.useState(null);
|
|
@@ -683,65 +807,23 @@ function AziridProviderInner({
|
|
|
683
807
|
(data) => data.at ?? data.accessToken,
|
|
684
808
|
[]
|
|
685
809
|
);
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
const { confirmPassword: _, ...payload } = data;
|
|
703
|
-
return client.post(client.paths.signup, withAppContext({ ...payload }));
|
|
704
|
-
},
|
|
705
|
-
onSuccess: (data) => {
|
|
706
|
-
setUser(data.user);
|
|
707
|
-
updateAccessToken(normalizeToken(data));
|
|
708
|
-
saveSessionTokens(data);
|
|
709
|
-
setError(null);
|
|
710
|
-
props.onSignupSuccess?.(data);
|
|
711
|
-
},
|
|
712
|
-
onError: (err) => {
|
|
713
|
-
setError(err.message);
|
|
714
|
-
props.onError?.(err.message);
|
|
715
|
-
}
|
|
716
|
-
});
|
|
717
|
-
const logoutMutation = reactQuery.useMutation({
|
|
718
|
-
mutationFn: () => client.post(client.paths.logout),
|
|
719
|
-
onSettled: () => {
|
|
720
|
-
clearSession();
|
|
721
|
-
setError(null);
|
|
722
|
-
queryClient.clear();
|
|
723
|
-
props.onLogoutSuccess?.();
|
|
724
|
-
}
|
|
810
|
+
const {
|
|
811
|
+
loginMutation,
|
|
812
|
+
signupMutation,
|
|
813
|
+
logoutMutation,
|
|
814
|
+
refreshFn,
|
|
815
|
+
switchTenantFn
|
|
816
|
+
} = useAuthMutations({
|
|
817
|
+
client,
|
|
818
|
+
props,
|
|
819
|
+
setUser,
|
|
820
|
+
setError,
|
|
821
|
+
updateAccessToken,
|
|
822
|
+
saveSessionTokens,
|
|
823
|
+
normalizeToken,
|
|
824
|
+
withAppContext,
|
|
825
|
+
clearSession
|
|
725
826
|
});
|
|
726
|
-
const refreshFn = react.useCallback(async () => {
|
|
727
|
-
try {
|
|
728
|
-
await client.refreshSession();
|
|
729
|
-
updateAccessToken(client.getAccessToken());
|
|
730
|
-
} catch (err) {
|
|
731
|
-
clearSession();
|
|
732
|
-
queryClient.clear();
|
|
733
|
-
props.onSessionExpired?.();
|
|
734
|
-
throw err;
|
|
735
|
-
}
|
|
736
|
-
}, [client, queryClient, props, updateAccessToken, clearSession]);
|
|
737
|
-
const switchTenantFn = react.useCallback(
|
|
738
|
-
async (tenantId) => {
|
|
739
|
-
await client.refreshSession({ tenantId });
|
|
740
|
-
updateAccessToken(client.getAccessToken());
|
|
741
|
-
await queryClient.invalidateQueries({ queryKey: ["azirid-access"] });
|
|
742
|
-
},
|
|
743
|
-
[client, queryClient, updateAccessToken]
|
|
744
|
-
);
|
|
745
827
|
const login = react.useCallback(
|
|
746
828
|
(data) => loginMutation.mutate(data),
|
|
747
829
|
[loginMutation]
|
|
@@ -1366,127 +1448,539 @@ var SignupForm = react.forwardRef(
|
|
|
1366
1448
|
}
|
|
1367
1449
|
);
|
|
1368
1450
|
SignupForm.displayName = "SignupForm";
|
|
1369
|
-
function
|
|
1451
|
+
function usePasswordReset(options) {
|
|
1370
1452
|
const client = useAccessClient();
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1453
|
+
const request = reactQuery.useMutation({
|
|
1454
|
+
mutationKey: ["azirid-access", "password-reset", "request"],
|
|
1455
|
+
mutationFn: (data) => client.post(client.paths.passwordResetRequest, data),
|
|
1456
|
+
onSuccess: () => options?.onRequestSuccess?.(),
|
|
1457
|
+
onError: options?.onError
|
|
1375
1458
|
});
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
return react.useMemo(
|
|
1384
|
-
() => ({ ...query, copyToClipboard }),
|
|
1385
|
-
[query, copyToClipboard]
|
|
1386
|
-
);
|
|
1459
|
+
const confirm = reactQuery.useMutation({
|
|
1460
|
+
mutationKey: ["azirid-access", "password-reset", "confirm"],
|
|
1461
|
+
mutationFn: (data) => client.post(client.paths.passwordResetConfirm, data),
|
|
1462
|
+
onSuccess: () => options?.onConfirmSuccess?.(),
|
|
1463
|
+
onError: options?.onError
|
|
1464
|
+
});
|
|
1465
|
+
return { request, confirm };
|
|
1387
1466
|
}
|
|
1388
|
-
var
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1467
|
+
var ForgotPasswordForm = react.forwardRef(
|
|
1468
|
+
({
|
|
1469
|
+
onSubmit: onSubmitProp,
|
|
1470
|
+
schema: schemaProp,
|
|
1471
|
+
isLoading: externalLoading,
|
|
1472
|
+
error: externalError,
|
|
1473
|
+
className,
|
|
1474
|
+
style,
|
|
1475
|
+
title: titleProp,
|
|
1476
|
+
description: descriptionProp,
|
|
1477
|
+
logo: logoProp,
|
|
1478
|
+
submitText: submitTextProp,
|
|
1479
|
+
footer,
|
|
1480
|
+
defaultValues
|
|
1481
|
+
}, ref) => {
|
|
1482
|
+
const msg = useMessages();
|
|
1483
|
+
const branding = useBranding();
|
|
1484
|
+
const [success, setSuccess] = react.useState(false);
|
|
1485
|
+
const [hookError, setHookError] = react.useState(null);
|
|
1486
|
+
const title = titleProp ?? msg.forgotPassword.title;
|
|
1487
|
+
const description = descriptionProp ?? msg.forgotPassword.description;
|
|
1488
|
+
const submitText = submitTextProp ?? msg.forgotPassword.submit;
|
|
1489
|
+
const logo = logoProp !== void 0 ? logoProp : branding?.logoUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: branding.logoUrl, alt: branding.displayName ?? "", className: "h-10 w-auto" }) : null;
|
|
1490
|
+
const schema = react.useMemo(
|
|
1491
|
+
() => schemaProp ?? createForgotPasswordSchema(msg.validation),
|
|
1492
|
+
[schemaProp, msg.validation]
|
|
1493
|
+
);
|
|
1494
|
+
let passwordReset = null;
|
|
1495
|
+
try {
|
|
1496
|
+
passwordReset = usePasswordReset({
|
|
1497
|
+
onRequestSuccess: () => setSuccess(true),
|
|
1498
|
+
onError: (err) => setHookError(err.message)
|
|
1499
|
+
});
|
|
1500
|
+
} catch {
|
|
1501
|
+
}
|
|
1502
|
+
const {
|
|
1503
|
+
register,
|
|
1504
|
+
handleSubmit,
|
|
1505
|
+
formState: { errors, isSubmitting }
|
|
1506
|
+
} = reactHookForm.useForm({
|
|
1507
|
+
resolver: zod$1.zodResolver(schema),
|
|
1508
|
+
defaultValues: { email: "", ...defaultValues }
|
|
1509
|
+
});
|
|
1510
|
+
const onSubmit = react.useCallback(
|
|
1511
|
+
async (values) => {
|
|
1512
|
+
setHookError(null);
|
|
1513
|
+
if (onSubmitProp) {
|
|
1514
|
+
await onSubmitProp(values);
|
|
1515
|
+
} else if (passwordReset) {
|
|
1516
|
+
passwordReset.request.mutate(values);
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
[onSubmitProp, passwordReset]
|
|
1520
|
+
);
|
|
1521
|
+
const loading = externalLoading ?? passwordReset?.request.isPending ?? isSubmitting;
|
|
1522
|
+
const error = externalError ?? hookError;
|
|
1523
|
+
const wrapperStyle = react.useMemo(() => {
|
|
1524
|
+
if (!branding?.primaryColor) return style ?? {};
|
|
1525
|
+
return {
|
|
1526
|
+
...style,
|
|
1527
|
+
"--aa-primary": branding.primaryColor,
|
|
1528
|
+
"--aa-primary-foreground": "#fff"
|
|
1529
|
+
};
|
|
1530
|
+
}, [style, branding?.primaryColor]);
|
|
1531
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-azirid": true, className: cn("flex flex-col gap-6", className), style: wrapperStyle, children: [
|
|
1532
|
+
logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 self-center font-medium", children: logo }),
|
|
1533
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
|
|
1534
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "text-center", children: [
|
|
1535
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "text-xl", children: title }),
|
|
1536
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: description })
|
|
1537
|
+
] }),
|
|
1538
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: success ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-md border border-green-200 bg-green-50 px-4 py-3 text-center text-sm text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-200", children: msg.forgotPassword.successMessage }) : /* @__PURE__ */ jsxRuntime.jsx("form", { ref, onSubmit: handleSubmit(onSubmit), noValidate: true, children: /* @__PURE__ */ jsxRuntime.jsxs(FieldGroup, { children: [
|
|
1539
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1540
|
+
"div",
|
|
1541
|
+
{
|
|
1542
|
+
role: "alert",
|
|
1543
|
+
className: "border-destructive/50 bg-destructive/10 text-destructive rounded-md border px-4 py-3 text-sm",
|
|
1544
|
+
children: error
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Field, { children: [
|
|
1548
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { htmlFor: "aa-forgot-email", children: msg.forgotPassword.emailLabel }),
|
|
1549
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1550
|
+
Input,
|
|
1551
|
+
{
|
|
1552
|
+
id: "aa-forgot-email",
|
|
1553
|
+
type: "email",
|
|
1554
|
+
autoComplete: "email",
|
|
1555
|
+
placeholder: msg.forgotPassword.emailPlaceholder,
|
|
1556
|
+
disabled: loading,
|
|
1557
|
+
"aria-invalid": !!errors.email,
|
|
1558
|
+
"aria-describedby": errors.email ? "aa-forgot-email-err" : void 0,
|
|
1559
|
+
...register("email")
|
|
1560
|
+
}
|
|
1561
|
+
),
|
|
1562
|
+
errors.email && /* @__PURE__ */ jsxRuntime.jsx("p", { id: "aa-forgot-email-err", className: "text-destructive text-xs", children: errors.email.message })
|
|
1563
|
+
] }),
|
|
1564
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Field, { children: [
|
|
1565
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "submit", disabled: loading, className: "w-full", children: [
|
|
1566
|
+
loading && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1567
|
+
"svg",
|
|
1568
|
+
{
|
|
1569
|
+
className: "mr-2 h-4 w-4 animate-spin",
|
|
1570
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1571
|
+
fill: "none",
|
|
1572
|
+
viewBox: "0 0 24 24",
|
|
1573
|
+
"aria-hidden": "true",
|
|
1574
|
+
children: [
|
|
1575
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1576
|
+
"circle",
|
|
1577
|
+
{
|
|
1578
|
+
className: "opacity-25",
|
|
1579
|
+
cx: "12",
|
|
1580
|
+
cy: "12",
|
|
1581
|
+
r: "10",
|
|
1582
|
+
stroke: "currentColor",
|
|
1583
|
+
strokeWidth: "4"
|
|
1584
|
+
}
|
|
1585
|
+
),
|
|
1586
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1587
|
+
"path",
|
|
1588
|
+
{
|
|
1589
|
+
className: "opacity-75",
|
|
1590
|
+
fill: "currentColor",
|
|
1591
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
1592
|
+
}
|
|
1593
|
+
)
|
|
1594
|
+
]
|
|
1595
|
+
}
|
|
1596
|
+
),
|
|
1597
|
+
submitText
|
|
1598
|
+
] }),
|
|
1599
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { className: "text-center", children: footer })
|
|
1600
|
+
] })
|
|
1601
|
+
] }) }) })
|
|
1602
|
+
] })
|
|
1603
|
+
] });
|
|
1604
|
+
}
|
|
1605
|
+
);
|
|
1606
|
+
ForgotPasswordForm.displayName = "ForgotPasswordForm";
|
|
1607
|
+
var ResetPasswordForm = react.forwardRef(
|
|
1608
|
+
({
|
|
1609
|
+
token,
|
|
1610
|
+
onSubmit: onSubmitProp,
|
|
1611
|
+
schema: schemaProp,
|
|
1612
|
+
isLoading: externalLoading,
|
|
1613
|
+
error: externalError,
|
|
1614
|
+
className,
|
|
1615
|
+
style,
|
|
1616
|
+
title: titleProp,
|
|
1617
|
+
description: descriptionProp,
|
|
1618
|
+
logo: logoProp,
|
|
1619
|
+
submitText: submitTextProp,
|
|
1620
|
+
footer,
|
|
1621
|
+
onSuccess
|
|
1622
|
+
}, ref) => {
|
|
1623
|
+
const msg = useMessages();
|
|
1624
|
+
const branding = useBranding();
|
|
1625
|
+
const [hookError, setHookError] = react.useState(null);
|
|
1626
|
+
const title = titleProp ?? msg.resetPassword.title;
|
|
1627
|
+
const description = descriptionProp ?? msg.resetPassword.description;
|
|
1628
|
+
const submitText = submitTextProp ?? msg.resetPassword.submit;
|
|
1629
|
+
const logo = logoProp !== void 0 ? logoProp : branding?.logoUrl ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: branding.logoUrl, alt: branding.displayName ?? "", className: "h-10 w-auto" }) : null;
|
|
1630
|
+
const schema = react.useMemo(
|
|
1631
|
+
() => schemaProp ?? createResetPasswordConfirmSchema(msg.validation),
|
|
1632
|
+
[schemaProp, msg.validation]
|
|
1633
|
+
);
|
|
1634
|
+
let passwordReset = null;
|
|
1635
|
+
try {
|
|
1636
|
+
passwordReset = usePasswordReset({
|
|
1637
|
+
onConfirmSuccess: () => onSuccess?.(),
|
|
1638
|
+
onError: (err) => setHookError(err.message)
|
|
1639
|
+
});
|
|
1640
|
+
} catch {
|
|
1641
|
+
}
|
|
1642
|
+
const {
|
|
1643
|
+
register,
|
|
1644
|
+
handleSubmit,
|
|
1645
|
+
formState: { errors, isSubmitting }
|
|
1646
|
+
} = reactHookForm.useForm({
|
|
1647
|
+
resolver: zod$1.zodResolver(schema),
|
|
1648
|
+
defaultValues: { token, newPassword: "", confirmPassword: "" }
|
|
1649
|
+
});
|
|
1650
|
+
const onSubmit = react.useCallback(
|
|
1651
|
+
async (values) => {
|
|
1652
|
+
setHookError(null);
|
|
1653
|
+
if (onSubmitProp) {
|
|
1654
|
+
await onSubmitProp({ token: values.token, newPassword: values.newPassword });
|
|
1655
|
+
} else if (passwordReset) {
|
|
1656
|
+
passwordReset.confirm.mutate({
|
|
1657
|
+
token: values.token,
|
|
1658
|
+
newPassword: values.newPassword
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
[onSubmitProp, passwordReset]
|
|
1663
|
+
);
|
|
1664
|
+
const loading = externalLoading ?? passwordReset?.confirm.isPending ?? isSubmitting;
|
|
1665
|
+
const error = externalError ?? hookError;
|
|
1666
|
+
const wrapperStyle = react.useMemo(() => {
|
|
1667
|
+
if (!branding?.primaryColor) return style ?? {};
|
|
1668
|
+
return {
|
|
1669
|
+
...style,
|
|
1670
|
+
"--aa-primary": branding.primaryColor,
|
|
1671
|
+
"--aa-primary-foreground": "#fff"
|
|
1672
|
+
};
|
|
1673
|
+
}, [style, branding?.primaryColor]);
|
|
1674
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-azirid": true, className: cn("flex flex-col gap-6", className), style: wrapperStyle, children: [
|
|
1675
|
+
logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 self-center font-medium", children: logo }),
|
|
1676
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
|
|
1677
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "text-center", children: [
|
|
1678
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "text-xl", children: title }),
|
|
1679
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: description })
|
|
1680
|
+
] }),
|
|
1681
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("form", { ref, onSubmit: handleSubmit(onSubmit), noValidate: true, children: [
|
|
1682
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", ...register("token") }),
|
|
1683
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FieldGroup, { children: [
|
|
1684
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1685
|
+
"div",
|
|
1686
|
+
{
|
|
1687
|
+
role: "alert",
|
|
1688
|
+
className: "border-destructive/50 bg-destructive/10 text-destructive rounded-md border px-4 py-3 text-sm",
|
|
1689
|
+
children: error
|
|
1690
|
+
}
|
|
1691
|
+
),
|
|
1692
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Field, { children: [
|
|
1693
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { htmlFor: "aa-reset-new-password", children: msg.resetPassword.newPasswordLabel }),
|
|
1694
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1695
|
+
Input,
|
|
1696
|
+
{
|
|
1697
|
+
id: "aa-reset-new-password",
|
|
1698
|
+
type: "password",
|
|
1699
|
+
autoComplete: "new-password",
|
|
1700
|
+
placeholder: msg.resetPassword.newPasswordPlaceholder,
|
|
1701
|
+
disabled: loading,
|
|
1702
|
+
"aria-invalid": !!errors.newPassword,
|
|
1703
|
+
"aria-describedby": errors.newPassword ? "aa-reset-newpass-err" : void 0,
|
|
1704
|
+
...register("newPassword")
|
|
1705
|
+
}
|
|
1706
|
+
),
|
|
1707
|
+
errors.newPassword && /* @__PURE__ */ jsxRuntime.jsx("p", { id: "aa-reset-newpass-err", className: "text-destructive text-xs", children: errors.newPassword.message })
|
|
1708
|
+
] }),
|
|
1709
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Field, { children: [
|
|
1710
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { htmlFor: "aa-reset-confirm-password", children: msg.resetPassword.confirmPasswordLabel }),
|
|
1711
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1712
|
+
Input,
|
|
1713
|
+
{
|
|
1714
|
+
id: "aa-reset-confirm-password",
|
|
1715
|
+
type: "password",
|
|
1716
|
+
autoComplete: "new-password",
|
|
1717
|
+
placeholder: msg.resetPassword.confirmPasswordPlaceholder,
|
|
1718
|
+
disabled: loading,
|
|
1719
|
+
"aria-invalid": !!errors.confirmPassword,
|
|
1720
|
+
"aria-describedby": errors.confirmPassword ? "aa-reset-confirmpass-err" : void 0,
|
|
1721
|
+
...register("confirmPassword")
|
|
1722
|
+
}
|
|
1723
|
+
),
|
|
1724
|
+
errors.confirmPassword && /* @__PURE__ */ jsxRuntime.jsx("p", { id: "aa-reset-confirmpass-err", className: "text-destructive text-xs", children: errors.confirmPassword.message })
|
|
1725
|
+
] }),
|
|
1726
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Field, { children: [
|
|
1727
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "submit", disabled: loading, className: "w-full", children: [
|
|
1728
|
+
loading && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1729
|
+
"svg",
|
|
1730
|
+
{
|
|
1731
|
+
className: "mr-2 h-4 w-4 animate-spin",
|
|
1732
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1733
|
+
fill: "none",
|
|
1734
|
+
viewBox: "0 0 24 24",
|
|
1735
|
+
"aria-hidden": "true",
|
|
1736
|
+
children: [
|
|
1737
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1738
|
+
"circle",
|
|
1739
|
+
{
|
|
1740
|
+
className: "opacity-25",
|
|
1741
|
+
cx: "12",
|
|
1742
|
+
cy: "12",
|
|
1743
|
+
r: "10",
|
|
1744
|
+
stroke: "currentColor",
|
|
1745
|
+
strokeWidth: "4"
|
|
1746
|
+
}
|
|
1747
|
+
),
|
|
1748
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1749
|
+
"path",
|
|
1750
|
+
{
|
|
1751
|
+
className: "opacity-75",
|
|
1752
|
+
fill: "currentColor",
|
|
1753
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
1754
|
+
}
|
|
1755
|
+
)
|
|
1756
|
+
]
|
|
1757
|
+
}
|
|
1758
|
+
),
|
|
1759
|
+
submitText
|
|
1760
|
+
] }),
|
|
1761
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx(FieldDescription, { className: "text-center", children: footer })
|
|
1762
|
+
] })
|
|
1763
|
+
] })
|
|
1764
|
+
] }) })
|
|
1765
|
+
] })
|
|
1766
|
+
] });
|
|
1767
|
+
}
|
|
1768
|
+
);
|
|
1769
|
+
ResetPasswordForm.displayName = "ResetPasswordForm";
|
|
1770
|
+
function AuthForm({
|
|
1771
|
+
view: controlledView,
|
|
1772
|
+
onViewChange,
|
|
1773
|
+
defaultView = "login",
|
|
1774
|
+
className,
|
|
1775
|
+
style,
|
|
1776
|
+
logo,
|
|
1777
|
+
showSocialButtons,
|
|
1778
|
+
hideNavigation,
|
|
1779
|
+
resetToken,
|
|
1780
|
+
defaultValues,
|
|
1781
|
+
loginProps,
|
|
1782
|
+
signupProps,
|
|
1783
|
+
forgotPasswordProps,
|
|
1784
|
+
resetPasswordProps
|
|
1785
|
+
}) {
|
|
1786
|
+
const [internalView, setInternalView] = react.useState(defaultView);
|
|
1787
|
+
const msg = useMessages();
|
|
1788
|
+
const currentView = controlledView ?? internalView;
|
|
1789
|
+
const navigate = react.useCallback(
|
|
1790
|
+
(target) => {
|
|
1791
|
+
if (onViewChange) {
|
|
1792
|
+
onViewChange(target);
|
|
1793
|
+
} else {
|
|
1794
|
+
setInternalView(target);
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
[onViewChange]
|
|
1798
|
+
);
|
|
1799
|
+
const navLink = (text, target) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1800
|
+
"button",
|
|
1801
|
+
{
|
|
1802
|
+
type: "button",
|
|
1803
|
+
onClick: () => navigate(target),
|
|
1804
|
+
className: "text-primary font-medium underline-offset-4 hover:underline",
|
|
1805
|
+
children: text
|
|
1806
|
+
}
|
|
1807
|
+
);
|
|
1808
|
+
const sharedProps = { className, style, logo };
|
|
1809
|
+
switch (currentView) {
|
|
1810
|
+
case "login":
|
|
1811
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1812
|
+
LoginForm,
|
|
1813
|
+
{
|
|
1814
|
+
...sharedProps,
|
|
1815
|
+
showSocialButtons,
|
|
1816
|
+
defaultValues,
|
|
1817
|
+
...loginProps,
|
|
1818
|
+
forgotPassword: hideNavigation ? void 0 : navLink(msg.navigation.forgotPassword, "forgot-password"),
|
|
1819
|
+
footer: hideNavigation ? void 0 : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1820
|
+
msg.navigation.noAccountText,
|
|
1821
|
+
" ",
|
|
1822
|
+
navLink(msg.navigation.signUpLink, "signup")
|
|
1823
|
+
] })
|
|
1824
|
+
}
|
|
1825
|
+
);
|
|
1826
|
+
case "signup":
|
|
1827
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1828
|
+
SignupForm,
|
|
1829
|
+
{
|
|
1830
|
+
...sharedProps,
|
|
1831
|
+
showSocialButtons,
|
|
1832
|
+
...signupProps,
|
|
1833
|
+
footer: hideNavigation ? void 0 : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
1834
|
+
msg.navigation.hasAccountText,
|
|
1835
|
+
" ",
|
|
1836
|
+
navLink(msg.navigation.signInLink, "login")
|
|
1837
|
+
] })
|
|
1838
|
+
}
|
|
1839
|
+
);
|
|
1840
|
+
case "forgot-password":
|
|
1841
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1842
|
+
ForgotPasswordForm,
|
|
1843
|
+
{
|
|
1844
|
+
...sharedProps,
|
|
1845
|
+
defaultValues: defaultValues ? { email: defaultValues.email } : void 0,
|
|
1846
|
+
...forgotPasswordProps,
|
|
1847
|
+
footer: hideNavigation ? void 0 : /* @__PURE__ */ jsxRuntime.jsx("span", { children: navLink(msg.navigation.backToLogin, "login") })
|
|
1848
|
+
}
|
|
1849
|
+
);
|
|
1850
|
+
case "reset-password":
|
|
1851
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1852
|
+
ResetPasswordForm,
|
|
1853
|
+
{
|
|
1854
|
+
...sharedProps,
|
|
1855
|
+
token: resetToken ?? "",
|
|
1856
|
+
...resetPasswordProps,
|
|
1857
|
+
footer: hideNavigation ? void 0 : /* @__PURE__ */ jsxRuntime.jsx("span", { children: navLink(msg.navigation.backToLogin, "login") })
|
|
1858
|
+
}
|
|
1859
|
+
);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
AuthForm.displayName = "AuthForm";
|
|
1863
|
+
function useReferral() {
|
|
1864
|
+
const client = useAccessClient();
|
|
1865
|
+
const query = reactQuery.useQuery({
|
|
1866
|
+
queryKey: ["azirid-access", "referral", "me"],
|
|
1867
|
+
queryFn: () => client.get(client.paths.referralMe),
|
|
1868
|
+
enabled: !!client.getAccessToken()
|
|
1869
|
+
});
|
|
1870
|
+
const copyToClipboard = react.useCallback(async () => {
|
|
1871
|
+
if (query.data?.referralUrl) {
|
|
1872
|
+
await navigator.clipboard.writeText(query.data.referralUrl);
|
|
1873
|
+
return true;
|
|
1874
|
+
}
|
|
1875
|
+
return false;
|
|
1876
|
+
}, [query.data?.referralUrl]);
|
|
1877
|
+
return react.useMemo(
|
|
1878
|
+
() => ({ ...query, copyToClipboard }),
|
|
1879
|
+
[query, copyToClipboard]
|
|
1880
|
+
);
|
|
1881
|
+
}
|
|
1882
|
+
var styles = {
|
|
1883
|
+
card: {
|
|
1884
|
+
border: "1px solid #e5e7eb",
|
|
1885
|
+
borderRadius: "12px",
|
|
1886
|
+
padding: "24px",
|
|
1887
|
+
backgroundColor: "#ffffff",
|
|
1888
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
|
|
1889
|
+
},
|
|
1890
|
+
title: {
|
|
1891
|
+
margin: "0 0 4px 0",
|
|
1892
|
+
fontSize: "18px",
|
|
1893
|
+
fontWeight: 600,
|
|
1894
|
+
color: "#111827"
|
|
1895
|
+
},
|
|
1896
|
+
description: {
|
|
1897
|
+
margin: "0 0 16px 0",
|
|
1898
|
+
fontSize: "14px",
|
|
1899
|
+
color: "#6b7280"
|
|
1900
|
+
},
|
|
1901
|
+
codeContainer: {
|
|
1902
|
+
display: "flex",
|
|
1903
|
+
alignItems: "center",
|
|
1904
|
+
gap: "8px",
|
|
1905
|
+
marginBottom: "16px"
|
|
1906
|
+
},
|
|
1907
|
+
codeInput: {
|
|
1908
|
+
flex: 1,
|
|
1909
|
+
padding: "10px 12px",
|
|
1910
|
+
border: "1px solid #d1d5db",
|
|
1911
|
+
borderRadius: "8px",
|
|
1912
|
+
backgroundColor: "#f9fafb",
|
|
1913
|
+
fontSize: "14px",
|
|
1914
|
+
fontFamily: "monospace",
|
|
1915
|
+
color: "#374151",
|
|
1916
|
+
outline: "none"
|
|
1917
|
+
},
|
|
1918
|
+
copyButton: {
|
|
1919
|
+
padding: "10px 16px",
|
|
1920
|
+
border: "1px solid #d1d5db",
|
|
1921
|
+
borderRadius: "8px",
|
|
1922
|
+
backgroundColor: "#ffffff",
|
|
1923
|
+
fontSize: "14px",
|
|
1924
|
+
fontWeight: 500,
|
|
1925
|
+
color: "#374151",
|
|
1926
|
+
cursor: "pointer",
|
|
1927
|
+
whiteSpace: "nowrap",
|
|
1928
|
+
transition: "background-color 0.15s"
|
|
1929
|
+
},
|
|
1930
|
+
copyButtonCopied: {
|
|
1931
|
+
backgroundColor: "#ecfdf5",
|
|
1932
|
+
borderColor: "#a7f3d0",
|
|
1933
|
+
color: "#065f46"
|
|
1934
|
+
},
|
|
1935
|
+
statsRow: {
|
|
1936
|
+
display: "flex",
|
|
1937
|
+
gap: "24px"
|
|
1938
|
+
},
|
|
1939
|
+
stat: {
|
|
1940
|
+
display: "flex",
|
|
1941
|
+
flexDirection: "column",
|
|
1942
|
+
gap: "2px"
|
|
1943
|
+
},
|
|
1944
|
+
statValue: {
|
|
1945
|
+
fontSize: "20px",
|
|
1946
|
+
fontWeight: 600,
|
|
1947
|
+
color: "#111827"
|
|
1948
|
+
},
|
|
1949
|
+
statLabel: {
|
|
1950
|
+
fontSize: "12px",
|
|
1951
|
+
color: "#6b7280"
|
|
1952
|
+
},
|
|
1953
|
+
skeleton: {
|
|
1954
|
+
backgroundColor: "#f3f4f6",
|
|
1955
|
+
borderRadius: "8px",
|
|
1956
|
+
animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
|
|
1957
|
+
},
|
|
1958
|
+
emptyMessage: {
|
|
1959
|
+
fontSize: "14px",
|
|
1960
|
+
color: "#9ca3af",
|
|
1961
|
+
textAlign: "center",
|
|
1962
|
+
padding: "12px 0"
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
function ReferralCard({
|
|
1966
|
+
className,
|
|
1967
|
+
style,
|
|
1968
|
+
title = "Refer a Friend",
|
|
1969
|
+
description = "Share your referral link and earn rewards for every friend who signs up."
|
|
1970
|
+
}) {
|
|
1971
|
+
const { data, isLoading } = useReferral();
|
|
1972
|
+
const [copied, setCopied] = react.useState(false);
|
|
1973
|
+
const handleCopy = react.useCallback(async () => {
|
|
1974
|
+
if (!data?.referralUrl) return;
|
|
1975
|
+
try {
|
|
1976
|
+
await navigator.clipboard.writeText(data.referralUrl);
|
|
1977
|
+
setCopied(true);
|
|
1978
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1979
|
+
} catch {
|
|
1980
|
+
}
|
|
1981
|
+
}, [data?.referralUrl]);
|
|
1982
|
+
if (isLoading) {
|
|
1983
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...styles.card, ...style }, children: [
|
|
1490
1984
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...styles.skeleton, height: "20px", width: "140px", marginBottom: "8px" } }),
|
|
1491
1985
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...styles.skeleton, height: "14px", width: "260px", marginBottom: "16px" } }),
|
|
1492
1986
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...styles.skeleton, height: "42px", width: "100%", marginBottom: "16px" } }),
|
|
@@ -1716,6 +2210,20 @@ function ReferralStats({ className, style }) {
|
|
|
1716
2210
|
] });
|
|
1717
2211
|
}
|
|
1718
2212
|
ReferralStats.displayName = "ReferralStats";
|
|
2213
|
+
|
|
2214
|
+
// ../shared/dist/index.js
|
|
2215
|
+
function formatAmount(amount, currency) {
|
|
2216
|
+
try {
|
|
2217
|
+
return new Intl.NumberFormat(void 0, {
|
|
2218
|
+
style: "currency",
|
|
2219
|
+
currency,
|
|
2220
|
+
minimumFractionDigits: 0,
|
|
2221
|
+
maximumFractionDigits: 2
|
|
2222
|
+
}).format(amount / 100);
|
|
2223
|
+
} catch {
|
|
2224
|
+
return `${currency} ${(amount / 100).toFixed(2)}`;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
1719
2227
|
function usePlans() {
|
|
1720
2228
|
const client = useAccessClient();
|
|
1721
2229
|
return reactQuery.useQuery({
|
|
@@ -1881,30 +2389,42 @@ var cancelStyle = {
|
|
|
1881
2389
|
cursor: "pointer",
|
|
1882
2390
|
fontFamily: "inherit"
|
|
1883
2391
|
};
|
|
2392
|
+
var styles3 = {
|
|
2393
|
+
featuresList: {
|
|
2394
|
+
listStyle: "none",
|
|
2395
|
+
padding: 0,
|
|
2396
|
+
margin: "0 0 24px 0",
|
|
2397
|
+
flex: 1
|
|
2398
|
+
},
|
|
2399
|
+
featureItem: {
|
|
2400
|
+
display: "flex",
|
|
2401
|
+
alignItems: "center",
|
|
2402
|
+
gap: "8px",
|
|
2403
|
+
padding: "6px 0",
|
|
2404
|
+
fontSize: "14px",
|
|
2405
|
+
color: "#374151"
|
|
2406
|
+
},
|
|
2407
|
+
checkmark: {
|
|
2408
|
+
color: "#10b981",
|
|
2409
|
+
fontSize: "16px",
|
|
2410
|
+
fontWeight: 700,
|
|
2411
|
+
flexShrink: 0
|
|
2412
|
+
}
|
|
2413
|
+
};
|
|
2414
|
+
function PricingFeatureList({ features }) {
|
|
2415
|
+
if (!features || features.length === 0) return null;
|
|
2416
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { style: styles3.featuresList, children: features.map((feature, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { style: styles3.featureItem, children: [
|
|
2417
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles3.checkmark, "aria-hidden": "true", children: "\u2713" }),
|
|
2418
|
+
feature
|
|
2419
|
+
] }, i)) });
|
|
2420
|
+
}
|
|
2421
|
+
PricingFeatureList.displayName = "PricingFeatureList";
|
|
1884
2422
|
var intervalLabels = {
|
|
1885
2423
|
MONTHLY: "/mo",
|
|
1886
2424
|
YEARLY: "/yr",
|
|
1887
2425
|
ONE_TIME: ""
|
|
1888
2426
|
};
|
|
1889
|
-
|
|
1890
|
-
try {
|
|
1891
|
-
return new Intl.NumberFormat(void 0, {
|
|
1892
|
-
style: "currency",
|
|
1893
|
-
currency,
|
|
1894
|
-
minimumFractionDigits: 0,
|
|
1895
|
-
maximumFractionDigits: 2
|
|
1896
|
-
}).format(amount / 100);
|
|
1897
|
-
} catch {
|
|
1898
|
-
return `${currency} ${(amount / 100).toFixed(2)}`;
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
var styles3 = {
|
|
1902
|
-
grid: (columns) => ({
|
|
1903
|
-
display: "grid",
|
|
1904
|
-
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
1905
|
-
gap: "24px",
|
|
1906
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
|
|
1907
|
-
}),
|
|
2427
|
+
var styles4 = {
|
|
1908
2428
|
card: (isCurrentPlan) => ({
|
|
1909
2429
|
border: isCurrentPlan ? "2px solid #6366f1" : "1px solid #e5e7eb",
|
|
1910
2430
|
borderRadius: "12px",
|
|
@@ -1955,26 +2475,6 @@ var styles3 = {
|
|
|
1955
2475
|
fontSize: "16px",
|
|
1956
2476
|
color: "#6b7280"
|
|
1957
2477
|
},
|
|
1958
|
-
featuresList: {
|
|
1959
|
-
listStyle: "none",
|
|
1960
|
-
padding: 0,
|
|
1961
|
-
margin: "0 0 24px 0",
|
|
1962
|
-
flex: 1
|
|
1963
|
-
},
|
|
1964
|
-
featureItem: {
|
|
1965
|
-
display: "flex",
|
|
1966
|
-
alignItems: "center",
|
|
1967
|
-
gap: "8px",
|
|
1968
|
-
padding: "6px 0",
|
|
1969
|
-
fontSize: "14px",
|
|
1970
|
-
color: "#374151"
|
|
1971
|
-
},
|
|
1972
|
-
checkmark: {
|
|
1973
|
-
color: "#10b981",
|
|
1974
|
-
fontSize: "16px",
|
|
1975
|
-
fontWeight: 700,
|
|
1976
|
-
flexShrink: 0
|
|
1977
|
-
},
|
|
1978
2478
|
selectButton: (isCurrentPlan) => ({
|
|
1979
2479
|
width: "100%",
|
|
1980
2480
|
padding: "12px 24px",
|
|
@@ -1986,11 +2486,46 @@ var styles3 = {
|
|
|
1986
2486
|
fontWeight: 600,
|
|
1987
2487
|
cursor: isCurrentPlan ? "default" : "pointer",
|
|
1988
2488
|
transition: "background-color 0.15s"
|
|
2489
|
+
})
|
|
2490
|
+
};
|
|
2491
|
+
function PricingCard({
|
|
2492
|
+
plan,
|
|
2493
|
+
isCurrentPlan,
|
|
2494
|
+
isCheckoutPending,
|
|
2495
|
+
onSelect
|
|
2496
|
+
}) {
|
|
2497
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles4.card(isCurrentPlan), children: [
|
|
2498
|
+
isCurrentPlan && /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles4.currentBadge, children: "Current Plan" }),
|
|
2499
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: styles4.planName, children: plan.name }),
|
|
2500
|
+
plan.description && /* @__PURE__ */ jsxRuntime.jsx("p", { style: styles4.planDescription, children: plan.description }),
|
|
2501
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles4.priceRow, children: [
|
|
2502
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles4.priceAmount, children: formatAmount(plan.amount, plan.currency) }),
|
|
2503
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles4.priceInterval, children: intervalLabels[plan.interval] })
|
|
2504
|
+
] }),
|
|
2505
|
+
plan.features && plan.features.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(PricingFeatureList, { features: plan.features }),
|
|
2506
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2507
|
+
"button",
|
|
2508
|
+
{
|
|
2509
|
+
type: "button",
|
|
2510
|
+
onClick: () => onSelect(plan),
|
|
2511
|
+
disabled: isCurrentPlan || isCheckoutPending,
|
|
2512
|
+
style: {
|
|
2513
|
+
...styles4.selectButton(isCurrentPlan),
|
|
2514
|
+
...isCheckoutPending && !isCurrentPlan ? { opacity: 0.6 } : {}
|
|
2515
|
+
},
|
|
2516
|
+
children: isCurrentPlan ? "Current Plan" : "Subscribe"
|
|
2517
|
+
}
|
|
2518
|
+
)
|
|
2519
|
+
] });
|
|
2520
|
+
}
|
|
2521
|
+
PricingCard.displayName = "PricingCard";
|
|
2522
|
+
var styles5 = {
|
|
2523
|
+
grid: (columns) => ({
|
|
2524
|
+
display: "grid",
|
|
2525
|
+
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
2526
|
+
gap: "24px",
|
|
2527
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
|
|
1989
2528
|
}),
|
|
1990
|
-
skeleton: {
|
|
1991
|
-
backgroundColor: "#f3f4f6",
|
|
1992
|
-
borderRadius: "12px"
|
|
1993
|
-
},
|
|
1994
2529
|
skeletonCard: {
|
|
1995
2530
|
border: "1px solid #e5e7eb",
|
|
1996
2531
|
borderRadius: "12px",
|
|
@@ -2092,8 +2627,8 @@ function ProviderSelectModal({
|
|
|
2092
2627
|
onSelect,
|
|
2093
2628
|
onClose
|
|
2094
2629
|
}) {
|
|
2095
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2096
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
2630
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: styles5.overlay, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles5.modal, onClick: (e) => e.stopPropagation(), children: [
|
|
2631
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: styles5.modalTitle, children: "Select payment method" }),
|
|
2097
2632
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: providers.map((p) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2098
2633
|
"button",
|
|
2099
2634
|
{
|
|
@@ -2121,17 +2656,22 @@ function ProviderSelectModal({
|
|
|
2121
2656
|
},
|
|
2122
2657
|
p.provider
|
|
2123
2658
|
)) }),
|
|
2124
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", style:
|
|
2659
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", style: styles5.closeButton, onClick: onClose, children: "Cancel" })
|
|
2125
2660
|
] }) });
|
|
2126
2661
|
}
|
|
2662
|
+
var intervalLabels2 = {
|
|
2663
|
+
MONTHLY: "/mo",
|
|
2664
|
+
YEARLY: "/yr",
|
|
2665
|
+
ONE_TIME: ""
|
|
2666
|
+
};
|
|
2127
2667
|
function TransferModal({
|
|
2128
2668
|
data,
|
|
2129
2669
|
onClose
|
|
2130
2670
|
}) {
|
|
2131
2671
|
const bankDetails = data.bankDetails;
|
|
2132
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2133
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { style:
|
|
2134
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { style:
|
|
2672
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: styles5.overlay, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles5.modal, onClick: (e) => e.stopPropagation(), children: [
|
|
2673
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: styles5.modalTitle, children: "Manual Transfer" }),
|
|
2674
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { style: styles5.modalSubtitle, children: [
|
|
2135
2675
|
"Transfer the amount below to subscribe to",
|
|
2136
2676
|
" ",
|
|
2137
2677
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: data.plan?.name })
|
|
@@ -2148,7 +2688,7 @@ function TransferModal({
|
|
|
2148
2688
|
},
|
|
2149
2689
|
children: [
|
|
2150
2690
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "32px", fontWeight: 700, color: "#111827" }, children: data.plan ? formatAmount(data.plan.amount, data.plan.currency) : "" }),
|
|
2151
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "14px", color: "#6b7280" }, children: data.plan?.interval ?
|
|
2691
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "14px", color: "#6b7280" }, children: data.plan?.interval ? intervalLabels2[data.plan.interval] ?? "" : "" })
|
|
2152
2692
|
]
|
|
2153
2693
|
}
|
|
2154
2694
|
),
|
|
@@ -2165,12 +2705,12 @@ function TransferModal({
|
|
|
2165
2705
|
children: "Bank Details"
|
|
2166
2706
|
}
|
|
2167
2707
|
),
|
|
2168
|
-
Object.entries(bankDetails).filter(([, v]) => v).map(([key, value]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style:
|
|
2169
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style:
|
|
2170
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style:
|
|
2708
|
+
Object.entries(bankDetails).filter(([, v]) => v).map(([key, value]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles5.bankDetailRow, children: [
|
|
2709
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles5.bankDetailLabel, children: key.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase()) }),
|
|
2710
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles5.bankDetailValue, children: value })
|
|
2171
2711
|
] }, key))
|
|
2172
2712
|
] }),
|
|
2173
|
-
data.transferInstructions && /* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2713
|
+
data.transferInstructions && /* @__PURE__ */ jsxRuntime.jsx("div", { style: styles5.instructions, children: data.transferInstructions }),
|
|
2174
2714
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2175
2715
|
"p",
|
|
2176
2716
|
{
|
|
@@ -2182,7 +2722,7 @@ function TransferModal({
|
|
|
2182
2722
|
children: "After completing the transfer, submit your proof of payment. Your subscription will be activated once the transfer is verified."
|
|
2183
2723
|
}
|
|
2184
2724
|
),
|
|
2185
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", style:
|
|
2725
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", style: styles5.closeButton, onClick: onClose, children: "Close" })
|
|
2186
2726
|
] }) });
|
|
2187
2727
|
}
|
|
2188
2728
|
function PricingTable({
|
|
@@ -2233,12 +2773,12 @@ function PricingTable({
|
|
|
2233
2773
|
checkout({ planId: plan.id, provider, successUrl, cancelUrl });
|
|
2234
2774
|
};
|
|
2235
2775
|
if (plansLoading) {
|
|
2236
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...
|
|
2776
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, style: { ...styles5.grid(columns), ...style }, children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: styles5.skeletonCard, children: [
|
|
2237
2777
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2238
2778
|
"div",
|
|
2239
2779
|
{
|
|
2240
2780
|
style: {
|
|
2241
|
-
...
|
|
2781
|
+
...styles5.skeletonLine,
|
|
2242
2782
|
width: "60%",
|
|
2243
2783
|
height: "20px"
|
|
2244
2784
|
}
|
|
@@ -2248,7 +2788,7 @@ function PricingTable({
|
|
|
2248
2788
|
"div",
|
|
2249
2789
|
{
|
|
2250
2790
|
style: {
|
|
2251
|
-
...
|
|
2791
|
+
...styles5.skeletonLine,
|
|
2252
2792
|
width: "80%",
|
|
2253
2793
|
height: "14px"
|
|
2254
2794
|
}
|
|
@@ -2258,7 +2798,7 @@ function PricingTable({
|
|
|
2258
2798
|
"div",
|
|
2259
2799
|
{
|
|
2260
2800
|
style: {
|
|
2261
|
-
...
|
|
2801
|
+
...styles5.skeletonLine,
|
|
2262
2802
|
width: "40%",
|
|
2263
2803
|
height: "36px",
|
|
2264
2804
|
marginTop: "8px"
|
|
@@ -2269,7 +2809,7 @@ function PricingTable({
|
|
|
2269
2809
|
"div",
|
|
2270
2810
|
{
|
|
2271
2811
|
style: {
|
|
2272
|
-
...
|
|
2812
|
+
...styles5.skeletonLine,
|
|
2273
2813
|
width: "90%",
|
|
2274
2814
|
height: "14px"
|
|
2275
2815
|
}
|
|
@@ -2280,7 +2820,7 @@ function PricingTable({
|
|
|
2280
2820
|
"div",
|
|
2281
2821
|
{
|
|
2282
2822
|
style: {
|
|
2283
|
-
...
|
|
2823
|
+
...styles5.skeletonLine,
|
|
2284
2824
|
width: "100%",
|
|
2285
2825
|
height: "44px",
|
|
2286
2826
|
marginTop: "16px"
|
|
@@ -2295,35 +2835,19 @@ function PricingTable({
|
|
|
2295
2835
|
"div",
|
|
2296
2836
|
{
|
|
2297
2837
|
className,
|
|
2298
|
-
style: { ...
|
|
2838
|
+
style: { ...styles5.grid(columns), ...style },
|
|
2299
2839
|
children: sortedPlans.map((plan) => {
|
|
2300
2840
|
const isCurrentPlan = subscription?.planId === plan.id && subscription.status === "ACTIVE";
|
|
2301
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
plan.
|
|
2310
|
-
|
|
2311
|
-
feature
|
|
2312
|
-
] }, i)) }),
|
|
2313
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2314
|
-
"button",
|
|
2315
|
-
{
|
|
2316
|
-
type: "button",
|
|
2317
|
-
onClick: () => handleSelect(plan),
|
|
2318
|
-
disabled: isCurrentPlan || checkoutPending,
|
|
2319
|
-
style: {
|
|
2320
|
-
...styles3.selectButton(isCurrentPlan),
|
|
2321
|
-
...checkoutPending && !isCurrentPlan ? { opacity: 0.6 } : {}
|
|
2322
|
-
},
|
|
2323
|
-
children: isCurrentPlan ? "Current Plan" : "Subscribe"
|
|
2324
|
-
}
|
|
2325
|
-
)
|
|
2326
|
-
] }, plan.id);
|
|
2841
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2842
|
+
PricingCard,
|
|
2843
|
+
{
|
|
2844
|
+
plan,
|
|
2845
|
+
isCurrentPlan,
|
|
2846
|
+
isCheckoutPending: checkoutPending,
|
|
2847
|
+
onSelect: handleSelect
|
|
2848
|
+
},
|
|
2849
|
+
plan.id
|
|
2850
|
+
);
|
|
2327
2851
|
})
|
|
2328
2852
|
}
|
|
2329
2853
|
),
|
|
@@ -2390,145 +2914,81 @@ function CheckoutButton({
|
|
|
2390
2914
|
},
|
|
2391
2915
|
disabled: isPending,
|
|
2392
2916
|
onClick: () => checkout({ planId, successUrl, cancelUrl }),
|
|
2393
|
-
children: isPending ? "Loading..." : children ?? "Subscribe"
|
|
2394
|
-
}
|
|
2395
|
-
);
|
|
2396
|
-
}
|
|
2397
|
-
CheckoutButton.displayName = "CheckoutButton";
|
|
2398
|
-
var PROVIDER_LABELS2 = {
|
|
2399
|
-
STRIPE: { en: "Credit/Debit Card", es: "Tarjeta de cr\xE9dito/d\xE9bito" },
|
|
2400
|
-
PAYPAL: { en: "PayPal", es: "PayPal" },
|
|
2401
|
-
PAYPHONE: { en: "Payphone", es: "Payphone" },
|
|
2402
|
-
NUVEI: { en: "Nuvei", es: "Nuvei" },
|
|
2403
|
-
MANUAL_TRANSFER: { en: "Bank Transfer", es: "Transferencia bancaria" }
|
|
2404
|
-
};
|
|
2405
|
-
var PROVIDER_ICONS2 = {
|
|
2406
|
-
STRIPE: "\u{1F4B3}",
|
|
2407
|
-
PAYPAL: "\u{1F17F}\uFE0F",
|
|
2408
|
-
PAYPHONE: "\u{1F4F1}",
|
|
2409
|
-
NUVEI: "\u{1F4B3}",
|
|
2410
|
-
MANUAL_TRANSFER: "\u{1F3E6}"
|
|
2411
|
-
};
|
|
2412
|
-
function formatAmount2(amount, currency) {
|
|
2413
|
-
try {
|
|
2414
|
-
return new Intl.NumberFormat(void 0, {
|
|
2415
|
-
style: "currency",
|
|
2416
|
-
currency,
|
|
2417
|
-
minimumFractionDigits: 0,
|
|
2418
|
-
maximumFractionDigits: 2
|
|
2419
|
-
}).format(amount / 100);
|
|
2420
|
-
} catch {
|
|
2421
|
-
return `${currency} ${(amount / 100).toFixed(2)}`;
|
|
2422
|
-
}
|
|
2423
|
-
}
|
|
2424
|
-
function PayButton({
|
|
2425
|
-
planId,
|
|
2426
|
-
intentId,
|
|
2427
|
-
successUrl,
|
|
2428
|
-
cancelUrl,
|
|
2429
|
-
className,
|
|
2430
|
-
style,
|
|
2431
|
-
children,
|
|
2432
|
-
disabled,
|
|
2433
|
-
onSuccess,
|
|
2434
|
-
onError,
|
|
2435
|
-
onProviderSelect
|
|
2436
|
-
}) {
|
|
2437
|
-
const messages = useMessages();
|
|
2438
|
-
const billing = messages?.billing;
|
|
2439
|
-
const [showProviderModal, setShowProviderModal] = react.useState(false);
|
|
2440
|
-
const [showTransferModal, setShowTransferModal] = react.useState(false);
|
|
2441
|
-
const [transferData, setTransferData] = react.useState(null);
|
|
2442
|
-
const [payphoneData, setPayphoneData] = react.useState(null);
|
|
2443
|
-
const { data: providers, isLoading: providersLoading } = usePaymentProviders();
|
|
2444
|
-
const { checkout, isPending } = useCheckout({
|
|
2445
|
-
redirectOnSuccess: true,
|
|
2446
|
-
onSuccess: (data) => {
|
|
2447
|
-
if (data.provider === "MANUAL_TRANSFER") {
|
|
2448
|
-
setTransferData(data);
|
|
2449
|
-
setShowTransferModal(true);
|
|
2450
|
-
setShowProviderModal(false);
|
|
2451
|
-
} else if (data.provider === "PAYPHONE" && data.widgetConfig) {
|
|
2452
|
-
setPayphoneData(data);
|
|
2453
|
-
setShowProviderModal(false);
|
|
2454
|
-
}
|
|
2455
|
-
onSuccess?.(data);
|
|
2456
|
-
},
|
|
2457
|
-
onError
|
|
2458
|
-
});
|
|
2459
|
-
const handleClick = () => {
|
|
2460
|
-
if (!providers || providers.length === 0) return;
|
|
2461
|
-
if (providers.length === 1) {
|
|
2462
|
-
doCheckout(providers[0].provider);
|
|
2463
|
-
} else {
|
|
2464
|
-
setShowProviderModal(true);
|
|
2465
|
-
}
|
|
2466
|
-
};
|
|
2467
|
-
const doCheckout = (provider) => {
|
|
2468
|
-
onProviderSelect?.(provider);
|
|
2469
|
-
checkout({
|
|
2470
|
-
planId,
|
|
2471
|
-
intentId,
|
|
2472
|
-
provider,
|
|
2473
|
-
successUrl,
|
|
2474
|
-
cancelUrl
|
|
2475
|
-
});
|
|
2476
|
-
};
|
|
2477
|
-
const isDisabled = disabled || isPending || providersLoading || !planId && !intentId;
|
|
2478
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2479
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2480
|
-
"button",
|
|
2481
|
-
{
|
|
2482
|
-
type: "button",
|
|
2483
|
-
className,
|
|
2484
|
-
style: {
|
|
2485
|
-
padding: "10px 24px",
|
|
2486
|
-
fontSize: "14px",
|
|
2487
|
-
fontWeight: 600,
|
|
2488
|
-
color: "#fff",
|
|
2489
|
-
backgroundColor: isDisabled ? "#9ca3af" : "#111827",
|
|
2490
|
-
border: "none",
|
|
2491
|
-
borderRadius: "8px",
|
|
2492
|
-
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
2493
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2494
|
-
...style
|
|
2495
|
-
},
|
|
2496
|
-
onClick: handleClick,
|
|
2497
|
-
disabled: isDisabled,
|
|
2498
|
-
children: isPending ? billing?.processing ?? "Processing..." : children ?? (billing?.pay ?? "Pay")
|
|
2499
|
-
}
|
|
2500
|
-
),
|
|
2501
|
-
showProviderModal && providers && providers.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2502
|
-
ProviderModal,
|
|
2503
|
-
{
|
|
2504
|
-
providers,
|
|
2505
|
-
isPending,
|
|
2506
|
-
onSelect: doCheckout,
|
|
2507
|
-
onClose: () => setShowProviderModal(false),
|
|
2508
|
-
labels: billing
|
|
2509
|
-
}
|
|
2510
|
-
),
|
|
2511
|
-
showTransferModal && transferData && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2512
|
-
TransferModal2,
|
|
2513
|
-
{
|
|
2514
|
-
data: transferData,
|
|
2515
|
-
onClose: () => {
|
|
2516
|
-
setShowTransferModal(false);
|
|
2517
|
-
setTransferData(null);
|
|
2518
|
-
},
|
|
2519
|
-
labels: billing
|
|
2520
|
-
}
|
|
2521
|
-
),
|
|
2522
|
-
payphoneData?.widgetConfig && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2523
|
-
PayphoneModal,
|
|
2524
|
-
{
|
|
2525
|
-
config: payphoneData.widgetConfig,
|
|
2526
|
-
successUrl,
|
|
2527
|
-
onClose: () => setPayphoneData(null)
|
|
2528
|
-
}
|
|
2529
|
-
)
|
|
2530
|
-
] });
|
|
2917
|
+
children: isPending ? "Loading..." : children ?? "Subscribe"
|
|
2918
|
+
}
|
|
2919
|
+
);
|
|
2531
2920
|
}
|
|
2921
|
+
CheckoutButton.displayName = "CheckoutButton";
|
|
2922
|
+
var PROVIDER_LABELS2 = {
|
|
2923
|
+
STRIPE: { en: "Credit/Debit Card", es: "Tarjeta de cr\xE9dito/d\xE9bito" },
|
|
2924
|
+
PAYPAL: { en: "PayPal", es: "PayPal" },
|
|
2925
|
+
PAYPHONE: { en: "Payphone", es: "Payphone" },
|
|
2926
|
+
NUVEI: { en: "Nuvei", es: "Nuvei" },
|
|
2927
|
+
MANUAL_TRANSFER: { en: "Bank Transfer", es: "Transferencia bancaria" }
|
|
2928
|
+
};
|
|
2929
|
+
var PROVIDER_ICONS2 = {
|
|
2930
|
+
STRIPE: "\u{1F4B3}",
|
|
2931
|
+
PAYPAL: "\u{1F17F}\uFE0F",
|
|
2932
|
+
PAYPHONE: "\u{1F4F1}",
|
|
2933
|
+
NUVEI: "\u{1F4B3}",
|
|
2934
|
+
MANUAL_TRANSFER: "\u{1F3E6}"
|
|
2935
|
+
};
|
|
2936
|
+
var modalStyles = {
|
|
2937
|
+
overlay: {
|
|
2938
|
+
position: "fixed",
|
|
2939
|
+
inset: 0,
|
|
2940
|
+
backgroundColor: "rgba(0,0,0,0.5)",
|
|
2941
|
+
display: "flex",
|
|
2942
|
+
alignItems: "center",
|
|
2943
|
+
justifyContent: "center",
|
|
2944
|
+
zIndex: 9999,
|
|
2945
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
2946
|
+
},
|
|
2947
|
+
card: {
|
|
2948
|
+
backgroundColor: "#fff",
|
|
2949
|
+
borderRadius: "12px",
|
|
2950
|
+
padding: "24px",
|
|
2951
|
+
maxWidth: "420px",
|
|
2952
|
+
width: "90%",
|
|
2953
|
+
boxShadow: "0 25px 50px -12px rgba(0,0,0,0.25)"
|
|
2954
|
+
},
|
|
2955
|
+
title: {
|
|
2956
|
+
fontSize: "18px",
|
|
2957
|
+
fontWeight: 700,
|
|
2958
|
+
color: "#111827",
|
|
2959
|
+
margin: "0 0 20px 0",
|
|
2960
|
+
textAlign: "center"
|
|
2961
|
+
},
|
|
2962
|
+
providerButton: {
|
|
2963
|
+
display: "flex",
|
|
2964
|
+
alignItems: "center",
|
|
2965
|
+
width: "100%",
|
|
2966
|
+
padding: "12px 16px",
|
|
2967
|
+
border: "1px solid #e5e7eb",
|
|
2968
|
+
borderRadius: "8px",
|
|
2969
|
+
backgroundColor: "#fff",
|
|
2970
|
+
cursor: "pointer",
|
|
2971
|
+
fontSize: "14px",
|
|
2972
|
+
fontWeight: 500,
|
|
2973
|
+
color: "#111827",
|
|
2974
|
+
transition: "background-color 0.15s",
|
|
2975
|
+
fontFamily: "inherit"
|
|
2976
|
+
},
|
|
2977
|
+
cancelButton: {
|
|
2978
|
+
display: "block",
|
|
2979
|
+
width: "100%",
|
|
2980
|
+
marginTop: "16px",
|
|
2981
|
+
padding: "10px",
|
|
2982
|
+
border: "none",
|
|
2983
|
+
borderRadius: "8px",
|
|
2984
|
+
backgroundColor: "#f3f4f6",
|
|
2985
|
+
color: "#6b7280",
|
|
2986
|
+
fontSize: "14px",
|
|
2987
|
+
fontWeight: 500,
|
|
2988
|
+
cursor: "pointer",
|
|
2989
|
+
fontFamily: "inherit"
|
|
2990
|
+
}
|
|
2991
|
+
};
|
|
2532
2992
|
function ProviderModal({
|
|
2533
2993
|
providers,
|
|
2534
2994
|
isPending,
|
|
@@ -2566,7 +3026,7 @@ function TransferModal2({
|
|
|
2566
3026
|
const bankDetails = data.bankDetails;
|
|
2567
3027
|
const plan = data.plan;
|
|
2568
3028
|
const intent = data.intent;
|
|
2569
|
-
const displayAmount = plan ?
|
|
3029
|
+
const displayAmount = plan ? formatAmount(plan.amount, plan.currency) : intent ? formatAmount(intent.amount, intent.currency) : "";
|
|
2570
3030
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: modalStyles.overlay, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: modalStyles.card, onClick: (e) => e.stopPropagation(), children: [
|
|
2571
3031
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { style: modalStyles.title, children: labels?.bankTransfer ?? "Bank Transfer" }),
|
|
2572
3032
|
displayAmount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2646,62 +3106,114 @@ function TransferModal2({
|
|
|
2646
3106
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", style: modalStyles.cancelButton, onClick: onClose, children: "Close" })
|
|
2647
3107
|
] }) });
|
|
2648
3108
|
}
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
3109
|
+
function PayButton({
|
|
3110
|
+
planId,
|
|
3111
|
+
intentId,
|
|
3112
|
+
successUrl,
|
|
3113
|
+
cancelUrl,
|
|
3114
|
+
className,
|
|
3115
|
+
style,
|
|
3116
|
+
children,
|
|
3117
|
+
disabled,
|
|
3118
|
+
onSuccess,
|
|
3119
|
+
onError,
|
|
3120
|
+
onProviderSelect
|
|
3121
|
+
}) {
|
|
3122
|
+
const messages = useMessages();
|
|
3123
|
+
const billing = messages?.billing;
|
|
3124
|
+
const [showProviderModal, setShowProviderModal] = react.useState(false);
|
|
3125
|
+
const [showTransferModal, setShowTransferModal] = react.useState(false);
|
|
3126
|
+
const [transferData, setTransferData] = react.useState(null);
|
|
3127
|
+
const [payphoneData, setPayphoneData] = react.useState(null);
|
|
3128
|
+
const { data: providers, isLoading: providersLoading } = usePaymentProviders();
|
|
3129
|
+
const { checkout, isPending } = useCheckout({
|
|
3130
|
+
redirectOnSuccess: true,
|
|
3131
|
+
onSuccess: (data) => {
|
|
3132
|
+
if (data.provider === "MANUAL_TRANSFER") {
|
|
3133
|
+
setTransferData(data);
|
|
3134
|
+
setShowTransferModal(true);
|
|
3135
|
+
setShowProviderModal(false);
|
|
3136
|
+
} else if (data.provider === "PAYPHONE" && data.widgetConfig) {
|
|
3137
|
+
setPayphoneData(data);
|
|
3138
|
+
setShowProviderModal(false);
|
|
3139
|
+
}
|
|
3140
|
+
onSuccess?.(data);
|
|
3141
|
+
},
|
|
3142
|
+
onError
|
|
3143
|
+
});
|
|
3144
|
+
const handleClick = () => {
|
|
3145
|
+
if (!providers || providers.length === 0) return;
|
|
3146
|
+
if (providers.length === 1) {
|
|
3147
|
+
doCheckout(providers[0].provider);
|
|
3148
|
+
} else {
|
|
3149
|
+
setShowProviderModal(true);
|
|
3150
|
+
}
|
|
3151
|
+
};
|
|
3152
|
+
const doCheckout = (provider) => {
|
|
3153
|
+
onProviderSelect?.(provider);
|
|
3154
|
+
checkout({
|
|
3155
|
+
planId,
|
|
3156
|
+
intentId,
|
|
3157
|
+
provider,
|
|
3158
|
+
successUrl,
|
|
3159
|
+
cancelUrl
|
|
3160
|
+
});
|
|
3161
|
+
};
|
|
3162
|
+
const isDisabled = disabled || isPending || providersLoading || !planId && !intentId;
|
|
3163
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3164
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3165
|
+
"button",
|
|
3166
|
+
{
|
|
3167
|
+
type: "button",
|
|
3168
|
+
className,
|
|
3169
|
+
style: {
|
|
3170
|
+
padding: "10px 24px",
|
|
3171
|
+
fontSize: "14px",
|
|
3172
|
+
fontWeight: 600,
|
|
3173
|
+
color: "#fff",
|
|
3174
|
+
backgroundColor: isDisabled ? "#9ca3af" : "#111827",
|
|
3175
|
+
border: "none",
|
|
3176
|
+
borderRadius: "8px",
|
|
3177
|
+
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
3178
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
3179
|
+
...style
|
|
3180
|
+
},
|
|
3181
|
+
onClick: handleClick,
|
|
3182
|
+
disabled: isDisabled,
|
|
3183
|
+
children: isPending ? billing?.processing ?? "Processing..." : children ?? (billing?.pay ?? "Pay")
|
|
3184
|
+
}
|
|
3185
|
+
),
|
|
3186
|
+
showProviderModal && providers && providers.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3187
|
+
ProviderModal,
|
|
3188
|
+
{
|
|
3189
|
+
providers,
|
|
3190
|
+
isPending,
|
|
3191
|
+
onSelect: doCheckout,
|
|
3192
|
+
onClose: () => setShowProviderModal(false),
|
|
3193
|
+
labels: billing
|
|
3194
|
+
}
|
|
3195
|
+
),
|
|
3196
|
+
showTransferModal && transferData && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3197
|
+
TransferModal2,
|
|
3198
|
+
{
|
|
3199
|
+
data: transferData,
|
|
3200
|
+
onClose: () => {
|
|
3201
|
+
setShowTransferModal(false);
|
|
3202
|
+
setTransferData(null);
|
|
3203
|
+
},
|
|
3204
|
+
labels: billing
|
|
3205
|
+
}
|
|
3206
|
+
),
|
|
3207
|
+
payphoneData?.widgetConfig && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3208
|
+
PayphoneModal,
|
|
3209
|
+
{
|
|
3210
|
+
config: payphoneData.widgetConfig,
|
|
3211
|
+
successUrl,
|
|
3212
|
+
onClose: () => setPayphoneData(null)
|
|
3213
|
+
}
|
|
3214
|
+
)
|
|
3215
|
+
] });
|
|
3216
|
+
}
|
|
2705
3217
|
function usePayphoneConfirm(options) {
|
|
2706
3218
|
const client = useAccessClient();
|
|
2707
3219
|
return reactQuery.useMutation({
|
|
@@ -2767,7 +3279,7 @@ var statusConfig = {
|
|
|
2767
3279
|
UNPAID: { bg: "#fee2e2", color: "#991b1b", label: "Unpaid" },
|
|
2768
3280
|
INCOMPLETE: { bg: "#f3f4f6", color: "#6b7280", label: "Incomplete" }
|
|
2769
3281
|
};
|
|
2770
|
-
var
|
|
3282
|
+
var styles6 = {
|
|
2771
3283
|
badge: {
|
|
2772
3284
|
display: "inline-flex",
|
|
2773
3285
|
alignItems: "center",
|
|
@@ -2796,7 +3308,7 @@ var styles4 = {
|
|
|
2796
3308
|
function SubscriptionBadge({ className, style }) {
|
|
2797
3309
|
const { data: subscription, isLoading } = useSubscription();
|
|
2798
3310
|
if (isLoading) {
|
|
2799
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className, style: { ...
|
|
3311
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className, style: { ...styles6.skeleton, ...style } });
|
|
2800
3312
|
}
|
|
2801
3313
|
if (!subscription) {
|
|
2802
3314
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2804,7 +3316,7 @@ function SubscriptionBadge({ className, style }) {
|
|
|
2804
3316
|
{
|
|
2805
3317
|
className,
|
|
2806
3318
|
style: {
|
|
2807
|
-
...
|
|
3319
|
+
...styles6.badge,
|
|
2808
3320
|
backgroundColor: "#f3f4f6",
|
|
2809
3321
|
color: "#6b7280",
|
|
2810
3322
|
...style
|
|
@@ -2819,13 +3331,13 @@ function SubscriptionBadge({ className, style }) {
|
|
|
2819
3331
|
{
|
|
2820
3332
|
className,
|
|
2821
3333
|
style: {
|
|
2822
|
-
...
|
|
3334
|
+
...styles6.badge,
|
|
2823
3335
|
backgroundColor: config.bg,
|
|
2824
3336
|
color: config.color,
|
|
2825
3337
|
...style
|
|
2826
3338
|
},
|
|
2827
3339
|
children: [
|
|
2828
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style:
|
|
3340
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: styles6.dot(config.color), "aria-hidden": "true" }),
|
|
2829
3341
|
subscription.plan.name,
|
|
2830
3342
|
" \xB7 ",
|
|
2831
3343
|
config.label
|
|
@@ -2859,19 +3371,7 @@ function formatDate2(dateStr) {
|
|
|
2859
3371
|
return dateStr;
|
|
2860
3372
|
}
|
|
2861
3373
|
}
|
|
2862
|
-
|
|
2863
|
-
try {
|
|
2864
|
-
return new Intl.NumberFormat(void 0, {
|
|
2865
|
-
style: "currency",
|
|
2866
|
-
currency,
|
|
2867
|
-
minimumFractionDigits: 0,
|
|
2868
|
-
maximumFractionDigits: 2
|
|
2869
|
-
}).format(amount / 100);
|
|
2870
|
-
} catch {
|
|
2871
|
-
return `${currency} ${(amount / 100).toFixed(2)}`;
|
|
2872
|
-
}
|
|
2873
|
-
}
|
|
2874
|
-
var styles5 = {
|
|
3374
|
+
var styles7 = {
|
|
2875
3375
|
container: {
|
|
2876
3376
|
border: "1px solid #e5e7eb",
|
|
2877
3377
|
borderRadius: "12px",
|
|
@@ -2940,41 +3440,41 @@ var styles5 = {
|
|
|
2940
3440
|
function InvoiceList({ className, style }) {
|
|
2941
3441
|
const { data: invoices, isLoading } = useInvoices();
|
|
2942
3442
|
if (isLoading) {
|
|
2943
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...
|
|
2944
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
3443
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...styles7.container, ...style }, children: [
|
|
3444
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles7.header, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...styles7.skeleton, width: "100px", height: "18px" } }) }),
|
|
2945
3445
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "24px" }, children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2946
3446
|
"div",
|
|
2947
3447
|
{
|
|
2948
|
-
style: { ...
|
|
3448
|
+
style: { ...styles7.skeleton, width: "100%", height: "16px", marginBottom: "16px" }
|
|
2949
3449
|
},
|
|
2950
3450
|
i
|
|
2951
3451
|
)) })
|
|
2952
3452
|
] });
|
|
2953
3453
|
}
|
|
2954
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...
|
|
2955
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2956
|
-
/* @__PURE__ */ jsxRuntime.jsxs("table", { style:
|
|
3454
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { ...styles7.container, ...style }, children: [
|
|
3455
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: styles7.header, children: /* @__PURE__ */ jsxRuntime.jsx("h3", { style: styles7.title, children: "Invoices" }) }),
|
|
3456
|
+
/* @__PURE__ */ jsxRuntime.jsxs("table", { style: styles7.table, children: [
|
|
2957
3457
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
2958
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { style:
|
|
2959
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { style:
|
|
2960
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { style:
|
|
2961
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { style:
|
|
3458
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: styles7.th, children: "Date" }),
|
|
3459
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: styles7.th, children: "Amount" }),
|
|
3460
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: styles7.th, children: "Status" }),
|
|
3461
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { style: styles7.th, children: "Invoice" })
|
|
2962
3462
|
] }) }),
|
|
2963
3463
|
/* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
|
|
2964
|
-
(!invoices || invoices.length === 0) && /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 4, style:
|
|
3464
|
+
(!invoices || invoices.length === 0) && /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 4, style: styles7.emptyRow, children: "No invoices yet." }) }),
|
|
2965
3465
|
invoices?.map((invoice) => {
|
|
2966
3466
|
const sc = statusColors2[invoice.status];
|
|
2967
3467
|
return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
2968
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { style:
|
|
2969
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { style:
|
|
2970
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { style:
|
|
2971
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { style:
|
|
3468
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: styles7.td, children: formatDate2(invoice.createdAt) }),
|
|
3469
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: styles7.td, children: formatAmount(invoice.amount, invoice.currency) }),
|
|
3470
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: styles7.td, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: styles7.badge(sc.bg, sc.color), children: invoice.status }) }),
|
|
3471
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { style: styles7.td, children: invoice.invoiceUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2972
3472
|
"a",
|
|
2973
3473
|
{
|
|
2974
3474
|
href: invoice.invoiceUrl,
|
|
2975
3475
|
target: "_blank",
|
|
2976
3476
|
rel: "noopener noreferrer",
|
|
2977
|
-
style:
|
|
3477
|
+
style: styles7.link,
|
|
2978
3478
|
children: "View"
|
|
2979
3479
|
}
|
|
2980
3480
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#d1d5db" }, children: "\u2014" }) })
|
|
@@ -3257,6 +3757,17 @@ function useSwitchTenant() {
|
|
|
3257
3757
|
};
|
|
3258
3758
|
return { switchTenant };
|
|
3259
3759
|
}
|
|
3760
|
+
function createMutationHook(config) {
|
|
3761
|
+
return function useGeneratedMutation(options) {
|
|
3762
|
+
const client = useAccessClient();
|
|
3763
|
+
return reactQuery.useMutation({
|
|
3764
|
+
mutationKey: config.mutationKey,
|
|
3765
|
+
mutationFn: (input) => config.mutationFn(client, input),
|
|
3766
|
+
onSuccess: options?.onSuccess,
|
|
3767
|
+
onError: options?.onError
|
|
3768
|
+
});
|
|
3769
|
+
};
|
|
3770
|
+
}
|
|
3260
3771
|
function zodToFieldErrors(zodError) {
|
|
3261
3772
|
return zodError.issues.map((issue) => ({
|
|
3262
3773
|
field: issue.path.join("."),
|
|
@@ -3313,11 +3824,13 @@ function usePasswordToggle() {
|
|
|
3313
3824
|
}
|
|
3314
3825
|
|
|
3315
3826
|
// src/index.ts
|
|
3316
|
-
var SDK_VERSION = "0.
|
|
3827
|
+
var SDK_VERSION = "0.9.0";
|
|
3317
3828
|
|
|
3829
|
+
exports.AuthForm = AuthForm;
|
|
3318
3830
|
exports.AziridProvider = AziridProvider;
|
|
3319
3831
|
exports.BASE_PATHS = BASE_PATHS;
|
|
3320
3832
|
exports.CheckoutButton = CheckoutButton;
|
|
3833
|
+
exports.ForgotPasswordForm = ForgotPasswordForm;
|
|
3321
3834
|
exports.InvoiceList = InvoiceList;
|
|
3322
3835
|
exports.LoginForm = LoginForm;
|
|
3323
3836
|
exports.PATHS = PATHS;
|
|
@@ -3326,6 +3839,7 @@ exports.PayphoneCallback = PayphoneCallback;
|
|
|
3326
3839
|
exports.PricingTable = PricingTable;
|
|
3327
3840
|
exports.ReferralCard = ReferralCard;
|
|
3328
3841
|
exports.ReferralStats = ReferralStats;
|
|
3842
|
+
exports.ResetPasswordForm = ResetPasswordForm;
|
|
3329
3843
|
exports.SDK_VERSION = SDK_VERSION;
|
|
3330
3844
|
exports.SignupForm = SignupForm;
|
|
3331
3845
|
exports.SubscriptionBadge = SubscriptionBadge;
|
|
@@ -3333,16 +3847,21 @@ exports.buildPaths = buildPaths;
|
|
|
3333
3847
|
exports.changePasswordSchema = changePasswordSchema;
|
|
3334
3848
|
exports.cn = cn;
|
|
3335
3849
|
exports.createAccessClient = createAccessClient;
|
|
3850
|
+
exports.createForgotPasswordSchema = createForgotPasswordSchema;
|
|
3336
3851
|
exports.createLoginSchema = createLoginSchema;
|
|
3852
|
+
exports.createMutationHook = createMutationHook;
|
|
3853
|
+
exports.createResetPasswordConfirmSchema = createResetPasswordConfirmSchema;
|
|
3337
3854
|
exports.createSignupSchema = createSignupSchema;
|
|
3338
3855
|
exports.en = en;
|
|
3339
3856
|
exports.es = es;
|
|
3857
|
+
exports.forgotPasswordSchema = forgotPasswordSchema;
|
|
3340
3858
|
exports.isAuthError = isAuthError;
|
|
3341
3859
|
exports.loginSchema = loginSchema;
|
|
3342
3860
|
exports.magicLinkRequestSchema = magicLinkRequestSchema;
|
|
3343
3861
|
exports.magicLinkVerifySchema = magicLinkVerifySchema;
|
|
3344
3862
|
exports.passkeyRegisterStartSchema = passkeyRegisterStartSchema;
|
|
3345
3863
|
exports.removeStyles = removeStyles;
|
|
3864
|
+
exports.resetPasswordConfirmSchema = resetPasswordConfirmSchema;
|
|
3346
3865
|
exports.resolveMessages = resolveMessages;
|
|
3347
3866
|
exports.signupSchema = signupSchema;
|
|
3348
3867
|
exports.socialLoginSchema = socialLoginSchema;
|
|
@@ -3359,6 +3878,7 @@ exports.useLogout = useLogout;
|
|
|
3359
3878
|
exports.useMagicLink = useMagicLink;
|
|
3360
3879
|
exports.useMessages = useMessages;
|
|
3361
3880
|
exports.usePasskeys = usePasskeys;
|
|
3881
|
+
exports.usePasswordReset = usePasswordReset;
|
|
3362
3882
|
exports.usePasswordToggle = usePasswordToggle;
|
|
3363
3883
|
exports.usePaymentProviders = usePaymentProviders;
|
|
3364
3884
|
exports.usePayphoneConfirm = usePayphoneConfirm;
|