@vuetify/one 3.1.2 → 4.0.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.
@@ -1,7 +1,7 @@
1
- import { ref as S, shallowRef as L, computed as f, readonly as q, reactive as G, watch as j, toRefs as Z, toRef as P, nextTick as D } from "vue";
1
+ import { ref as S, shallowRef as L, computed as m, readonly as q, reactive as Y, watch as j, toRefs as G, toRef as P, nextTick as Z } from "vue";
2
2
  import { defineStore as $ } from "pinia";
3
- import { merge as x, debounce as ee } from "lodash-es";
4
- import { useRoute as te, useRouter as Q } from "vue-router";
3
+ import { merge as U, debounce as D } from "lodash-es";
4
+ import { useRoute as ee, useRouter as K } from "vue-router";
5
5
  const J = $("queue", () => {
6
6
  const e = S([]);
7
7
  function i(r) {
@@ -29,7 +29,7 @@ const J = $("queue", () => {
29
29
  showError: t,
30
30
  showSuccess: s
31
31
  };
32
- }), U = $("http", {
32
+ }), _ = $("http", {
33
33
  state: () => ({ url: "" }),
34
34
  actions: {
35
35
  async fetch(e, i = {}) {
@@ -67,18 +67,18 @@ const J = $("queue", () => {
67
67
  });
68
68
  }
69
69
  }
70
- }), he = $("auth-api-key", () => {
71
- const e = U(), i = S(null), t = L(!1), s = f(() => i.value?.apiKey || ""), r = f(() => {
70
+ }), de = $("auth-api-key", () => {
71
+ const e = _(), i = S(null), t = L(!1), s = m(() => i.value?.apiKey || ""), r = m(() => {
72
72
  if (!s.value) return "";
73
73
  const a = s.value;
74
74
  return `${a.slice(0, 6)}...${a.slice(-6)}`;
75
75
  });
76
76
  async function n(a = !1) {
77
77
  !t.value && a && (t.value = !0);
78
- const d = a ? "regenerate" : "generate", g = a ? await e.post(`/one/mcp/${d}`) : await e.fetch(`/one/mcp/${d}`);
79
- return i.value = g, g;
78
+ const d = a ? "regenerate" : "generate", y = a ? await e.post(`/one/mcp/${d}`) : await e.fetch(`/one/mcp/${d}`);
79
+ return i.value = y, y;
80
80
  }
81
- async function c() {
81
+ async function u() {
82
82
  try {
83
83
  const a = await e.fetch("/one/mcp/getToken");
84
84
  return a?.apiKey ? (i.value = a, a) : null;
@@ -92,14 +92,14 @@ const J = $("queue", () => {
92
92
  regenerated: q(t),
93
93
  trim: q(r),
94
94
  generate: n,
95
- fetch: c
95
+ fetch: u
96
96
  };
97
- }), ne = typeof window < "u";
98
- function se() {
97
+ }), te = typeof window < "u";
98
+ function ne() {
99
99
  return document.cookie.split(";").some((e) => e.trim().startsWith("sx="));
100
100
  }
101
- const V = $("auth-core", () => {
102
- const e = U(), i = S(!1), t = S(null), s = L(!1), r = L({}), n = L(null), c = f(() => !!t.value), a = f(() => t.value?.role === "super"), d = f(() => ["super", "admin"].includes(t.value?.role ?? "")), g = f(() => [
101
+ const Q = $("auth-core", () => {
102
+ const e = _(), i = S(!1), t = S(null), s = L(!1), r = L({}), n = L(null), u = m(() => !!t.value), a = m(() => t.value?.role === "super"), d = m(() => ["super", "admin"].includes(t.value?.role ?? "")), y = m(() => [
103
103
  "super",
104
104
  "admin",
105
105
  "editor"
@@ -109,40 +109,35 @@ const V = $("auth-core", () => {
109
109
  }
110
110
  async function O(l = !1) {
111
111
  if (n.value) return n.value;
112
- if (!e.url || !l && !se() && location.hostname?.match(/([^.]+\.[^.]+)$/)?.[1] === new URL(e.url).hostname.match(/([^.]+\.[^.]+)$/)?.[1])
112
+ if (!e.url || !l && !ne() && location.hostname?.match(/([^.]+\.[^.]+)$/)?.[1] === new URL(e.url).hostname.match(/([^.]+\.[^.]+)$/)?.[1])
113
113
  return t.value = null, null;
114
114
  s.value = !0;
115
- const p = fetch(`${e.url}/auth/verify`, {
115
+ const g = fetch(`${e.url}/auth/verify`, {
116
116
  credentials: "include",
117
117
  cache: l ? "reload" : void 0
118
118
  });
119
- return !p || typeof p.then != "function" ? (s.value = !1, t.value = null, null) : (n.value = p.then(async (h) => {
120
- if (h.ok || h.status === 401) {
121
- const b = await h.json();
119
+ return !g || typeof g.then != "function" ? (s.value = !1, t.value = null, null) : (n.value = g.then(async (v) => {
120
+ if (v.ok || v.status === 401) {
121
+ const b = await v.json();
122
122
  return t.value = b.user, r.value.onAuth?.(b), b;
123
123
  } else {
124
- const b = new Error(h.statusText || `HTTP ${h.status}`);
124
+ const b = new Error(v.statusText || `HTTP ${v.status}`);
125
125
  return r.value.onError?.(b), null;
126
126
  }
127
- }, (h) => (r.value.onError?.(h), null)).finally(() => {
127
+ }, (v) => (r.value.onError?.(v), null)).finally(() => {
128
128
  s.value = !1, n.value = null;
129
129
  }), n.value);
130
130
  }
131
131
  async function I(l = "github") {
132
132
  s.value = !0;
133
- const p = `${e.url}/auth/${l}/redirect`;
134
- if (l === "shopify") {
135
- window.location.assign(p + "?next=" + encodeURIComponent(window.location.href));
136
- return;
137
- }
138
- const h = 400, b = 600, W = window.screenX + (window.innerWidth - h) / 2, _ = window.screenY + (window.innerHeight - b) / 2, u = window.open(p, "vuetify:authorize:popup", `popup,left=${W},top=${_},width=${h},height=${b},resizable`);
139
- if (!u) {
133
+ const g = `${e.url}/auth/${l}/redirect`, v = 400, b = 600, z = window.screenX + (window.innerWidth - v) / 2, N = window.screenY + (window.innerHeight - b) / 2, c = window.open(g, "vuetify:authorize:popup", `popup,left=${z},top=${N},width=${v},height=${b},resizable`);
134
+ if (!c) {
140
135
  const E = /* @__PURE__ */ new Error("Failed to open popup");
141
136
  r.value.onError?.(E), s.value = !1;
142
137
  return;
143
138
  }
144
- let y = -1, A = -1;
145
- function N(E) {
139
+ let p = -1, A = -1;
140
+ function x(E) {
146
141
  if (E.origin === e.url && E.data?.type === "auth-response") {
147
142
  if (E.data.status === "success")
148
143
  t.value || (localStorage.setItem("vuetify@lastLoginProvider", l), i.value = !1), t.value = E.data.body.user, r.value.onAuth?.({
@@ -153,62 +148,62 @@ const V = $("auth-core", () => {
153
148
  const H = new Error(E.data.message || "Authentication failed");
154
149
  r.value.onError?.(H);
155
150
  }
156
- z();
151
+ W();
157
152
  }
158
153
  }
159
- function z() {
160
- window.removeEventListener("message", N), window.clearInterval(y), window.clearTimeout(A), u?.close(), s.value = !1;
154
+ function W() {
155
+ window.removeEventListener("message", x), window.clearInterval(p), window.clearTimeout(A), c?.close(), s.value = !1;
161
156
  }
162
- window.addEventListener("message", N), y = window.setInterval(() => {
163
- !u || u.closed ? (r.value.onError?.(/* @__PURE__ */ new Error("Auth popup closed")), z()) : u.postMessage({ type: "auth-request" }, e.url);
157
+ window.addEventListener("message", x), p = window.setInterval(() => {
158
+ !c || c.closed ? (r.value.onError?.(/* @__PURE__ */ new Error("Auth popup closed")), W()) : c.postMessage({ type: "auth-request" }, e.url);
164
159
  }, 1e3), A = window.setTimeout(() => {
165
- z(), r.value.onError?.(/* @__PURE__ */ new Error("Auth timed out"));
160
+ W(), r.value.onError?.(/* @__PURE__ */ new Error("Auth timed out"));
166
161
  }, 120 * 1e3);
167
162
  }
168
- async function v(l) {
163
+ async function h(l) {
169
164
  s.value = !0;
170
- const p = l ? `/auth/${l}/logout` : "/auth/logout";
165
+ const g = l ? `/auth/${l}/logout` : "/auth/logout";
171
166
  try {
172
- await e.post(p), t.value = null;
173
- } catch (h) {
174
- r.value.onError?.(h);
167
+ await e.post(g), t.value = null;
168
+ } catch (v) {
169
+ r.value.onError?.(v);
175
170
  } finally {
176
171
  s.value = !1;
177
172
  }
178
173
  }
179
174
  function T(l) {
180
- return t.value?.identities.find((p) => p.provider === l);
175
+ return t.value?.identities.find((g) => g.provider === l);
181
176
  }
182
- function m() {
183
- return ne ? localStorage.getItem("vuetify@lastLoginProvider") : null;
177
+ function f() {
178
+ return te ? localStorage.getItem("vuetify@lastLoginProvider") : null;
184
179
  }
185
180
  return {
186
181
  user: t,
187
182
  dialog: i,
188
183
  isLoading: s,
189
- isAuthenticated: c,
184
+ isAuthenticated: u,
190
185
  isSuper: a,
191
186
  isAdmin: d,
192
- isEditor: g,
187
+ isEditor: y,
193
188
  setCallbacks: R,
194
189
  verify: O,
195
190
  login: I,
196
- logout: v,
191
+ logout: h,
197
192
  findIdentity: T,
198
- lastLoginProvider: m
193
+ lastLoginProvider: f
199
194
  };
200
195
  }), ve = $("auth-device", () => {
201
- const e = U(), i = V(), t = S(null), s = L("idle"), r = S(null);
196
+ const e = _(), i = Q(), t = S(null), s = L("idle"), r = S(null);
202
197
  async function n(d) {
203
198
  if (!i.isAuthenticated)
204
199
  return r.value = "Must be authenticated to authorize device", !1;
205
200
  try {
206
201
  return s.value = "pending", await e.post(`/auth/device/${d}/authorize`), s.value = "authorized", !0;
207
- } catch (g) {
208
- return s.value = "error", r.value = g.message, !1;
202
+ } catch (y) {
203
+ return s.value = "error", r.value = y.message, !1;
209
204
  }
210
205
  }
211
- async function c(d) {
206
+ async function u(d) {
212
207
  try {
213
208
  return (await e.get(`/auth/device/${d}/status`)).status;
214
209
  } catch {
@@ -223,17 +218,17 @@ const V = $("auth-core", () => {
223
218
  status: q(s),
224
219
  error: q(r),
225
220
  authorize: n,
226
- getStatus: c,
221
+ getStatus: u,
227
222
  reset: a
228
223
  };
229
- }), re = [
224
+ }), se = [
230
225
  (e) => (e.v || (e.pwaRefresh = !0, typeof e.api == "boolean" && (e.api = e.api ? "inline" : "link-only"), typeof e.rtl == "boolean" && (e.direction = e.rtl ? "rtl" : "ltr", delete e.rtl), typeof e.theme == "object" && (e.mixedTheme = e.theme.mixed, e.theme = e.theme.system ? "system" : e.theme.dark ? "dark" : "light"), Array.isArray(e.notifications) && (e.notifications = { read: e.notifications }), typeof e.last == "object" && (e.notifications = e.notifications || {}, e.notifications.last = e.last, delete e.last), e.v = 1), e),
231
226
  (e) => (e.v === 1 && (Array.isArray(e.composition) && (e.composition = "composition"), Array.isArray(e.notifications?.last?.banner) || (e.notifications = e.notifications || {}, e.notifications.last = e.notifications.last || {}, e.notifications.last.banner = []), e.v = 2), e),
232
227
  (e) => (e.v === 2 && (e.syncSettings = !0, e.disableAds = !1, e.v = 3), e),
233
228
  (e) => (e.v === 3 && (e.quickbar = !1, e.v = 4), e),
234
229
  (e) => (e.v === 4 && (e.suits = { show: !1, elements: ["app-bar"], suit: "" }, e.notifications = e.notifications || {}, e.notifications.banners = !0, e.v = 5), e)
235
230
  ];
236
- function oe(e) {
231
+ function re(e) {
237
232
  return {
238
233
  version: 6,
239
234
  ecosystem: {
@@ -304,8 +299,8 @@ function F(e) {
304
299
  }
305
300
  };
306
301
  }
307
- function ie(e) {
308
- const i = re.reduce((s, r) => r(s), e), t = oe(i);
302
+ function oe(e) {
303
+ const i = se.reduce((s, r) => r(s), e), t = re(i);
309
304
  return F(t);
310
305
  }
311
306
  const B = typeof window < "u", C = {
@@ -371,8 +366,8 @@ const B = typeof window < "u", C = {
371
366
  sync: !0,
372
367
  devmode: !1
373
368
  }
374
- }, ae = $("user", () => {
375
- const e = G(structuredClone(C));
369
+ }, ie = $("user", () => {
370
+ const e = Y(structuredClone(C));
376
371
  j(e, t, { deep: !0 });
377
372
  function i() {
378
373
  if (!B)
@@ -382,22 +377,22 @@ const B = typeof window < "u", C = {
382
377
  try {
383
378
  const n = JSON.parse(r);
384
379
  if (n.version >= 7) {
385
- const c = {
380
+ const u = {
386
381
  version: 7,
387
- ecosystem: x(structuredClone(C.ecosystem), n.ecosystem || {}),
388
- one: x(structuredClone(C.one), n.one || {})
382
+ ecosystem: U(structuredClone(C.ecosystem), n.ecosystem || {}),
383
+ one: U(structuredClone(C.one), n.one || {})
389
384
  };
390
- Object.assign(e, c);
385
+ Object.assign(e, u);
391
386
  } else if (n.version === 6) {
392
- const c = F(n), a = {
387
+ const u = F(n), a = {
393
388
  version: 7,
394
- ecosystem: x(structuredClone(C.ecosystem), c.ecosystem || {}),
395
- one: x(structuredClone(C.one), c.one || {})
389
+ ecosystem: U(structuredClone(C.ecosystem), u.ecosystem || {}),
390
+ one: U(structuredClone(C.one), u.one || {})
396
391
  };
397
392
  Object.assign(e, a);
398
393
  } else {
399
- const c = ie(n);
400
- Object.assign(e, c);
394
+ const u = oe(n);
395
+ Object.assign(e, u);
401
396
  }
402
397
  t();
403
398
  } catch (n) {
@@ -411,27 +406,27 @@ const B = typeof window < "u", C = {
411
406
  B && (Object.assign(e, structuredClone(C)), t());
412
407
  }
413
408
  return i(), {
414
- ...Z(e),
409
+ ...G(e),
415
410
  load: i,
416
411
  save: t,
417
412
  reset: s
418
413
  };
419
414
  });
420
- function M() {
421
- const e = te();
422
- return f(
415
+ function V() {
416
+ const e = ee();
417
+ return m(
423
418
  () => e.query
424
419
  );
425
420
  }
426
- const X = $("one", () => {
427
- const e = M(), i = Q(), t = Y(), s = U(), r = J(), n = L(!1), c = L(!1), a = S(null), d = S([]), g = f(() => e.value.session_id), R = f(() => a.value?.items[0].plan.interval), O = f(() => a.value?.items[0].plan.type), I = S([]), v = f(() => t.user?.sponsorships.find((o) => o.platform === "stripe" && o.tierName.startsWith("sub_"))), T = f(() => !!v.value?.tierName), m = f(() => t.user?.sponsorships.reduce((o, w) => {
421
+ const M = $("one", () => {
422
+ const e = V(), i = K(), t = X(), s = _(), r = J(), n = L(!1), u = L(!1), a = S(null), d = S([]), y = m(() => e.value.session_id), R = m(() => a.value?.items[0].plan.interval), O = m(() => a.value?.items[0].plan.type), I = S([]), h = m(() => t.user?.sponsorships.find((o) => o.platform === "stripe" && o.tierName.startsWith("sub_"))), T = m(() => !!h.value?.tierName), f = m(() => t.user?.sponsorships.reduce((o, w) => {
428
423
  if (!w.isActive || w.interval === "once")
429
424
  return o;
430
425
  const k = w.interval === "month" ? w.amount : w.amount / 12;
431
426
  return o + k / 100;
432
- }, 0) ?? 0), l = f(() => t.user?.sponsorships.find((o) => o.tierName.startsWith("sub_") && o.isActive)), p = f(() => t.user?.sponsorships.find((o) => o.platform === "github" && o.isActive)), h = f(() => t.user?.sponsorships.find((o) => o.platform === "discord" && o.isActive)), b = f(() => t.user?.sponsorships.find((o) => o.platform === "opencollective" && o.isActive)), W = f(() => t.user?.identities.find((o) => o.provider === "shopify")), _ = f(() => !s.url || t.isAdmin || v.value?.isActive || I.value.some((o) => ["one", "one/team"].includes(o)));
433
- j(c, K), j(g, async (o) => {
434
- o && await u();
427
+ }, 0) ?? 0), l = m(() => t.user?.sponsorships.find((o) => o.tierName.startsWith("sub_") && o.isActive)), g = m(() => t.user?.sponsorships.find((o) => o.platform === "github" && o.isActive)), v = m(() => t.user?.sponsorships.find((o) => o.platform === "discord" && o.isActive)), b = m(() => t.user?.sponsorships.find((o) => o.platform === "opencollective" && o.isActive)), z = m(() => !s.url || t.isAdmin || h.value?.isActive || I.value.some((o) => ["one", "one/team"].includes(o)));
428
+ j(u, H), j(y, async (o) => {
429
+ o && await N();
435
430
  }, { immediate: !0 }), j(e, (o) => {
436
431
  if (o.one !== "subscribe" || t.user)
437
432
  return;
@@ -440,9 +435,9 @@ const X = $("one", () => {
440
435
  k && (t.dialog = !1, w());
441
436
  });
442
437
  }, { immediate: !0 });
443
- async function u() {
438
+ async function N() {
444
439
  try {
445
- n.value = !0, await s.post("/one/activate", { sessionId: g.value }), await t.verify(!0), await E();
440
+ n.value = !0, await s.post("/one/activate", { sessionId: y.value }), await t.verify(!0), await W();
446
441
  const o = new URL(window.location.href), w = o.searchParams;
447
442
  w.delete("session_id"), w.delete("team"), history.pushState(null, "", o.toString());
448
443
  } catch (o) {
@@ -451,19 +446,19 @@ const X = $("one", () => {
451
446
  n.value = !1;
452
447
  }
453
448
  }
454
- async function y() {
449
+ async function c() {
455
450
  window.open(`${s.url}/one/manage`, "_blank");
456
451
  }
457
- async function A(o, w) {
452
+ async function p(o, w) {
458
453
  n.value = !0;
459
454
  const k = new URL("/one/subscribe", s.url);
460
455
  k.searchParams.set("interval", o), k.searchParams.set("type", w), window.location.href = k.toString();
461
456
  }
462
- async function N() {
463
- if (v.value)
457
+ async function A() {
458
+ if (h.value)
464
459
  try {
465
460
  n.value = !0, await s.post(
466
- `/one/cancel?subscriptionId=${v.value?.tierName}`
461
+ `/one/cancel?subscriptionId=${h.value?.tierName}`
467
462
  ), await t.verify(!0);
468
463
  } catch (o) {
469
464
  r.showError(o?.message ?? "Error cancelling subscription, Please contact support");
@@ -471,11 +466,11 @@ const X = $("one", () => {
471
466
  n.value = !1;
472
467
  }
473
468
  }
474
- async function z(o, w) {
475
- if (v.value)
469
+ async function x(o, w) {
470
+ if (h.value)
476
471
  try {
477
472
  n.value = !0, await s.post("/one/modify", {
478
- subscriptionId: v.value.tierName,
473
+ subscriptionId: h.value.tierName,
479
474
  interval: o,
480
475
  type: w
481
476
  }), await t.verify(!0);
@@ -485,7 +480,7 @@ const X = $("one", () => {
485
480
  n.value = !1;
486
481
  }
487
482
  }
488
- async function E() {
483
+ async function W() {
489
484
  try {
490
485
  n.value = !0;
491
486
  const o = await s.get("/one/info");
@@ -496,7 +491,7 @@ const X = $("one", () => {
496
491
  n.value = !1;
497
492
  }
498
493
  }
499
- async function H() {
494
+ async function E() {
500
495
  try {
501
496
  return n.value = !0, (await s.get("/one/activity")).items;
502
497
  } catch (o) {
@@ -505,7 +500,7 @@ const X = $("one", () => {
505
500
  n.value = !1;
506
501
  }
507
502
  }
508
- function K() {
503
+ function H() {
509
504
  i.push({
510
505
  query: {
511
506
  ...e.value,
@@ -519,50 +514,49 @@ const X = $("one", () => {
519
514
  subscriptionType: O,
520
515
  access: I,
521
516
  invoices: d,
522
- sessionId: g,
523
- subscription: v,
524
- monthlyTotal: m,
525
- recentActivity: H,
517
+ sessionId: y,
518
+ subscription: h,
519
+ monthlyTotal: f,
520
+ recentActivity: E,
526
521
  hasBilling: T,
527
522
  isLoading: n,
528
- isOpen: c,
529
- isSubscriber: _,
523
+ isOpen: u,
524
+ isSubscriber: z,
530
525
  opencollective: b,
531
- github: p,
532
- discord: h,
533
- shopify: W,
526
+ github: g,
527
+ discord: v,
534
528
  one: l,
535
- activate: u,
536
- cancel: N,
537
- manage: y,
538
- modify: z,
539
- resetQuery: K,
540
- subscribe: A,
541
- subscriptionInfo: E
529
+ activate: N,
530
+ cancel: A,
531
+ manage: c,
532
+ modify: x,
533
+ resetQuery: H,
534
+ subscribe: p,
535
+ subscriptionInfo: W
542
536
  };
543
- }), ue = $("team", () => {
544
- const e = M(), i = Y(), t = X(), s = U(), r = J(), n = L(!1), c = S(null), a = S(!1), d = f(() => e.value.invite), g = f(
545
- () => c.value ? t.access?.some((m) => ["one/team", "snips/team"].includes(m)) : !1
537
+ }), ae = $("team", () => {
538
+ const e = V(), i = X(), t = M(), s = _(), r = J(), n = L(!1), u = S(null), a = S(!1), d = m(() => e.value.invite), y = m(
539
+ () => u.value ? t.access?.some((f) => ["one/team", "snips/team"].includes(f)) : !1
546
540
  );
547
541
  j(d, async () => {
548
542
  if (d.value) {
549
543
  i.user || (i.dialog = !0);
550
544
  try {
551
545
  n.value = !0;
552
- const m = await s.get(`/one/team/${d.value}`);
553
- c.value = m.team, a.value = !0;
554
- } catch (m) {
555
- v(), r.showError(m.message);
546
+ const f = await s.get(`/one/team/${d.value}`);
547
+ u.value = f.team, a.value = !0;
548
+ } catch (f) {
549
+ h(), r.showError(f.message);
556
550
  } finally {
557
551
  n.value = !1;
558
552
  }
559
553
  }
560
554
  }, { immediate: !0 });
561
- async function R(m) {
555
+ async function R(f) {
562
556
  try {
563
- if (n.value = !0, !c.value)
557
+ if (n.value = !0, !u.value)
564
558
  return;
565
- await s.post("/one/team/remove", { userId: m }), c.value.members = c.value.members.filter((l) => l.id !== m);
559
+ await s.post("/one/team/remove", { userId: f }), u.value.members = u.value.members.filter((l) => l.id !== f);
566
560
  } catch (l) {
567
561
  r.showError(l?.message ?? "Error removing user from team");
568
562
  } finally {
@@ -571,103 +565,103 @@ const X = $("one", () => {
571
565
  }
572
566
  async function O() {
573
567
  try {
574
- n.value = !0, await s.post("/one/team/leave", { teamId: c.value?.id }), await i.verify(!0);
575
- } catch (m) {
576
- r.showError(m?.message ?? "Error leaving team");
568
+ n.value = !0, await s.post("/one/team/leave", { teamId: u.value?.id }), await i.verify(!0);
569
+ } catch (f) {
570
+ r.showError(f?.message ?? "Error leaving team");
577
571
  } finally {
578
572
  n.value = !1;
579
573
  }
580
574
  }
581
575
  async function I() {
582
576
  try {
583
- n.value = !0, await s.post("/one/team/join", { inviteCode: d.value }), await i.verify(!0), v();
584
- } catch (m) {
585
- r.showError(m?.message ?? "Error joining team");
577
+ n.value = !0, await s.post("/one/team/join", { inviteCode: d.value }), await i.verify(!0), h();
578
+ } catch (f) {
579
+ r.showError(f?.message ?? "Error joining team");
586
580
  } finally {
587
581
  n.value = !1;
588
582
  }
589
583
  }
590
- function v() {
584
+ function h() {
591
585
  a.value = !1;
592
- const m = new URL(window.location.href);
593
- m.searchParams.delete("invite"), window.history.replaceState({}, "", m.toString());
586
+ const f = new URL(window.location.href);
587
+ f.searchParams.delete("invite"), window.history.replaceState({}, "", f.toString());
594
588
  }
595
- const T = f(() => i.user?.id === i.user?.team?.owner?.id);
589
+ const T = m(() => i.user?.id === i.user?.team?.owner?.id);
596
590
  return {
597
- team: c,
591
+ team: u,
598
592
  teamInviteDialog: a,
599
593
  teamInviteCode: d,
600
- hasTeamAccess: g,
594
+ hasTeamAccess: y,
601
595
  isTeamOwner: T,
602
596
  isLoading: n,
603
597
  removeFromTeam: R,
604
598
  leaveTeam: O,
605
599
  joinTeam: I,
606
- clearTeamQuery: v
600
+ clearTeamQuery: h
607
601
  };
608
- }), ce = typeof window < "u", Y = $("auth", () => {
609
- const e = V(), i = U(), t = ae(), s = Q(), r = X(), n = ue(), c = J(), a = P(() => e.user), d = P(e, "dialog"), g = P(() => e.isLoading), R = P(() => e.isAuthenticated), O = P(() => e.isSuper), I = P(() => e.isAdmin), v = P(() => e.isEditor);
602
+ }), ue = typeof window < "u", X = $("auth", () => {
603
+ const e = Q(), i = _(), t = ie(), s = K(), r = M(), n = ae(), u = J(), a = P(() => e.user), d = P(e, "dialog"), y = P(() => e.isLoading), R = P(() => e.isAuthenticated), O = P(() => e.isSuper), I = P(() => e.isAdmin), h = P(() => e.isEditor);
610
604
  let T = !!e.lastLoginProvider();
611
- j(a, (u) => {
612
- if (!ce || !u?.settings)
605
+ j(a, (c) => {
606
+ if (!ue || !c?.settings)
613
607
  return;
614
- const y = localStorage.getItem("vuetify@user") || "{}";
615
- if (JSON.stringify(u.settings, null, 2) === y)
608
+ const p = localStorage.getItem("vuetify@user") || "{}";
609
+ if (JSON.stringify(c.settings, null, 2) === p)
616
610
  return;
617
611
  T = !0;
618
- let A = u.settings;
612
+ let A = c.settings;
619
613
  A.version === 6 && (A = F(A));
620
- const N = {
614
+ const x = {
621
615
  version: 7,
622
- ecosystem: x(structuredClone(C.ecosystem), A.ecosystem || {}),
623
- one: x(structuredClone(C.one), A.one || {})
616
+ ecosystem: U(structuredClone(C.ecosystem), A.ecosystem || {}),
617
+ one: U(structuredClone(C.one), A.one || {})
624
618
  };
625
- Object.assign(t, N);
619
+ Object.assign(t, x);
626
620
  });
627
- const m = ee(l, 500);
621
+ const f = D(l, 500);
628
622
  t.$subscribe(() => {
629
- T || m(), T = !1;
623
+ T || f(), T = !1;
630
624
  });
631
625
  async function l() {
632
- if (await D(), !(!a.value || !t.one.sync))
626
+ if (await Z(), !(!a.value || !t.one.sync))
633
627
  try {
634
- await i.post("/user/settings", { settings: t.$state }), await p(!0);
635
- } catch (u) {
636
- c.showError(u?.message ?? "Error syncing settings");
628
+ await i.post("/user/settings", { settings: t.$state }), await g(!0);
629
+ } catch (c) {
630
+ u.showError(c?.message ?? "Error syncing settings");
637
631
  }
638
632
  }
639
633
  e.setCallbacks({
640
- onAuth: (u) => {
641
- r.access = u.access;
642
- const y = u.user?.team;
643
- y?.inviteCode && y.members && y.owner && (n.team = {
644
- id: y.id,
645
- name: y.name,
646
- inviteCode: y.inviteCode,
647
- members: y.members,
648
- owner: y.owner
634
+ onAuth: (c) => {
635
+ r.access = c.access;
636
+ const p = c.user?.team;
637
+ p?.inviteCode && p.members && p.owner && (n.team = {
638
+ id: p.id,
639
+ name: p.name,
640
+ inviteCode: p.inviteCode,
641
+ members: p.members,
642
+ owner: p.owner
649
643
  });
650
644
  },
651
- onError: (u) => {
652
- c.showError(u.message ?? "Authentication error");
645
+ onError: (c) => {
646
+ u.showError(c.message ?? "Authentication error");
653
647
  }
654
648
  });
655
- async function p(u = !1) {
656
- return e.verify(u);
649
+ async function g(c = !1) {
650
+ return e.verify(c);
657
651
  }
658
- async function h(u = "github") {
659
- await e.login(u), e.user && (e.dialog = !1, s.push("/user/dashboard"), l());
652
+ async function v(c = "github") {
653
+ await e.login(c), e.user && (e.dialog = !1, s.push("/user/dashboard"), l());
660
654
  }
661
- async function b(u) {
662
- await e.logout(u), s.push({
655
+ async function b(c) {
656
+ await e.logout(c), s.push({
663
657
  path: "/",
664
658
  query: s.currentRoute.value.query
665
659
  });
666
660
  }
667
- function W(u) {
668
- return e.findIdentity(u);
661
+ function z(c) {
662
+ return e.findIdentity(c);
669
663
  }
670
- function _() {
664
+ function N() {
671
665
  return e.lastLoginProvider();
672
666
  }
673
667
  return {
@@ -675,28 +669,28 @@ const X = $("one", () => {
675
669
  user: a,
676
670
  url: i.url,
677
671
  dialog: d,
678
- isLoading: g,
672
+ isLoading: y,
679
673
  isAuthenticated: R,
680
674
  isSuper: O,
681
675
  isAdmin: I,
682
- isEditor: v,
676
+ isEditor: h,
683
677
  // Actions
684
- verify: p,
685
- findIdentity: W,
686
- login: h,
678
+ verify: g,
679
+ findIdentity: z,
680
+ login: v,
687
681
  logout: b,
688
- lastLoginProvider: _,
682
+ lastLoginProvider: N,
689
683
  sync: l
690
684
  };
691
685
  });
692
686
  export {
693
- Y as a,
694
- ae as b,
695
- X as c,
696
- M as d,
697
- U as e,
698
- ue as f,
699
- he as g,
687
+ X as a,
688
+ ie as b,
689
+ M as c,
690
+ V as d,
691
+ _ as e,
692
+ ae as f,
693
+ de as g,
700
694
  ve as h,
701
695
  J as u
702
696
  };