@wssto2/vue-core 0.3.0 → 0.4.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/README.md +3 -0
- package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-DKX3PH2n.js → AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js} +1 -1
- package/dist/{AccountMenuItem.vue_vue_type_script_setup_true_lang-DIGqTLwd.js → AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js} +1 -1
- package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-B7Lpfkf6.js → ActionRow.vue_vue_type_script_setup_true_lang-LlfIPWsJ.js} +2 -2
- package/dist/{Activity-DviO0VQ8.js → Activity-2gGxQn7v.js} +9 -9
- package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-CvAnzdc1.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-BoinCY93.js} +3 -3
- package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-CJsMUIUg.js → AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js} +1 -1
- package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-CCtthMRd.js → AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js} +4 -4
- package/dist/{Banner.vue_vue_type_script_setup_true_lang-Cib_YYpr.js → Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js} +1 -1
- package/dist/{Button.vue_vue_type_script_setup_true_lang-CYil8h9z.js → Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js} +1 -1
- package/dist/{Changes-DlT5mN9G.js → Changes-Bm8xvagD.js} +8 -8
- package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CXILftEc.js → CollectionPage.vue_vue_type_script_setup_true_lang-DCBVw2Qd.js} +176 -172
- package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DSYgS9lC.js → DataTable.vue_vue_type_script_setup_true_lang-UH6f9puS.js} +1 -1
- package/dist/DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js +255 -0
- package/dist/DeadLetters-CMRtXn_N.js +104 -0
- package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-Cb3xJI1x.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-D1arePCZ.js} +1 -1
- package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-C2ZYIT9F.js → EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js} +1 -1
- package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DVgNBQ8p.js → FormErrors.vue_vue_type_script_setup_true_lang-BQb7wLT0.js} +1 -1
- package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-0mfG8TkU.js → FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js} +10 -10
- package/dist/{FormView.vue_vue_type_script_setup_true_lang-Bz2m3AtF.js → FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js} +2 -2
- package/dist/{General-BD-Hcz0a.js → General-CTqd0SLK.js} +8 -8
- package/dist/HeaderAction.vue_vue_type_script_setup_true_lang-Cgji-Jrr.js +45 -0
- package/dist/{Icon.vue_vue_type_script_lang-VvcV2Bzo.js → Icon.vue_vue_type_script_lang-D7oC-d-S.js} +33 -29
- package/dist/{IconTile.vue_vue_type_script_setup_true_lang-D7QgnUyN.js → IconTile.vue_vue_type_script_setup_true_lang-BpIjgu5E.js} +1 -1
- package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-C2udmeEA.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js} +1 -1
- package/dist/{Menu.vue_vue_type_script_setup_true_lang-BNAjx9tj.js → Menu.vue_vue_type_script_setup_true_lang-DTbAcDzL.js} +30 -26
- package/dist/{Modal.vue_vue_type_script_setup_true_lang-D7SwVPpL.js → Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js} +2 -2
- package/dist/{NewRolePage-Dla4YnMs.js → NewRolePage-DTOWIxxC.js} +4 -4
- package/dist/{NoAccess.vue_vue_type_script_setup_true_lang-8m9cNptR.js → NoAccess.vue_vue_type_script_setup_true_lang-DWxq-MTM.js} +1 -1
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-CYRg7Kfg.js → NumberField.vue_vue_type_script_setup_true_lang-C7N5nq0P.js} +1 -1
- package/dist/{PageBar.vue_vue_type_script_setup_true_lang-Cfr5xsJx.js → PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js} +1 -1
- package/dist/{Panel.vue_vue_type_script_setup_true_lang-BCRxRK4D.js → Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js} +1 -1
- package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +46 -0
- package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-B3Q4dhqJ.js → PhotoViewer.vue_vue_type_script_setup_true_lang-QPCW3Xi6.js} +1 -1
- package/dist/ProfilePage-BlpiWH_W.js +654 -0
- package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DKsaKlAq.js → RecordHeader.vue_vue_type_script_setup_true_lang-C_ymvhHU.js} +2 -2
- package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-CJcKa9SW.js → ResourcePage.vue_vue_type_script_setup_true_lang-CwI_sROp.js} +5 -5
- package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-DuEPOmjI.js → RoleEditor.vue_vue_type_script_setup_true_lang-CmwvSytD.js} +30 -29
- package/dist/{RolePage-bZzv_E4l.js → RolePage-DZk7BZOc.js} +13 -13
- package/dist/{RolesPage-BniZv0nB.js → RolesPage-DzGGCMnm.js} +9 -9
- package/dist/{SectionList.vue_vue_type_script_setup_true_lang-BKP_bge8.js → SectionList.vue_vue_type_script_setup_true_lang-BFYls8fR.js} +3 -3
- package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BgGEGxSI.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DSMXEaCs.js} +5 -5
- package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-BZ9UdgA1.js → SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js} +1 -1
- package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BiGaEKBQ.js → SelectField.vue_vue_type_script_setup_true_lang-7O1BAx04.js} +15 -14
- package/dist/{SessionList.vue_vue_type_script_setup_true_lang-DUQpr7gb.js → SessionList.vue_vue_type_script_setup_true_lang-D5KRitar.js} +4 -4
- package/dist/{Sessions-Co5-xdeb.js → Sessions-CWqjjTr1.js} +6 -6
- package/dist/SettingsPage-C4s0IdkW.js +255 -0
- package/dist/{Sheet.vue_vue_type_script_setup_true_lang-bHYzx7-J.js → Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js} +48 -45
- package/dist/{SignIn-BWwFbxki.js → SignIn-zzKY__df.js} +7 -7
- package/dist/{SignInPage-FnLtoi2q.js → SignInPage-Rqnus_s-.js} +6 -6
- package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-Dnx3T_42.js → SignInTable.vue_vue_type_script_setup_true_lang-CEbAvZ_C.js} +1 -1
- package/dist/{SignIns-3UcI64_h.js → SignIns-Cnf9BVR0.js} +6 -6
- package/dist/{SwipeActions.vue_vue_type_script_setup_true_lang-4I8m27ol.js → SwipeActions.vue_vue_type_script_setup_true_lang-BJIA2JfI.js} +1 -1
- package/dist/SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js +64 -0
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-BeGaydRr.js → Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js} +1 -1
- package/dist/{TextField.vue_vue_type_script_setup_true_lang-C_FMf3Vc.js → TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js} +3 -3
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js +68 -0
- package/dist/TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js +164 -0
- package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-1RJGKxbD.js → Timestamp.vue_vue_type_script_setup_true_lang-FVRUr-9y.js} +1 -1
- package/dist/{UserRecord-Ci8HfwbX.js → UserRecord-DqigxVxH.js} +12 -12
- package/dist/{UsersList-vEJ-cgkT.js → UsersList-DNlZsI9J.js} +8 -8
- package/dist/{ViewTabs.vue_vue_type_script_setup_true_lang-ByqTU2JT.js → ViewTabs.vue_vue_type_script_setup_true_lang-BJIoZAlH.js} +1 -1
- package/dist/access/index.js +1 -1
- package/dist/app/index.js +9 -9
- package/dist/button/index.js +1 -1
- package/dist/client/index.js +11 -19
- package/dist/{client-Bw0aM5Gu.js → client-k9euDWF4.js} +19 -19
- package/dist/collection/definition.d.ts +3 -0
- package/dist/collection/index.js +6 -6
- package/dist/collection/useCollection.d.ts +2 -0
- package/dist/content/index.js +2 -2
- package/dist/{contributions-CDDg3fKp.js → contributions-DsfmDoRD.js} +1 -1
- package/dist/control-7EP4tjYy.js +313 -0
- package/dist/controls/index.js +4 -4
- package/dist/form/index.js +987 -1134
- package/dist/{guards-Cd1V28oG.js → guards-Dve61KjR.js} +1 -1
- package/dist/{http-DGGSKWvU.js → http-CNcDHSOj.js} +9 -8
- package/dist/i18n/index.js +20 -20
- package/dist/icon/core.d.ts +4 -0
- package/dist/icon/index.js +1 -1
- package/dist/identity/index.js +1 -1
- package/dist/index-BsJ92eub.js +504 -0
- package/dist/{index-BAcl44SC.js → index-CGv-u1Ws.js} +19 -19
- package/dist/{index-B2dbYZR9.js → index-GcLnFF-z.js} +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/modal/Sheet.vue.d.ts +2 -0
- package/dist/modal/index.js +5 -5
- package/dist/modules/events/entities.d.ts +16 -0
- package/dist/modules/events/routes.d.ts +17 -0
- package/dist/modules/events/schemas.d.ts +16 -0
- package/dist/modules/notification/entities.d.ts +46 -0
- package/dist/modules/notification/routes.d.ts +26 -0
- package/dist/modules/notification/schemas.d.ts +25 -0
- package/dist/{navigation-BPWa63ge.js → navigation-Cm3iChlR.js} +1 -1
- package/dist/{neighbors-D0WRBxXI.js → neighbors-DpaIMQAL.js} +1 -1
- package/dist/notifications/InboxPanel.vue.d.ts +16 -0
- package/dist/notifications/MarkAllRead.vue.d.ts +7 -0
- package/dist/notifications/NotificationBell.vue.d.ts +2 -0
- package/dist/notifications/SettingsLink.vue.d.ts +6 -0
- package/dist/notifications/context.d.ts +20 -0
- package/dist/notifications/deadletters/DeadLetters.vue.d.ts +2 -0
- package/dist/notifications/deadletters/access.d.ts +3 -0
- package/dist/notifications/deadletters/list.d.ts +3 -0
- package/dist/notifications/deadletters/routes.d.ts +13 -0
- package/dist/notifications/feature.d.ts +31 -0
- package/dist/notifications/inbox.d.ts +62 -0
- package/dist/notifications/index.d.ts +13 -0
- package/dist/notifications/index.js +8 -0
- package/dist/notifications/settings/EmailPanel.vue.d.ts +14 -0
- package/dist/notifications/settings/QuietHoursPanel.vue.d.ts +14 -0
- package/dist/notifications/settings/SettingsMenuItem.vue.d.ts +2 -0
- package/dist/notifications/settings/SettingsPage.vue.d.ts +2 -0
- package/dist/notifications/settings/categoryText.d.ts +9 -0
- package/dist/notifications/settings/routes.d.ts +13 -0
- package/dist/notifications/settings/settings.d.ts +18 -0
- package/dist/notifications/settings/state.d.ts +16 -0
- package/dist/notifications/state.d.ts +27 -0
- package/dist/notifications/stream.d.ts +21 -0
- package/dist/options-Ba_0uLWN.js +18 -0
- package/dist/overlay/index.js +3 -3
- package/dist/page/index.js +7 -7
- package/dist/phone/index.js +68 -67
- package/dist/platform/index.js +2 -2
- package/dist/{platform-hunMqFdB.js → platform-q3cjODLx.js} +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/route-goWMxDUN.js +13 -0
- package/dist/router/index.js +4 -4
- package/dist/{rowLayout-BI7a3Kom.js → rowLayout-BqTEhEuy.js} +5 -5
- package/dist/{sections-BEqW1dOc.js → sections-CntvUTxn.js} +1 -1
- package/dist/shell/index.js +460 -496
- package/dist/state/index.js +4 -4
- package/dist/{status-C9aXR-Jb.js → status-BuP3ULjH.js} +2 -2
- package/dist/styles.css +1 -1
- package/dist/{suggestions-BJAqOj4c.js → suggestions-BxMm6MQA.js} +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/transport-BnP7WC0Y.js +4 -0
- package/dist/{useCommand-BgRwnYlV.js → useCommand-BkONMn3X.js} +2 -2
- package/dist/{useResourceForm-Bgc9jMcu.js → useResourceForm-D1hIpwW5.js} +1 -1
- package/dist/useTypedEntry-aTfPBAhw.js +857 -0
- package/package.json +6 -2
- package/dist/DateField.vue_vue_type_script_setup_true_lang-DMVjNsaM.js +0 -1099
- package/dist/ProfilePage-OJMQ8cr8.js +0 -691
- package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CU3KTKIJ.js +0 -127
- package/dist/options-BXkMR63B.js +0 -329
|
@@ -1,691 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, openBlock as v, createElementBlock as E, toDisplayString as _, unref as e, createCommentVNode as G, createBlock as C, withCtx as p, createTextVNode as P, createVNode as i, watch as X, mergeProps as R, useModel as fe, useId as me, useTemplateRef as J, ref as b, onMounted as ve, onBeforeUnmount as _e, computed as F, withModifiers as ge, createElementVNode as x, Fragment as oe, mergeModels as le } from "vue";
|
|
2
|
-
import { useI18n as U } from "vue-i18n";
|
|
3
|
-
import { a as ye } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-CvAnzdc1.js";
|
|
4
|
-
import { u as L } from "./platform-hunMqFdB.js";
|
|
5
|
-
import { _ as Q } from "./AsyncSection.vue_vue_type_script_setup_true_lang-CCtthMRd.js";
|
|
6
|
-
import { u as Y } from "./useLoad-CYRVx6HW.js";
|
|
7
|
-
import { i as q, d as H } from "./index-BAcl44SC.js";
|
|
8
|
-
import { u as Z } from "./FormErrors.vue_vue_type_script_setup_true_lang-DVgNBQ8p.js";
|
|
9
|
-
import { _ as ee } from "./FormView.vue_vue_type_script_setup_true_lang-Bz2m3AtF.js";
|
|
10
|
-
import { _ as D } from "./TextField.vue_vue_type_script_setup_true_lang-C_FMf3Vc.js";
|
|
11
|
-
import { _ as O } from "./Panel.vue_vue_type_script_setup_true_lang-BCRxRK4D.js";
|
|
12
|
-
import { t as S } from "./toast-D9Z5To38.js";
|
|
13
|
-
import { u as W } from "./fieldMessages-C3Rpbktw.js";
|
|
14
|
-
import { _ as A } from "./Button.vue_vue_type_script_setup_true_lang-CYil8h9z.js";
|
|
15
|
-
import { a as re } from "./leaveGuard-Cc8yeLxM.js";
|
|
16
|
-
import { _ as we } from "./KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js";
|
|
17
|
-
import { u as ie } from "./format-B8mJm946.js";
|
|
18
|
-
import { _ as be } from "./Banner.vue_vue_type_script_setup_true_lang-Cib_YYpr.js";
|
|
19
|
-
import { a as K } from "./error-CD7x0Jrz.js";
|
|
20
|
-
import { _ as xe } from "./Modal.vue_vue_type_script_setup_true_lang-D7SwVPpL.js";
|
|
21
|
-
import { _ as he } from "./OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js";
|
|
22
|
-
import { _ as $e } from "./AlertDialog.vue_vue_type_script_setup_true_lang-CJsMUIUg.js";
|
|
23
|
-
import { _ as ke } from "./SessionList.vue_vue_type_script_setup_true_lang-DUQpr7gb.js";
|
|
24
|
-
import { _ as qe } from "./PageBar.vue_vue_type_script_setup_true_lang-Cfr5xsJx.js";
|
|
25
|
-
import { _ as Ce } from "./SignInTable.vue_vue_type_script_setup_true_lang-Dnx3T_42.js";
|
|
26
|
-
import { _ as Pe } from "./ViewTabs.vue_vue_type_script_setup_true_lang-ByqTU2JT.js";
|
|
27
|
-
const Se = { class: "flex flex-wrap items-center justify-end gap-3" }, Ve = {
|
|
28
|
-
key: 0,
|
|
29
|
-
class: "mr-auto text-footnote text-content-muted",
|
|
30
|
-
"data-unsaved": ""
|
|
31
|
-
}, ne = /* @__PURE__ */ N({
|
|
32
|
-
__name: "PanelActions",
|
|
33
|
-
props: {
|
|
34
|
-
label: {},
|
|
35
|
-
processing: { type: Boolean },
|
|
36
|
-
dirty: { type: Boolean }
|
|
37
|
-
},
|
|
38
|
-
emits: ["submit", "cancel"],
|
|
39
|
-
setup(h, { emit: r }) {
|
|
40
|
-
const u = h, t = r, { t: s } = U();
|
|
41
|
-
return re(() => u.dirty), (c, l) => (v(), E("div", Se, [
|
|
42
|
-
u.dirty ? (v(), E("span", Ve, _(e(s)("core.form.unsaved_changes")), 1)) : G("", !0),
|
|
43
|
-
u.dirty ? (v(), C(e(A), {
|
|
44
|
-
key: 1,
|
|
45
|
-
disabled: u.processing,
|
|
46
|
-
onClick: l[0] || (l[0] = (n) => t("cancel"))
|
|
47
|
-
}, {
|
|
48
|
-
default: p(() => [
|
|
49
|
-
P(_(e(s)("core.actions.cancel")), 1)
|
|
50
|
-
]),
|
|
51
|
-
_: 1
|
|
52
|
-
}, 8, ["disabled"])) : G("", !0),
|
|
53
|
-
i(e(A), {
|
|
54
|
-
prominence: "primary",
|
|
55
|
-
processing: u.processing,
|
|
56
|
-
onClick: l[1] || (l[1] = (n) => t("submit"))
|
|
57
|
-
}, {
|
|
58
|
-
default: p(() => [
|
|
59
|
-
P(_(u.label), 1)
|
|
60
|
-
]),
|
|
61
|
-
_: 1
|
|
62
|
-
}, 8, ["processing"])
|
|
63
|
-
]));
|
|
64
|
-
}
|
|
65
|
-
}), Ee = /* @__PURE__ */ N({
|
|
66
|
-
__name: "DetailsPanel",
|
|
67
|
-
props: {
|
|
68
|
-
profile: {}
|
|
69
|
-
},
|
|
70
|
-
emits: ["updated"],
|
|
71
|
-
setup(h, { emit: r }) {
|
|
72
|
-
const u = h, t = r, { t: s } = U(), { http: c } = L(), l = {
|
|
73
|
-
safeParse(o) {
|
|
74
|
-
const { name: d, phone: y } = o;
|
|
75
|
-
return d.trim() === "" ? { success: !1, error: { issues: [{ path: ["name"], message: s("core.account.validation.required") }] } } : { success: !0, data: { name: d, phone: y.trim() === "" ? void 0 : y } };
|
|
76
|
-
}
|
|
77
|
-
}, n = Z({ ...W(), defaults: () => ({ name: "", phone: "" }), validator: l });
|
|
78
|
-
X(() => u.profile, (o) => n.hydrate({ name: o.name, phone: o.phone }), { immediate: !0 });
|
|
79
|
-
async function a() {
|
|
80
|
-
const o = await n.submit(async (d) => (await c.request(q.profileUpdate, d)).data);
|
|
81
|
-
o.status === "saved" && (S.success(s("core.profile.details.saved")), t("updated", o.value));
|
|
82
|
-
}
|
|
83
|
-
return (o, d) => (v(), C(e(O), {
|
|
84
|
-
title: e(s)("core.profile.details.title"),
|
|
85
|
-
icon: "user3Line",
|
|
86
|
-
"data-profile-details": ""
|
|
87
|
-
}, {
|
|
88
|
-
footer: p(() => [
|
|
89
|
-
i(ne, {
|
|
90
|
-
label: e(s)("core.profile.details.submit"),
|
|
91
|
-
processing: e(n).submitting.value,
|
|
92
|
-
dirty: e(n).dirty.value,
|
|
93
|
-
onSubmit: a,
|
|
94
|
-
onCancel: d[0] || (d[0] = (y) => e(n).reset())
|
|
95
|
-
}, null, 8, ["label", "processing", "dirty"])
|
|
96
|
-
]),
|
|
97
|
-
default: p(() => [
|
|
98
|
-
i(e(ee), {
|
|
99
|
-
form: e(n),
|
|
100
|
-
onSubmit: a
|
|
101
|
-
}, {
|
|
102
|
-
default: p(() => [
|
|
103
|
-
i(e(D), R(e(n).bind("name"), {
|
|
104
|
-
label: e(s)("core.users.fields.name"),
|
|
105
|
-
required: "",
|
|
106
|
-
autocomplete: "name"
|
|
107
|
-
}), null, 16, ["label"]),
|
|
108
|
-
i(e(D), R(e(n).bind("phone"), {
|
|
109
|
-
label: e(s)("core.users.fields.phone"),
|
|
110
|
-
type: "tel",
|
|
111
|
-
autocomplete: "tel"
|
|
112
|
-
}), null, 16, ["label"]),
|
|
113
|
-
i(e(D), {
|
|
114
|
-
"model-value": u.profile.login,
|
|
115
|
-
label: e(s)("core.users.fields.login"),
|
|
116
|
-
hint: e(s)("core.profile.details.login_hint"),
|
|
117
|
-
disabled: "",
|
|
118
|
-
mono: "",
|
|
119
|
-
"data-profile-login": ""
|
|
120
|
-
}, null, 8, ["model-value", "label", "hint"])
|
|
121
|
-
]),
|
|
122
|
-
_: 1
|
|
123
|
-
}, 8, ["form"])
|
|
124
|
-
]),
|
|
125
|
-
_: 1
|
|
126
|
-
}, 8, ["title"]));
|
|
127
|
-
}
|
|
128
|
-
}), Ae = {
|
|
129
|
-
key: 0,
|
|
130
|
-
class: "max-w-sm text-body text-content-muted"
|
|
131
|
-
}, Ne = ["id"], Ue = {
|
|
132
|
-
key: 2,
|
|
133
|
-
class: "mt-3 text-footnote text-content-muted",
|
|
134
|
-
"data-verify-expires": ""
|
|
135
|
-
}, Be = { class: "mt-6 flex w-full flex-col gap-2" }, Re = /* @__PURE__ */ N({
|
|
136
|
-
__name: "VerifyCode",
|
|
137
|
-
props: /* @__PURE__ */ le({
|
|
138
|
-
description: { default: void 0 },
|
|
139
|
-
length: { default: 6 },
|
|
140
|
-
resendAvailableAt: { default: null },
|
|
141
|
-
expiresAt: { default: null },
|
|
142
|
-
error: { default: "" },
|
|
143
|
-
expired: { type: Boolean, default: !1 },
|
|
144
|
-
verifying: { type: Boolean, default: !1 },
|
|
145
|
-
resending: { type: Boolean, default: !1 }
|
|
146
|
-
}, {
|
|
147
|
-
modelValue: { default: "" },
|
|
148
|
-
modelModifiers: {}
|
|
149
|
-
}),
|
|
150
|
-
emits: /* @__PURE__ */ le(["verify", "resend", "cancel"], ["update:modelValue"]),
|
|
151
|
-
setup(h, { expose: r, emit: u }) {
|
|
152
|
-
const t = h, s = fe(h, "modelValue"), c = u, { t: l } = U(), n = ie(), a = me(), o = J("otp"), d = b(Date.now());
|
|
153
|
-
let y;
|
|
154
|
-
ve(() => y = setInterval(() => d.value = Date.now(), 1e3)), _e(() => clearInterval(y));
|
|
155
|
-
const g = F(() => {
|
|
156
|
-
const k = t.resendAvailableAt ? Date.parse(t.resendAvailableAt) : Number.NaN;
|
|
157
|
-
return Number.isNaN(k) ? 0 : Math.max(0, Math.ceil((k - d.value) / 1e3));
|
|
158
|
-
}), V = F(() => `${Math.floor(g.value / 60)}:${String(g.value % 60).padStart(2, "0")}`), w = F(() => t.expiresAt && !t.expired ? n.time(t.expiresAt) : ""), $ = F(() => s.value.length === t.length), j = F(() => t.verifying || t.resending);
|
|
159
|
-
function I(k = s.value) {
|
|
160
|
-
k.length === t.length && !j.value && !t.expired && c("verify", k);
|
|
161
|
-
}
|
|
162
|
-
function z() {
|
|
163
|
-
g.value === 0 && !j.value && c("resend");
|
|
164
|
-
}
|
|
165
|
-
return X(() => t.error, (k) => {
|
|
166
|
-
k && (s.value = "", o.value?.focus());
|
|
167
|
-
}), r({ focus: () => o.value?.focus() }), (k, B) => (v(), E("form", {
|
|
168
|
-
class: "flex flex-col items-center text-center",
|
|
169
|
-
"data-verify-code": "",
|
|
170
|
-
novalidate: "",
|
|
171
|
-
onSubmit: B[2] || (B[2] = ge((M) => I(), ["prevent"]))
|
|
172
|
-
}, [
|
|
173
|
-
t.description ? (v(), E("p", Ae, _(t.description), 1)) : G("", !0),
|
|
174
|
-
i(e(he), {
|
|
175
|
-
ref_key: "otp",
|
|
176
|
-
ref: o,
|
|
177
|
-
modelValue: s.value,
|
|
178
|
-
"onUpdate:modelValue": B[0] || (B[0] = (M) => s.value = M),
|
|
179
|
-
class: "mt-6",
|
|
180
|
-
length: t.length,
|
|
181
|
-
invalid: !!t.error,
|
|
182
|
-
disabled: t.expired || t.verifying,
|
|
183
|
-
"described-by": t.error ? e(a) : void 0,
|
|
184
|
-
autofocus: "",
|
|
185
|
-
onComplete: I
|
|
186
|
-
}, null, 8, ["modelValue", "length", "invalid", "disabled", "described-by"]),
|
|
187
|
-
t.error ? (v(), E("p", {
|
|
188
|
-
key: 1,
|
|
189
|
-
id: e(a),
|
|
190
|
-
role: "alert",
|
|
191
|
-
class: "mt-3 text-footnote text-content-destructive",
|
|
192
|
-
"data-verify-error": ""
|
|
193
|
-
}, _(t.error), 9, Ne)) : w.value ? (v(), E("p", Ue, _(e(l)("core.profile.email.valid_until", { time: w.value })), 1)) : G("", !0),
|
|
194
|
-
x("div", Be, [
|
|
195
|
-
t.expired ? G("", !0) : (v(), C(e(A), {
|
|
196
|
-
key: 0,
|
|
197
|
-
type: "submit",
|
|
198
|
-
prominence: "primary",
|
|
199
|
-
size: "lg",
|
|
200
|
-
class: "w-full justify-center",
|
|
201
|
-
disabled: !$.value || t.resending,
|
|
202
|
-
processing: t.verifying,
|
|
203
|
-
"data-verify-submit": ""
|
|
204
|
-
}, {
|
|
205
|
-
default: p(() => [
|
|
206
|
-
P(_(e(l)("core.profile.email.verify")), 1)
|
|
207
|
-
]),
|
|
208
|
-
_: 1
|
|
209
|
-
}, 8, ["disabled", "processing"])),
|
|
210
|
-
i(e(A), {
|
|
211
|
-
prominence: t.expired ? "primary" : "standard",
|
|
212
|
-
size: "lg",
|
|
213
|
-
class: "w-full justify-center",
|
|
214
|
-
disabled: g.value > 0 || t.verifying,
|
|
215
|
-
processing: t.resending,
|
|
216
|
-
"data-verify-resend": "",
|
|
217
|
-
onClick: z
|
|
218
|
-
}, {
|
|
219
|
-
default: p(() => [
|
|
220
|
-
g.value > 0 ? (v(), E(oe, { key: 0 }, [
|
|
221
|
-
P(_(e(l)("core.profile.email.resend_in", { time: V.value })), 1)
|
|
222
|
-
], 64)) : (v(), E(oe, { key: 1 }, [
|
|
223
|
-
P(_(t.expired ? e(l)("core.profile.email.request_new") : e(l)("core.profile.email.resend")), 1)
|
|
224
|
-
], 64))
|
|
225
|
-
]),
|
|
226
|
-
_: 1
|
|
227
|
-
}, 8, ["prominence", "disabled", "processing"]),
|
|
228
|
-
i(e(A), {
|
|
229
|
-
prominence: "link",
|
|
230
|
-
class: "mt-1 self-center",
|
|
231
|
-
disabled: t.verifying,
|
|
232
|
-
"data-verify-cancel": "",
|
|
233
|
-
onClick: B[1] || (B[1] = (M) => c("cancel"))
|
|
234
|
-
}, {
|
|
235
|
-
default: p(() => [
|
|
236
|
-
P(_(e(l)("core.profile.email.cancel_change")), 1)
|
|
237
|
-
]),
|
|
238
|
-
_: 1
|
|
239
|
-
}, 8, ["disabled"])
|
|
240
|
-
])
|
|
241
|
-
], 32));
|
|
242
|
-
}
|
|
243
|
-
}), De = { class: "text-body text-content-muted" }, Ie = {
|
|
244
|
-
key: 1,
|
|
245
|
-
class: "px-2 py-4 sm:px-6"
|
|
246
|
-
}, Me = /* @__PURE__ */ N({
|
|
247
|
-
__name: "EmailChangeDialog",
|
|
248
|
-
emits: ["pending", "changed", "cancelled"],
|
|
249
|
-
setup(h, { expose: r, emit: u }) {
|
|
250
|
-
const t = u, { t: s } = U(), { http: c } = L(), l = W(), n = J("modal"), a = b("request"), o = b(null), d = b(!1), g = Z({ ...l, defaults: () => ({ email: "", password: "" }), validator: {
|
|
251
|
-
safeParse(f) {
|
|
252
|
-
const { email: m, password: T } = f, se = s("core.account.validation.required"), ae = [...m.trim() === "" ? [{ path: ["email"], message: se }] : [], ...T === "" ? [{ path: ["password"], message: se }] : []];
|
|
253
|
-
return ae.length > 0 ? { success: !1, error: { issues: ae } } : { success: !0, data: { email: m.trim(), current_password: T } };
|
|
254
|
-
}
|
|
255
|
-
}, serverField: (f) => f === "current_password" ? "password" : f }), { confirmDiscard: V } = re(() => d.value && a.value === "request" && g.dirty.value), w = b(""), $ = b(""), j = b(!1), I = b(!1), z = b(!1), k = b(!1), B = ["identity.code.expired", "identity.code.too_many_attempts", "identity.code.no_pending"];
|
|
256
|
-
function M() {
|
|
257
|
-
w.value = "", $.value = "", j.value = !1;
|
|
258
|
-
}
|
|
259
|
-
function ce(f) {
|
|
260
|
-
o.value = f, a.value = f ? "verify" : "request", g.hydrate({ email: "", password: "" }), M(), n.value?.present();
|
|
261
|
-
}
|
|
262
|
-
async function te() {
|
|
263
|
-
const f = await g.submit(async (m) => (await c.request(q.profileRequestEmail, m)).data);
|
|
264
|
-
f.status === "saved" && (o.value = f.value, M(), a.value = "verify", t("pending", f.value));
|
|
265
|
-
}
|
|
266
|
-
async function de(f) {
|
|
267
|
-
if (!I.value) {
|
|
268
|
-
I.value = !0, $.value = "";
|
|
269
|
-
try {
|
|
270
|
-
const m = (await c.request(q.profileConfirmEmail, { code: f })).data;
|
|
271
|
-
t("changed", m), S.success(s("core.profile.email.changed")), n.value?.dismiss();
|
|
272
|
-
} catch (m) {
|
|
273
|
-
if (H(m)) return;
|
|
274
|
-
if (K(m) && m.fields.email?.[0]) {
|
|
275
|
-
o.value = null, t("pending", null), a.value = "request", g.errors.set({ email: [l.translate(m.fields.email[0])] });
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
j.value = K(m) && m.code !== null && B.includes(m.code), $.value = l.sentence(m, s("core.profile.email.verify_failed"));
|
|
279
|
-
} finally {
|
|
280
|
-
I.value = !1;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
async function ue() {
|
|
285
|
-
if (!z.value) {
|
|
286
|
-
z.value = !0;
|
|
287
|
-
try {
|
|
288
|
-
o.value = (await c.request(q.profileResendEmail)).data, M(), t("pending", o.value), S.success(s("core.profile.email.code_sent", { email: o.value.email }));
|
|
289
|
-
} catch (f) {
|
|
290
|
-
if (H(f)) return;
|
|
291
|
-
if (K(f) && f.code === "identity.code.no_pending") {
|
|
292
|
-
o.value = null, t("pending", null), a.value = "request";
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
$.value = l.sentence(f, s("core.profile.email.resend_failed"));
|
|
296
|
-
} finally {
|
|
297
|
-
z.value = !1;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
async function pe() {
|
|
302
|
-
if (!k.value) {
|
|
303
|
-
k.value = !0;
|
|
304
|
-
try {
|
|
305
|
-
await c.request(q.profileCancelEmail), o.value = null, t("cancelled"), S.success(s("core.profile.email.cancelled")), n.value?.dismiss();
|
|
306
|
-
} catch (f) {
|
|
307
|
-
H(f) || S.error(l.sentence(f, s("core.profile.email.cancel_failed")));
|
|
308
|
-
} finally {
|
|
309
|
-
k.value = !1;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return r({ present: ce }), (f, m) => (v(), C(e(xe), {
|
|
314
|
-
ref_key: "modal",
|
|
315
|
-
ref: n,
|
|
316
|
-
size: "md",
|
|
317
|
-
title: a.value === "request" ? e(s)("core.profile.email.change_title") : e(s)("core.profile.email.verify_title"),
|
|
318
|
-
"primary-label": a.value === "request" ? e(s)("core.profile.email.send_code") : void 0,
|
|
319
|
-
"without-footer": a.value === "verify",
|
|
320
|
-
status: e(g).submitting.value ? "processing" : "idle",
|
|
321
|
-
"before-dismiss": e(V),
|
|
322
|
-
onPrimary: te,
|
|
323
|
-
onPresented: m[1] || (m[1] = (T) => d.value = !0),
|
|
324
|
-
onDismissed: m[2] || (m[2] = (T) => d.value = !1)
|
|
325
|
-
}, {
|
|
326
|
-
default: p(() => [
|
|
327
|
-
a.value === "request" ? (v(), C(e(ee), {
|
|
328
|
-
key: 0,
|
|
329
|
-
form: e(g),
|
|
330
|
-
onSubmit: te
|
|
331
|
-
}, {
|
|
332
|
-
default: p(() => [
|
|
333
|
-
x("p", De, _(e(s)("core.profile.email.request_hint")), 1),
|
|
334
|
-
i(e(D), R(e(g).bind("email"), {
|
|
335
|
-
label: e(s)("core.profile.email.new_email"),
|
|
336
|
-
type: "email",
|
|
337
|
-
required: "",
|
|
338
|
-
autocomplete: "email"
|
|
339
|
-
}), null, 16, ["label"]),
|
|
340
|
-
i(e(D), R(e(g).bind("password"), {
|
|
341
|
-
label: e(s)("core.profile.email.current_password"),
|
|
342
|
-
type: "password",
|
|
343
|
-
required: "",
|
|
344
|
-
autocomplete: "current-password"
|
|
345
|
-
}), null, 16, ["label"])
|
|
346
|
-
]),
|
|
347
|
-
_: 1
|
|
348
|
-
}, 8, ["form"])) : (v(), E("div", Ie, [
|
|
349
|
-
i(Re, {
|
|
350
|
-
modelValue: w.value,
|
|
351
|
-
"onUpdate:modelValue": m[0] || (m[0] = (T) => w.value = T),
|
|
352
|
-
description: e(s)("core.profile.email.verify_description", { email: o.value?.email ?? "" }),
|
|
353
|
-
"resend-available-at": o.value?.resend_available_at ?? null,
|
|
354
|
-
"expires-at": o.value?.expires_at ?? null,
|
|
355
|
-
error: $.value,
|
|
356
|
-
expired: j.value,
|
|
357
|
-
verifying: I.value,
|
|
358
|
-
resending: z.value,
|
|
359
|
-
onVerify: de,
|
|
360
|
-
onResend: ue,
|
|
361
|
-
onCancel: pe
|
|
362
|
-
}, null, 8, ["modelValue", "description", "resend-available-at", "expires-at", "error", "expired", "verifying", "resending"])
|
|
363
|
-
]))
|
|
364
|
-
]),
|
|
365
|
-
_: 1
|
|
366
|
-
}, 8, ["title", "primary-label", "without-footer", "status", "before-dismiss"]));
|
|
367
|
-
}
|
|
368
|
-
}), Fe = { class: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" }, Le = { class: "text-footnote" }, je = { class: "mt-2 flex flex-wrap gap-2" }, ze = /* @__PURE__ */ N({
|
|
369
|
-
__name: "EmailPanel",
|
|
370
|
-
props: {
|
|
371
|
-
profile: {}
|
|
372
|
-
},
|
|
373
|
-
emits: ["updated"],
|
|
374
|
-
setup(h, { emit: r }) {
|
|
375
|
-
const u = h, t = r, { t: s } = U(), { http: c } = L(), l = ie(), n = W(), a = J("dialog"), o = b(!1), d = F(() => u.profile.pending_email), y = (V) => t("updated", { ...u.profile, pending_email: V });
|
|
376
|
-
async function g() {
|
|
377
|
-
if (!o.value) {
|
|
378
|
-
o.value = !0;
|
|
379
|
-
try {
|
|
380
|
-
await c.request(q.profileCancelEmail), S.success(s("core.profile.email.cancelled")), y(null);
|
|
381
|
-
} catch (V) {
|
|
382
|
-
H(V) || S.error(n.sentence(V, s("core.profile.email.cancel_failed")));
|
|
383
|
-
} finally {
|
|
384
|
-
o.value = !1;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
return (V, w) => (v(), C(e(O), {
|
|
389
|
-
title: e(s)("core.profile.email.title"),
|
|
390
|
-
icon: "mailUnreadFill",
|
|
391
|
-
"data-profile-email": ""
|
|
392
|
-
}, {
|
|
393
|
-
default: p(() => [
|
|
394
|
-
x("div", Fe, [
|
|
395
|
-
x("dl", null, [
|
|
396
|
-
i(e(we), {
|
|
397
|
-
label: e(s)("core.profile.email.current"),
|
|
398
|
-
value: u.profile.email,
|
|
399
|
-
"data-profile-email-current": ""
|
|
400
|
-
}, null, 8, ["label", "value"])
|
|
401
|
-
]),
|
|
402
|
-
i(e(A), {
|
|
403
|
-
icon: "mailUnreadFill",
|
|
404
|
-
"data-email-change": "",
|
|
405
|
-
onClick: w[0] || (w[0] = ($) => a.value?.present(null))
|
|
406
|
-
}, {
|
|
407
|
-
default: p(() => [
|
|
408
|
-
P(_(e(s)("core.profile.email.change")), 1)
|
|
409
|
-
]),
|
|
410
|
-
_: 1
|
|
411
|
-
})
|
|
412
|
-
]),
|
|
413
|
-
d.value ? (v(), C(e(be), {
|
|
414
|
-
key: 0,
|
|
415
|
-
tone: "info",
|
|
416
|
-
class: "mt-4",
|
|
417
|
-
"data-email-pending": ""
|
|
418
|
-
}, {
|
|
419
|
-
default: p(() => [
|
|
420
|
-
x("p", null, _(e(s)("core.profile.email.pending", { email: d.value.email })), 1),
|
|
421
|
-
x("p", Le, _(e(s)("core.profile.email.valid_until", { time: e(l).time(d.value.expires_at) })), 1),
|
|
422
|
-
x("div", je, [
|
|
423
|
-
i(e(A), {
|
|
424
|
-
size: "sm",
|
|
425
|
-
prominence: "primary",
|
|
426
|
-
"data-email-enter-code": "",
|
|
427
|
-
onClick: w[1] || (w[1] = ($) => a.value?.present(d.value))
|
|
428
|
-
}, {
|
|
429
|
-
default: p(() => [
|
|
430
|
-
P(_(e(s)("core.profile.email.enter_code")), 1)
|
|
431
|
-
]),
|
|
432
|
-
_: 1
|
|
433
|
-
}),
|
|
434
|
-
i(e(A), {
|
|
435
|
-
size: "sm",
|
|
436
|
-
processing: o.value,
|
|
437
|
-
"data-email-cancel": "",
|
|
438
|
-
onClick: g
|
|
439
|
-
}, {
|
|
440
|
-
default: p(() => [
|
|
441
|
-
P(_(e(s)("core.profile.email.cancel_change")), 1)
|
|
442
|
-
]),
|
|
443
|
-
_: 1
|
|
444
|
-
}, 8, ["processing"])
|
|
445
|
-
])
|
|
446
|
-
]),
|
|
447
|
-
_: 1
|
|
448
|
-
})) : G("", !0),
|
|
449
|
-
i(Me, {
|
|
450
|
-
ref_key: "dialog",
|
|
451
|
-
ref: a,
|
|
452
|
-
onPending: y,
|
|
453
|
-
onChanged: w[2] || (w[2] = ($) => t("updated", $)),
|
|
454
|
-
onCancelled: w[3] || (w[3] = ($) => y(null))
|
|
455
|
-
}, null, 512)
|
|
456
|
-
]),
|
|
457
|
-
_: 1
|
|
458
|
-
}, 8, ["title"]));
|
|
459
|
-
}
|
|
460
|
-
}), Te = { class: "flex justify-end" }, Ge = /* @__PURE__ */ N({
|
|
461
|
-
__name: "PasswordPanel",
|
|
462
|
-
setup(h) {
|
|
463
|
-
const { t: r } = U(), { http: u } = L(), t = b(!1), s = {
|
|
464
|
-
safeParse(n) {
|
|
465
|
-
const a = n, o = r("core.account.validation.required"), d = [
|
|
466
|
-
...a.current === "" ? [{ path: ["current"], message: o }] : [],
|
|
467
|
-
...a.password === "" ? [{ path: ["password"], message: o }] : [],
|
|
468
|
-
...a.password !== "" && a.repeat !== a.password ? [{ path: ["repeat"], message: a.repeat === "" ? o : r("core.account.validation.mismatch") }] : []
|
|
469
|
-
];
|
|
470
|
-
return d.length > 0 ? { success: !1, error: { issues: d } } : { success: !0, data: { current_password: a.current, new_password: a.password, new_password_confirmation: a.repeat } };
|
|
471
|
-
}
|
|
472
|
-
}, c = Z({
|
|
473
|
-
...W(),
|
|
474
|
-
defaults: () => ({ current: "", password: "", repeat: "" }),
|
|
475
|
-
validator: s,
|
|
476
|
-
// The server names its fields; the draft's are shorter.
|
|
477
|
-
serverField: (n) => ({ current_password: "current", new_password: "password", new_password_confirmation: "repeat" })[n] ?? n
|
|
478
|
-
});
|
|
479
|
-
async function l() {
|
|
480
|
-
(await c.submit((a) => u.request(q.profileChangePassword, a))).status === "saved" && (c.hydrate({ current: "", password: "", repeat: "" }), t.value = !1, S.success(r("core.profile.password.changed")));
|
|
481
|
-
}
|
|
482
|
-
return (n, a) => (v(), C(e(O), {
|
|
483
|
-
title: e(r)("core.profile.password.title"),
|
|
484
|
-
icon: "key2Line",
|
|
485
|
-
"data-profile-password": ""
|
|
486
|
-
}, {
|
|
487
|
-
footer: p(() => [
|
|
488
|
-
i(ne, {
|
|
489
|
-
label: e(r)("core.profile.password.submit"),
|
|
490
|
-
processing: e(c).submitting.value,
|
|
491
|
-
dirty: e(c).dirty.value,
|
|
492
|
-
onSubmit: l,
|
|
493
|
-
onCancel: a[1] || (a[1] = (o) => e(c).reset())
|
|
494
|
-
}, null, 8, ["label", "processing", "dirty"])
|
|
495
|
-
]),
|
|
496
|
-
default: p(() => [
|
|
497
|
-
i(e(ee), {
|
|
498
|
-
form: e(c),
|
|
499
|
-
onSubmit: l
|
|
500
|
-
}, {
|
|
501
|
-
default: p(() => [
|
|
502
|
-
i(e(D), R(e(c).bind("current"), {
|
|
503
|
-
type: t.value ? "text" : "password",
|
|
504
|
-
label: e(r)("core.profile.password.current"),
|
|
505
|
-
required: "",
|
|
506
|
-
autocomplete: "current-password"
|
|
507
|
-
}), null, 16, ["type", "label"]),
|
|
508
|
-
i(e(D), R(e(c).bind("password"), {
|
|
509
|
-
type: t.value ? "text" : "password",
|
|
510
|
-
label: e(r)("core.profile.password.new"),
|
|
511
|
-
required: "",
|
|
512
|
-
autocomplete: "new-password"
|
|
513
|
-
}), null, 16, ["type", "label"]),
|
|
514
|
-
i(e(D), R(e(c).bind("repeat"), {
|
|
515
|
-
type: t.value ? "text" : "password",
|
|
516
|
-
label: e(r)("core.profile.password.repeat"),
|
|
517
|
-
required: "",
|
|
518
|
-
autocomplete: "new-password"
|
|
519
|
-
}), null, 16, ["type", "label"]),
|
|
520
|
-
x("div", Te, [
|
|
521
|
-
i(e(A), R({
|
|
522
|
-
prominence: "link",
|
|
523
|
-
size: "sm",
|
|
524
|
-
icon: t.value ? "eyeOff" : "eye"
|
|
525
|
-
}, { "aria-pressed": t.value }, {
|
|
526
|
-
"data-password-visibility": "",
|
|
527
|
-
onClick: a[0] || (a[0] = (o) => t.value = !t.value)
|
|
528
|
-
}), {
|
|
529
|
-
default: p(() => [
|
|
530
|
-
P(_(t.value ? e(r)("core.profile.password.hide") : e(r)("core.profile.password.show")), 1)
|
|
531
|
-
]),
|
|
532
|
-
_: 1
|
|
533
|
-
}, 16, ["icon"])
|
|
534
|
-
])
|
|
535
|
-
]),
|
|
536
|
-
_: 1
|
|
537
|
-
}, 8, ["form"])
|
|
538
|
-
]),
|
|
539
|
-
_: 1
|
|
540
|
-
}, 8, ["title"]));
|
|
541
|
-
}
|
|
542
|
-
}), He = { class: "p-3" }, Oe = /* @__PURE__ */ N({
|
|
543
|
-
__name: "SessionsPanel",
|
|
544
|
-
setup(h) {
|
|
545
|
-
const { t: r } = U(), { http: u } = L(), t = W(), s = Y(async ({ signal: o }) => (await u.request(q.profileSessions, void 0, { signal: o })).data), c = F(() => s.data.value?.sessions ?? []), l = J("dialog"), n = b(null);
|
|
546
|
-
async function a(o) {
|
|
547
|
-
try {
|
|
548
|
-
await u.request(q.profileRevokeSession, { session_id: o.id }), S.success(r("core.account.sessions.ended"));
|
|
549
|
-
} catch (d) {
|
|
550
|
-
H(d) || S.error(t.sentence(d, r("core.account.sessions.end_failed")));
|
|
551
|
-
}
|
|
552
|
-
await s.reload();
|
|
553
|
-
}
|
|
554
|
-
return (o, d) => (v(), C(e(O), {
|
|
555
|
-
title: e(r)("core.profile.sessions.title"),
|
|
556
|
-
icon: "deviceLine",
|
|
557
|
-
flush: "",
|
|
558
|
-
"data-profile-sessions": ""
|
|
559
|
-
}, {
|
|
560
|
-
default: p(() => [
|
|
561
|
-
i(e(Q), {
|
|
562
|
-
state: e(s).state.value,
|
|
563
|
-
"skeleton-rows": 3,
|
|
564
|
-
"is-empty": () => !1,
|
|
565
|
-
onRetry: d[1] || (d[1] = (y) => e(s).reload())
|
|
566
|
-
}, {
|
|
567
|
-
default: p(() => [
|
|
568
|
-
x("div", He, [
|
|
569
|
-
i(ke, {
|
|
570
|
-
sessions: c.value,
|
|
571
|
-
"can-end": "",
|
|
572
|
-
footer: e(r)("core.profile.sessions.footer"),
|
|
573
|
-
onEnd: d[0] || (d[0] = (y) => {
|
|
574
|
-
n.value = y, l.value?.present(y);
|
|
575
|
-
})
|
|
576
|
-
}, null, 8, ["sessions", "footer"])
|
|
577
|
-
])
|
|
578
|
-
]),
|
|
579
|
-
_: 1
|
|
580
|
-
}, 8, ["state"]),
|
|
581
|
-
i(e($e), {
|
|
582
|
-
ref_key: "dialog",
|
|
583
|
-
ref: l,
|
|
584
|
-
tone: "critical",
|
|
585
|
-
icon: "logoutBoxRLine",
|
|
586
|
-
title: e(r)("core.account.sessions.end_title"),
|
|
587
|
-
message: e(r)("core.account.sessions.end_body", { device: n.value?.device || e(r)("core.account.sessions.unknown_device") }),
|
|
588
|
-
"confirm-label": e(r)("core.account.sessions.end"),
|
|
589
|
-
action: a
|
|
590
|
-
}, null, 8, ["title", "message", "confirm-label"])
|
|
591
|
-
]),
|
|
592
|
-
_: 1
|
|
593
|
-
}, 8, ["title"]));
|
|
594
|
-
}
|
|
595
|
-
}), We = { class: "px-3 pt-3" }, Xe = { class: "px-3 pt-3" }, Je = { class: "py-3" }, Ke = { class: "px-4 pb-3 text-footnote text-content-muted" }, Qe = /* @__PURE__ */ N({
|
|
596
|
-
__name: "SignInsPanel",
|
|
597
|
-
setup(h) {
|
|
598
|
-
const { t: r } = U(), { http: u } = L(), t = ["all", "failed"], s = b("all"), c = b(1), l = Y(async ({ signal: n }) => (await u.request(q.profileSignins, { view: s.value, page: c.value, per_page: 20 }, { signal: n })).data);
|
|
599
|
-
return X(s, () => {
|
|
600
|
-
c.value = 1, l.reload();
|
|
601
|
-
}), X(c, () => void l.reload()), (n, a) => (v(), C(e(O), {
|
|
602
|
-
title: e(r)("core.profile.signins.title"),
|
|
603
|
-
icon: "timeFill",
|
|
604
|
-
flush: "",
|
|
605
|
-
"data-profile-signins": ""
|
|
606
|
-
}, {
|
|
607
|
-
default: p(() => [
|
|
608
|
-
x("div", We, [
|
|
609
|
-
i(Pe, {
|
|
610
|
-
modelValue: s.value,
|
|
611
|
-
"onUpdate:modelValue": a[0] || (a[0] = (o) => s.value = o),
|
|
612
|
-
views: t,
|
|
613
|
-
counts: e(l).data.value?.meta?.views,
|
|
614
|
-
"label-of": (o) => e(r)(`core.account.signins.views.${o}`),
|
|
615
|
-
label: e(r)("core.profile.signins.title")
|
|
616
|
-
}, null, 8, ["modelValue", "counts", "label-of", "label"])
|
|
617
|
-
]),
|
|
618
|
-
i(e(Q), {
|
|
619
|
-
state: e(l).state.value,
|
|
620
|
-
"skeleton-rows": 4,
|
|
621
|
-
"is-empty": () => !1,
|
|
622
|
-
onRetry: a[2] || (a[2] = (o) => e(l).reload())
|
|
623
|
-
}, {
|
|
624
|
-
default: p(({ value: o }) => [
|
|
625
|
-
x("div", Xe, [
|
|
626
|
-
i(Ce, {
|
|
627
|
-
rows: o.data
|
|
628
|
-
}, null, 8, ["rows"])
|
|
629
|
-
]),
|
|
630
|
-
x("div", Je, [
|
|
631
|
-
i(qe, {
|
|
632
|
-
page: c.value,
|
|
633
|
-
"onUpdate:page": a[1] || (a[1] = (d) => c.value = d),
|
|
634
|
-
"last-page": o.last_page,
|
|
635
|
-
total: o.total
|
|
636
|
-
}, null, 8, ["page", "last-page", "total"])
|
|
637
|
-
]),
|
|
638
|
-
x("p", Ke, _(e(r)("core.profile.signins.footer")), 1)
|
|
639
|
-
]),
|
|
640
|
-
_: 1
|
|
641
|
-
}, 8, ["state"])
|
|
642
|
-
]),
|
|
643
|
-
_: 1
|
|
644
|
-
}, 8, ["title"]));
|
|
645
|
-
}
|
|
646
|
-
}), Ye = { class: "grid grid-cols-1 items-start gap-4 lg:grid-cols-2" }, Ze = { class: "flex flex-col gap-4" }, Ct = /* @__PURE__ */ N({
|
|
647
|
-
__name: "ProfilePage",
|
|
648
|
-
setup(h) {
|
|
649
|
-
const { t: r } = U(), { http: u, session: t } = L(), s = Y(async ({ signal: l }) => (await u.request(q.profileShow, void 0, { signal: l })).data);
|
|
650
|
-
function c(l) {
|
|
651
|
-
s.update(l), t.refresh();
|
|
652
|
-
}
|
|
653
|
-
return (l, n) => (v(), C(e(ye), {
|
|
654
|
-
title: e(r)("core.profile.title"),
|
|
655
|
-
description: e(r)("core.profile.description"),
|
|
656
|
-
width: "content"
|
|
657
|
-
}, {
|
|
658
|
-
default: p(() => [
|
|
659
|
-
i(e(Q), {
|
|
660
|
-
state: e(s).state.value,
|
|
661
|
-
"skeleton-rows": 6,
|
|
662
|
-
"is-empty": () => !1,
|
|
663
|
-
onRetry: n[0] || (n[0] = (a) => e(s).reload())
|
|
664
|
-
}, {
|
|
665
|
-
default: p(({ value: a }) => [
|
|
666
|
-
x("div", Ye, [
|
|
667
|
-
x("div", Ze, [
|
|
668
|
-
i(Ee, {
|
|
669
|
-
profile: a,
|
|
670
|
-
onUpdated: c
|
|
671
|
-
}, null, 8, ["profile"]),
|
|
672
|
-
i(ze, {
|
|
673
|
-
profile: a,
|
|
674
|
-
onUpdated: c
|
|
675
|
-
}, null, 8, ["profile"])
|
|
676
|
-
]),
|
|
677
|
-
i(Ge),
|
|
678
|
-
i(Oe, { class: "lg:col-span-2" }),
|
|
679
|
-
i(Qe, { class: "lg:col-span-2" })
|
|
680
|
-
])
|
|
681
|
-
]),
|
|
682
|
-
_: 1
|
|
683
|
-
}, 8, ["state"])
|
|
684
|
-
]),
|
|
685
|
-
_: 1
|
|
686
|
-
}, 8, ["title", "description"]));
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
export {
|
|
690
|
-
Ct as default
|
|
691
|
-
};
|