@yackey-labs/yauth-ui-solidjs 0.12.5 → 0.14.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.js +447 -380
- package/package.json +3 -3
- package/src/components/consent-screen.tsx +56 -40
- package/src/components/oauth-consent-page.tsx +127 -0
- package/src/hooks/create-organizations.ts +3 -3
- package/src/index.ts +3 -0
- package/src/safe-redirect.ts +15 -0
package/dist/index.js
CHANGED
|
@@ -55,9 +55,9 @@ function O(e, t = {}) {
|
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/components/audit-destination-create.tsx
|
|
58
|
-
var k = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"),
|
|
59
|
-
function
|
|
60
|
-
let { create: t, submitting: n, error: r } = O(() => e.organizationId ?? null), [a, c] = v("webhook"), [l, u] = v(""), [d, f] = v(""), [m, h] = v("json"), [g, _] = v(""), [y, b] = v(""), [x, S] = v(6514), [C, w] = v("tcp"), [T, E] = v(13), [D,
|
|
58
|
+
var k = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), A = /* @__PURE__ */ u("<fieldset class=space-y-2><label class=block><span class=\"text-xs font-medium\">URL</span><input type=url required placeholder=https://hooks.example.com/yauth-audit class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">Format</span><select class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"><option value=json>JSON</option><option value=cef>CEF</option><option value=rfc5424>RFC 5424 syslog body</option></select></label><label class=block><span class=\"text-xs font-medium\">HMAC secret (optional)</span><input type=password placeholder=\"cryptographic random, 32 bytes recommended\"class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"><p class=\"mt-1 text-xs text-muted-foreground\">When set, each request carries <code class=font-mono>X-Yauth-Signature: t=<unix>,v1=<hex></code>. See <code>docs/audit-export/webhook.md</code> for the verifier helper (Node + Python)."), j = /* @__PURE__ */ u("<fieldset class=space-y-2><label class=block><span class=\"text-xs font-medium\">Host</span><input type=text required placeholder=siem.example.internal class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">Port</span><input type=number required min=1 max=65535 class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">Transport</span><select class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"><option value=tcp>TCP (RFC 6587 octet-counted)</option><option value=udp>UDP (unauthenticated, not recommended)</option><option value=tls>TCP + TLS (port 6514)</option></select></label><label class=block><span class=\"text-xs font-medium\">Facility (0–23)</span><input type=number required min=0 max=23 class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\">"), M = /* @__PURE__ */ u("<fieldset class=space-y-2><label class=block><span class=\"text-xs font-medium\">Bucket</span><input type=text required class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">Prefix</span><input type=text class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">Region</span><input type=text required class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">Partition</span><select class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"><option value=by_date>By date</option><option value=by_org>By org</option><option value=by_date_and_org>By date and org"), ee = /* @__PURE__ */ u("<fieldset class=space-y-2><label class=block><span class=\"text-xs font-medium\">HEC URL</span><input type=url required placeholder=https://splunk.example.com:8088 class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"></label><label class=block><span class=\"text-xs font-medium\">HEC token</span><input type=password required class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\">"), N = /* @__PURE__ */ u("<fieldset class=space-y-2><label class=block><span class=\"text-xs font-medium\">Site</span><select class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\"><option value=datadoghq.com>datadoghq.com (US1)</option><option value=us3.datadoghq.com>us3.datadoghq.com (US3)</option><option value=us5.datadoghq.com>us5.datadoghq.com (US5)</option><option value=datadoghq.eu>datadoghq.eu (EU)</option><option value=ap1.datadoghq.com>ap1.datadoghq.com (AP1)</option><option value=ddog-gov.com>ddog-gov.com (US1-FED)</option></select></label><label class=block><span class=\"text-xs font-medium\">API key</span><input type=password required class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm\">"), P = /* @__PURE__ */ u("<form class=\"space-y-3 rounded-md border border-border p-4\"><h3 class=\"text-base font-semibold\">Add destination</h3><label class=block><span class=\"text-xs font-medium\">Name</span><input type=text required class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring\"></label><label class=block><span class=\"text-xs font-medium\">Kind</span><select class=\"mt-1 block w-full rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring\"><option value=webhook>Webhook (HTTPS POST)</option><option value=syslog>Syslog (RFC 5424)</option><option value=s3>S3-compatible object storage</option><option value=splunk>Splunk HEC</option><option value=datadog>Datadog logs</option></select></label><button type=submit class=\"inline-flex h-9 cursor-pointer items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-50\">Add destination");
|
|
59
|
+
function F(e) {
|
|
60
|
+
let { create: t, submitting: n, error: r } = O(() => e.organizationId ?? null), [a, c] = v("webhook"), [l, u] = v(""), [d, f] = v(""), [m, h] = v("json"), [g, _] = v(""), [y, b] = v(""), [x, S] = v(6514), [C, w] = v("tcp"), [T, E] = v(13), [D, F] = v(""), [I, L] = v("audit"), [R, z] = v("us-east-1"), [B, V] = v("by_date"), [H, U] = v(""), [W, G] = v(""), [K, q] = v("datadoghq.com"), [J, Y] = v(""), X = async (n) => {
|
|
61
61
|
n.preventDefault();
|
|
62
62
|
let r;
|
|
63
63
|
switch (a()) {
|
|
@@ -82,23 +82,23 @@ function P(e) {
|
|
|
82
82
|
r = {
|
|
83
83
|
type: "s3",
|
|
84
84
|
bucket: D().trim(),
|
|
85
|
-
prefix:
|
|
86
|
-
region:
|
|
87
|
-
partition:
|
|
85
|
+
prefix: I().trim(),
|
|
86
|
+
region: R().trim(),
|
|
87
|
+
partition: B()
|
|
88
88
|
};
|
|
89
89
|
break;
|
|
90
90
|
case "splunk":
|
|
91
91
|
r = {
|
|
92
92
|
type: "splunk",
|
|
93
|
-
hec_url:
|
|
94
|
-
hec_token:
|
|
93
|
+
hec_url: H().trim(),
|
|
94
|
+
hec_token: W().trim()
|
|
95
95
|
};
|
|
96
96
|
break;
|
|
97
97
|
case "datadog":
|
|
98
98
|
r = {
|
|
99
99
|
type: "datadog",
|
|
100
|
-
site:
|
|
101
|
-
api_key:
|
|
100
|
+
site: K().trim(),
|
|
101
|
+
api_key: J().trim()
|
|
102
102
|
};
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
@@ -106,11 +106,11 @@ function P(e) {
|
|
|
106
106
|
name: l().trim(),
|
|
107
107
|
organization_id: e.organizationId ?? null,
|
|
108
108
|
kind: r
|
|
109
|
-
}) && (e.onCreated?.(), u(""), f(""), _(""), b(""),
|
|
109
|
+
}) && (e.onCreated?.(), u(""), f(""), _(""), b(""), F(""), U(""), G(""), Y(""));
|
|
110
110
|
};
|
|
111
111
|
return (() => {
|
|
112
|
-
var e =
|
|
113
|
-
return e.addEventListener("submit",
|
|
112
|
+
var e = P(), t = e.firstChild.nextSibling, v = t.firstChild.nextSibling, O = t.nextSibling, Z = O.firstChild.nextSibling, Q = O.nextSibling;
|
|
113
|
+
return e.addEventListener("submit", X), s(e, i(p, {
|
|
114
114
|
get when() {
|
|
115
115
|
return r();
|
|
116
116
|
},
|
|
@@ -118,54 +118,54 @@ function P(e) {
|
|
|
118
118
|
var e = k();
|
|
119
119
|
return s(e, r), e;
|
|
120
120
|
}
|
|
121
|
-
}), t), v.$$input = (e) => u(e.currentTarget.value),
|
|
121
|
+
}), t), v.$$input = (e) => u(e.currentTarget.value), Z.addEventListener("change", (e) => c(e.currentTarget.value)), s(e, i(p, {
|
|
122
122
|
get when() {
|
|
123
123
|
return a() === "webhook";
|
|
124
124
|
},
|
|
125
125
|
get children() {
|
|
126
|
-
var e =
|
|
126
|
+
var e = A(), t = e.firstChild, n = t.firstChild.nextSibling, r = t.nextSibling, i = r.firstChild.nextSibling, a = r.nextSibling.firstChild.nextSibling;
|
|
127
127
|
return n.$$input = (e) => f(e.currentTarget.value), i.addEventListener("change", (e) => h(e.currentTarget.value)), a.$$input = (e) => _(e.currentTarget.value), o(() => n.value = d()), o(() => i.value = m()), o(() => a.value = g()), e;
|
|
128
128
|
}
|
|
129
|
-
}),
|
|
129
|
+
}), Q), s(e, i(p, {
|
|
130
130
|
get when() {
|
|
131
131
|
return a() === "syslog";
|
|
132
132
|
},
|
|
133
133
|
get children() {
|
|
134
|
-
var e =
|
|
134
|
+
var e = j(), t = e.firstChild, n = t.firstChild.nextSibling, r = t.nextSibling, i = r.firstChild.nextSibling, a = r.nextSibling, s = a.firstChild.nextSibling, c = a.nextSibling.firstChild.nextSibling;
|
|
135
135
|
return n.$$input = (e) => b(e.currentTarget.value), i.$$input = (e) => S(Number(e.currentTarget.value) || 0), s.addEventListener("change", (e) => w(e.currentTarget.value)), c.$$input = (e) => E(Number(e.currentTarget.value) || 0), o(() => n.value = y()), o(() => i.value = x()), o(() => s.value = C()), o(() => c.value = T()), e;
|
|
136
136
|
}
|
|
137
|
-
}),
|
|
137
|
+
}), Q), s(e, i(p, {
|
|
138
138
|
get when() {
|
|
139
139
|
return a() === "s3";
|
|
140
140
|
},
|
|
141
141
|
get children() {
|
|
142
|
-
var e =
|
|
143
|
-
return n.$$input = (e) =>
|
|
142
|
+
var e = M(), t = e.firstChild, n = t.firstChild.nextSibling, r = t.nextSibling, i = r.firstChild.nextSibling, a = r.nextSibling, s = a.firstChild.nextSibling, c = a.nextSibling.firstChild.nextSibling;
|
|
143
|
+
return n.$$input = (e) => F(e.currentTarget.value), i.$$input = (e) => L(e.currentTarget.value), s.$$input = (e) => z(e.currentTarget.value), c.addEventListener("change", (e) => V(e.currentTarget.value)), o(() => n.value = D()), o(() => i.value = I()), o(() => s.value = R()), o(() => c.value = B()), e;
|
|
144
144
|
}
|
|
145
|
-
}),
|
|
145
|
+
}), Q), s(e, i(p, {
|
|
146
146
|
get when() {
|
|
147
147
|
return a() === "splunk";
|
|
148
148
|
},
|
|
149
149
|
get children() {
|
|
150
|
-
var e =
|
|
151
|
-
return n.$$input = (e) =>
|
|
150
|
+
var e = ee(), t = e.firstChild, n = t.firstChild.nextSibling, r = t.nextSibling.firstChild.nextSibling;
|
|
151
|
+
return n.$$input = (e) => U(e.currentTarget.value), r.$$input = (e) => G(e.currentTarget.value), o(() => n.value = H()), o(() => r.value = W()), e;
|
|
152
152
|
}
|
|
153
|
-
}),
|
|
153
|
+
}), Q), s(e, i(p, {
|
|
154
154
|
get when() {
|
|
155
155
|
return a() === "datadog";
|
|
156
156
|
},
|
|
157
157
|
get children() {
|
|
158
|
-
var e =
|
|
159
|
-
return n.addEventListener("change", (e) =>
|
|
158
|
+
var e = N(), t = e.firstChild, n = t.firstChild.nextSibling, r = t.nextSibling.firstChild.nextSibling;
|
|
159
|
+
return n.addEventListener("change", (e) => q(e.currentTarget.value)), r.$$input = (e) => Y(e.currentTarget.value), o(() => n.value = K()), o(() => r.value = J()), e;
|
|
160
160
|
}
|
|
161
|
-
}),
|
|
161
|
+
}), Q), o(() => Q.disabled = n()), o(() => v.value = l()), o(() => Z.value = a()), e;
|
|
162
162
|
})();
|
|
163
163
|
}
|
|
164
164
|
a(["input"]);
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/components/audit-destination-list.tsx
|
|
167
|
-
var
|
|
168
|
-
function
|
|
167
|
+
var I = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), L = /* @__PURE__ */ u("<p class=\"text-sm text-muted-foreground\">Loading…"), R = /* @__PURE__ */ u("<ul class=\"divide-y divide-border\">"), z = /* @__PURE__ */ u("<section class=space-y-4><header class=\"flex items-center justify-between\"><h2 class=\"text-lg font-semibold\"></h2><button type=button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50\">Refresh"), B = /* @__PURE__ */ u("<p class=\"text-sm text-muted-foreground\">No destinations configured. Use the “Add destination” form below."), V = /* @__PURE__ */ u("<button type=button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-xs font-medium shadow-sm hover:bg-accent disabled:pointer-events-none disabled:opacity-50\">Disable"), H = /* @__PURE__ */ u("<li class=\"flex items-start justify-between gap-3 py-3\"><div class=\"min-w-0 flex-1 space-y-1\"><div class=\"flex flex-wrap items-center gap-2\"><span class=font-medium></span><span class=\"rounded-full bg-muted px-2 py-0.5 text-xs uppercase text-muted-foreground\"></span><span></span></div><pre class=\"overflow-x-auto rounded-md bg-muted/50 p-2 text-xs leading-snug\"></pre><p class=\"text-xs text-muted-foreground\">Last success: <!> · Last failure: </p></div><div class=\"flex flex-col gap-2\"><button type=button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-destructive bg-transparent px-3 text-xs font-medium text-destructive shadow-sm hover:bg-destructive/10 disabled:pointer-events-none disabled:opacity-50\">Delete");
|
|
168
|
+
function U(e) {
|
|
169
169
|
if (!e) return "—";
|
|
170
170
|
try {
|
|
171
171
|
return new Date(e).toLocaleString();
|
|
@@ -173,16 +173,16 @@ function H(e) {
|
|
|
173
173
|
return e;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function W(e) {
|
|
177
177
|
let t = g(() => e.organizationId ?? null), { destinations: r, loading: a, error: l, disable: u, remove: d, submitting: m, refresh: h } = O(() => t());
|
|
178
178
|
return (() => {
|
|
179
|
-
var t =
|
|
179
|
+
var t = z(), g = t.firstChild.firstChild, _ = g.nextSibling;
|
|
180
180
|
return s(g, () => e.organizationId ? "Per-org SIEM destinations" : "Deployment-wide SIEM destinations"), _.$$click = () => void h(), s(t, i(p, {
|
|
181
181
|
get when() {
|
|
182
182
|
return l();
|
|
183
183
|
},
|
|
184
184
|
get children() {
|
|
185
|
-
var e =
|
|
185
|
+
var e = I();
|
|
186
186
|
return s(e, l), e;
|
|
187
187
|
}
|
|
188
188
|
}), null), s(t, i(p, {
|
|
@@ -190,7 +190,7 @@ function U(e) {
|
|
|
190
190
|
return a();
|
|
191
191
|
},
|
|
192
192
|
get children() {
|
|
193
|
-
return
|
|
193
|
+
return L();
|
|
194
194
|
}
|
|
195
195
|
}), null), s(t, i(p, {
|
|
196
196
|
get when() {
|
|
@@ -202,26 +202,26 @@ function U(e) {
|
|
|
202
202
|
return !a();
|
|
203
203
|
},
|
|
204
204
|
get children() {
|
|
205
|
-
return
|
|
205
|
+
return B();
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
},
|
|
209
209
|
get children() {
|
|
210
|
-
var e =
|
|
210
|
+
var e = R();
|
|
211
211
|
return s(e, i(f, {
|
|
212
212
|
get each() {
|
|
213
213
|
return r();
|
|
214
214
|
},
|
|
215
215
|
children: (e) => (() => {
|
|
216
|
-
var t =
|
|
216
|
+
var t = H(), r = t.firstChild, a = r.firstChild, c = a.firstChild, l = c.nextSibling, f = l.nextSibling, h = a.nextSibling, g = h.nextSibling, _ = g.firstChild.nextSibling;
|
|
217
217
|
_.nextSibling;
|
|
218
218
|
var v = r.nextSibling, y = v.firstChild;
|
|
219
|
-
return s(c, () => e.name), s(l, () => e.kind_tag), s(f, () => e.status), s(h, () => JSON.stringify(e.kind, null, 2)), s(g, () =>
|
|
219
|
+
return s(c, () => e.name), s(l, () => e.kind_tag), s(f, () => e.status), s(h, () => JSON.stringify(e.kind, null, 2)), s(g, () => U(e.last_success_at), _), s(g, () => U(e.last_failure_at), null), s(v, i(p, {
|
|
220
220
|
get when() {
|
|
221
221
|
return e.status === "active";
|
|
222
222
|
},
|
|
223
223
|
get children() {
|
|
224
|
-
var t =
|
|
224
|
+
var t = V();
|
|
225
225
|
return t.$$click = () => void u(e.id), o(() => t.disabled = m()), t;
|
|
226
226
|
}
|
|
227
227
|
}), y), y.$$click = () => void d(e.id), o((t) => {
|
|
@@ -244,7 +244,7 @@ function U(e) {
|
|
|
244
244
|
a(["click"]);
|
|
245
245
|
//#endregion
|
|
246
246
|
//#region src/provider.tsx
|
|
247
|
-
var
|
|
247
|
+
var G = m(), K = (e) => {
|
|
248
248
|
if (!e.client && !e.baseUrl) throw Error("YAuthProvider requires either a `client` or `baseUrl` prop");
|
|
249
249
|
let [t, n] = v(e.client ?? null);
|
|
250
250
|
if (!e.client && e.baseUrl) {
|
|
@@ -278,7 +278,7 @@ var W = m(), G = (e) => {
|
|
|
278
278
|
return t();
|
|
279
279
|
},
|
|
280
280
|
fallback: null,
|
|
281
|
-
children: (t) => i(
|
|
281
|
+
children: (t) => i(G.Provider, {
|
|
282
282
|
get value() {
|
|
283
283
|
return {
|
|
284
284
|
client: t(),
|
|
@@ -293,15 +293,15 @@ var W = m(), G = (e) => {
|
|
|
293
293
|
})
|
|
294
294
|
});
|
|
295
295
|
};
|
|
296
|
-
function
|
|
297
|
-
let e = b(
|
|
296
|
+
function q() {
|
|
297
|
+
let e = b(G);
|
|
298
298
|
if (!e) throw Error("useYAuth must be used within a <YAuthProvider>");
|
|
299
299
|
return e;
|
|
300
300
|
}
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/components/change-password-form.tsx
|
|
303
|
-
var
|
|
304
|
-
let { client: n } =
|
|
303
|
+
var J = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), Y = /* @__PURE__ */ u("<div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">Password changed successfully."), X = /* @__PURE__ */ u("<form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-current-password>Current password</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-current-password name=current_password type=password required autocomplete=current-password></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-new-password>New password</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-new-password name=new_password type=password required autocomplete=new-password></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-confirm-password>Confirm new password</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-confirm-password name=confirm_password type=password required autocomplete=new-password></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Z = (t) => {
|
|
304
|
+
let { client: n } = q(), r = n?.emailPassword;
|
|
305
305
|
if (!r) return null;
|
|
306
306
|
let [a, c] = v(""), [l, u] = v(""), [d, f] = v(""), [p, m] = v(null), [h, g] = v(!1), [_, y] = v(!1), b = async (e) => {
|
|
307
307
|
e.preventDefault(), m(null), g(!1);
|
|
@@ -324,13 +324,13 @@ var q = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 t
|
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
326
|
return (() => {
|
|
327
|
-
var t =
|
|
327
|
+
var t = X(), n = t.firstChild, r = n.firstChild.nextSibling, m = n.nextSibling, g = m.firstChild.nextSibling, v = m.nextSibling, y = v.firstChild.nextSibling, x = v.nextSibling;
|
|
328
328
|
return t.addEventListener("submit", b), s(t, i(e, {
|
|
329
329
|
get when() {
|
|
330
330
|
return p();
|
|
331
331
|
},
|
|
332
332
|
get children() {
|
|
333
|
-
var e =
|
|
333
|
+
var e = J();
|
|
334
334
|
return s(e, p), e;
|
|
335
335
|
}
|
|
336
336
|
}), n), s(t, i(e, {
|
|
@@ -338,7 +338,7 @@ var q = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 t
|
|
|
338
338
|
return h();
|
|
339
339
|
},
|
|
340
340
|
get children() {
|
|
341
|
-
return
|
|
341
|
+
return Y();
|
|
342
342
|
}
|
|
343
343
|
}), n), r.$$input = (e) => c(e.currentTarget.value), g.$$input = (e) => u(e.currentTarget.value), y.$$input = (e) => f(e.currentTarget.value), s(x, () => _() ? "Changing password..." : "Change password"), o((e) => {
|
|
344
344
|
var t = _(), n = _(), i = _(), a = _();
|
|
@@ -353,49 +353,47 @@ var q = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 t
|
|
|
353
353
|
};
|
|
354
354
|
a(["input"]);
|
|
355
355
|
//#endregion
|
|
356
|
+
//#region src/safe-redirect.ts
|
|
357
|
+
function Q(e) {
|
|
358
|
+
try {
|
|
359
|
+
let t = new URL(e, window.location.origin).protocol;
|
|
360
|
+
return t === "https:" || t === "http:";
|
|
361
|
+
} catch {
|
|
362
|
+
return !1;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
356
366
|
//#region src/components/consent-screen.tsx
|
|
357
|
-
var
|
|
367
|
+
var te = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), ne = /* @__PURE__ */ u("<div class=\"rounded-md border p-4 space-y-3\"><p class=\"text-sm font-medium\">This application is requesting the following permissions:</p><ul class=space-y-2>"), re = /* @__PURE__ */ u("<div class=\"mx-auto max-w-md space-y-6 p-6\"><div class=\"space-y-2 text-center\"><h2 class=\"text-2xl font-semibold tracking-tight\">Authorize </h2><p class=\"text-sm text-muted-foreground\"><strong></strong> is requesting access to your account.</p></div><div class=\"flex gap-3\"><button class=\"inline-flex h-9 flex-1 cursor-pointer items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>Deny</button><button class=\"inline-flex h-9 flex-1 cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button></button></div><p class=\"text-center text-xs text-muted-foreground\">By authorizing, you allow this application to access your account with the permissions listed above."), ie = /* @__PURE__ */ u("<code class=\"ml-1 text-xs text-muted-foreground\">"), ae = /* @__PURE__ */ u("<li class=\"flex items-start gap-2 text-sm\"><svg class=\"mt-0.5 h-4 w-4 shrink-0 text-primary\"fill=none stroke=currentColor viewBox=\"0 0 24 24\"aria-label=Checkmark role=img><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"></path></svg><span>"), oe = (t) => {
|
|
358
368
|
let [n, r] = v(!1), [a, l] = v(null), u = async (e) => {
|
|
359
369
|
l(null), r(!0);
|
|
360
370
|
try {
|
|
361
|
-
let n = t.authBaseUrl ?? "/api/auth", r = await fetch(`${n}/
|
|
371
|
+
let n = t.authBaseUrl ?? "/api/auth", r = await fetch(`${n}/oauth2/consent`, {
|
|
362
372
|
method: "POST",
|
|
363
373
|
headers: { "Content-Type": "application/json" },
|
|
364
374
|
credentials: "include",
|
|
365
375
|
body: JSON.stringify({
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
response_type: t.responseType,
|
|
369
|
-
code_challenge: t.codeChallenge,
|
|
370
|
-
code_challenge_method: t.codeChallengeMethod,
|
|
371
|
-
scope: t.scopes?.join(" "),
|
|
372
|
-
state: t.state,
|
|
376
|
+
request_id: t.requestId,
|
|
377
|
+
csrf_token: t.csrfToken,
|
|
373
378
|
approved: e
|
|
374
379
|
})
|
|
375
|
-
});
|
|
376
|
-
if (r.
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
if (!r.ok) {
|
|
381
|
-
let e = await r.json().catch(() => null);
|
|
382
|
-
throw Error(e?.error_description ?? e?.error ?? "Authorization failed");
|
|
383
|
-
}
|
|
384
|
-
let i = r.headers.get("Location");
|
|
385
|
-
if (i) {
|
|
386
|
-
window.location.href = i;
|
|
380
|
+
}), i = await r.json().catch(() => null);
|
|
381
|
+
if (!r.ok) throw Error(i?.error_description ?? i?.error ?? "Authorization failed");
|
|
382
|
+
if (i?.redirect_url) {
|
|
383
|
+
if (!Q(i.redirect_url)) throw Error("Blocked unsafe redirect target");
|
|
384
|
+
window.location.href = i.redirect_url;
|
|
387
385
|
return;
|
|
388
386
|
}
|
|
389
|
-
t.
|
|
387
|
+
t.onResult?.(e);
|
|
390
388
|
} catch (e) {
|
|
391
389
|
let n = e instanceof Error ? e : Error(String(e));
|
|
392
390
|
l(n.message), t.onError?.(n);
|
|
393
391
|
} finally {
|
|
394
392
|
r(!1);
|
|
395
393
|
}
|
|
396
|
-
}, d = () => t.clientName ?? t.clientId;
|
|
394
|
+
}, d = () => t.clientName ?? t.clientId ?? "An application";
|
|
397
395
|
return (() => {
|
|
398
|
-
var r =
|
|
396
|
+
var r = re(), l = r.firstChild, p = l.firstChild;
|
|
399
397
|
p.firstChild;
|
|
400
398
|
var m = p.nextSibling.firstChild, h = l.nextSibling, g = h.firstChild, _ = g.nextSibling;
|
|
401
399
|
return s(p, d, null), s(m, d), s(r, i(e, {
|
|
@@ -403,7 +401,7 @@ var X = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 t
|
|
|
403
401
|
return a();
|
|
404
402
|
},
|
|
405
403
|
get children() {
|
|
406
|
-
var e =
|
|
404
|
+
var e = te();
|
|
407
405
|
return s(e, a), e;
|
|
408
406
|
}
|
|
409
407
|
}), h), s(r, i(e, {
|
|
@@ -411,16 +409,24 @@ var X = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 t
|
|
|
411
409
|
return c(() => !!t.scopes)() && t.scopes.length > 0;
|
|
412
410
|
},
|
|
413
411
|
get children() {
|
|
414
|
-
var
|
|
415
|
-
return s(
|
|
412
|
+
var n = ne(), r = n.firstChild.nextSibling;
|
|
413
|
+
return s(r, i(f, {
|
|
416
414
|
get each() {
|
|
417
415
|
return t.scopes;
|
|
418
416
|
},
|
|
419
|
-
children: (
|
|
420
|
-
var
|
|
421
|
-
return s(n,
|
|
417
|
+
children: (n) => (() => {
|
|
418
|
+
var r = ae(), a = r.firstChild.nextSibling;
|
|
419
|
+
return s(a, () => t.scopeDescriptions?.[n] ?? n, null), s(a, i(e, {
|
|
420
|
+
get when() {
|
|
421
|
+
return t.scopeDescriptions?.[n];
|
|
422
|
+
},
|
|
423
|
+
get children() {
|
|
424
|
+
var e = ie();
|
|
425
|
+
return s(e, n), e;
|
|
426
|
+
}
|
|
427
|
+
}), null), r;
|
|
422
428
|
})()
|
|
423
|
-
})),
|
|
429
|
+
})), n;
|
|
424
430
|
}
|
|
425
431
|
}), h), g.$$click = () => u(!1), _.$$click = () => u(!0), s(_, () => n() ? "Authorizing..." : "Authorize"), o((e) => {
|
|
426
432
|
var t = n(), r = n();
|
|
@@ -433,19 +439,80 @@ var X = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 t
|
|
|
433
439
|
};
|
|
434
440
|
a(["click"]);
|
|
435
441
|
//#endregion
|
|
442
|
+
//#region src/components/oauth-consent-page.tsx
|
|
443
|
+
var se = /* @__PURE__ */ u("<div class=\"mx-auto max-w-md p-6 text-sm text-destructive\">"), ce = (e) => e.client?.id ?? e.client_id, le = (e) => e.client?.name ?? e.client_name, ue = (e) => Array.isArray(e.scopes) ? e.scopes : typeof e.scope == "string" && e.scope.length > 0 ? e.scope.split(/\s+/) : [], de = (e) => {
|
|
444
|
+
let t = () => e.authBaseUrl ?? "/api/auth", [n] = _(async () => {
|
|
445
|
+
let n = window.location.pathname + window.location.search, r = await fetch(`${t()}/oauth/authorize${window.location.search}`, {
|
|
446
|
+
method: "GET",
|
|
447
|
+
credentials: "include",
|
|
448
|
+
headers: { Accept: "application/json" }
|
|
449
|
+
});
|
|
450
|
+
if (r.status === 401) {
|
|
451
|
+
let t = e.loginPath ?? "/login";
|
|
452
|
+
return window.location.href = `${t}?redirect_to=${encodeURIComponent(n)}`, null;
|
|
453
|
+
}
|
|
454
|
+
let i = await r.json().catch(() => null);
|
|
455
|
+
if (!r.ok) throw Error(i?.error_description ?? i?.error ?? "Failed to start authorization");
|
|
456
|
+
if (i?.redirect_url) {
|
|
457
|
+
if (!Q(i.redirect_url)) throw Error("Blocked unsafe redirect target");
|
|
458
|
+
return window.location.href = i.redirect_url, null;
|
|
459
|
+
}
|
|
460
|
+
return i;
|
|
461
|
+
});
|
|
462
|
+
return i(p, {
|
|
463
|
+
get when() {
|
|
464
|
+
return n();
|
|
465
|
+
},
|
|
466
|
+
get fallback() {
|
|
467
|
+
return i(p, {
|
|
468
|
+
get when() {
|
|
469
|
+
return n.error;
|
|
470
|
+
},
|
|
471
|
+
get children() {
|
|
472
|
+
var e = se();
|
|
473
|
+
return s(e, () => n.error?.message ?? "Authorization error"), e;
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
},
|
|
477
|
+
children: (n) => i(oe, {
|
|
478
|
+
get authBaseUrl() {
|
|
479
|
+
return t();
|
|
480
|
+
},
|
|
481
|
+
get clientId() {
|
|
482
|
+
return ce(n());
|
|
483
|
+
},
|
|
484
|
+
get clientName() {
|
|
485
|
+
return le(n());
|
|
486
|
+
},
|
|
487
|
+
get scopes() {
|
|
488
|
+
return ue(n());
|
|
489
|
+
},
|
|
490
|
+
get scopeDescriptions() {
|
|
491
|
+
return e.scopeDescriptions;
|
|
492
|
+
},
|
|
493
|
+
get requestId() {
|
|
494
|
+
return n().request_id;
|
|
495
|
+
},
|
|
496
|
+
get csrfToken() {
|
|
497
|
+
return n().csrf_token;
|
|
498
|
+
}
|
|
499
|
+
})
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
//#endregion
|
|
436
503
|
//#region src/hooks/create-organizations.ts
|
|
437
|
-
function
|
|
504
|
+
function fe(e) {
|
|
438
505
|
return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 64);
|
|
439
506
|
}
|
|
440
|
-
function
|
|
441
|
-
let { client: e } =
|
|
507
|
+
function pe() {
|
|
508
|
+
let { client: e } = q(), [t, n] = v([]), [r, i] = v(!1), [a, o] = v(null), s = async () => {
|
|
442
509
|
if (!e?.organizations) {
|
|
443
510
|
o("Organizations feature is not enabled on this server.");
|
|
444
511
|
return;
|
|
445
512
|
}
|
|
446
513
|
i(!0), o(null);
|
|
447
514
|
try {
|
|
448
|
-
n(await e.organizations.list());
|
|
515
|
+
n((await e.organizations.list()).organizations);
|
|
449
516
|
} catch (e) {
|
|
450
517
|
o(e instanceof Error ? e.message : String(e));
|
|
451
518
|
} finally {
|
|
@@ -478,8 +545,8 @@ function Q() {
|
|
|
478
545
|
}
|
|
479
546
|
};
|
|
480
547
|
}
|
|
481
|
-
function
|
|
482
|
-
let { client: t } =
|
|
548
|
+
function me(e) {
|
|
549
|
+
let { client: t } = q(), [n, r] = v(null), [i, a] = v(!1), [o, s] = v(null), c = async () => {
|
|
483
550
|
let n = e();
|
|
484
551
|
if (!n) {
|
|
485
552
|
r(null);
|
|
@@ -516,8 +583,8 @@ function se(e) {
|
|
|
516
583
|
}
|
|
517
584
|
};
|
|
518
585
|
}
|
|
519
|
-
function
|
|
520
|
-
let { client: t } =
|
|
586
|
+
function he(e) {
|
|
587
|
+
let { client: t } = q(), [n, r] = v([]), [i, a] = v(!1), [o, s] = v(null), c = async () => {
|
|
521
588
|
let n = e();
|
|
522
589
|
if (!n) {
|
|
523
590
|
r([]);
|
|
@@ -529,7 +596,7 @@ function ce(e) {
|
|
|
529
596
|
}
|
|
530
597
|
a(!0), s(null);
|
|
531
598
|
try {
|
|
532
|
-
r(await t.organizations.listMembers(n));
|
|
599
|
+
r((await t.organizations.listMembers(n)).members);
|
|
533
600
|
} catch (e) {
|
|
534
601
|
s(e instanceof Error ? e.message : String(e));
|
|
535
602
|
} finally {
|
|
@@ -553,8 +620,8 @@ function ce(e) {
|
|
|
553
620
|
}
|
|
554
621
|
};
|
|
555
622
|
}
|
|
556
|
-
function
|
|
557
|
-
let { client: e } =
|
|
623
|
+
function ge() {
|
|
624
|
+
let { client: e } = q(), [t, n] = v(!1), [r, i] = v(null);
|
|
558
625
|
return {
|
|
559
626
|
submitting: t,
|
|
560
627
|
error: r,
|
|
@@ -579,8 +646,8 @@ var $ = {
|
|
|
579
646
|
MEMBER: "member",
|
|
580
647
|
VIEWER: "viewer"
|
|
581
648
|
};
|
|
582
|
-
function
|
|
583
|
-
let { client: t } =
|
|
649
|
+
function _e(e) {
|
|
650
|
+
let { client: t } = q(), [n, r] = v(null), [i, a] = v(!1), [o, s] = v(null), c = async () => {
|
|
584
651
|
let n = e();
|
|
585
652
|
if (!n) {
|
|
586
653
|
r(null);
|
|
@@ -610,8 +677,8 @@ function ue(e) {
|
|
|
610
677
|
isRole: (e) => n()?.role === e
|
|
611
678
|
};
|
|
612
679
|
}
|
|
613
|
-
function
|
|
614
|
-
let { client: t } =
|
|
680
|
+
function ve(e) {
|
|
681
|
+
let { client: t } = q(), [n, r] = v(!1), [i, a] = v(null);
|
|
615
682
|
return {
|
|
616
683
|
submitting: n,
|
|
617
684
|
error: i,
|
|
@@ -653,8 +720,8 @@ function de(e) {
|
|
|
653
720
|
}
|
|
654
721
|
};
|
|
655
722
|
}
|
|
656
|
-
function
|
|
657
|
-
let { client: t } =
|
|
723
|
+
function ye(e) {
|
|
724
|
+
let { client: t } = q(), [n, r] = v([]), [i, a] = v(!1), [o, s] = v(!1), [c, l] = v(null), [u, d] = v(null), f = async () => {
|
|
658
725
|
let n = e();
|
|
659
726
|
if (!n) {
|
|
660
727
|
r([]);
|
|
@@ -666,7 +733,7 @@ function fe(e) {
|
|
|
666
733
|
}
|
|
667
734
|
a(!0), l(null);
|
|
668
735
|
try {
|
|
669
|
-
r(await t.organizations.listDomains(n));
|
|
736
|
+
r((await t.organizations.listDomains(n)).domains);
|
|
670
737
|
} catch (e) {
|
|
671
738
|
l(e instanceof Error ? e.message : String(e));
|
|
672
739
|
} finally {
|
|
@@ -737,11 +804,11 @@ function fe(e) {
|
|
|
737
804
|
}
|
|
738
805
|
//#endregion
|
|
739
806
|
//#region src/components/domain-claim.tsx
|
|
740
|
-
var
|
|
741
|
-
let { claim: n, lastCreated: r, error: a, submitting: c } =
|
|
807
|
+
var be = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), xe = /* @__PURE__ */ u("<form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-domain-input>Domain</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-domain-input name=domain type=text placeholder=acme.com required autocomplete=off></div><label class=\"flex items-center gap-2 text-sm\"><input type=checkbox>Auto-join matching users on signup</label><label class=\"flex items-center gap-2 text-sm\"><input type=checkbox>Require verified email before auto-join</label><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Se = /* @__PURE__ */ u("<div class=\"rounded-md border border-input bg-muted/40 p-3 space-y-2\"><p class=\"text-xs text-muted-foreground\">Publish the following DNS TXT record to verify ownership. The token is shown ONCE — copy it now.</p><div><span class=\"text-xs font-medium\">Record</span><code class=\"mt-1 block break-all font-mono text-xs\"></code></div><div><span class=\"text-xs font-medium\">Value</span><code class=\"mt-1 block break-all font-mono text-xs\">"), Ce = (e) => /^[a-z0-9.-]+\.[a-z]{2,}$/i.test(e.trim()), we = (e) => {
|
|
808
|
+
let { claim: n, lastCreated: r, error: a, submitting: c } = ye(() => e.organizationId), [l, u] = v(""), [d, f] = v(!1), [m, h] = v(!0), g = async (t) => {
|
|
742
809
|
t.preventDefault();
|
|
743
810
|
let r = l().trim().toLowerCase();
|
|
744
|
-
if (!
|
|
811
|
+
if (!Ce(r)) return;
|
|
745
812
|
let i = await n({
|
|
746
813
|
domain: r,
|
|
747
814
|
auto_join_on_signup: d(),
|
|
@@ -750,13 +817,13 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
750
817
|
i ? (u(""), e.onSuccess?.(i)) : a() && e.onError?.(Error(a()));
|
|
751
818
|
};
|
|
752
819
|
return (() => {
|
|
753
|
-
var e =
|
|
820
|
+
var e = xe(), n = e.firstChild, _ = n.firstChild.nextSibling, v = n.nextSibling, y = v.firstChild, b = v.nextSibling, x = b.firstChild, S = b.nextSibling;
|
|
754
821
|
return t(e, "submit", g), s(e, i(p, {
|
|
755
822
|
get when() {
|
|
756
823
|
return a();
|
|
757
824
|
},
|
|
758
825
|
get children() {
|
|
759
|
-
var e =
|
|
826
|
+
var e = be();
|
|
760
827
|
return s(e, a), e;
|
|
761
828
|
}
|
|
762
829
|
}), n), t(_, "input", (e) => u(e.currentTarget.value)), t(y, "change", (e) => f(e.currentTarget.checked)), t(x, "change", (e) => h(e.currentTarget.checked)), s(S, () => c() ? "Claiming…" : "Claim domain"), s(e, i(p, {
|
|
@@ -764,11 +831,11 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
764
831
|
return r();
|
|
765
832
|
},
|
|
766
833
|
children: (e) => (() => {
|
|
767
|
-
var t =
|
|
834
|
+
var t = Se(), n = t.firstChild.nextSibling, r = n.firstChild.nextSibling, i = n.nextSibling.firstChild.nextSibling;
|
|
768
835
|
return s(r, () => e().dns_record_name), s(i, () => e().verification_token), t;
|
|
769
836
|
})()
|
|
770
837
|
}), null), o((e) => {
|
|
771
|
-
var t = c(), n = c(), r = c(), i = c() || !
|
|
838
|
+
var t = c(), n = c(), r = c(), i = c() || !Ce(l().trim());
|
|
772
839
|
return t !== e.e && (_.disabled = e.e = t), n !== e.t && (y.disabled = e.t = n), r !== e.a && (x.disabled = e.a = r), i !== e.o && (S.disabled = e.o = i), e;
|
|
773
840
|
}, {
|
|
774
841
|
e: void 0,
|
|
@@ -777,20 +844,20 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
777
844
|
o: void 0
|
|
778
845
|
}), o(() => _.value = l()), o(() => y.checked = d()), o(() => x.checked = m()), e;
|
|
779
846
|
})();
|
|
780
|
-
},
|
|
847
|
+
}, Te = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), Ee = /* @__PURE__ */ u("<p class=\"text-sm text-muted-foreground\">Loading domains…"), De = /* @__PURE__ */ u("<p class=\"text-sm text-muted-foreground\">No domains claimed yet."), Oe = /* @__PURE__ */ u("<div class=space-y-3><ul class=\"divide-y divide-border\">"), ke = /* @__PURE__ */ u("<button type=button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50\">Verify"), Ae = /* @__PURE__ */ u("<li class=\"flex items-center justify-between gap-3 py-2\"><div class=\"min-w-0 flex-1\"><div class=\"flex items-center gap-2\"><code class=\"font-mono text-sm\"></code><span></span></div><p class=\"text-xs text-muted-foreground\">Auto-join <!> · default role </p></div><div class=\"flex gap-2\"><button type=button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-input bg-transparent px-3 text-xs font-medium text-destructive shadow-sm transition-colors hover:bg-destructive/10 disabled:pointer-events-none disabled:opacity-50\">Remove"), je = {
|
|
781
848
|
pending: "Pending verification",
|
|
782
849
|
verified: "Verified",
|
|
783
850
|
failed: "Verification failed"
|
|
784
|
-
},
|
|
785
|
-
let { domains: n, loading: a, error: l, verify: u, remove: d, submitting: m } =
|
|
851
|
+
}, Me = (e) => {
|
|
852
|
+
let { domains: n, loading: a, error: l, verify: u, remove: d, submitting: m } = ye(() => e.organizationId);
|
|
786
853
|
return (() => {
|
|
787
|
-
var e =
|
|
854
|
+
var e = Oe(), h = e.firstChild;
|
|
788
855
|
return s(e, i(p, {
|
|
789
856
|
get when() {
|
|
790
857
|
return l();
|
|
791
858
|
},
|
|
792
859
|
get children() {
|
|
793
|
-
var e =
|
|
860
|
+
var e = Te();
|
|
794
861
|
return s(e, l), e;
|
|
795
862
|
}
|
|
796
863
|
}), h), s(e, i(p, {
|
|
@@ -798,29 +865,29 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
798
865
|
return a();
|
|
799
866
|
},
|
|
800
867
|
get children() {
|
|
801
|
-
return
|
|
868
|
+
return Ee();
|
|
802
869
|
}
|
|
803
870
|
}), h), s(e, i(p, {
|
|
804
871
|
get when() {
|
|
805
872
|
return c(() => !a())() && n().length === 0;
|
|
806
873
|
},
|
|
807
874
|
get children() {
|
|
808
|
-
return
|
|
875
|
+
return De();
|
|
809
876
|
}
|
|
810
877
|
}), h), s(h, i(f, {
|
|
811
878
|
get each() {
|
|
812
879
|
return n();
|
|
813
880
|
},
|
|
814
881
|
children: (e) => (() => {
|
|
815
|
-
var n =
|
|
882
|
+
var n = Ae(), a = n.firstChild, c = a.firstChild, l = c.firstChild, f = l.nextSibling, h = c.nextSibling, g = h.firstChild.nextSibling;
|
|
816
883
|
g.nextSibling;
|
|
817
884
|
var _ = a.nextSibling, v = _.firstChild;
|
|
818
|
-
return s(l, () => e.domain), s(f, () =>
|
|
885
|
+
return s(l, () => e.domain), s(f, () => je[e.status] ?? e.status), s(h, () => e.auto_join_on_signup ? "on" : "off", g), s(h, () => e.default_role_on_auto_join, null), s(_, i(p, {
|
|
819
886
|
get when() {
|
|
820
887
|
return e.status !== "verified";
|
|
821
888
|
},
|
|
822
889
|
get children() {
|
|
823
|
-
var n =
|
|
890
|
+
var n = ke();
|
|
824
891
|
return t(n, "click", () => u(e.id)), o(() => n.disabled = m()), n;
|
|
825
892
|
}
|
|
826
893
|
}), v), t(v, "click", () => d(e.id)), o((t) => {
|
|
@@ -833,19 +900,19 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
833
900
|
})()
|
|
834
901
|
})), e;
|
|
835
902
|
})();
|
|
836
|
-
},
|
|
837
|
-
let { verify: n, error: r, submitting: a } =
|
|
903
|
+
}, Ne = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), Pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-amber-500/10 px-3 py-2 text-sm text-amber-700\">Verification did not find the expected DNS TXT record. Double-check the record name + value, then retry."), Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700\">Domain verified. JIT auto-join is now active for matching users."), Ie = /* @__PURE__ */ u("<div class=space-y-3><div class=\"rounded-md border border-input bg-muted/40 p-3 space-y-2\"><p class=\"text-xs text-muted-foreground\">Publish the following DNS TXT record at your DNS provider, then click \"Run verification\". Some DNS providers can take up to 60 seconds to propagate.</p><div><span class=\"text-xs font-medium\">Record</span><code class=\"mt-1 block break-all font-mono text-xs\"></code></div><div><span class=\"text-xs font-medium\">Value</span><code class=\"mt-1 block break-all font-mono text-xs\"></code></div></div><button type=button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-50\">"), Le = (e) => {
|
|
904
|
+
let { verify: n, error: r, submitting: a } = ye(() => e.organizationId), [l, u] = v(null), d = async () => {
|
|
838
905
|
let t = await n(e.claim.domain.id);
|
|
839
906
|
u(t), t?.verified && e.onVerified?.(t);
|
|
840
907
|
};
|
|
841
908
|
return (() => {
|
|
842
|
-
var n =
|
|
909
|
+
var n = Ie(), u = n.firstChild, f = u.firstChild.nextSibling, m = f.firstChild.nextSibling, h = f.nextSibling.firstChild.nextSibling, g = u.nextSibling;
|
|
843
910
|
return s(m, () => e.claim.dns_record_name), s(h, () => e.claim.verification_token), s(n, i(p, {
|
|
844
911
|
get when() {
|
|
845
912
|
return r();
|
|
846
913
|
},
|
|
847
914
|
get children() {
|
|
848
|
-
var e =
|
|
915
|
+
var e = Ne();
|
|
849
916
|
return s(e, r), e;
|
|
850
917
|
}
|
|
851
918
|
}), g), s(n, i(p, {
|
|
@@ -853,19 +920,19 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
853
920
|
return c(() => !!l())() && !l()?.verified;
|
|
854
921
|
},
|
|
855
922
|
get children() {
|
|
856
|
-
return
|
|
923
|
+
return Pe();
|
|
857
924
|
}
|
|
858
925
|
}), g), s(n, i(p, {
|
|
859
926
|
get when() {
|
|
860
927
|
return l()?.verified;
|
|
861
928
|
},
|
|
862
929
|
get children() {
|
|
863
|
-
return
|
|
930
|
+
return Fe();
|
|
864
931
|
}
|
|
865
932
|
}), g), t(g, "click", d), s(g, () => a() ? "Verifying…" : "Run verification"), o(() => g.disabled = a()), n;
|
|
866
933
|
})();
|
|
867
|
-
},
|
|
868
|
-
let { client: n } =
|
|
934
|
+
}, Re = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), ze = /* @__PURE__ */ u("<div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">"), Be = /* @__PURE__ */ u("<form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-forgot-password-email>Email</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-forgot-password-email name=email type=email required autocomplete=email></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Ve = (t) => {
|
|
935
|
+
let { client: n } = q(), r = n?.emailPassword;
|
|
869
936
|
if (!r) return null;
|
|
870
937
|
let [a, c] = v(""), [l, u] = v(null), [d, f] = v(null), [p, m] = v(!1), h = async (e) => {
|
|
871
938
|
e.preventDefault(), u(null), f(null), m(!0);
|
|
@@ -879,13 +946,13 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
879
946
|
}
|
|
880
947
|
};
|
|
881
948
|
return (() => {
|
|
882
|
-
var t =
|
|
949
|
+
var t = Be(), n = t.firstChild, r = n.firstChild.nextSibling, u = n.nextSibling;
|
|
883
950
|
return t.addEventListener("submit", h), s(t, i(e, {
|
|
884
951
|
get when() {
|
|
885
952
|
return l();
|
|
886
953
|
},
|
|
887
954
|
get children() {
|
|
888
|
-
var e =
|
|
955
|
+
var e = Re();
|
|
889
956
|
return s(e, l), e;
|
|
890
957
|
}
|
|
891
958
|
}), n), s(t, i(e, {
|
|
@@ -893,7 +960,7 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
893
960
|
return d();
|
|
894
961
|
},
|
|
895
962
|
get children() {
|
|
896
|
-
var e =
|
|
963
|
+
var e = ze();
|
|
897
964
|
return s(e, d), e;
|
|
898
965
|
}
|
|
899
966
|
}), n), r.$$input = (e) => c(e.currentTarget.value), s(u, () => p() ? "Sending..." : "Send reset link"), o((e) => {
|
|
@@ -908,20 +975,20 @@ var pe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
908
975
|
a(["input"]);
|
|
909
976
|
//#endregion
|
|
910
977
|
//#region src/components/invitation-accept.tsx
|
|
911
|
-
var
|
|
912
|
-
let { accept: r, submitting: a, error: c } =
|
|
978
|
+
var He = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), Ue = /* @__PURE__ */ u("<div class=\"rounded-md bg-primary/10 px-3 py-2 text-sm\"role=status aria-live=polite>Invitation accepted. Welcome to the organization!"), We = /* @__PURE__ */ u("<div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-invitation-accept-token>Invitation token</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 font-mono text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-invitation-accept-token name=token type=text required autocomplete=off>"), Ge = /* @__PURE__ */ u("<button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Ke = /* @__PURE__ */ u("<form class=space-y-4>"), qe = (n) => {
|
|
979
|
+
let { accept: r, submitting: a, error: c } = ge(), [l, u] = v(n.token ?? ""), [d, f] = v(null), p = async (e) => {
|
|
913
980
|
e.preventDefault();
|
|
914
981
|
let t = await r(l().trim());
|
|
915
982
|
t ? (f(t), n.onSuccess?.(t)) : c() && n.onError?.(Error(c()));
|
|
916
983
|
};
|
|
917
984
|
return (() => {
|
|
918
|
-
var n =
|
|
985
|
+
var n = Ke();
|
|
919
986
|
return t(n, "submit", p), s(n, i(e, {
|
|
920
987
|
get when() {
|
|
921
988
|
return c();
|
|
922
989
|
},
|
|
923
990
|
get children() {
|
|
924
|
-
var e =
|
|
991
|
+
var e = He();
|
|
925
992
|
return s(e, c), e;
|
|
926
993
|
}
|
|
927
994
|
}), null), s(n, i(e, {
|
|
@@ -929,7 +996,7 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
929
996
|
return d();
|
|
930
997
|
},
|
|
931
998
|
get children() {
|
|
932
|
-
return
|
|
999
|
+
return Ue();
|
|
933
1000
|
}
|
|
934
1001
|
}), null), s(n, i(e, {
|
|
935
1002
|
get when() {
|
|
@@ -937,20 +1004,20 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
937
1004
|
},
|
|
938
1005
|
get children() {
|
|
939
1006
|
return [(() => {
|
|
940
|
-
var e =
|
|
1007
|
+
var e = We(), n = e.firstChild.nextSibling;
|
|
941
1008
|
return t(n, "input", (e) => u(e.currentTarget.value)), o(() => n.disabled = a()), o(() => n.value = l()), e;
|
|
942
1009
|
})(), (() => {
|
|
943
|
-
var e =
|
|
1010
|
+
var e = Ge();
|
|
944
1011
|
return s(e, () => a() ? "Accepting…" : "Accept invitation"), o(() => e.disabled = a() || !l().trim()), e;
|
|
945
1012
|
})()];
|
|
946
1013
|
}
|
|
947
1014
|
}), null), n;
|
|
948
1015
|
})();
|
|
949
|
-
},
|
|
950
|
-
let { invite: r, error: a } =
|
|
1016
|
+
}, Je = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), Ye = /* @__PURE__ */ u("<div class=\"rounded-md border border-input bg-muted/40 p-3\"><p class=\"text-xs text-muted-foreground\">Invitation created. Deliver this token to the invitee — it will not be shown again.</p><code class=\"mt-2 block break-all font-mono text-xs\">"), Xe = /* @__PURE__ */ u("<form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-invite-email>Email</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-invite-email name=email type=email required autocomplete=email></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-invite-role>Role</label><select class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-invite-role name=role><option value=member>Member</option><option value=admin>Admin</option></select></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Ze = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e), Qe = (n) => {
|
|
1017
|
+
let { invite: r, error: a } = he(() => n.organizationId), [c, l] = v(""), [u, d] = v("member"), [f, p] = v(!1), [m, h] = v(null), g = async (e) => {
|
|
951
1018
|
e.preventDefault();
|
|
952
1019
|
let t = c().trim();
|
|
953
|
-
if (!
|
|
1020
|
+
if (!Ze(t)) return;
|
|
954
1021
|
p(!0);
|
|
955
1022
|
let i = await r({
|
|
956
1023
|
email: t,
|
|
@@ -959,13 +1026,13 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
959
1026
|
p(!1), i ? (h(i.token), l(""), n.onSuccess?.(i)) : a() && n.onError?.(Error(a()));
|
|
960
1027
|
};
|
|
961
1028
|
return (() => {
|
|
962
|
-
var n =
|
|
1029
|
+
var n = Xe(), r = n.firstChild, p = r.firstChild.nextSibling, h = r.nextSibling, _ = h.firstChild.nextSibling, v = h.nextSibling;
|
|
963
1030
|
return t(n, "submit", g), s(n, i(e, {
|
|
964
1031
|
get when() {
|
|
965
1032
|
return a();
|
|
966
1033
|
},
|
|
967
1034
|
get children() {
|
|
968
|
-
var e =
|
|
1035
|
+
var e = Je();
|
|
969
1036
|
return s(e, a), e;
|
|
970
1037
|
}
|
|
971
1038
|
}), r), t(p, "input", (e) => l(e.currentTarget.value)), t(_, "change", (e) => d(e.currentTarget.value)), s(v, () => f() ? "Sending…" : "Send invitation"), s(n, i(e, {
|
|
@@ -973,11 +1040,11 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
973
1040
|
return m();
|
|
974
1041
|
},
|
|
975
1042
|
get children() {
|
|
976
|
-
var e =
|
|
1043
|
+
var e = Ye(), t = e.firstChild.nextSibling;
|
|
977
1044
|
return s(t, m), e;
|
|
978
1045
|
}
|
|
979
1046
|
}), null), o((e) => {
|
|
980
|
-
var t = f(), n = f(), r = f() || !
|
|
1047
|
+
var t = f(), n = f(), r = f() || !Ze(c().trim());
|
|
981
1048
|
return t !== e.e && (p.disabled = e.e = t), n !== e.t && (_.disabled = e.t = n), r !== e.a && (v.disabled = e.a = r), e;
|
|
982
1049
|
}, {
|
|
983
1050
|
e: void 0,
|
|
@@ -985,8 +1052,8 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
985
1052
|
a: void 0
|
|
986
1053
|
}), o(() => p.value = c()), o(() => _.value = u()), n;
|
|
987
1054
|
})();
|
|
988
|
-
},
|
|
989
|
-
let { client: n } =
|
|
1055
|
+
}, $e = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), et = /* @__PURE__ */ u("<div class=space-y-2><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>"), tt = (t) => {
|
|
1056
|
+
let { client: n } = q(), r = n?.passkey;
|
|
990
1057
|
if (!r) return null;
|
|
991
1058
|
let [a, l] = v(null), [u, d] = v(!1), f = async () => {
|
|
992
1059
|
let e = await r.loginBegin({ email: t.email ?? void 0 }), i = await E({ optionsJSON: e.options.publicKey });
|
|
@@ -1014,13 +1081,13 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1014
1081
|
}
|
|
1015
1082
|
};
|
|
1016
1083
|
return (() => {
|
|
1017
|
-
var n =
|
|
1084
|
+
var n = et(), r = n.firstChild;
|
|
1018
1085
|
return s(n, i(e, {
|
|
1019
1086
|
get when() {
|
|
1020
1087
|
return a();
|
|
1021
1088
|
},
|
|
1022
1089
|
get children() {
|
|
1023
|
-
var e =
|
|
1090
|
+
var e = $e();
|
|
1024
1091
|
return s(e, a), e;
|
|
1025
1092
|
}
|
|
1026
1093
|
}), r), r.$$click = m, s(r, (() => {
|
|
@@ -1032,8 +1099,8 @@ var Fe = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1032
1099
|
a(["click"]);
|
|
1033
1100
|
//#endregion
|
|
1034
1101
|
//#region src/components/login-form.tsx
|
|
1035
|
-
var
|
|
1036
|
-
let { client: r, refetch: a } =
|
|
1102
|
+
var nt = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), rt = /* @__PURE__ */ u("<div class=relative><div class=\"absolute inset-0 flex items-center\"style=pointer-events:none><span class=\"w-full border-t\"></span></div><div class=\"relative flex justify-center text-xs uppercase\"><span class=\"bg-background px-2 text-muted-foreground\">or"), it = /* @__PURE__ */ u("<form class=space-y-6><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-login-email>Email</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-login-email name=email type=email required autocomplete=email></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-login-password>Password</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-login-password name=password type=password required autocomplete=current-password></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), at = (n) => {
|
|
1103
|
+
let { client: r, refetch: a } = q(), c = r?.emailPassword;
|
|
1037
1104
|
if (!c) return null;
|
|
1038
1105
|
let [l, u] = v(""), [d, f] = v(""), [p, m] = v(null), [h, g] = v(!1), _ = async (e) => {
|
|
1039
1106
|
e.preventDefault(), m(null), g(!0);
|
|
@@ -1053,13 +1120,13 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1053
1120
|
}
|
|
1054
1121
|
};
|
|
1055
1122
|
return (() => {
|
|
1056
|
-
var r =
|
|
1123
|
+
var r = it(), c = r.firstChild, m = c.firstChild.nextSibling, g = c.nextSibling, v = g.firstChild.nextSibling, y = g.nextSibling;
|
|
1057
1124
|
return t(r, "submit", _), s(r, i(e, {
|
|
1058
1125
|
get when() {
|
|
1059
1126
|
return p();
|
|
1060
1127
|
},
|
|
1061
1128
|
get children() {
|
|
1062
|
-
var e =
|
|
1129
|
+
var e = nt();
|
|
1063
1130
|
return s(e, p), e;
|
|
1064
1131
|
}
|
|
1065
1132
|
}), c), t(m, "input", (e) => u(e.currentTarget.value)), t(v, "input", (e) => f(e.currentTarget.value)), s(y, () => h() ? "Signing in..." : "Sign in"), s(r, i(e, {
|
|
@@ -1067,7 +1134,7 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1067
1134
|
return n.showPasskey;
|
|
1068
1135
|
},
|
|
1069
1136
|
get children() {
|
|
1070
|
-
return [
|
|
1137
|
+
return [rt(), i(tt, {
|
|
1071
1138
|
mode: "login",
|
|
1072
1139
|
get email() {
|
|
1073
1140
|
return l();
|
|
@@ -1089,8 +1156,8 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1089
1156
|
a: void 0
|
|
1090
1157
|
}), o(() => m.value = l()), o(() => v.value = d()), r;
|
|
1091
1158
|
})();
|
|
1092
|
-
},
|
|
1093
|
-
let { client: n } =
|
|
1159
|
+
}, ot = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), st = /* @__PURE__ */ u("<div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">"), ct = /* @__PURE__ */ u("<div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-magic-link-email>Email</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-magic-link-email name=email type=email required autocomplete=email placeholder=you@example.com>"), lt = /* @__PURE__ */ u("<button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), ut = /* @__PURE__ */ u("<form class=space-y-4>"), dt = (t) => {
|
|
1160
|
+
let { client: n } = q(), r = n?.magicLink;
|
|
1094
1161
|
if (!r) return null;
|
|
1095
1162
|
let [a, c] = v(""), [l, u] = v(null), [d, f] = v(null), [p, m] = v(!1), h = async (e) => {
|
|
1096
1163
|
e.preventDefault(), u(null), f(null), m(!0);
|
|
@@ -1104,13 +1171,13 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1104
1171
|
}
|
|
1105
1172
|
};
|
|
1106
1173
|
return (() => {
|
|
1107
|
-
var t =
|
|
1174
|
+
var t = ut();
|
|
1108
1175
|
return t.addEventListener("submit", h), s(t, i(e, {
|
|
1109
1176
|
get when() {
|
|
1110
1177
|
return l();
|
|
1111
1178
|
},
|
|
1112
1179
|
get children() {
|
|
1113
|
-
var e =
|
|
1180
|
+
var e = ot();
|
|
1114
1181
|
return s(e, l), e;
|
|
1115
1182
|
}
|
|
1116
1183
|
}), null), s(t, i(e, {
|
|
@@ -1118,7 +1185,7 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1118
1185
|
return d();
|
|
1119
1186
|
},
|
|
1120
1187
|
get children() {
|
|
1121
|
-
var e =
|
|
1188
|
+
var e = st();
|
|
1122
1189
|
return s(e, d), e;
|
|
1123
1190
|
}
|
|
1124
1191
|
}), null), s(t, i(e, {
|
|
@@ -1127,10 +1194,10 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1127
1194
|
},
|
|
1128
1195
|
get children() {
|
|
1129
1196
|
return [(() => {
|
|
1130
|
-
var e =
|
|
1197
|
+
var e = ct(), t = e.firstChild.nextSibling;
|
|
1131
1198
|
return t.$$input = (e) => c(e.currentTarget.value), o(() => t.disabled = p()), o(() => t.value = a()), e;
|
|
1132
1199
|
})(), (() => {
|
|
1133
|
-
var e =
|
|
1200
|
+
var e = lt();
|
|
1134
1201
|
return s(e, () => p() ? "Sending..." : "Send magic link"), o(() => e.disabled = p()), e;
|
|
1135
1202
|
})()];
|
|
1136
1203
|
}
|
|
@@ -1140,14 +1207,14 @@ var Ye = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1140
1207
|
a(["input"]);
|
|
1141
1208
|
//#endregion
|
|
1142
1209
|
//#region src/components/role-selector.tsx
|
|
1143
|
-
var
|
|
1144
|
-
var t =
|
|
1210
|
+
var ft = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-background px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"aria-label=\"Member role\"><option>Admin</option><option>Billing admin</option><option>Member</option><option>Viewer"), pt = (e) => (() => {
|
|
1211
|
+
var t = ft(), n = t.firstChild, r = n.nextSibling, i = r.nextSibling, a = i.nextSibling;
|
|
1145
1212
|
return t.addEventListener("change", (t) => e.onChange(t.currentTarget.value)), o(() => t.disabled = e.disabled), o(() => n.value = $.ADMIN), o(() => r.value = $.BILLING_ADMIN), o(() => i.value = $.MEMBER), o(() => a.value = $.VIEWER), o(() => t.value = e.value), t;
|
|
1146
|
-
})(),
|
|
1213
|
+
})(), mt = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), ht = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading members…"), gt = /* @__PURE__ */ u("<th scope=col class=\"py-2 pr-4 text-right\">Actions"), _t = /* @__PURE__ */ u("<table class=\"w-full text-sm\"aria-label=\"Organization members\"><thead><tr class=\"border-b border-input text-left text-xs font-medium text-muted-foreground\"><th scope=col class=\"py-2 pr-4\">User</th><th scope=col class=\"py-2 pr-4\">Role</th><th scope=col class=\"py-2 pr-4\">Status</th><th scope=col class=\"py-2 pr-4\">Joined</th></tr></thead><tbody>"), vt = /* @__PURE__ */ u("<div class=\"rounded-md border border-dashed border-input px-4 py-6 text-center text-sm text-muted-foreground\">No members yet."), yt = /* @__PURE__ */ u("<div class=space-y-3>"), bt = /* @__PURE__ */ u("<span>"), xt = /* @__PURE__ */ u("<button type=button class=\"rounded-md bg-primary px-2 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50\">Save"), St = /* @__PURE__ */ u("<button type=button class=\"rounded-md border border-input px-2 py-1 text-xs hover:bg-secondary\">Cancel"), Ct = /* @__PURE__ */ u("<td class=\"py-2 pr-4 text-right\"><div class=\"inline-flex gap-2\">"), wt = /* @__PURE__ */ u("<tr class=\"border-b border-input/40\"><td class=\"py-2 pr-4 font-mono text-xs\"></td><td class=\"py-2 pr-4\"></td><td class=\"py-2 pr-4 text-xs text-muted-foreground\"></td><td class=\"py-2 pr-4 text-xs text-muted-foreground\">"), Tt = /* @__PURE__ */ u("<button type=button class=\"rounded-md border border-input px-2 py-1 text-xs hover:bg-secondary\">Change role"), Et = /* @__PURE__ */ u("<button type=button class=\"rounded-md border border-destructive/40 px-2 py-1 text-xs text-destructive hover:bg-destructive/10\">Remove"), Dt = (e) => {
|
|
1147
1214
|
if (!e) return "—";
|
|
1148
1215
|
let t = new Date(e);
|
|
1149
1216
|
return Number.isNaN(t.getTime()) ? "—" : t.toLocaleDateString();
|
|
1150
|
-
},
|
|
1217
|
+
}, Ot = (e) => {
|
|
1151
1218
|
switch (e) {
|
|
1152
1219
|
case $.OWNER: return "bg-amber-500/15 text-amber-700 dark:text-amber-300";
|
|
1153
1220
|
case $.ADMIN: return "bg-blue-500/15 text-blue-700 dark:text-blue-300";
|
|
@@ -1156,8 +1223,8 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1156
1223
|
case $.VIEWER: return "bg-muted text-muted-foreground";
|
|
1157
1224
|
default: return "bg-secondary text-secondary-foreground";
|
|
1158
1225
|
}
|
|
1159
|
-
},
|
|
1160
|
-
let { members: t, loading: n, error: a, refetch: l } =
|
|
1226
|
+
}, kt = (e) => {
|
|
1227
|
+
let { members: t, loading: n, error: a, refetch: l } = he(() => e.organizationId), { hasPermission: u } = _e(() => e.organizationId), { submitting: d, error: m, changeRole: h, removeMember: g } = ve(() => e.organizationId), [_, y] = v(null), [b, x] = v(""), S = (e, t) => {
|
|
1161
1228
|
y(e), x(t);
|
|
1162
1229
|
}, C = () => {
|
|
1163
1230
|
y(null), x("");
|
|
@@ -1167,13 +1234,13 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1167
1234
|
confirm("Remove this member from the organization?") && await g(e) && await l();
|
|
1168
1235
|
}, E = () => u("members:change_role") || u("members:remove");
|
|
1169
1236
|
return (() => {
|
|
1170
|
-
var e =
|
|
1237
|
+
var e = yt();
|
|
1171
1238
|
return s(e, i(p, {
|
|
1172
1239
|
get when() {
|
|
1173
1240
|
return a() || m();
|
|
1174
1241
|
},
|
|
1175
1242
|
get children() {
|
|
1176
|
-
var e =
|
|
1243
|
+
var e = mt();
|
|
1177
1244
|
return s(e, () => a() || m()), e;
|
|
1178
1245
|
}
|
|
1179
1246
|
}), null), s(e, i(p, {
|
|
@@ -1181,14 +1248,14 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1181
1248
|
return c(() => !!n())() && t().length === 0;
|
|
1182
1249
|
},
|
|
1183
1250
|
get children() {
|
|
1184
|
-
return
|
|
1251
|
+
return ht();
|
|
1185
1252
|
}
|
|
1186
1253
|
}), null), s(e, i(p, {
|
|
1187
1254
|
get when() {
|
|
1188
1255
|
return t().length > 0;
|
|
1189
1256
|
},
|
|
1190
1257
|
get children() {
|
|
1191
|
-
var e =
|
|
1258
|
+
var e = _t(), n = e.firstChild, a = n.firstChild;
|
|
1192
1259
|
a.firstChild.nextSibling.nextSibling.nextSibling;
|
|
1193
1260
|
var l = n.nextSibling;
|
|
1194
1261
|
return s(a, i(p, {
|
|
@@ -1196,20 +1263,20 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1196
1263
|
return E();
|
|
1197
1264
|
},
|
|
1198
1265
|
get children() {
|
|
1199
|
-
return
|
|
1266
|
+
return gt();
|
|
1200
1267
|
}
|
|
1201
1268
|
}), null), s(l, i(f, {
|
|
1202
1269
|
get each() {
|
|
1203
1270
|
return t();
|
|
1204
1271
|
},
|
|
1205
1272
|
children: (e) => (() => {
|
|
1206
|
-
var t =
|
|
1273
|
+
var t = wt(), n = t.firstChild, a = n.nextSibling, l = a.nextSibling, f = l.nextSibling;
|
|
1207
1274
|
return s(n, () => e.user_id), s(a, i(p, {
|
|
1208
1275
|
get when() {
|
|
1209
1276
|
return _() !== e.user_id;
|
|
1210
1277
|
},
|
|
1211
1278
|
get fallback() {
|
|
1212
|
-
return i(
|
|
1279
|
+
return i(pt, {
|
|
1213
1280
|
get value() {
|
|
1214
1281
|
return b();
|
|
1215
1282
|
},
|
|
@@ -1220,15 +1287,15 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1220
1287
|
});
|
|
1221
1288
|
},
|
|
1222
1289
|
get children() {
|
|
1223
|
-
var t =
|
|
1224
|
-
return s(t, () => e.role), o(() => r(t, `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${
|
|
1290
|
+
var t = bt();
|
|
1291
|
+
return s(t, () => e.role), o(() => r(t, `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${Ot(e.role)}`)), t;
|
|
1225
1292
|
}
|
|
1226
|
-
})), s(l, () => e.status), s(f, () =>
|
|
1293
|
+
})), s(l, () => e.status), s(f, () => Dt(e.joined_at)), s(t, i(p, {
|
|
1227
1294
|
get when() {
|
|
1228
1295
|
return E();
|
|
1229
1296
|
},
|
|
1230
1297
|
get children() {
|
|
1231
|
-
var t =
|
|
1298
|
+
var t = Ct(), n = t.firstChild;
|
|
1232
1299
|
return s(n, i(p, {
|
|
1233
1300
|
get when() {
|
|
1234
1301
|
return _() === e.user_id;
|
|
@@ -1239,7 +1306,7 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1239
1306
|
return c(() => !!u("members:change_role"))() && e.role !== $.OWNER;
|
|
1240
1307
|
},
|
|
1241
1308
|
get children() {
|
|
1242
|
-
var t =
|
|
1309
|
+
var t = Tt();
|
|
1243
1310
|
return t.$$click = () => S(e.user_id, e.role), t;
|
|
1244
1311
|
}
|
|
1245
1312
|
}), i(p, {
|
|
@@ -1247,17 +1314,17 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1247
1314
|
return c(() => !!u("members:remove"))() && e.role !== $.OWNER;
|
|
1248
1315
|
},
|
|
1249
1316
|
get children() {
|
|
1250
|
-
var t =
|
|
1317
|
+
var t = Et();
|
|
1251
1318
|
return t.$$click = () => T(e.user_id), o(() => t.disabled = d()), t;
|
|
1252
1319
|
}
|
|
1253
1320
|
})];
|
|
1254
1321
|
},
|
|
1255
1322
|
get children() {
|
|
1256
1323
|
return [(() => {
|
|
1257
|
-
var t =
|
|
1324
|
+
var t = xt();
|
|
1258
1325
|
return t.$$click = () => w(e.user_id), o(() => t.disabled = d()), t;
|
|
1259
1326
|
})(), (() => {
|
|
1260
|
-
var e =
|
|
1327
|
+
var e = St();
|
|
1261
1328
|
return e.$$click = C, o(() => e.disabled = d()), e;
|
|
1262
1329
|
})()];
|
|
1263
1330
|
}
|
|
@@ -1272,7 +1339,7 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1272
1339
|
return c(() => !n())() && t().length === 0;
|
|
1273
1340
|
},
|
|
1274
1341
|
get children() {
|
|
1275
|
-
return
|
|
1342
|
+
return vt();
|
|
1276
1343
|
}
|
|
1277
1344
|
}), null), e;
|
|
1278
1345
|
})();
|
|
@@ -1280,8 +1347,8 @@ var at = /* @__PURE__ */ u("<select class=\"rounded-md border border-input bg-ba
|
|
|
1280
1347
|
a(["click"]);
|
|
1281
1348
|
//#endregion
|
|
1282
1349
|
//#region src/components/mfa-challenge.tsx
|
|
1283
|
-
var
|
|
1284
|
-
let { client: n } =
|
|
1350
|
+
var At = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), jt = /* @__PURE__ */ u("<form class=space-y-4><p class=\"text-sm text-muted-foreground\">Enter the code from your authenticator app, or use a backup code.</p><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-mfa-challenge-code>Verification code</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-mfa-challenge-code name=code type=text inputmode=numeric autocomplete=one-time-code required></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Mt = (t) => {
|
|
1351
|
+
let { client: n } = q(), r = n?.mfa;
|
|
1285
1352
|
if (!r) return null;
|
|
1286
1353
|
let [a, c] = v(""), [l, u] = v(null), [d, f] = v(!1), p = async (e) => {
|
|
1287
1354
|
e.preventDefault(), u(null), f(!0);
|
|
@@ -1301,13 +1368,13 @@ var Ct = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1301
1368
|
}
|
|
1302
1369
|
};
|
|
1303
1370
|
return (() => {
|
|
1304
|
-
var t =
|
|
1371
|
+
var t = jt(), n = t.firstChild, r = n.nextSibling, u = r.firstChild.nextSibling, f = r.nextSibling;
|
|
1305
1372
|
return t.addEventListener("submit", p), s(t, i(e, {
|
|
1306
1373
|
get when() {
|
|
1307
1374
|
return l();
|
|
1308
1375
|
},
|
|
1309
1376
|
get children() {
|
|
1310
|
-
var e =
|
|
1377
|
+
var e = At();
|
|
1311
1378
|
return s(e, l), e;
|
|
1312
1379
|
}
|
|
1313
1380
|
}), n), u.$$input = (e) => c(e.currentTarget.value), s(f, () => d() ? "Verifying..." : "Verify"), o((e) => {
|
|
@@ -1322,8 +1389,8 @@ var Ct = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1322
1389
|
a(["input"]);
|
|
1323
1390
|
//#endregion
|
|
1324
1391
|
//#region src/components/mfa-setup.tsx
|
|
1325
|
-
var
|
|
1326
|
-
let { client: n } =
|
|
1392
|
+
var Nt = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), Pt = /* @__PURE__ */ u("<div class=space-y-4><p class=\"text-sm text-muted-foreground\">Set up two-factor authentication to secure your account.</p><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>"), Ft = /* @__PURE__ */ u("<div class=space-y-4><p class=\"text-sm text-muted-foreground\">Add this account to your authenticator app using the URI below, then enter the verification code.</p><div class=space-y-1><span class=\"text-sm font-medium leading-none\">OTP Auth URI</span><code class=\"block w-full break-all rounded-md border border-input bg-muted px-3 py-2 text-xs\"></code></div><div class=space-y-1><span class=\"text-sm font-medium leading-none\">Manual entry key</span><code class=\"block w-full break-all rounded-md border border-input bg-muted px-3 py-2 text-xs font-mono tracking-wider\"></code></div><form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-mfa-setup-code>Verification code</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-mfa-setup-code name=code type=text inputmode=numeric autocomplete=one-time-code required></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), It = /* @__PURE__ */ u("<div class=space-y-4><div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">Two-factor authentication has been enabled. Save these backup codes in a safe place. Each code can only be used once.</div><ul class=space-y-1>"), Lt = /* @__PURE__ */ u("<div class=space-y-4>"), Rt = /* @__PURE__ */ u("<li class=\"rounded-md border border-input bg-muted px-3 py-1.5 text-center font-mono text-sm tracking-wider\">"), zt = (t) => {
|
|
1393
|
+
let { client: n } = q(), r = n?.mfa;
|
|
1327
1394
|
if (!r) return null;
|
|
1328
1395
|
let [a, c] = v("begin"), [l, u] = v(""), [d, p] = v(""), [m, h] = v(""), [g, _] = v([]), [y, b] = v(null), [x, S] = v(!1), C = async () => {
|
|
1329
1396
|
b(null), S(!0);
|
|
@@ -1347,13 +1414,13 @@ var Et = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1347
1414
|
}
|
|
1348
1415
|
};
|
|
1349
1416
|
return (() => {
|
|
1350
|
-
var t =
|
|
1417
|
+
var t = Lt();
|
|
1351
1418
|
return s(t, i(e, {
|
|
1352
1419
|
get when() {
|
|
1353
1420
|
return y();
|
|
1354
1421
|
},
|
|
1355
1422
|
get children() {
|
|
1356
|
-
var e =
|
|
1423
|
+
var e = Nt();
|
|
1357
1424
|
return s(e, y), e;
|
|
1358
1425
|
}
|
|
1359
1426
|
}), null), s(t, i(e, {
|
|
@@ -1361,7 +1428,7 @@ var Et = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1361
1428
|
return a() === "begin";
|
|
1362
1429
|
},
|
|
1363
1430
|
get children() {
|
|
1364
|
-
var e =
|
|
1431
|
+
var e = Pt(), t = e.firstChild.nextSibling;
|
|
1365
1432
|
return t.$$click = C, s(t, () => x() ? "Setting up..." : "Set up 2FA"), o(() => t.disabled = x()), e;
|
|
1366
1433
|
}
|
|
1367
1434
|
}), null), s(t, i(e, {
|
|
@@ -1369,7 +1436,7 @@ var Et = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1369
1436
|
return a() === "confirm";
|
|
1370
1437
|
},
|
|
1371
1438
|
get children() {
|
|
1372
|
-
var e =
|
|
1439
|
+
var e = Ft(), t = e.firstChild.nextSibling, n = t.firstChild.nextSibling, r = t.nextSibling, i = r.firstChild.nextSibling, a = r.nextSibling, c = a.firstChild, u = c.firstChild.nextSibling, f = c.nextSibling;
|
|
1373
1440
|
return s(n, l), s(i, d), a.addEventListener("submit", w), u.$$input = (e) => h(e.currentTarget.value), s(f, () => x() ? "Verifying..." : "Verify and enable"), o((e) => {
|
|
1374
1441
|
var t = x(), n = x();
|
|
1375
1442
|
return t !== e.e && (u.disabled = e.e = t), n !== e.t && (f.disabled = e.t = n), e;
|
|
@@ -1383,13 +1450,13 @@ var Et = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1383
1450
|
return a() === "done";
|
|
1384
1451
|
},
|
|
1385
1452
|
get children() {
|
|
1386
|
-
var e =
|
|
1453
|
+
var e = It(), t = e.firstChild.nextSibling;
|
|
1387
1454
|
return s(t, i(f, {
|
|
1388
1455
|
get each() {
|
|
1389
1456
|
return g();
|
|
1390
1457
|
},
|
|
1391
1458
|
children: (e) => (() => {
|
|
1392
|
-
var t =
|
|
1459
|
+
var t = Rt();
|
|
1393
1460
|
return s(t, e), t;
|
|
1394
1461
|
})()
|
|
1395
1462
|
})), e;
|
|
@@ -1400,20 +1467,20 @@ var Et = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1400
1467
|
a(["click", "input"]);
|
|
1401
1468
|
//#endregion
|
|
1402
1469
|
//#region src/components/oauth-buttons.tsx
|
|
1403
|
-
var
|
|
1404
|
-
let { client: t } =
|
|
1470
|
+
var Bt = /* @__PURE__ */ u("<div class=space-y-2>"), Vt = /* @__PURE__ */ u("<button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>Sign in with "), Ht = (e) => {
|
|
1471
|
+
let { client: t } = q(), n = t?.oauth;
|
|
1405
1472
|
if (!n) return null;
|
|
1406
1473
|
let r = (e) => {
|
|
1407
1474
|
window.location.href = n.authorize(e);
|
|
1408
1475
|
};
|
|
1409
1476
|
return (() => {
|
|
1410
|
-
var t =
|
|
1477
|
+
var t = Bt();
|
|
1411
1478
|
return s(t, i(f, {
|
|
1412
1479
|
get each() {
|
|
1413
1480
|
return e.providers;
|
|
1414
1481
|
},
|
|
1415
1482
|
children: (e) => (() => {
|
|
1416
|
-
var t =
|
|
1483
|
+
var t = Vt();
|
|
1417
1484
|
return t.firstChild, t.$$click = () => r(e), s(t, () => e.charAt(0).toUpperCase() + e.slice(1), null), t;
|
|
1418
1485
|
})()
|
|
1419
1486
|
})), t;
|
|
@@ -1422,14 +1489,14 @@ var Nt = /* @__PURE__ */ u("<div class=space-y-2>"), Pt = /* @__PURE__ */ u("<bu
|
|
|
1422
1489
|
a(["click"]);
|
|
1423
1490
|
//#endregion
|
|
1424
1491
|
//#region src/components/organization-card.tsx
|
|
1425
|
-
var
|
|
1426
|
-
var r =
|
|
1492
|
+
var Ut = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground\">"), Wt = /* @__PURE__ */ u("<div class=\"shrink-0 text-xs text-muted-foreground\"> "), Gt = /* @__PURE__ */ u("<button class=\"flex w-full items-start justify-between gap-4 rounded-md border border-input bg-card px-4 py-3 text-left text-card-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"type=button><div class=\"min-w-0 flex-1\"><div class=\"flex items-center gap-2\"><span class=\"truncate text-sm font-medium\"></span></div><div class=\"mt-1 truncate text-xs text-muted-foreground\">@"), Kt = (n) => (() => {
|
|
1493
|
+
var r = Gt(), a = r.firstChild.firstChild, o = a.firstChild, l = a.nextSibling;
|
|
1427
1494
|
return l.firstChild, t(r, "click", () => n.onSelect?.(n.organization)), s(o, () => n.organization.display_name || n.organization.name), s(a, i(e, {
|
|
1428
1495
|
get when() {
|
|
1429
1496
|
return n.role;
|
|
1430
1497
|
},
|
|
1431
1498
|
get children() {
|
|
1432
|
-
var e =
|
|
1499
|
+
var e = Ut();
|
|
1433
1500
|
return s(e, () => n.role), e;
|
|
1434
1501
|
}
|
|
1435
1502
|
}), null), s(l, () => n.organization.slug, null), s(r, i(e, {
|
|
@@ -1437,18 +1504,18 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1437
1504
|
return c(() => n.memberCount !== null)() && n.memberCount !== void 0;
|
|
1438
1505
|
},
|
|
1439
1506
|
get children() {
|
|
1440
|
-
var e =
|
|
1507
|
+
var e = Wt(), t = e.firstChild;
|
|
1441
1508
|
return s(e, () => n.memberCount, t), s(e, () => n.memberCount === 1 ? "member" : "members", null), e;
|
|
1442
1509
|
}
|
|
1443
1510
|
}), null), r;
|
|
1444
|
-
})(),
|
|
1445
|
-
let { create: r, error: a } =
|
|
1511
|
+
})(), qt = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), Jt = /* @__PURE__ */ u("<form class=space-y-6><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-org-create-name>Organization name</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-org-create-name name=name type=text required maxlength=120 autocomplete=organization></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-org-create-slug>Slug</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 font-mono text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-org-create-slug name=slug type=text required pattern=[a-z0-9-]+ maxlength=64 aria-describedby=yauth-org-create-slug-hint><p id=yauth-org-create-slug-hint class=\"text-xs text-muted-foreground\">URL-safe identifier. Lowercase letters, numbers, and hyphens only.</p></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-org-create-display-name>Display name (optional)</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-org-create-display-name name=display_name type=text maxlength=120></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Yt = (n) => {
|
|
1512
|
+
let { create: r, error: a } = pe(), [c, l] = v(""), [u, d] = v(""), [f, p] = v(""), [m, g] = v(!1), [_, y] = v(!1);
|
|
1446
1513
|
h(() => {
|
|
1447
|
-
let e =
|
|
1514
|
+
let e = fe(c());
|
|
1448
1515
|
m() || p(e);
|
|
1449
1516
|
});
|
|
1450
1517
|
let b = (e) => {
|
|
1451
|
-
g(!0), p(
|
|
1518
|
+
g(!0), p(fe(e.currentTarget.value));
|
|
1452
1519
|
}, x = async (e) => {
|
|
1453
1520
|
if (e.preventDefault(), !c().trim() || !f().trim()) return;
|
|
1454
1521
|
y(!0);
|
|
@@ -1460,13 +1527,13 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1460
1527
|
y(!1), t ? (n.onSuccess?.(t), l(""), d(""), p(""), g(!1)) : a() && n.onError?.(Error(a()));
|
|
1461
1528
|
};
|
|
1462
1529
|
return (() => {
|
|
1463
|
-
var n =
|
|
1530
|
+
var n = Jt(), r = n.firstChild, p = r.firstChild.nextSibling, m = r.nextSibling, h = m.firstChild.nextSibling, g = m.nextSibling, v = g.firstChild.nextSibling, y = g.nextSibling;
|
|
1464
1531
|
return t(n, "submit", x), s(n, i(e, {
|
|
1465
1532
|
get when() {
|
|
1466
1533
|
return a();
|
|
1467
1534
|
},
|
|
1468
1535
|
get children() {
|
|
1469
|
-
var e =
|
|
1536
|
+
var e = qt();
|
|
1470
1537
|
return s(e, a), e;
|
|
1471
1538
|
}
|
|
1472
1539
|
}), r), t(p, "input", (e) => l(e.currentTarget.value)), t(h, "input", b), t(v, "input", (e) => d(e.currentTarget.value)), s(y, () => _() ? "Creating…" : "Create organization"), o((e) => {
|
|
@@ -1479,16 +1546,16 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1479
1546
|
o: void 0
|
|
1480
1547
|
}), o(() => p.value = c()), o(() => h.value = f()), o(() => v.value = u()), n;
|
|
1481
1548
|
})();
|
|
1482
|
-
},
|
|
1483
|
-
let { organization: n, loading: r, error: a } =
|
|
1549
|
+
}, Xt = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), Zt = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading organization…"), Qt = /* @__PURE__ */ u("<section class=space-y-6>"), $t = /* @__PURE__ */ u("<div class=space-y-2><h2 class=\"text-lg font-semibold\"></h2><p class=\"font-mono text-xs text-muted-foreground\">@"), en = /* @__PURE__ */ u("<div class=space-y-3><h3 class=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">Members"), tn = /* @__PURE__ */ u("<div class=space-y-3><h3 class=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">Invite a member"), nn = (t) => {
|
|
1550
|
+
let { organization: n, loading: r, error: a } = me(() => t.organizationId);
|
|
1484
1551
|
return (() => {
|
|
1485
|
-
var o =
|
|
1552
|
+
var o = Qt();
|
|
1486
1553
|
return s(o, i(e, {
|
|
1487
1554
|
get when() {
|
|
1488
1555
|
return a();
|
|
1489
1556
|
},
|
|
1490
1557
|
get children() {
|
|
1491
|
-
var e =
|
|
1558
|
+
var e = Xt();
|
|
1492
1559
|
return s(e, a), e;
|
|
1493
1560
|
}
|
|
1494
1561
|
}), null), s(o, i(e, {
|
|
@@ -1496,7 +1563,7 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1496
1563
|
return c(() => !!r())() && !n();
|
|
1497
1564
|
},
|
|
1498
1565
|
get children() {
|
|
1499
|
-
return
|
|
1566
|
+
return Zt();
|
|
1500
1567
|
}
|
|
1501
1568
|
}), null), s(o, i(e, {
|
|
1502
1569
|
get when() {
|
|
@@ -1504,12 +1571,12 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1504
1571
|
},
|
|
1505
1572
|
children: (n) => [
|
|
1506
1573
|
(() => {
|
|
1507
|
-
var e =
|
|
1574
|
+
var e = $t(), t = e.firstChild, r = t.nextSibling;
|
|
1508
1575
|
return r.firstChild, s(t, () => n().display_name || n().name), s(r, () => n().slug, null), e;
|
|
1509
1576
|
})(),
|
|
1510
1577
|
(() => {
|
|
1511
|
-
var e =
|
|
1512
|
-
return e.firstChild, s(e, i(
|
|
1578
|
+
var e = en();
|
|
1579
|
+
return e.firstChild, s(e, i(kt, { get organizationId() {
|
|
1513
1580
|
return n().id;
|
|
1514
1581
|
} }), null), e;
|
|
1515
1582
|
})(),
|
|
@@ -1518,8 +1585,8 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1518
1585
|
return t.canInvite !== !1;
|
|
1519
1586
|
},
|
|
1520
1587
|
get children() {
|
|
1521
|
-
var e =
|
|
1522
|
-
return e.firstChild, s(e, i(
|
|
1588
|
+
var e = tn();
|
|
1589
|
+
return e.firstChild, s(e, i(Qe, { get organizationId() {
|
|
1523
1590
|
return n().id;
|
|
1524
1591
|
} }), null), e;
|
|
1525
1592
|
}
|
|
@@ -1527,16 +1594,16 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1527
1594
|
]
|
|
1528
1595
|
}), null), o;
|
|
1529
1596
|
})();
|
|
1530
|
-
},
|
|
1531
|
-
let { organizations: n, loading: r, error: a } =
|
|
1597
|
+
}, rn = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert aria-live=polite>"), an = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading organizations…"), on = /* @__PURE__ */ u("<div class=\"rounded-md border border-dashed border-input px-4 py-6 text-center text-sm text-muted-foreground\">You're not in any organizations yet."), sn = /* @__PURE__ */ u("<ul class=space-y-2>"), cn = /* @__PURE__ */ u("<div class=space-y-3>"), ln = /* @__PURE__ */ u("<li>"), un = (t) => {
|
|
1598
|
+
let { organizations: n, loading: r, error: a } = pe();
|
|
1532
1599
|
return (() => {
|
|
1533
|
-
var o =
|
|
1600
|
+
var o = cn();
|
|
1534
1601
|
return s(o, i(e, {
|
|
1535
1602
|
get when() {
|
|
1536
1603
|
return a();
|
|
1537
1604
|
},
|
|
1538
1605
|
get children() {
|
|
1539
|
-
var e =
|
|
1606
|
+
var e = rn();
|
|
1540
1607
|
return s(e, a), e;
|
|
1541
1608
|
}
|
|
1542
1609
|
}), null), s(o, i(e, {
|
|
@@ -1544,28 +1611,28 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1544
1611
|
return c(() => !!r())() && n().length === 0;
|
|
1545
1612
|
},
|
|
1546
1613
|
get children() {
|
|
1547
|
-
return
|
|
1614
|
+
return an();
|
|
1548
1615
|
}
|
|
1549
1616
|
}), null), s(o, i(e, {
|
|
1550
1617
|
get when() {
|
|
1551
1618
|
return c(() => !r())() && n().length === 0;
|
|
1552
1619
|
},
|
|
1553
1620
|
get children() {
|
|
1554
|
-
return
|
|
1621
|
+
return on();
|
|
1555
1622
|
}
|
|
1556
1623
|
}), null), s(o, i(e, {
|
|
1557
1624
|
get when() {
|
|
1558
1625
|
return n().length > 0;
|
|
1559
1626
|
},
|
|
1560
1627
|
get children() {
|
|
1561
|
-
var e =
|
|
1628
|
+
var e = sn();
|
|
1562
1629
|
return s(e, i(f, {
|
|
1563
1630
|
get each() {
|
|
1564
1631
|
return n();
|
|
1565
1632
|
},
|
|
1566
1633
|
children: (e) => (() => {
|
|
1567
|
-
var n =
|
|
1568
|
-
return s(n, i(
|
|
1634
|
+
var n = ln();
|
|
1635
|
+
return s(n, i(Kt, {
|
|
1569
1636
|
organization: e,
|
|
1570
1637
|
get onSelect() {
|
|
1571
1638
|
return t.onSelect;
|
|
@@ -1579,8 +1646,8 @@ var It = /* @__PURE__ */ u("<span class=\"rounded-full bg-secondary px-2 py-0.5
|
|
|
1579
1646
|
};
|
|
1580
1647
|
//#endregion
|
|
1581
1648
|
//#region src/hooks/create-active-org.ts
|
|
1582
|
-
function
|
|
1583
|
-
let { client: e } =
|
|
1649
|
+
function dn() {
|
|
1650
|
+
let { client: e } = q(), [t, n] = v(null), [r, i] = v([]), [a, o] = v(!1), [s, c] = v(null), l = (e) => {
|
|
1584
1651
|
n(e.active_org_id ?? null), i(e.orgs);
|
|
1585
1652
|
}, u = async () => {
|
|
1586
1653
|
if (!e?.organizations) {
|
|
@@ -1630,8 +1697,8 @@ function rn() {
|
|
|
1630
1697
|
}
|
|
1631
1698
|
//#endregion
|
|
1632
1699
|
//#region src/components/organization-switcher.tsx
|
|
1633
|
-
var
|
|
1634
|
-
let { activeOrgId: r, orgs: a, loading: c, switchTo: u } =
|
|
1700
|
+
var fn = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground\">No organizations."), pn = /* @__PURE__ */ u("<div class=\"absolute z-50 mt-1 max-h-64 w-full overflow-auto rounded-md border border-input bg-popover text-popover-foreground shadow-md\"role=listbox>"), mn = /* @__PURE__ */ u("<div class=\"relative inline-block w-full\"><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"type=button aria-haspopup=listbox aria-label=\"Switch organization\"><span class=truncate></span><svg class=\"h-4 w-4 shrink-0 opacity-50\"viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2 aria-hidden=true><polyline points=\"6 9 12 15 18 9\">"), hn = /* @__PURE__ */ u("<div class=\"truncate font-mono text-xs text-muted-foreground\">@"), gn = /* @__PURE__ */ u("<svg class=\"h-4 w-4 shrink-0\"viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2 aria-hidden=true><polyline points=\"20 6 9 17 4 12\">"), _n = /* @__PURE__ */ u("<button class=\"flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2 text-left text-sm hover:bg-accent focus-visible:bg-accent focus-visible:outline-none\"type=button role=option><div class=\"min-w-0 flex-1\"><div class=\"truncate font-medium\">"), vn = (n) => {
|
|
1701
|
+
let { activeOrgId: r, orgs: a, loading: c, switchTo: u } = dn(), [p, m] = v(!1), h, g = () => n.activeId === void 0 ? r() : n.activeId, _ = () => a().find((e) => e.organization_id === g()) ?? null, b = (e) => {
|
|
1635
1702
|
h && (h.contains(e.target) || (m(!1), document.removeEventListener("mousedown", b)));
|
|
1636
1703
|
}, x = () => {
|
|
1637
1704
|
let e = !p();
|
|
@@ -1644,25 +1711,25 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1644
1711
|
return y(() => {
|
|
1645
1712
|
document.removeEventListener("mousedown", b);
|
|
1646
1713
|
}), (() => {
|
|
1647
|
-
var n =
|
|
1714
|
+
var n = mn(), r = n.firstChild, u = r.firstChild, m = h;
|
|
1648
1715
|
return typeof m == "function" ? d(m, n) : h = n, t(r, "click", x), s(u, () => _()?.display_name || _()?.slug || (c() ? "Loading…" : "Select organization")), s(n, i(e, {
|
|
1649
1716
|
get when() {
|
|
1650
1717
|
return p();
|
|
1651
1718
|
},
|
|
1652
1719
|
get children() {
|
|
1653
|
-
var n =
|
|
1720
|
+
var n = pn();
|
|
1654
1721
|
return s(n, i(f, {
|
|
1655
1722
|
get each() {
|
|
1656
1723
|
return a();
|
|
1657
1724
|
},
|
|
1658
1725
|
children: (n) => (() => {
|
|
1659
|
-
var r =
|
|
1726
|
+
var r = _n(), a = r.firstChild, c = a.firstChild;
|
|
1660
1727
|
return t(r, "click", () => void S(n)), s(c, () => n.display_name || n.slug || n.organization_id), s(a, i(e, {
|
|
1661
1728
|
get when() {
|
|
1662
1729
|
return n.slug;
|
|
1663
1730
|
},
|
|
1664
1731
|
get children() {
|
|
1665
|
-
var e =
|
|
1732
|
+
var e = hn();
|
|
1666
1733
|
return e.firstChild, s(e, () => n.slug, null), e;
|
|
1667
1734
|
}
|
|
1668
1735
|
}), null), s(r, i(e, {
|
|
@@ -1670,7 +1737,7 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1670
1737
|
return n.organization_id === g();
|
|
1671
1738
|
},
|
|
1672
1739
|
get children() {
|
|
1673
|
-
return
|
|
1740
|
+
return gn();
|
|
1674
1741
|
}
|
|
1675
1742
|
}), null), o(() => l(r, "aria-selected", n.organization_id === g())), r;
|
|
1676
1743
|
})()
|
|
@@ -1679,7 +1746,7 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1679
1746
|
return a().length === 0;
|
|
1680
1747
|
},
|
|
1681
1748
|
get children() {
|
|
1682
|
-
return
|
|
1749
|
+
return fn();
|
|
1683
1750
|
}
|
|
1684
1751
|
}), null), n;
|
|
1685
1752
|
}
|
|
@@ -1691,8 +1758,8 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1691
1758
|
t: void 0
|
|
1692
1759
|
}), n;
|
|
1693
1760
|
})();
|
|
1694
|
-
},
|
|
1695
|
-
let { client: t, user: n, loading: r } =
|
|
1761
|
+
}, yn = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading profile..."), bn = /* @__PURE__ */ u("<div class=space-y-8>"), xn = /* @__PURE__ */ u("<dt class=\"font-medium text-muted-foreground\">Display name"), Sn = /* @__PURE__ */ u("<dd>"), Cn = /* @__PURE__ */ u("<section class=space-y-4><h2 class=\"text-lg font-semibold tracking-tight\">Profile</h2><dl class=\"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm\"><dt class=\"font-medium text-muted-foreground\">Email</dt><dd></dd><dt class=\"font-medium text-muted-foreground\">Email verified</dt><dd></dd><dt class=\"font-medium text-muted-foreground\">Role</dt><dd>"), wn = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), Tn = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading passkeys..."), En = /* @__PURE__ */ u("<section class=space-y-4><h2 class=\"text-lg font-semibold tracking-tight\">Passkeys"), Dn = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading accounts..."), On = /* @__PURE__ */ u("<section class=space-y-4><h2 class=\"text-lg font-semibold tracking-tight\">Connected accounts"), kn = /* @__PURE__ */ u("<div class=\"flex gap-2\"><button class=\"inline-flex h-9 cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button></button><button class=\"inline-flex h-9 cursor-pointer items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm transition-colors hover:bg-destructive hover:text-destructive-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>"), An = /* @__PURE__ */ u("<div class=space-y-4><p class=\"text-sm text-muted-foreground\">Add this account to your authenticator app, then enter the verification code.</p><div class=space-y-1><span class=\"text-sm font-medium leading-none\">OTP Auth URI</span><code class=\"block w-full break-all rounded-md border border-input bg-muted px-3 py-2 text-xs\"></code></div><div class=space-y-1><span class=\"text-sm font-medium leading-none\">Manual entry key</span><code class=\"block w-full break-all rounded-md border border-input bg-muted px-3 py-2 text-xs font-mono tracking-wider\"></code></div><form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-profile-mfa-code>Verification code</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-profile-mfa-code name=mfa_code type=text inputmode=numeric autocomplete=one-time-code required></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), jn = /* @__PURE__ */ u("<div class=space-y-4><div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">Two-factor authentication is enabled. Save these backup codes in a safe place.</div><ul class=space-y-1>"), Mn = /* @__PURE__ */ u("<section class=space-y-4><h2 class=\"text-lg font-semibold tracking-tight\">Two-factor authentication"), Nn = /* @__PURE__ */ u("<ul class=space-y-2>"), Pn = /* @__PURE__ */ u("<p class=\"text-sm text-muted-foreground\">No passkeys registered."), Fn = /* @__PURE__ */ u("<li class=\"flex items-center justify-between rounded-md border border-input px-3 py-2\"><div class=space-y-0.5><span class=\"text-sm font-medium\"></span><span class=\"block text-xs text-muted-foreground\">Added </span></div><button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-destructive hover:text-destructive-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>"), In = /* @__PURE__ */ u("<p class=\"text-sm text-muted-foreground\">No connected accounts."), Ln = /* @__PURE__ */ u("<li class=\"flex items-center justify-between rounded-md border border-input px-3 py-2\"><div class=space-y-0.5><span class=\"text-sm font-medium\"></span><span class=\"block text-xs text-muted-foreground\">Connected </span></div><button class=\"inline-flex h-8 cursor-pointer items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-destructive hover:text-destructive-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=button>"), Rn = /* @__PURE__ */ u("<li class=\"rounded-md border border-input bg-muted px-3 py-1.5 text-center font-mono text-sm tracking-wider\">"), zn = () => {
|
|
1762
|
+
let { client: t, user: n, loading: r } = q(), a = t?.passkey, c = t?.oauth, l = t?.mfa, u = !!a, d = !!c, p = !!l, [m, { refetch: h }] = _(async () => {
|
|
1696
1763
|
if (!a) return [];
|
|
1697
1764
|
try {
|
|
1698
1765
|
return (await a.list()).items;
|
|
@@ -1706,7 +1773,7 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1706
1773
|
} catch {
|
|
1707
1774
|
return [];
|
|
1708
1775
|
}
|
|
1709
|
-
}), [w, T] = v(null), [E, D] = v(null), [O, k] = v(""), [
|
|
1776
|
+
}), [w, T] = v(null), [E, D] = v(null), [O, k] = v(""), [A, j] = v(""), [M, ee] = v(""), [N, P] = v([]), [F, I] = v("idle"), [L, R] = v(null), [z, B] = v(!1), V = async (e) => {
|
|
1710
1777
|
y(null), x(e);
|
|
1711
1778
|
try {
|
|
1712
1779
|
await a.delete(e), h();
|
|
@@ -1715,7 +1782,7 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1715
1782
|
} finally {
|
|
1716
1783
|
x(null);
|
|
1717
1784
|
}
|
|
1718
|
-
},
|
|
1785
|
+
}, H = async (e) => {
|
|
1719
1786
|
T(null), D(e);
|
|
1720
1787
|
try {
|
|
1721
1788
|
await c.unlink(e), C();
|
|
@@ -1724,44 +1791,44 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1724
1791
|
} finally {
|
|
1725
1792
|
D(null);
|
|
1726
1793
|
}
|
|
1727
|
-
},
|
|
1728
|
-
|
|
1794
|
+
}, U = async () => {
|
|
1795
|
+
R(null), B(!0);
|
|
1729
1796
|
try {
|
|
1730
1797
|
let e = await l.setup();
|
|
1731
|
-
k(e.otpauth_url),
|
|
1798
|
+
k(e.otpauth_url), j(e.secret), P(e.backup_codes), I("confirm");
|
|
1732
1799
|
} catch (e) {
|
|
1733
|
-
|
|
1800
|
+
R((e instanceof Error ? e : Error(String(e))).message);
|
|
1734
1801
|
} finally {
|
|
1735
|
-
|
|
1802
|
+
B(!1);
|
|
1736
1803
|
}
|
|
1737
|
-
},
|
|
1738
|
-
e.preventDefault(),
|
|
1804
|
+
}, W = async (e) => {
|
|
1805
|
+
e.preventDefault(), R(null), B(!0);
|
|
1739
1806
|
try {
|
|
1740
1807
|
let t = e.currentTarget, n = new FormData(t);
|
|
1741
|
-
await l.confirm({ code: n.get("mfa_code") ||
|
|
1808
|
+
await l.confirm({ code: n.get("mfa_code") || M() }), I("done");
|
|
1742
1809
|
} catch (e) {
|
|
1743
|
-
|
|
1810
|
+
R((e instanceof Error ? e : Error(String(e))).message);
|
|
1744
1811
|
} finally {
|
|
1745
|
-
|
|
1812
|
+
B(!1);
|
|
1746
1813
|
}
|
|
1747
|
-
},
|
|
1748
|
-
|
|
1814
|
+
}, G = async () => {
|
|
1815
|
+
R(null), B(!0);
|
|
1749
1816
|
try {
|
|
1750
|
-
await l.disable(),
|
|
1817
|
+
await l.disable(), I("idle"), k(""), j(""), ee(""), P([]);
|
|
1751
1818
|
} catch (e) {
|
|
1752
|
-
|
|
1819
|
+
R((e instanceof Error ? e : Error(String(e))).message);
|
|
1753
1820
|
} finally {
|
|
1754
|
-
|
|
1821
|
+
B(!1);
|
|
1755
1822
|
}
|
|
1756
1823
|
};
|
|
1757
1824
|
return (() => {
|
|
1758
|
-
var t =
|
|
1825
|
+
var t = bn();
|
|
1759
1826
|
return s(t, i(e, {
|
|
1760
1827
|
get when() {
|
|
1761
1828
|
return r();
|
|
1762
1829
|
},
|
|
1763
1830
|
get children() {
|
|
1764
|
-
return
|
|
1831
|
+
return yn();
|
|
1765
1832
|
}
|
|
1766
1833
|
}), null), s(t, i(e, {
|
|
1767
1834
|
get when() {
|
|
@@ -1769,14 +1836,14 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1769
1836
|
},
|
|
1770
1837
|
children: (t) => [
|
|
1771
1838
|
(() => {
|
|
1772
|
-
var n =
|
|
1839
|
+
var n = Cn(), r = n.firstChild.nextSibling, a = r.firstChild.nextSibling, o = a.nextSibling, c = o.nextSibling, l = c.nextSibling.nextSibling;
|
|
1773
1840
|
return s(a, () => t().email), s(r, i(e, {
|
|
1774
1841
|
get when() {
|
|
1775
1842
|
return t().display_name;
|
|
1776
1843
|
},
|
|
1777
1844
|
get children() {
|
|
1778
|
-
return [
|
|
1779
|
-
var e =
|
|
1845
|
+
return [xn(), (() => {
|
|
1846
|
+
var e = Sn();
|
|
1780
1847
|
return s(e, () => t().display_name), e;
|
|
1781
1848
|
})()];
|
|
1782
1849
|
}
|
|
@@ -1785,13 +1852,13 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1785
1852
|
i(e, {
|
|
1786
1853
|
when: u,
|
|
1787
1854
|
get children() {
|
|
1788
|
-
var t =
|
|
1855
|
+
var t = En();
|
|
1789
1856
|
return t.firstChild, s(t, i(e, {
|
|
1790
1857
|
get when() {
|
|
1791
1858
|
return g();
|
|
1792
1859
|
},
|
|
1793
1860
|
get children() {
|
|
1794
|
-
var e =
|
|
1861
|
+
var e = wn();
|
|
1795
1862
|
return s(e, g), e;
|
|
1796
1863
|
}
|
|
1797
1864
|
}), null), s(t, i(e, {
|
|
@@ -1799,7 +1866,7 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1799
1866
|
return m.loading;
|
|
1800
1867
|
},
|
|
1801
1868
|
get children() {
|
|
1802
|
-
return
|
|
1869
|
+
return Tn();
|
|
1803
1870
|
}
|
|
1804
1871
|
}), null), s(t, i(e, {
|
|
1805
1872
|
get when() {
|
|
@@ -1810,19 +1877,19 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1810
1877
|
return t().length > 0;
|
|
1811
1878
|
},
|
|
1812
1879
|
get fallback() {
|
|
1813
|
-
return
|
|
1880
|
+
return Pn();
|
|
1814
1881
|
},
|
|
1815
1882
|
get children() {
|
|
1816
|
-
var e =
|
|
1883
|
+
var e = Nn();
|
|
1817
1884
|
return s(e, i(f, {
|
|
1818
1885
|
get each() {
|
|
1819
1886
|
return t();
|
|
1820
1887
|
},
|
|
1821
1888
|
children: (e) => (() => {
|
|
1822
|
-
var t =
|
|
1889
|
+
var t = Fn(), n = t.firstChild, r = n.firstChild, i = r.nextSibling;
|
|
1823
1890
|
i.firstChild;
|
|
1824
1891
|
var a = n.nextSibling;
|
|
1825
|
-
return s(r, () => e.name ?? "Unnamed passkey"), s(i, () => new Date(e.created_at).toLocaleDateString(), null), a.$$click = () =>
|
|
1892
|
+
return s(r, () => e.name ?? "Unnamed passkey"), s(i, () => new Date(e.created_at).toLocaleDateString(), null), a.$$click = () => V(e.id), s(a, () => b() === e.id ? "Deleting..." : "Delete"), o(() => a.disabled = b() === e.id), t;
|
|
1826
1893
|
})()
|
|
1827
1894
|
})), e;
|
|
1828
1895
|
}
|
|
@@ -1833,13 +1900,13 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1833
1900
|
i(e, {
|
|
1834
1901
|
when: d,
|
|
1835
1902
|
get children() {
|
|
1836
|
-
var t =
|
|
1903
|
+
var t = On();
|
|
1837
1904
|
return t.firstChild, s(t, i(e, {
|
|
1838
1905
|
get when() {
|
|
1839
1906
|
return w();
|
|
1840
1907
|
},
|
|
1841
1908
|
get children() {
|
|
1842
|
-
var e =
|
|
1909
|
+
var e = wn();
|
|
1843
1910
|
return s(e, w), e;
|
|
1844
1911
|
}
|
|
1845
1912
|
}), null), s(t, i(e, {
|
|
@@ -1847,7 +1914,7 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1847
1914
|
return S.loading;
|
|
1848
1915
|
},
|
|
1849
1916
|
get children() {
|
|
1850
|
-
return
|
|
1917
|
+
return Dn();
|
|
1851
1918
|
}
|
|
1852
1919
|
}), null), s(t, i(e, {
|
|
1853
1920
|
get when() {
|
|
@@ -1858,19 +1925,19 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1858
1925
|
return t().length > 0;
|
|
1859
1926
|
},
|
|
1860
1927
|
get fallback() {
|
|
1861
|
-
return
|
|
1928
|
+
return In();
|
|
1862
1929
|
},
|
|
1863
1930
|
get children() {
|
|
1864
|
-
var e =
|
|
1931
|
+
var e = Nn();
|
|
1865
1932
|
return s(e, i(f, {
|
|
1866
1933
|
get each() {
|
|
1867
1934
|
return t();
|
|
1868
1935
|
},
|
|
1869
1936
|
children: (e) => (() => {
|
|
1870
|
-
var t =
|
|
1937
|
+
var t = Ln(), n = t.firstChild, r = n.firstChild, i = r.nextSibling;
|
|
1871
1938
|
i.firstChild;
|
|
1872
1939
|
var a = n.nextSibling;
|
|
1873
|
-
return s(r, () => e.provider.charAt(0).toUpperCase() + e.provider.slice(1)), s(i, () => new Date(e.created_at).toLocaleDateString(), null), a.$$click = () =>
|
|
1940
|
+
return s(r, () => e.provider.charAt(0).toUpperCase() + e.provider.slice(1)), s(i, () => new Date(e.created_at).toLocaleDateString(), null), a.$$click = () => H(e.provider), s(a, () => E() === e.provider ? "Unlinking..." : "Unlink"), o(() => a.disabled = E() === e.provider), t;
|
|
1874
1941
|
})()
|
|
1875
1942
|
})), e;
|
|
1876
1943
|
}
|
|
@@ -1881,23 +1948,23 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1881
1948
|
i(e, {
|
|
1882
1949
|
when: p,
|
|
1883
1950
|
get children() {
|
|
1884
|
-
var t =
|
|
1951
|
+
var t = Mn();
|
|
1885
1952
|
return t.firstChild, s(t, i(e, {
|
|
1886
1953
|
get when() {
|
|
1887
|
-
return
|
|
1954
|
+
return L();
|
|
1888
1955
|
},
|
|
1889
1956
|
get children() {
|
|
1890
|
-
var e =
|
|
1891
|
-
return s(e,
|
|
1957
|
+
var e = wn();
|
|
1958
|
+
return s(e, L), e;
|
|
1892
1959
|
}
|
|
1893
1960
|
}), null), s(t, i(e, {
|
|
1894
1961
|
get when() {
|
|
1895
|
-
return
|
|
1962
|
+
return F() === "idle";
|
|
1896
1963
|
},
|
|
1897
1964
|
get children() {
|
|
1898
|
-
var e =
|
|
1899
|
-
return t.$$click =
|
|
1900
|
-
var r =
|
|
1965
|
+
var e = kn(), t = e.firstChild, n = t.nextSibling;
|
|
1966
|
+
return t.$$click = U, s(t, () => z() ? "Setting up..." : "Set up 2FA"), n.$$click = G, s(n, () => z() ? "Disabling..." : "Disable 2FA"), o((e) => {
|
|
1967
|
+
var r = z(), i = z();
|
|
1901
1968
|
return r !== e.e && (t.disabled = e.e = r), i !== e.t && (n.disabled = e.t = i), e;
|
|
1902
1969
|
}, {
|
|
1903
1970
|
e: void 0,
|
|
@@ -1906,30 +1973,30 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1906
1973
|
}
|
|
1907
1974
|
}), null), s(t, i(e, {
|
|
1908
1975
|
get when() {
|
|
1909
|
-
return
|
|
1976
|
+
return F() === "confirm";
|
|
1910
1977
|
},
|
|
1911
1978
|
get children() {
|
|
1912
|
-
var e =
|
|
1913
|
-
return s(n, O), s(i,
|
|
1914
|
-
var t =
|
|
1979
|
+
var e = An(), t = e.firstChild.nextSibling, n = t.firstChild.nextSibling, r = t.nextSibling, i = r.firstChild.nextSibling, a = r.nextSibling, c = a.firstChild, l = c.firstChild.nextSibling, u = c.nextSibling;
|
|
1980
|
+
return s(n, O), s(i, A), a.addEventListener("submit", W), l.$$input = (e) => ee(e.currentTarget.value), s(u, () => z() ? "Verifying..." : "Verify and enable"), o((e) => {
|
|
1981
|
+
var t = z(), n = z();
|
|
1915
1982
|
return t !== e.e && (l.disabled = e.e = t), n !== e.t && (u.disabled = e.t = n), e;
|
|
1916
1983
|
}, {
|
|
1917
1984
|
e: void 0,
|
|
1918
1985
|
t: void 0
|
|
1919
|
-
}), o(() => l.value =
|
|
1986
|
+
}), o(() => l.value = M()), e;
|
|
1920
1987
|
}
|
|
1921
1988
|
}), null), s(t, i(e, {
|
|
1922
1989
|
get when() {
|
|
1923
|
-
return
|
|
1990
|
+
return F() === "done";
|
|
1924
1991
|
},
|
|
1925
1992
|
get children() {
|
|
1926
|
-
var e =
|
|
1993
|
+
var e = jn(), t = e.firstChild.nextSibling;
|
|
1927
1994
|
return s(t, i(f, {
|
|
1928
1995
|
get each() {
|
|
1929
|
-
return
|
|
1996
|
+
return N();
|
|
1930
1997
|
},
|
|
1931
1998
|
children: (e) => (() => {
|
|
1932
|
-
var t =
|
|
1999
|
+
var t = Rn();
|
|
1933
2000
|
return s(t, e), t;
|
|
1934
2001
|
})()
|
|
1935
2002
|
})), e;
|
|
@@ -1944,8 +2011,8 @@ var an = /* @__PURE__ */ u("<div class=\"px-3 py-2 text-sm text-muted-foreground
|
|
|
1944
2011
|
a(["click", "input"]);
|
|
1945
2012
|
//#endregion
|
|
1946
2013
|
//#region src/components/register-form.tsx
|
|
1947
|
-
var
|
|
1948
|
-
let { client: n } =
|
|
2014
|
+
var Bn = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), Vn = /* @__PURE__ */ u("<form class=space-y-6><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-register-email>Email</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-register-email name=email type=email required autocomplete=email></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-register-password>Password</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-register-password name=password type=password required autocomplete=new-password></div><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-register-display-name>Display name (optional)</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-register-display-name name=display_name type=text autocomplete=name></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Hn = (t) => {
|
|
2015
|
+
let { client: n } = q(), r = n?.emailPassword;
|
|
1949
2016
|
if (!r) return null;
|
|
1950
2017
|
let [a, c] = v(""), [l, u] = v(""), [d, f] = v(""), [p, m] = v(null), [h, g] = v(!1), _ = async (e) => {
|
|
1951
2018
|
e.preventDefault(), m(null), g(!0);
|
|
@@ -1964,13 +2031,13 @@ var Nn = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1964
2031
|
}
|
|
1965
2032
|
};
|
|
1966
2033
|
return (() => {
|
|
1967
|
-
var t =
|
|
2034
|
+
var t = Vn(), n = t.firstChild, r = n.firstChild.nextSibling, m = n.nextSibling, g = m.firstChild.nextSibling, v = m.nextSibling, y = v.firstChild.nextSibling, b = v.nextSibling;
|
|
1968
2035
|
return t.addEventListener("submit", _), s(t, i(e, {
|
|
1969
2036
|
get when() {
|
|
1970
2037
|
return p();
|
|
1971
2038
|
},
|
|
1972
2039
|
get children() {
|
|
1973
|
-
var e =
|
|
2040
|
+
var e = Bn();
|
|
1974
2041
|
return s(e, p), e;
|
|
1975
2042
|
}
|
|
1976
2043
|
}), n), r.$$input = (e) => c(e.currentTarget.value), g.$$input = (e) => u(e.currentTarget.value), y.$$input = (e) => f(e.currentTarget.value), s(b, () => h() ? "Creating account..." : "Create account"), o((e) => {
|
|
@@ -1987,8 +2054,8 @@ var Nn = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
1987
2054
|
a(["input"]);
|
|
1988
2055
|
//#endregion
|
|
1989
2056
|
//#region src/components/reset-password-form.tsx
|
|
1990
|
-
var
|
|
1991
|
-
let { client: n } =
|
|
2057
|
+
var Un = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), Wn = /* @__PURE__ */ u("<div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">"), Gn = /* @__PURE__ */ u("<form class=space-y-4><div class=space-y-2><label class=\"text-sm font-medium leading-none\"for=yauth-reset-password-input>New password</label><input class=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\"id=yauth-reset-password-input name=password type=password required autocomplete=new-password></div><button class=\"inline-flex h-9 w-full cursor-pointer items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"type=submit>"), Kn = (t) => {
|
|
2058
|
+
let { client: n } = q(), r = n?.emailPassword;
|
|
1992
2059
|
if (!r) return null;
|
|
1993
2060
|
let [a, c] = v(""), [l, u] = v(null), [d, f] = v(null), [p, m] = v(!1), h = async (e) => {
|
|
1994
2061
|
e.preventDefault(), u(null), f(null), m(!0);
|
|
@@ -2005,13 +2072,13 @@ var In = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
2005
2072
|
}
|
|
2006
2073
|
};
|
|
2007
2074
|
return (() => {
|
|
2008
|
-
var t =
|
|
2075
|
+
var t = Gn(), n = t.firstChild, r = n.firstChild.nextSibling, u = n.nextSibling;
|
|
2009
2076
|
return t.addEventListener("submit", h), s(t, i(e, {
|
|
2010
2077
|
get when() {
|
|
2011
2078
|
return l();
|
|
2012
2079
|
},
|
|
2013
2080
|
get children() {
|
|
2014
|
-
var e =
|
|
2081
|
+
var e = Un();
|
|
2015
2082
|
return s(e, l), e;
|
|
2016
2083
|
}
|
|
2017
2084
|
}), n), s(t, i(e, {
|
|
@@ -2019,7 +2086,7 @@ var In = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
2019
2086
|
return d();
|
|
2020
2087
|
},
|
|
2021
2088
|
get children() {
|
|
2022
|
-
var e =
|
|
2089
|
+
var e = Wn();
|
|
2023
2090
|
return s(e, d), e;
|
|
2024
2091
|
}
|
|
2025
2092
|
}), n), r.$$input = (e) => c(e.currentTarget.value), s(u, () => p() ? "Resetting..." : "Reset password"), o((e) => {
|
|
@@ -2034,8 +2101,8 @@ var In = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2
|
|
|
2034
2101
|
a(["input"]);
|
|
2035
2102
|
//#endregion
|
|
2036
2103
|
//#region src/hooks/create-sso-connections.ts
|
|
2037
|
-
function
|
|
2038
|
-
let { client: t } =
|
|
2104
|
+
function qn(e) {
|
|
2105
|
+
let { client: t } = q(), [n, r] = v([]), [i, a] = v(!1), [o, s] = v(null), c = async () => {
|
|
2039
2106
|
let n = e();
|
|
2040
2107
|
if (!n || !t?.organizations) {
|
|
2041
2108
|
r([]);
|
|
@@ -2107,21 +2174,21 @@ function Bn(e) {
|
|
|
2107
2174
|
}
|
|
2108
2175
|
//#endregion
|
|
2109
2176
|
//#region src/components/saml-connection-form.tsx
|
|
2110
|
-
var
|
|
2111
|
-
function
|
|
2112
|
-
let { create: t, error: n } =
|
|
2177
|
+
var Jn = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert>"), Yn = /* @__PURE__ */ u("<form class=space-y-4><div class=\"grid gap-3 md:grid-cols-2\"><label class=block><span class=\"text-xs font-medium\">Name</span><input required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"placeholder=\"Acme Okta SAML\"></label><label class=block><span class=\"text-xs font-medium\">IdP Entity ID</span><input required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"placeholder=\"urn:idp:acme:saml or https://acme.okta.com/...\"></label><label class=\"block md:col-span-2\"><span class=\"text-xs font-medium\">IdP Single Sign-On URL</span><input required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"placeholder=https://acme.okta.com/app/.../sso/saml></label><label class=\"block md:col-span-2\"><span class=\"text-xs font-medium\">IdP Single Logout URL (optional)</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"placeholder=https://acme.okta.com/app/.../slo/saml></label><label class=\"block md:col-span-2\"><span class=\"text-xs font-medium\">IdP X.509 Signing Certificate (PEM)</span><textarea required rows=6 class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"placeholder=\"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\"></textarea></label><label class=\"block md:col-span-2\"><span class=\"text-xs font-medium\">SP Private Key (PEM) — optional, only for SP signing or encrypted assertions</span><textarea rows=4 class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"placeholder=\"-----BEGIN PRIVATE KEY-----\"></textarea></label></div><fieldset class=\"rounded-md border p-3\"><legend class=\"px-1 text-xs font-medium\">Attribute mappings</legend><div class=\"grid gap-3 md:grid-cols-2\"><label class=block><span class=text-xs>email attribute</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"></label><label class=block><span class=text-xs>display_name attribute</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"></label><label class=block><span class=text-xs>external_id (default: NameID)</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"></label><label class=block><span class=text-xs>groups attribute</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"></label></div><div class=\"mt-3 space-y-2\"><div class=\"text-xs font-medium\">group → role</div><button type=button class=\"rounded-md border px-3 py-1 text-xs\">+ Add mapping</button></div></fieldset><fieldset class=\"rounded-md border p-3\"><legend class=\"px-1 text-xs font-medium\">Signing requirements</legend><div class=space-y-2><label class=\"flex items-center gap-2 text-xs\"><input type=checkbox>Require assertion signature (recommended)</label><label class=\"flex items-center gap-2 text-xs\"><input type=checkbox>Require response signature (recommended)</label><label class=\"flex items-center gap-2 text-xs\"><input type=checkbox>Require encrypted assertions (requires SP private key)</label><label class=\"flex items-center gap-2 text-xs\"><input type=checkbox>Allow IdP-initiated SSO (cross-tenant footgun — leave OFF unless the IdP sets <code>RelayState=cid:<uuid></code>)</label></div></fieldset><div class=\"flex items-center gap-4\"><label class=\"flex items-center gap-2 text-xs\"><input type=checkbox>JIT provisioning</label><label class=\"flex items-center gap-2 text-xs\">Default role:<select class=\"rounded-md border bg-background px-2 py-1\"><option value=owner>owner</option><option value=admin>admin</option><option value=member>member</option></select></label></div><button type=submit class=\"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50\">"), Xn = /* @__PURE__ */ u("<div class=\"flex items-center gap-2\"><input placeholder=\"group name\"class=\"flex-1 rounded-md border bg-background px-3 py-2 text-sm\"><select class=\"rounded-md border bg-background px-3 py-2 text-sm\"><option value=owner>owner</option><option value=admin>admin</option><option value=member>member</option></select><button type=button class=\"rounded-md border px-2 py-1 text-xs\">x");
|
|
2178
|
+
function Zn(e) {
|
|
2179
|
+
let { create: t, error: n } = qn(() => e.organizationId), [r, a] = v(""), [c, l] = v(""), [u, d] = v(""), [m, h] = v(""), [_, y] = v(""), [b, x] = v(""), [S, C] = v("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), [w, T] = v("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"), [E, D] = v("NameID"), [O, k] = v("http://schemas.xmlsoap.org/claims/Group"), [A, j] = v([{
|
|
2113
2180
|
group: "",
|
|
2114
2181
|
role: "member"
|
|
2115
|
-
}]), [
|
|
2116
|
-
|
|
2182
|
+
}]), [M, ee] = v(!0), [N, P] = v(!0), [F, I] = v(!1), [L, R] = v(!1), [z, B] = v(!0), [V, H] = v("member"), [U, W] = v(!1), G = g(() => r().trim() !== "" && c().trim() !== "" && u().trim().startsWith("http") && _().includes("BEGIN CERTIFICATE")), K = (e, t) => {
|
|
2183
|
+
j((n) => n.map((n, r) => r === e ? {
|
|
2117
2184
|
...n,
|
|
2118
2185
|
...t
|
|
2119
2186
|
} : n));
|
|
2120
|
-
},
|
|
2121
|
-
if (i.preventDefault(), !
|
|
2122
|
-
|
|
2187
|
+
}, q = async (i) => {
|
|
2188
|
+
if (i.preventDefault(), !G() || U()) return;
|
|
2189
|
+
W(!0);
|
|
2123
2190
|
let a = {};
|
|
2124
|
-
for (let { group: e, role: t } of
|
|
2191
|
+
for (let { group: e, role: t } of A()) {
|
|
2125
2192
|
let n = e.trim();
|
|
2126
2193
|
n && (a[n] = t);
|
|
2127
2194
|
}
|
|
@@ -2134,10 +2201,10 @@ function Wn(e) {
|
|
|
2134
2201
|
idp_slo_url: m().trim() || null,
|
|
2135
2202
|
idp_x509_cert: _().trim(),
|
|
2136
2203
|
sp_private_key: b().trim() || null,
|
|
2137
|
-
idp_initiated_sso_allowed:
|
|
2138
|
-
assertion_signed_required:
|
|
2139
|
-
response_signed_required:
|
|
2140
|
-
want_encrypted_assertions:
|
|
2204
|
+
idp_initiated_sso_allowed: L(),
|
|
2205
|
+
assertion_signed_required: M(),
|
|
2206
|
+
response_signed_required: N(),
|
|
2207
|
+
want_encrypted_assertions: F(),
|
|
2141
2208
|
attribute_mappings: {
|
|
2142
2209
|
email: S().trim(),
|
|
2143
2210
|
display_name: w().trim() || null,
|
|
@@ -2146,41 +2213,41 @@ function Wn(e) {
|
|
|
2146
2213
|
group_to_role: a
|
|
2147
2214
|
}
|
|
2148
2215
|
},
|
|
2149
|
-
jit_provisioning_enabled:
|
|
2150
|
-
default_role_on_jit:
|
|
2216
|
+
jit_provisioning_enabled: z(),
|
|
2217
|
+
default_role_on_jit: V()
|
|
2151
2218
|
});
|
|
2152
|
-
|
|
2219
|
+
W(!1), o ? e.onSuccess?.(o) : n() && e.onError?.(Error(n() ?? "create failed"));
|
|
2153
2220
|
};
|
|
2154
2221
|
return (() => {
|
|
2155
|
-
var e =
|
|
2156
|
-
return e.addEventListener("submit",
|
|
2222
|
+
var e = Yn(), t = e.firstChild, g = t.firstChild, v = g.firstChild.nextSibling, W = g.nextSibling, J = W.firstChild.nextSibling, Y = W.nextSibling, X = Y.firstChild.nextSibling, Z = Y.nextSibling, Q = Z.firstChild.nextSibling, te = Z.nextSibling, ne = te.firstChild.nextSibling, re = te.nextSibling.firstChild.nextSibling, ie = t.nextSibling, ae = ie.firstChild.nextSibling, oe = ae.firstChild, se = oe.firstChild.nextSibling, ce = oe.nextSibling, le = ce.firstChild.nextSibling, ue = ce.nextSibling, de = ue.firstChild.nextSibling, fe = ue.nextSibling.firstChild.nextSibling, pe = ae.nextSibling, me = pe.firstChild.nextSibling, he = ie.nextSibling, ge = he.firstChild.nextSibling.firstChild, $ = ge.firstChild, _e = ge.nextSibling, ve = _e.firstChild, ye = _e.nextSibling, be = ye.firstChild, xe = ye.nextSibling.firstChild, Se = he.nextSibling, Ce = Se.firstChild, we = Ce.firstChild, Te = Ce.nextSibling.firstChild.nextSibling, Ee = Se.nextSibling;
|
|
2223
|
+
return e.addEventListener("submit", q), s(e, i(p, {
|
|
2157
2224
|
get when() {
|
|
2158
2225
|
return n();
|
|
2159
2226
|
},
|
|
2160
2227
|
get children() {
|
|
2161
|
-
var e =
|
|
2228
|
+
var e = Jn();
|
|
2162
2229
|
return s(e, n), e;
|
|
2163
2230
|
}
|
|
2164
|
-
}), t), v.$$input = (e) => a(e.currentTarget.value),
|
|
2231
|
+
}), t), v.$$input = (e) => a(e.currentTarget.value), J.$$input = (e) => l(e.currentTarget.value), X.$$input = (e) => d(e.currentTarget.value), Q.$$input = (e) => h(e.currentTarget.value), ne.$$input = (e) => y(e.currentTarget.value), re.$$input = (e) => x(e.currentTarget.value), se.$$input = (e) => C(e.currentTarget.value), le.$$input = (e) => T(e.currentTarget.value), de.$$input = (e) => D(e.currentTarget.value), fe.$$input = (e) => k(e.currentTarget.value), s(pe, i(f, {
|
|
2165
2232
|
get each() {
|
|
2166
|
-
return
|
|
2233
|
+
return A();
|
|
2167
2234
|
},
|
|
2168
2235
|
children: (e, t) => (() => {
|
|
2169
|
-
var n =
|
|
2170
|
-
return r.$$input = (e) =>
|
|
2236
|
+
var n = Xn(), r = n.firstChild, i = r.nextSibling, a = i.nextSibling;
|
|
2237
|
+
return r.$$input = (e) => K(t(), { group: e.currentTarget.value }), i.addEventListener("change", (e) => K(t(), { role: e.currentTarget.value })), a.$$click = () => j((e) => e.filter((e, n) => n !== t())), o(() => r.value = e.group), o(() => i.value = e.role), n;
|
|
2171
2238
|
})()
|
|
2172
|
-
}),
|
|
2239
|
+
}), me), me.$$click = () => j((e) => [...e, {
|
|
2173
2240
|
group: "",
|
|
2174
2241
|
role: "member"
|
|
2175
|
-
}]),
|
|
2242
|
+
}]), $.addEventListener("change", (e) => ee(e.currentTarget.checked)), ve.addEventListener("change", (e) => P(e.currentTarget.checked)), be.addEventListener("change", (e) => I(e.currentTarget.checked)), xe.addEventListener("change", (e) => R(e.currentTarget.checked)), we.addEventListener("change", (e) => B(e.currentTarget.checked)), Te.addEventListener("change", (e) => H(e.currentTarget.value)), s(Ee, () => U() ? "Saving..." : "Create SAML connection"), o(() => Ee.disabled = !G() || U()), o(() => v.value = r()), o(() => J.value = c()), o(() => X.value = u()), o(() => Q.value = m()), o(() => ne.value = _()), o(() => re.value = b()), o(() => se.value = S()), o(() => le.value = w()), o(() => de.value = E()), o(() => fe.value = O()), o(() => $.checked = M()), o(() => ve.checked = N()), o(() => be.checked = F()), o(() => xe.checked = L()), o(() => we.checked = z()), o(() => Te.value = V()), e;
|
|
2176
2243
|
})();
|
|
2177
2244
|
}
|
|
2178
2245
|
a(["input", "click"]);
|
|
2179
2246
|
//#endregion
|
|
2180
2247
|
//#region src/components/saml-login-button.tsx
|
|
2181
|
-
var
|
|
2182
|
-
function
|
|
2183
|
-
let t =
|
|
2248
|
+
var Qn = /* @__PURE__ */ u("<a class=\"inline-flex items-center justify-center rounded-md border bg-background px-4 py-2 text-sm font-medium hover:bg-accent\"><svg class=\"mr-2 h-4 w-4\"viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2><title>SAML</title><path d=\"M21 2H3a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM7 17l5-5-5-5M13 17h4\">");
|
|
2249
|
+
function $n(e) {
|
|
2250
|
+
let t = q(), n = g(() => t.client.sso.samlLoginUrl({
|
|
2184
2251
|
org: e.orgSlug,
|
|
2185
2252
|
domain: e.domain,
|
|
2186
2253
|
redirectTo: e.redirectTo
|
|
@@ -2190,21 +2257,21 @@ function Kn(e) {
|
|
|
2190
2257
|
return r();
|
|
2191
2258
|
},
|
|
2192
2259
|
get children() {
|
|
2193
|
-
var t =
|
|
2260
|
+
var t = Qn();
|
|
2194
2261
|
return t.firstChild, s(t, () => e.label ?? "Sign in via SAML", null), o(() => l(t, "href", n())), t;
|
|
2195
2262
|
}
|
|
2196
2263
|
});
|
|
2197
2264
|
}
|
|
2198
2265
|
//#endregion
|
|
2199
2266
|
//#region src/components/scim-settings-panel.tsx
|
|
2200
|
-
var
|
|
2201
|
-
function
|
|
2267
|
+
var er = /* @__PURE__ */ u("<section class=space-y-6><header><h2 class=\"text-base font-semibold\">SCIM provisioning</h2><p class=\"mt-1 text-sm text-muted-foreground\">Paste the SCIM Base URL and an org-scoped API key into your IdP (Okta, Entra ID, OneLogin) so it can provision users into this organization.</p></header><div class=space-y-2><label class=\"block text-xs font-medium uppercase tracking-wider text-muted-foreground\">SCIM Base URL</label><div class=\"flex gap-2\"><code class=\"flex-1 truncate rounded-md border bg-muted px-3 py-2 text-xs\"></code><button type=button class=\"rounded-md border px-3 py-1 text-xs\"></button></div></div><div class=\"rounded-md border bg-muted/30 p-4 text-sm\"role=region aria-label=\"API key requirement\"><div class=\"mb-2 font-medium\">Authentication</div><p class=text-muted-foreground>SCIM uses an <strong>org-scoped API key</strong> with the <code>scim:read</code> and <code>scim:write</code> scopes. The IdP sends it as <code>Authorization: Bearer <key></code> on every request.</p><div class=mt-3><a class=\"inline-flex items-center rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground\">Manage API keys →</a></div><p class=\"mt-3 text-xs text-muted-foreground\">The plaintext key is shown <strong>only at the moment of creation</strong>. We never display it here or in the IdP-side view — only the prefix and the <code>scim:*</code> scopes.</p></div><div class=space-y-3><h3 class=\"text-sm font-medium\">Verify with curl</h3><p class=\"text-xs text-muted-foreground\">Replace <code><your-scim-key></code> with the plaintext API key you copied during key creation.</p><div class=space-y-2><label class=\"block text-xs font-medium uppercase tracking-wider text-muted-foreground\">List users</label><div class=\"flex gap-2\"><pre class=\"flex-1 overflow-x-auto rounded-md border bg-muted px-3 py-2 text-xs whitespace-pre\"></pre><button type=button class=\"rounded-md border px-3 py-1 text-xs self-start\"></button></div></div><div class=space-y-2><label class=\"block text-xs font-medium uppercase tracking-wider text-muted-foreground\">Discover capabilities</label><div class=\"flex gap-2\"><pre class=\"flex-1 overflow-x-auto rounded-md border bg-muted px-3 py-2 text-xs whitespace-pre\"></pre><button type=button class=\"rounded-md border px-3 py-1 text-xs self-start\"></button></div></div></div><div class=\"rounded-md border bg-muted/30 p-4 text-xs text-muted-foreground\"><div class=\"mb-1 font-medium text-foreground\">Per-IdP setup guides</div><ul class=\"ml-4 list-disc space-y-1\"><li><a class=underline href=/docs/scim/okta.md target=_blank>Okta</a></li><li><a class=underline href=/docs/scim/entra.md target=_blank>Microsoft Entra ID</a></li><li><a class=underline href=/docs/scim/onelogin.md target=_blank>OneLogin");
|
|
2268
|
+
function tr(e) {
|
|
2202
2269
|
let t = e.length;
|
|
2203
2270
|
for (; t > 0 && e[t - 1] === "/";) t--;
|
|
2204
2271
|
return e.slice(0, t);
|
|
2205
2272
|
}
|
|
2206
|
-
function
|
|
2207
|
-
let t = g(() => e.apiKeysRoute ?? `/organizations/${e.organizationId}/settings/api-keys`), n = g(() => `${
|
|
2273
|
+
function nr(e) {
|
|
2274
|
+
let t = g(() => e.apiKeysRoute ?? `/organizations/${e.organizationId}/settings/api-keys`), n = g(() => `${tr(e.baseUrl)}/api/scim/v2/organizations/${e.organizationId}`), r = g(() => `curl -H "Authorization: Bearer <your-scim-key>" \\
|
|
2208
2275
|
-H "Accept: application/scim+json" \\
|
|
2209
2276
|
"${n()}/Users?count=10"`), i = g(() => `curl -H "Authorization: Bearer <your-scim-key>" \\
|
|
2210
2277
|
-H "Accept: application/scim+json" \\
|
|
@@ -2216,26 +2283,26 @@ function Yn(e) {
|
|
|
2216
2283
|
} catch {}
|
|
2217
2284
|
};
|
|
2218
2285
|
return (() => {
|
|
2219
|
-
var e =
|
|
2286
|
+
var e = er(), c = e.firstChild.nextSibling, d = c.firstChild.nextSibling.firstChild, f = d.nextSibling, p = c.nextSibling, m = p.firstChild.nextSibling.nextSibling.firstChild, h = p.nextSibling.firstChild.nextSibling.nextSibling, g = h.firstChild.nextSibling.firstChild, _ = g.nextSibling, v = h.nextSibling.firstChild.nextSibling.firstChild, y = v.nextSibling;
|
|
2220
2287
|
return s(d, n), f.$$click = () => u(n(), "url"), s(f, () => a() === "url" ? "Copied" : "Copy"), s(g, r), _.$$click = () => u(r(), "curl-list"), s(_, () => a() === "curl-list" ? "Copied" : "Copy"), s(v, i), y.$$click = () => u(i(), "curl-config"), s(y, () => a() === "curl-config" ? "Copied" : "Copy"), o(() => l(m, "href", t())), e;
|
|
2221
2288
|
})();
|
|
2222
2289
|
}
|
|
2223
2290
|
a(["click"]);
|
|
2224
2291
|
//#endregion
|
|
2225
2292
|
//#region src/components/sso-connection-form.tsx
|
|
2226
|
-
var
|
|
2227
|
-
function
|
|
2228
|
-
let { create: t, error: n } =
|
|
2293
|
+
var rr = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert>"), ir = /* @__PURE__ */ u("<form class=space-y-4><div class=\"grid gap-3 md:grid-cols-2\"><label class=block><span class=\"text-xs font-medium\">Name</span><input required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"placeholder=\"Acme Okta\"></label><label class=block><span class=\"text-xs font-medium\">Discovery URL</span><input required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs\"placeholder=https://idp.example/.well-known/openid-configuration></label><label class=block><span class=\"text-xs font-medium\">Client ID</span><input required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label><label class=block><span class=\"text-xs font-medium\">Client Secret</span><input type=password required class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label><label class=\"block md:col-span-2\"><span class=\"text-xs font-medium\">Scopes (comma-separated)</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label></div><fieldset class=\"rounded-md border p-3\"><legend class=\"px-1 text-xs font-medium\">Claim mappings</legend><div class=\"grid gap-3 md:grid-cols-2\"><label class=block><span class=text-xs>external_id</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label><label class=block><span class=text-xs>email</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label><label class=block><span class=text-xs>display_name</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label><label class=block><span class=text-xs>groups</span><input class=\"mt-1 w-full rounded-md border bg-background px-3 py-2\"></label></div><div class=\"mt-3 space-y-2\"><div class=\"text-xs font-medium\">group → role</div><button type=button class=\"rounded-md border px-3 py-1 text-xs\">+ Add mapping</button></div></fieldset><div class=\"flex items-center gap-4\"><label class=\"flex items-center gap-2 text-xs\"><input type=checkbox>JIT provisioning</label><label class=\"flex items-center gap-2 text-xs\">Default role:<select class=\"rounded-md border bg-background px-2 py-1\"><option value=owner>owner</option><option value=admin>admin</option><option value=member>member</option></select></label></div><button type=submit class=\"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50\">"), ar = /* @__PURE__ */ u("<div class=\"flex items-center gap-2\"><input placeholder=\"group name\"class=\"flex-1 rounded-md border bg-background px-3 py-2 text-sm\"><select class=\"rounded-md border bg-background px-3 py-2 text-sm\"><option value=owner>owner</option><option value=admin>admin</option><option value=member>member</option></select><button type=button class=\"rounded-md border px-2 py-1 text-xs\">✕");
|
|
2294
|
+
function or(e) {
|
|
2295
|
+
let { create: t, error: n } = qn(() => e.organizationId), [r, a] = v(""), [c, l] = v(""), [u, d] = v(""), [m, h] = v(""), [_, y] = v("openid, email, profile"), [b, x] = v("sub"), [S, C] = v("email"), [w, T] = v("name"), [E, D] = v("groups"), [O, k] = v([{
|
|
2229
2296
|
group: "",
|
|
2230
2297
|
role: "member"
|
|
2231
|
-
}]), [
|
|
2298
|
+
}]), [A, j] = v(!0), [M, ee] = v("member"), [N, P] = v(!1), F = g(() => r().trim() !== "" && c().includes(".well-known/openid-configuration") && u().trim() !== "" && m().trim() !== ""), I = (e, t) => {
|
|
2232
2299
|
k((n) => n.map((n, r) => r === e ? {
|
|
2233
2300
|
...n,
|
|
2234
2301
|
...t
|
|
2235
2302
|
} : n));
|
|
2236
|
-
},
|
|
2237
|
-
if (i.preventDefault(), !
|
|
2238
|
-
|
|
2303
|
+
}, L = async (i) => {
|
|
2304
|
+
if (i.preventDefault(), !F() || N()) return;
|
|
2305
|
+
P(!0);
|
|
2239
2306
|
let a = {};
|
|
2240
2307
|
for (let { group: e, role: t } of O()) {
|
|
2241
2308
|
let n = e.trim();
|
|
@@ -2257,62 +2324,62 @@ function $n(e) {
|
|
|
2257
2324
|
group_to_role: a
|
|
2258
2325
|
}
|
|
2259
2326
|
},
|
|
2260
|
-
jit_provisioning_enabled:
|
|
2261
|
-
default_role_on_jit:
|
|
2327
|
+
jit_provisioning_enabled: A(),
|
|
2328
|
+
default_role_on_jit: M()
|
|
2262
2329
|
});
|
|
2263
|
-
|
|
2330
|
+
P(!1), o ? e.onSuccess?.(o) : n() && e.onError?.(Error(n() ?? "create failed"));
|
|
2264
2331
|
};
|
|
2265
2332
|
return (() => {
|
|
2266
|
-
var e =
|
|
2267
|
-
return e.addEventListener("submit",
|
|
2333
|
+
var e = ir(), t = e.firstChild, g = t.firstChild, v = g.firstChild.nextSibling, P = g.nextSibling, R = P.firstChild.nextSibling, z = P.nextSibling, B = z.firstChild.nextSibling, V = z.nextSibling, H = V.firstChild.nextSibling, U = V.nextSibling.firstChild.nextSibling, W = t.nextSibling, G = W.firstChild.nextSibling, K = G.firstChild, q = K.firstChild.nextSibling, J = K.nextSibling, Y = J.firstChild.nextSibling, X = J.nextSibling, Z = X.firstChild.nextSibling, Q = X.nextSibling.firstChild.nextSibling, te = G.nextSibling, ne = te.firstChild.nextSibling, re = W.nextSibling, ie = re.firstChild, ae = ie.firstChild, oe = ie.nextSibling.firstChild.nextSibling, se = re.nextSibling;
|
|
2334
|
+
return e.addEventListener("submit", L), s(e, i(p, {
|
|
2268
2335
|
get when() {
|
|
2269
2336
|
return n();
|
|
2270
2337
|
},
|
|
2271
2338
|
get children() {
|
|
2272
|
-
var e =
|
|
2339
|
+
var e = rr();
|
|
2273
2340
|
return s(e, n), e;
|
|
2274
2341
|
}
|
|
2275
|
-
}), t), v.$$input = (e) => a(e.currentTarget.value),
|
|
2342
|
+
}), t), v.$$input = (e) => a(e.currentTarget.value), R.$$input = (e) => l(e.currentTarget.value), B.$$input = (e) => d(e.currentTarget.value), H.$$input = (e) => h(e.currentTarget.value), U.$$input = (e) => y(e.currentTarget.value), q.$$input = (e) => x(e.currentTarget.value), Y.$$input = (e) => C(e.currentTarget.value), Z.$$input = (e) => T(e.currentTarget.value), Q.$$input = (e) => D(e.currentTarget.value), s(te, i(f, {
|
|
2276
2343
|
get each() {
|
|
2277
2344
|
return O();
|
|
2278
2345
|
},
|
|
2279
2346
|
children: (e, t) => (() => {
|
|
2280
|
-
var n =
|
|
2281
|
-
return r.$$input = (e) =>
|
|
2347
|
+
var n = ar(), r = n.firstChild, i = r.nextSibling, a = i.nextSibling;
|
|
2348
|
+
return r.$$input = (e) => I(t(), { group: e.currentTarget.value }), i.addEventListener("change", (e) => I(t(), { role: e.currentTarget.value })), a.$$click = () => k((e) => e.filter((e, n) => n !== t())), o(() => r.value = e.group), o(() => i.value = e.role), n;
|
|
2282
2349
|
})()
|
|
2283
|
-
}),
|
|
2350
|
+
}), ne), ne.$$click = () => k((e) => [...e, {
|
|
2284
2351
|
group: "",
|
|
2285
2352
|
role: "member"
|
|
2286
|
-
}]),
|
|
2353
|
+
}]), ae.addEventListener("change", (e) => j(e.currentTarget.checked)), oe.addEventListener("change", (e) => ee(e.currentTarget.value)), s(se, () => N() ? "Saving…" : "Create connection"), o(() => se.disabled = !F() || N()), o(() => v.value = r()), o(() => R.value = c()), o(() => B.value = u()), o(() => H.value = m()), o(() => U.value = _()), o(() => q.value = b()), o(() => Y.value = S()), o(() => Z.value = w()), o(() => Q.value = E()), o(() => ae.checked = A()), o(() => oe.value = M()), e;
|
|
2287
2354
|
})();
|
|
2288
2355
|
}
|
|
2289
2356
|
a(["input", "click"]);
|
|
2290
2357
|
//#endregion
|
|
2291
2358
|
//#region src/components/sso-connection-list.tsx
|
|
2292
|
-
var
|
|
2359
|
+
var sr = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Loading…"), cr = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert>"), lr = /* @__PURE__ */ u("<ul class=space-y-3>"), ur = /* @__PURE__ */ u("<div class=space-y-4>"), dr = /* @__PURE__ */ u("<div class=\"rounded-md border border-dashed px-4 py-6 text-center text-sm text-muted-foreground\">No SSO connections yet. Add one to enable federated sign-in for this organization."), fr = /* @__PURE__ */ u("<div class=\"mt-1 text-xs text-muted-foreground\">client_id: <code>"), pr = /* @__PURE__ */ u("<a class=\"rounded-md border px-3 py-1 text-xs hover:bg-accent\"data-testid=saml-metadata-download>SP metadata"), mr = /* @__PURE__ */ u("<button type=button class=\"rounded-md border px-3 py-1 text-xs\">Disable"), hr = /* @__PURE__ */ u("<li class=\"rounded-md border bg-card p-4\"><div class=\"flex items-start justify-between gap-4\"><div><div class=font-medium></div><div class=\"text-xs text-muted-foreground\"> · <span></span></div></div><div class=\"flex flex-wrap gap-2\"><button type=button class=\"rounded-md border px-3 py-1 text-xs\">Test</button><button type=button class=\"rounded-md border border-destructive px-3 py-1 text-xs text-destructive\">Delete"), gr = /* @__PURE__ */ u("<div class=\"mt-1 space-y-1\"><div class=\"text-xs text-muted-foreground\">IdP entity: <code></code></div><div class=\"text-xs text-muted-foreground\">SP entity: <code></code></div><div class=\"text-xs text-muted-foreground\">"), _r = /* @__PURE__ */ u("<button type=button class=\"rounded-md border px-3 py-1 text-xs\">Enable"), vr = (e) => {
|
|
2293
2360
|
let t = [];
|
|
2294
2361
|
return e.assertion_signed_required && t.push("assertion signed"), e.response_signed_required && t.push("response signed"), e.want_encrypted_assertions && t.push("encrypted"), e.idp_initiated_sso_allowed && t.push("IdP-init allowed"), t.length > 0 ? t.join(" · ") : "no signing required";
|
|
2295
2362
|
};
|
|
2296
|
-
function
|
|
2297
|
-
let { connections: t, loading: n, error: r, disable: a, enable: u, remove: d, test: m } =
|
|
2363
|
+
function yr(e) {
|
|
2364
|
+
let { connections: t, loading: n, error: r, disable: a, enable: u, remove: d, test: m } = qn(() => e.organizationId), h = q(), g = async (t) => {
|
|
2298
2365
|
let n = await m(t);
|
|
2299
2366
|
n && e.onTest?.(t, n.ok, n.detail);
|
|
2300
2367
|
}, _ = (e) => h.client.sso.samlMetadataUrl(e);
|
|
2301
2368
|
return (() => {
|
|
2302
|
-
var e =
|
|
2369
|
+
var e = ur();
|
|
2303
2370
|
return s(e, i(p, {
|
|
2304
2371
|
get when() {
|
|
2305
2372
|
return n();
|
|
2306
2373
|
},
|
|
2307
2374
|
get children() {
|
|
2308
|
-
return
|
|
2375
|
+
return sr();
|
|
2309
2376
|
}
|
|
2310
2377
|
}), null), s(e, i(p, {
|
|
2311
2378
|
get when() {
|
|
2312
2379
|
return r();
|
|
2313
2380
|
},
|
|
2314
2381
|
get children() {
|
|
2315
|
-
var e =
|
|
2382
|
+
var e = cr();
|
|
2316
2383
|
return s(e, r), e;
|
|
2317
2384
|
}
|
|
2318
2385
|
}), null), s(e, i(p, {
|
|
@@ -2325,24 +2392,24 @@ function fr(e) {
|
|
|
2325
2392
|
return !n();
|
|
2326
2393
|
},
|
|
2327
2394
|
get children() {
|
|
2328
|
-
return
|
|
2395
|
+
return dr();
|
|
2329
2396
|
}
|
|
2330
2397
|
});
|
|
2331
2398
|
},
|
|
2332
2399
|
get children() {
|
|
2333
|
-
var e =
|
|
2400
|
+
var e = lr();
|
|
2334
2401
|
return s(e, i(f, {
|
|
2335
2402
|
get each() {
|
|
2336
2403
|
return t();
|
|
2337
2404
|
},
|
|
2338
2405
|
children: (e) => (() => {
|
|
2339
|
-
var t =
|
|
2406
|
+
var t = hr(), n = t.firstChild.firstChild, r = n.firstChild, c = r.nextSibling, f = c.firstChild, m = f.nextSibling, h = n.nextSibling, v = h.firstChild, y = v.nextSibling;
|
|
2340
2407
|
return s(r, () => e.name), s(c, () => e.kind, f), s(m, () => e.status), s(n, i(p, {
|
|
2341
2408
|
get when() {
|
|
2342
2409
|
return e.oidc;
|
|
2343
2410
|
},
|
|
2344
2411
|
get children() {
|
|
2345
|
-
var t =
|
|
2412
|
+
var t = fr(), n = t.firstChild.nextSibling;
|
|
2346
2413
|
return s(n, () => e.oidc?.client_id), t;
|
|
2347
2414
|
}
|
|
2348
2415
|
}), null), s(n, i(p, {
|
|
@@ -2350,15 +2417,15 @@ function fr(e) {
|
|
|
2350
2417
|
return e.saml;
|
|
2351
2418
|
},
|
|
2352
2419
|
children: (e) => (() => {
|
|
2353
|
-
var t =
|
|
2354
|
-
return s(r, () => e().idp_entity_id), s(a, () => e().sp_entity_id), s(o, () =>
|
|
2420
|
+
var t = gr(), n = t.firstChild, r = n.firstChild.nextSibling, i = n.nextSibling, a = i.firstChild.nextSibling, o = i.nextSibling;
|
|
2421
|
+
return s(r, () => e().idp_entity_id), s(a, () => e().sp_entity_id), s(o, () => vr(e())), t;
|
|
2355
2422
|
})()
|
|
2356
2423
|
}), null), s(h, i(p, {
|
|
2357
2424
|
get when() {
|
|
2358
2425
|
return e.saml;
|
|
2359
2426
|
},
|
|
2360
2427
|
get children() {
|
|
2361
|
-
var t =
|
|
2428
|
+
var t = pr();
|
|
2362
2429
|
return o((n) => {
|
|
2363
2430
|
var r = _(e.id), i = `sp-metadata-${e.id}.xml`;
|
|
2364
2431
|
return r !== n.e && l(t, "href", n.e = r), i !== n.t && l(t, "download", n.t = i), n;
|
|
@@ -2373,12 +2440,12 @@ function fr(e) {
|
|
|
2373
2440
|
},
|
|
2374
2441
|
get fallback() {
|
|
2375
2442
|
return (() => {
|
|
2376
|
-
var t =
|
|
2443
|
+
var t = _r();
|
|
2377
2444
|
return t.$$click = () => u(e.id), t;
|
|
2378
2445
|
})();
|
|
2379
2446
|
},
|
|
2380
2447
|
get children() {
|
|
2381
|
-
var t =
|
|
2448
|
+
var t = mr();
|
|
2382
2449
|
return t.$$click = () => a(e.id), t;
|
|
2383
2450
|
}
|
|
2384
2451
|
}), y), y.$$click = () => d(e.id), o((t) => {
|
|
@@ -2398,9 +2465,9 @@ function fr(e) {
|
|
|
2398
2465
|
a(["click"]);
|
|
2399
2466
|
//#endregion
|
|
2400
2467
|
//#region src/components/sso-login-button.tsx
|
|
2401
|
-
var
|
|
2402
|
-
function
|
|
2403
|
-
let t =
|
|
2468
|
+
var br = /* @__PURE__ */ u("<a class=\"inline-flex items-center justify-center rounded-md border bg-background px-4 py-2 text-sm font-medium hover:bg-accent\"><svg class=\"mr-2 h-4 w-4\"viewBox=\"0 0 24 24\"fill=none stroke=currentColor stroke-width=2><title>SSO</title><path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M15 12H3\">");
|
|
2469
|
+
function xr(e) {
|
|
2470
|
+
let t = q(), n = g(() => t.client.sso.loginUrl({
|
|
2404
2471
|
org: e.orgSlug,
|
|
2405
2472
|
domain: e.domain,
|
|
2406
2473
|
redirectTo: e.redirectTo
|
|
@@ -2410,15 +2477,15 @@ function mr(e) {
|
|
|
2410
2477
|
return r();
|
|
2411
2478
|
},
|
|
2412
2479
|
get children() {
|
|
2413
|
-
var t =
|
|
2480
|
+
var t = br();
|
|
2414
2481
|
return t.firstChild, s(t, () => e.label ?? "Sign in with SSO", null), o(() => l(t, "href", n())), t;
|
|
2415
2482
|
}
|
|
2416
2483
|
});
|
|
2417
2484
|
}
|
|
2418
2485
|
//#endregion
|
|
2419
2486
|
//#region src/components/transfer-ownership.tsx
|
|
2420
|
-
var
|
|
2421
|
-
let { members: t, refetch: n } =
|
|
2487
|
+
var Sr = /* @__PURE__ */ u("<div class=\"mb-3 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\"role=alert>"), Cr = /* @__PURE__ */ u("<div class=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50\"role=dialog aria-modal=true aria-labelledby=transfer-ownership-title><div class=\"w-full max-w-md rounded-lg border border-input bg-background p-6 shadow-lg\"><h2 id=transfer-ownership-title class=\"mb-2 text-lg font-semibold\">Transfer ownership</h2><p class=\"mb-4 text-sm text-muted-foreground\">Choose a member to promote to owner. You will be demoted to admin. This cannot be undone without another transfer.</p><label class=\"mb-2 block text-sm font-medium\"for=successor-select>New owner</label><select id=successor-select class=\"mb-4 w-full rounded-md border border-input bg-background px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-ring\"><option value disabled>Select a member…</option></select><label class=\"mb-4 flex items-start gap-2 text-sm\"><input type=checkbox class=mt-0.5><span>I understand I will lose owner privileges in this organization.</span></label><div class=\"flex justify-end gap-2\"><button type=button class=\"rounded-md border border-input px-3 py-1.5 text-sm hover:bg-secondary\">Cancel</button><button type=button class=\"rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50\">"), wr = /* @__PURE__ */ u("<option> (<!>)"), Tr = (e) => {
|
|
2488
|
+
let { members: t, refetch: n } = he(() => e.organizationId), { submitting: r, error: a, transferOwnership: c } = ve(() => e.organizationId), [l, u] = v(""), [d, m] = v(!1), h = g(() => t().filter((e) => e.role !== $.OWNER)), _ = () => {
|
|
2422
2489
|
u(""), m(!1), e.onClose();
|
|
2423
2490
|
}, y = async () => {
|
|
2424
2491
|
!l() || !d() || await c({ new_owner_user_id: l() }) && (e.onSuccess?.(), await n(), _());
|
|
@@ -2428,7 +2495,7 @@ var hr = /* @__PURE__ */ u("<div class=\"mb-3 rounded-md bg-destructive/10 px-3
|
|
|
2428
2495
|
return e.open;
|
|
2429
2496
|
},
|
|
2430
2497
|
get children() {
|
|
2431
|
-
var e =
|
|
2498
|
+
var e = Cr(), t = e.firstChild, n = t.firstChild.nextSibling.nextSibling, c = n.nextSibling;
|
|
2432
2499
|
c.firstChild;
|
|
2433
2500
|
var g = c.nextSibling, v = g.firstChild, b = g.nextSibling.firstChild, x = b.nextSibling;
|
|
2434
2501
|
return s(t, i(p, {
|
|
@@ -2436,7 +2503,7 @@ var hr = /* @__PURE__ */ u("<div class=\"mb-3 rounded-md bg-destructive/10 px-3
|
|
|
2436
2503
|
return a();
|
|
2437
2504
|
},
|
|
2438
2505
|
get children() {
|
|
2439
|
-
var e =
|
|
2506
|
+
var e = Sr();
|
|
2440
2507
|
return s(e, a), e;
|
|
2441
2508
|
}
|
|
2442
2509
|
}), n), c.addEventListener("change", (e) => u(e.currentTarget.value)), s(c, i(f, {
|
|
@@ -2444,7 +2511,7 @@ var hr = /* @__PURE__ */ u("<div class=\"mb-3 rounded-md bg-destructive/10 px-3
|
|
|
2444
2511
|
return h();
|
|
2445
2512
|
},
|
|
2446
2513
|
children: (e) => (() => {
|
|
2447
|
-
var t =
|
|
2514
|
+
var t = wr(), n = t.firstChild, r = n.nextSibling;
|
|
2448
2515
|
return r.nextSibling, s(t, () => e.user_id, n), s(t, () => e.role, r), o(() => t.value = e.user_id), t;
|
|
2449
2516
|
})()
|
|
2450
2517
|
}), null), v.addEventListener("change", (e) => m(e.currentTarget.checked)), b.$$click = _, x.$$click = y, s(x, () => r() ? "Transferring…" : "Transfer ownership"), o((e) => {
|
|
@@ -2462,8 +2529,8 @@ var hr = /* @__PURE__ */ u("<div class=\"mb-3 rounded-md bg-destructive/10 px-3
|
|
|
2462
2529
|
a(["click"]);
|
|
2463
2530
|
//#endregion
|
|
2464
2531
|
//#region src/components/verify-email.tsx
|
|
2465
|
-
var
|
|
2466
|
-
let { client: n } =
|
|
2532
|
+
var Er = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Verifying your email address..."), Dr = /* @__PURE__ */ u("<div class=\"rounded-md bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400\">"), Or = /* @__PURE__ */ u("<div class=\"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">"), kr = /* @__PURE__ */ u("<div class=space-y-4>"), Ar = (t) => {
|
|
2533
|
+
let { client: n } = q(), r = n?.emailPassword;
|
|
2467
2534
|
if (!r) return null;
|
|
2468
2535
|
let [a, o] = v("loading"), [c, l] = v(""), [u, d] = v("");
|
|
2469
2536
|
return h(async () => {
|
|
@@ -2474,20 +2541,20 @@ var yr = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Verifyi
|
|
|
2474
2541
|
d(n.message), o("error"), t.onError?.(n);
|
|
2475
2542
|
}
|
|
2476
2543
|
}), (() => {
|
|
2477
|
-
var t =
|
|
2544
|
+
var t = kr();
|
|
2478
2545
|
return s(t, i(e, {
|
|
2479
2546
|
get when() {
|
|
2480
2547
|
return a() === "loading";
|
|
2481
2548
|
},
|
|
2482
2549
|
get children() {
|
|
2483
|
-
return
|
|
2550
|
+
return Er();
|
|
2484
2551
|
}
|
|
2485
2552
|
}), null), s(t, i(e, {
|
|
2486
2553
|
get when() {
|
|
2487
2554
|
return a() === "success";
|
|
2488
2555
|
},
|
|
2489
2556
|
get children() {
|
|
2490
|
-
var e =
|
|
2557
|
+
var e = Dr();
|
|
2491
2558
|
return s(e, c), e;
|
|
2492
2559
|
}
|
|
2493
2560
|
}), null), s(t, i(e, {
|
|
@@ -2495,11 +2562,11 @@ var yr = /* @__PURE__ */ u("<div class=\"text-sm text-muted-foreground\">Verifyi
|
|
|
2495
2562
|
return a() === "error";
|
|
2496
2563
|
},
|
|
2497
2564
|
get children() {
|
|
2498
|
-
var e =
|
|
2565
|
+
var e = Or();
|
|
2499
2566
|
return s(e, u), e;
|
|
2500
2567
|
}
|
|
2501
2568
|
}), null), t;
|
|
2502
2569
|
})();
|
|
2503
2570
|
};
|
|
2504
2571
|
//#endregion
|
|
2505
|
-
export {
|
|
2572
|
+
export { F as AuditDestinationCreate, W as AuditDestinationList, Z as ChangePasswordForm, oe as ConsentScreen, we as DomainClaim, Me as DomainList, Le as DomainVerifyStep, Ve as ForgotPasswordForm, qe as InvitationAccept, Qe as InviteForm, at as LoginForm, dt as MagicLinkForm, kt as MemberList, Mt as MfaChallenge, zt as MfaSetup, Ht as OAuthButtons, de as OAuthConsentPage, Kt as OrganizationCard, Yt as OrganizationCreate, nn as OrganizationDetail, un as OrganizationList, vn as OrganizationSwitcher, tt as PasskeyButton, zn as ProfileSettings, $ as ROLES, Hn as RegisterForm, Kn as ResetPasswordForm, pt as RoleSelector, Zn as SamlConnectionForm, $n as SamlLoginButton, nr as ScimSettingsPanel, or as SsoConnectionForm, yr as SsoConnectionList, xr as SsoLoginButton, Tr as TransferOwnership, Ar as VerifyEmail, K as YAuthProvider, dn as createActiveOrg, O as createAuditDestinations, ye as createDomains, ge as createInvitation, he as createMembers, _e as createOrgPermissions, ve as createOrgRoles, me as createOrganization, pe as createOrganizations, qn as createSsoConnections, fe as slugify, q as useYAuth };
|