@wssto2/vue-core 0.5.3 → 0.6.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -1
  3. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-Bv-APkGf.js → ActionRow.vue_vue_type_script_setup_true_lang-D8NCXX4p.js} +1 -1
  4. package/dist/{Activity-DUjDaPfP.js → Activity-DGodh6BU.js} +4 -4
  5. package/dist/{Changes-B0tZO6BZ.js → Changes-38u4xY6e.js} +3 -3
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-o_Pj-JcD.js → CollectionPage.vue_vue_type_script_setup_true_lang-DPcCnrjr.js} +3 -3
  7. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CDg31ZU7.js → DateField.vue_vue_type_script_setup_true_lang-BxUuUypB.js} +1 -1
  8. package/dist/{DeadLetters-IgVHao84.js → DeadLetters-CeHfhFHP.js} +6 -5
  9. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-CSgT4ITL.js → FormGroup.vue_vue_type_script_setup_true_lang-CNb2CK01.js} +1 -1
  10. package/dist/{FormView.vue_vue_type_script_setup_true_lang-D31Hk3pJ.js → FormView.vue_vue_type_script_setup_true_lang-nyz8EkzM.js} +1 -1
  11. package/dist/{General-C40HxupS.js → General-BNTjPvat.js} +6 -6
  12. package/dist/{NewRolePage-Bhy8KJO1.js → NewRolePage-Btg7gzzH.js} +7 -6
  13. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-BdS7BxuS.js → NumberField.vue_vue_type_script_setup_true_lang-C8um4ARi.js} +1 -1
  14. package/dist/PersonAccess.vue_vue_type_script_setup_true_lang-ClmawvYm.js +600 -0
  15. package/dist/{ProfilePage-Bf7dFzGd.js → ProfilePage-CoZyG11N.js} +9 -9
  16. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-C6oloGIh.js → RoleEditor.vue_vue_type_script_setup_true_lang-Bs9bo0Zb.js} +30 -29
  17. package/dist/{RolePage-BjbvciTg.js → RolePage-CPlwZA6X.js} +37 -35
  18. package/dist/{RolesPage-DzVOgF4z.js → RolesPage-CdYdIHR4.js} +29 -27
  19. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-DXe_iOS8.js → SegmentedField.vue_vue_type_script_setup_true_lang-B_hBL5f4.js} +1 -1
  20. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BN4vzvV9.js → SelectField.vue_vue_type_script_setup_true_lang-CBZhGNpm.js} +4 -4
  21. package/dist/ServiceAccountDialog.vue_vue_type_script_setup_true_lang-DuvSSBbX.js +126 -0
  22. package/dist/ServiceAccountRecord-BtaUZuWU.js +511 -0
  23. package/dist/ServiceAccountsList-CcRJvNaf.js +137 -0
  24. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-PuWIK-Wa.js → SessionList.vue_vue_type_script_setup_true_lang-VvBB2EZz.js} +2 -2
  25. package/dist/{Sessions-CRUObe5G.js → Sessions-DkGNO1FO.js} +2 -2
  26. package/dist/{SettingsPage-C0qEC0uI.js → SettingsPage-D4G1HGbG.js} +8 -8
  27. package/dist/{SignIn-Uy0Jujzz.js → SignIn-DS1YymqD.js} +4 -4
  28. package/dist/{SignInPage-CpVZfrLZ.js → SignInPage-BrmL0PUw.js} +3 -3
  29. package/dist/{SignIns-Cp5Gx2dk.js → SignIns-C7l7IPHQ.js} +1 -1
  30. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-Dj5Aq8QT.js → SwitchField.vue_vue_type_script_setup_true_lang-DXZK89A3.js} +1 -1
  31. package/dist/{TextField.vue_vue_type_script_setup_true_lang-BwfNNQEz.js → TextField.vue_vue_type_script_setup_true_lang-CX3LdZLK.js} +2 -2
  32. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-aT1P8Xqr.js → TextareaField.vue_vue_type_script_setup_true_lang-BOtn_1GT.js} +1 -1
  33. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-jPKPE1hc.js → TimeField.vue_vue_type_script_setup_true_lang-CbflIrq6.js} +1 -1
  34. package/dist/{UserRecord-DbSMnTbj.js → UserRecord-Du8M_kuk.js} +25 -25
  35. package/dist/{UsersList-9MicE2pG.js → UsersList-D3ydQice.js} +13 -13
  36. package/dist/access/api.d.ts +7 -8
  37. package/dist/access/context.d.ts +2 -7
  38. package/dist/access/feature.d.ts +0 -8
  39. package/dist/access/index.js +47 -15
  40. package/dist/client/client.d.ts +2 -2
  41. package/dist/client/index.d.ts +1 -1
  42. package/dist/client/route.d.ts +22 -3
  43. package/dist/collection/http.d.ts +3 -2
  44. package/dist/collection/index.js +17 -16
  45. package/dist/form/index.js +586 -611
  46. package/dist/http-nz92KjdS.js +42 -0
  47. package/dist/i18n/index.js +32 -32
  48. package/dist/identity/index.d.ts +7 -0
  49. package/dist/identity/index.js +19 -15
  50. package/dist/identity/serviceaccounts/ApiKeysPanel.vue.d.ts +17 -0
  51. package/dist/identity/serviceaccounts/CreatedApiKeyDialog.vue.d.ts +53 -0
  52. package/dist/identity/serviceaccounts/NewApiKeyDialog.vue.d.ts +24 -0
  53. package/dist/identity/serviceaccounts/ServiceAccountDialog.vue.d.ts +22 -0
  54. package/dist/identity/serviceaccounts/ServiceAccountRecord.vue.d.ts +2 -0
  55. package/dist/identity/serviceaccounts/ServiceAccountsList.vue.d.ts +2 -0
  56. package/dist/identity/serviceaccounts/access.d.ts +4 -0
  57. package/dist/identity/serviceaccounts/api.d.ts +27 -0
  58. package/dist/identity/serviceaccounts/context.d.ts +14 -0
  59. package/dist/identity/serviceaccounts/feature.d.ts +23 -0
  60. package/dist/identity/serviceaccounts/form.d.ts +4 -0
  61. package/dist/identity/serviceaccounts/messages.d.ts +11 -0
  62. package/dist/identity/serviceaccounts/routes.d.ts +22 -0
  63. package/dist/{index-Ok29ucE3.js → index-Cmj9iZmT.js} +191 -168
  64. package/dist/{index-C-oM_Mnf.js → index-DH0MoFqg.js} +2 -2
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/internal/copyText.d.ts +5 -0
  68. package/dist/modules/access/routes.d.ts +13 -13
  69. package/dist/modules/events/routes.d.ts +4 -4
  70. package/dist/modules/identity/routes.d.ts +31 -31
  71. package/dist/modules/notification/routes.d.ts +16 -16
  72. package/dist/modules/serviceaccount/entities.d.ts +127 -0
  73. package/dist/modules/serviceaccount/routes.d.ts +58 -0
  74. package/dist/modules/serviceaccount/schemas.d.ts +49 -0
  75. package/dist/{neighbors-Bv6vnWlW.js → neighbors-DNZuGlQH.js} +1 -1
  76. package/dist/notifications/index.js +1 -1
  77. package/dist/{options-Bu0XbEpN.js → options-e_CAfvDQ.js} +3 -3
  78. package/dist/phone/index.js +1 -1
  79. package/dist/refusals-COPr15XZ.js +135 -0
  80. package/dist/routes-CVckt7Pj.js +19 -0
  81. package/dist/state-BC1Fc6U2.js +154 -0
  82. package/dist/{status-C78NpXyB.js → status-C8XtnK6m.js} +7 -6
  83. package/dist/styles.css +1 -1
  84. package/dist/{suggestions-ClyLexMO.js → suggestions-cPjs5gQz.js} +1 -1
  85. package/dist/{useCommand-DyuPTosF.js → useCommand-CfG727e8.js} +1 -1
  86. package/dist/{useGroupSheet-C2NyqWRp.js → useGroupSheet-BVcNDWbP.js} +2 -2
  87. package/dist/useRecordDialog-D65FF85F.js +30 -0
  88. package/package.json +2 -2
  89. package/dist/http-CdQowFlW.js +0 -194
  90. package/dist/index-BdGnA1Jh.js +0 -765
@@ -0,0 +1,600 @@
1
+ import { defineComponent as Y, ref as R, computed as j, watch as te, openBlock as i, createBlock as E, unref as e, withCtx as y, createElementVNode as A, createElementBlock as b, toDisplayString as w, createCommentVNode as D, createVNode as $, Fragment as B, renderList as G, createSlots as fe, renderSlot as ke, createTextVNode as M, useTemplateRef as le } from "vue";
2
+ import { useI18n as ee } from "vue-i18n";
3
+ import { _ as I } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
4
+ import { _ as K } from "./FormGroup.vue_vue_type_script_setup_true_lang-CNb2CK01.js";
5
+ import { g as V } from "./options-e_CAfvDQ.js";
6
+ import { _ as $e } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
7
+ import { t as Z } from "./toast-CqSDTWRX.js";
8
+ import { _ as ne } from "./AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js";
9
+ import { i as xe } from "./error-Bb_dr_Ay.js";
10
+ import { _ as je } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
11
+ import { _ as Le } from "./EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js";
12
+ import { u as qe } from "./useLoad-W4tfxmm5.js";
13
+ import { _ as Ce, a as Ee } from "./SelectField.vue_vue_type_script_setup_true_lang-CBZhGNpm.js";
14
+ import { _ as Ne } from "./SegmentedField.vue_vue_type_script_setup_true_lang-B_hBL5f4.js";
15
+ import { u as Te, _ as Se } from "./useCommand-CfG727e8.js";
16
+ import { route as C } from "./client/index.js";
17
+ import { s as Ae } from "./routes-CVckt7Pj.js";
18
+ import { u as Re } from "./platform-Dx6STiwY.js";
19
+ import { u as J, g as pe, f as De, j as Ue, l as Be, S as ce, e as Oe, a as re } from "./refusals-COPr15XZ.js";
20
+ import { _ as Pe } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
21
+ import { u as Ge } from "./mediaQuery-CygcXmFW.js";
22
+ import { _ as Ve } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
23
+ const U = {
24
+ rolesList: C("GET", "/v1/iam/roles", { permission: "iam.role:view" }),
25
+ rolesShow: C("GET", "/v1/iam/roles/:ref", { permission: "iam.role:view" }),
26
+ rolesHolders: C("GET", "/v1/iam/roles/:ref/holders", { permission: "iam.role:view" }),
27
+ rolesCompare: C("GET", "/v1/iam/roles/:ref/compare", { permission: "iam.role:view" }),
28
+ rolesCreate: C("POST", "/v1/iam/roles", { permission: "iam.role:manage" }),
29
+ rolesUpdate: C("PUT", "/v1/iam/roles/:ref", { permission: "iam.role:manage" }),
30
+ rolesDelete: C("DELETE", "/v1/iam/roles/:ref", { permission: "iam.role:delete" }),
31
+ rolesReplace: C("POST", "/v1/iam/roles/:ref/replace", { permission: "iam.role:manage" }),
32
+ bindable: C("GET", "/v1/iam/bindable-roles"),
33
+ subjectsAccess: C("GET", "/v1/iam/users/:id/access", { permission: "iam.user:view" }),
34
+ subjectsScopes: C("GET", "/v1/iam/users/:id/scopes", { permission: "iam.user:manage" }),
35
+ subjectsBind: C("POST", "/v1/iam/users/:id/bindings", { permission: "iam.user:manage" }),
36
+ subjectsUnbind: C("DELETE", "/v1/iam/users/:id/bindings/:binding_id", { permission: "iam.user:manage" }),
37
+ me: C.raw("GET", "/v1/me/access")
38
+ };
39
+ function F(l) {
40
+ if (l === "user") return U;
41
+ const { access: s, scopes: o, bind: f, unbind: t, bindableroles: a } = Ae;
42
+ return { bindable: a, subjectsAccess: s, subjectsScopes: o, subjectsBind: f, subjectsUnbind: t };
43
+ }
44
+ function Fe(l) {
45
+ return {
46
+ roles: async (s) => (await l.request(U.rolesList, void 0, s)).data.roles,
47
+ role: async (s, o) => (await l.request(U.rolesShow, { ref: s }, o)).data,
48
+ holders: async (s, o) => (await l.request(U.rolesHolders, { ref: s }, o)).data.holders,
49
+ compare: async (s, o, f) => (await l.request(U.rolesCompare, { ref: s, with: o }, f)).data,
50
+ create: async (s) => (await l.request(U.rolesCreate, s)).data,
51
+ update: async (s) => (await l.request(U.rolesUpdate, s)).data,
52
+ remove: async (s) => void await l.request(U.rolesDelete, { ref: s }),
53
+ replace: async (s, o) => (await l.request(U.rolesReplace, { ref: s, with: o })).data.rebound,
54
+ access: async (s, o) => (await l.request(F(s.kind).subjectsAccess, { id: s.id }, o)).data,
55
+ scopes: async (s, o) => (await l.request(F(s.kind).subjectsScopes, { id: s.id }, o)).data,
56
+ bindable: async (s, o, f, t) => (await l.request(F(s.kind).bindable, { level: o, scope_id: f ?? 0 }, t)).data.roles,
57
+ bind: async (s, o) => (await l.request(F(s.kind).subjectsBind, { id: s.id, ...o })).data,
58
+ unbind: async (s, o) => void await l.request(F(s.kind).subjectsUnbind, { id: s.id, binding_id: o })
59
+ };
60
+ }
61
+ const ve = () => Fe(Re().http);
62
+ function Me(l) {
63
+ const s = /* @__PURE__ */ new Map();
64
+ for (const t of l.places) s.set(t.level, t.parent_level);
65
+ const o = (t) => {
66
+ const a = [t], u = new Set(a);
67
+ for (let v = s.get(t); v !== void 0 && v !== l.root_level && s.has(v) && !u.has(v); v = s.get(v))
68
+ a.unshift(v), u.add(v);
69
+ return a;
70
+ }, f = [...s.keys()].map((t) => ({ level: t, chain: o(t) })).sort((t, a) => a.chain.length - t.chain.length || t.level.localeCompare(a.level));
71
+ return l.root ? [...f, { level: l.root_level, chain: [] }] : f;
72
+ }
73
+ const Ke = (l) => l.filter((s) => s.chain.length > 0).sort((s, o) => s.chain.length - o.chain.length)[0] ?? l[0] ?? null;
74
+ function ie(l, s, o, f) {
75
+ const t = s.chain[o], a = s.chain[o + 1];
76
+ return l.places.filter(
77
+ (u) => u.level === t && (o === 0 || u.parent_level === s.chain[o - 1] && u.parent_id === f[o - 1]) && (a === void 0 || l.places.some((v) => v.level === a && v.parent_id === u.id))
78
+ );
79
+ }
80
+ const ze = {
81
+ class: "flex min-w-0 flex-col gap-group-gap",
82
+ "data-test": "add-role-sheet"
83
+ }, He = {
84
+ key: 0,
85
+ class: "px-row-inset text-body text-content-destructive",
86
+ role: "alert",
87
+ "data-test": "scopes-failed"
88
+ }, We = {
89
+ key: 1,
90
+ class: "px-row-inset text-body text-content-muted",
91
+ "data-test": "no-places"
92
+ }, Ie = {
93
+ key: 0,
94
+ class: "px-row-inset text-body text-content-muted",
95
+ "data-test": "roles-loading"
96
+ }, Ye = {
97
+ key: 1,
98
+ class: "px-row-inset text-body text-content-destructive",
99
+ role: "alert",
100
+ "data-test": "roles-failed"
101
+ }, Je = {
102
+ key: 2,
103
+ class: "px-row-inset text-body text-content-muted",
104
+ "data-test": "roles-none"
105
+ }, Qe = {
106
+ key: 3,
107
+ "data-test": "bindable-roles"
108
+ }, Xe = { class: "px-row-inset pb-1.5 text-footnote uppercase tracking-wide text-content-muted" }, Ze = {
109
+ key: 4,
110
+ "data-test": "chosen-role"
111
+ }, es = /* @__PURE__ */ Y({
112
+ __name: "AddRoleDialog",
113
+ props: {
114
+ subject: {},
115
+ subjectLabel: {}
116
+ },
117
+ emits: ["added"],
118
+ setup(l, { expose: s, emit: o }) {
119
+ const f = l, t = o, { t: a } = ee(), u = J(), v = ve(), { catalogue: T, scopes: L } = pe(), x = Te({
120
+ defaults: () => ({ level: null, place: null, role: null }),
121
+ validator: {
122
+ safeParse(c) {
123
+ const d = c, r = [
124
+ ...d.level === null || d.level !== m.value?.root_level && d.place === null ? [{ path: ["level"], message: a("core.access.add.choose_place") }] : [],
125
+ ...d.role === null ? [{ path: ["role"], message: a("core.access.add.choose_role") }] : []
126
+ ];
127
+ return r.length === 0 ? { success: !0, data: { level: d.level, place: d.place, role: d.role } } : { success: !1, error: { issues: r } };
128
+ }
129
+ },
130
+ failureMessage: De(),
131
+ run: (c) => v.bind(f.subject, { role_ref: c.role, level: c.level, scope_id: c.place }),
132
+ done: (c) => {
133
+ Z.success(a("core.access.added")), t("added", c);
134
+ }
135
+ }), n = x.form.values, m = R(null), h = R(!1), _ = R([]), p = R([]), N = R(!1), k = R(!1), q = j(() => m.value ? Me(m.value) : []), g = j(() => q.value.find((c) => c.level === n.level) ?? null), O = j(() => q.value.length > 1), se = j(() => {
136
+ const c = m.value, d = g.value;
137
+ return c && d ? d.chain.map((r, P) => ({ name: r, places: ie(c, d, P, _.value) })) : [];
138
+ }), _e = j(() => {
139
+ const c = g.value?.chain.length ?? 0, d = c ? _.value[c - 1] : null;
140
+ return m.value?.places.find((r) => r.level === g.value?.level && r.id === d)?.name ?? null;
141
+ }), Q = j(() => g.value !== null && g.value.chain.every((c, d) => _.value[d] != null));
142
+ function ae(c) {
143
+ n.level = c, _.value = [], n.place = null;
144
+ }
145
+ function oe(c, d) {
146
+ const r = _.value.slice(0, c);
147
+ r[c] = d, _.value = r;
148
+ }
149
+ te([() => n.level, _, m], () => {
150
+ const c = m.value, d = g.value;
151
+ if (!(!c || !d)) {
152
+ for (let r = 0; r < d.chain.length; r++) {
153
+ if (_.value[r] != null) continue;
154
+ const P = ie(c, d, r, _.value);
155
+ P.length === 1 && P[0] && oe(r, P[0].id);
156
+ break;
157
+ }
158
+ n.place = d.chain.length === 0 ? null : _.value[d.chain.length - 1] ?? null;
159
+ }
160
+ }, { deep: !0 });
161
+ async function be() {
162
+ if (n.role = null, p.value = [], k.value = !1, !g.value || !Q.value) return;
163
+ N.value = !0;
164
+ const c = `${n.level}:${n.place}`;
165
+ try {
166
+ const d = await v.bindable(f.subject, g.value.level, n.place);
167
+ c === `${n.level}:${n.place}` && (p.value = d);
168
+ } catch {
169
+ c === `${n.level}:${n.place}` && (k.value = !0);
170
+ } finally {
171
+ N.value = !1;
172
+ }
173
+ }
174
+ te([() => n.level, () => n.place, Q], () => void be());
175
+ const ge = j(() => p.value.map((c) => ({ value: c.ref, label: u.roleName(c), description: u.roleKind(c) }))), z = j(() => p.value.find((c) => c.ref === n.role) ?? null), he = j(() => {
176
+ const c = /* @__PURE__ */ new Map();
177
+ for (const d of z.value?.grants ?? []) {
178
+ const r = T[d.permission]?.ownable;
179
+ r && (!c.has(r) || d.permission.endsWith(":view")) && c.set(r, d.qualifier);
180
+ }
181
+ return [...c].map(([d, r]) => ({ ownable: d, qualifier: r }));
182
+ }), ye = j(() => u.scopeLabel({ level: n.level ?? m.value?.root_level ?? "", name: _e.value }));
183
+ async function we() {
184
+ m.value = null, h.value = !1, _.value = [], p.value = [], x.present();
185
+ try {
186
+ m.value = L ? await L(f.subject, new AbortController().signal) : await v.scopes(f.subject);
187
+ } catch {
188
+ h.value = !0;
189
+ return;
190
+ }
191
+ const c = Ke(q.value);
192
+ c && ae(c.level);
193
+ }
194
+ return s({ present: we }), (c, d) => (i(), E(e(Se), {
195
+ command: e(x),
196
+ title: e(a)("core.access.add_role"),
197
+ subtitle: f.subjectLabel,
198
+ size: "lg",
199
+ "confirm-label": e(a)("core.access.add.confirm")
200
+ }, {
201
+ default: y(() => [
202
+ A("div", ze, [
203
+ h.value ? (i(), b("p", He, w(e(a)("core.access.add.scopes_failed")), 1)) : m.value && q.value.length === 0 ? (i(), b("p", We, w(e(a)("core.access.add.no_places")), 1)) : D("", !0),
204
+ O.value ? (i(), E(e(K), {
205
+ key: 2,
206
+ header: e(a)("core.access.add.scope_header")
207
+ }, {
208
+ default: y(() => [
209
+ $(e(Ne), {
210
+ "model-value": e(n).level,
211
+ label: e(a)("core.access.add.scope_level"),
212
+ options: q.value.map((r) => ({ value: r.level, label: e(u).levelLabel(r.level) })),
213
+ "onUpdate:modelValue": d[0] || (d[0] = (r) => ae(r))
214
+ }, null, 8, ["model-value", "label", "options"]),
215
+ (i(!0), b(B, null, G(se.value, (r, P) => (i(), E(e(Ce), {
216
+ key: r.name,
217
+ "model-value": _.value[P] ?? null,
218
+ label: e(u).levelLabel(r.name),
219
+ options: r.places.map((H) => ({ value: H.id, label: H.name })),
220
+ "onUpdate:modelValue": (H) => oe(P, H)
221
+ }, null, 8, ["model-value", "label", "options", "onUpdate:modelValue"]))), 128))
222
+ ]),
223
+ _: 1
224
+ }, 8, ["header"])) : D("", !0),
225
+ Q.value ? (i(), b(B, { key: 3 }, [
226
+ N.value ? (i(), b("p", Ie, w(e(a)("core.access.add.roles_loading")), 1)) : k.value ? (i(), b("p", Ye, w(e(a)("core.access.add.roles_failed")), 1)) : p.value.length === 0 ? (i(), b("p", Je, w(e(a)("core.access.add.no_roles")), 1)) : (i(), b("div", Qe, [
227
+ A("p", Xe, w(e(a)("core.access.add.role")), 1),
228
+ $(e(Ee), {
229
+ options: ge.value,
230
+ "model-value": e(n).role,
231
+ onSelect: d[1] || (d[1] = (r) => e(n).role = r)
232
+ }, null, 8, ["options", "model-value"])
233
+ ]))
234
+ ], 64)) : D("", !0),
235
+ z.value ? (i(), b("div", Ze, [
236
+ $(e(K), {
237
+ header: e(a)("core.access.add.role_gives"),
238
+ footer: e(a)("core.access.add.role_gives_footer")
239
+ }, {
240
+ default: y(() => [
241
+ $(e(V), {
242
+ layout: "setting",
243
+ label: e(u).roleName(z.value),
244
+ sub: z.value.description
245
+ }, null, 8, ["label", "sub"]),
246
+ (i(!0), b(B, null, G(he.value, (r) => (i(), E(e(V), {
247
+ key: r.ownable,
248
+ layout: "setting",
249
+ label: e(u).ownableLabel(r.ownable),
250
+ value: `${e(u).qualifierNoun(r.qualifier)} · ${ye.value}`
251
+ }, null, 8, ["label", "value"]))), 128))
252
+ ]),
253
+ _: 1
254
+ }, 8, ["header", "footer"])
255
+ ])) : D("", !0)
256
+ ])
257
+ ]),
258
+ _: 1
259
+ }, 8, ["command", "title", "subtitle", "confirm-label"]));
260
+ }
261
+ }), ss = {
262
+ class: "text-right text-footnote text-content-muted compact:text-left",
263
+ "data-test": "binding-scope"
264
+ }, as = /* @__PURE__ */ Y({
265
+ __name: "BindingRow",
266
+ props: {
267
+ binding: {}
268
+ },
269
+ setup(l) {
270
+ const s = l, o = J(), f = j(() => [o.roleKind(s.binding.role), ...s.binding.role.attrs.map(o.constraintLabel)].join(" · "));
271
+ return (t, a) => (i(), E(e(V), {
272
+ layout: "setting",
273
+ "stack-on-compact": "",
274
+ label: e(o).roleName(s.binding.role),
275
+ sub: f.value
276
+ }, fe({
277
+ leading: y(() => [
278
+ $(e(Pe), {
279
+ tone: s.binding.role.predefined ? "anchor" : "brand",
280
+ icon: "shieldStarFill"
281
+ }, null, 8, ["tone"])
282
+ ]),
283
+ default: y(() => [
284
+ A("span", ss, w(e(o).scopeLabel(s.binding.scope)), 1)
285
+ ]),
286
+ _: 2
287
+ }, [
288
+ t.$slots.trailing ? {
289
+ name: "trailing",
290
+ fn: y(() => [
291
+ ke(t.$slots, "trailing")
292
+ ]),
293
+ key: "0"
294
+ } : void 0
295
+ ]), 1032, ["label", "sub"]));
296
+ }
297
+ }), ue = { own: 0, own_location: 1, all: 2 }, de = (l, s) => ue[s] > ue[l] ? s : l, W = (l) => `${l.level}:${l.id ?? ""}`, X = ["view", "create", "update", "manage", "delete"], me = (l) => X.includes(l) ? X.indexOf(l) : X.length;
298
+ function os(l, s) {
299
+ const o = /* @__PURE__ */ new Map();
300
+ for (const t of s) {
301
+ if (t.grants.length === 0) continue;
302
+ const a = l[t.permission], [u = t.permission, v = ""] = t.permission.split(":"), T = a ? Ue(a) : u.split(".")[0] ?? u, L = a ? Be(a) : u.replace(/\./g, "_"), S = a?.ownable != null, x = o.get(T) ?? /* @__PURE__ */ new Map(), n = x.get(L) ?? { key: L, actions: [], sources: [], qualifier: null, scopes: [], ownable: !1, allUnavailable: !0 };
303
+ n.actions.push({ permission: t.permission, verb: a?.verb ?? v, unavailable: t.unavailable, grants: t.grants }), n.ownable || (n.ownable = S), n.allUnavailable && (n.allUnavailable = t.unavailable);
304
+ for (const m of t.grants) {
305
+ const h = S ? m.qualifier : "all";
306
+ n.scopes.some((p) => W(p) === W(m.scope)) || n.scopes.push(m.scope), S && (n.qualifier = n.qualifier ? de(n.qualifier, h) : h);
307
+ const _ = n.sources.find((p) => p.roleName === m.role_name && W(p.scope) === W(m.scope));
308
+ _ ? S && (n.sources[n.sources.indexOf(_)] = { ..._, qualifier: de(_.qualifier, h) }) : n.sources.push({ roleKey: m.role_key, roleName: m.role_name, qualifier: h, scope: m.scope });
309
+ }
310
+ x.set(L, n), o.set(T, x);
311
+ }
312
+ return [...o.keys()].sort((t, a) => +(t === ce) - +(a === ce) || t.localeCompare(a)).map((t) => ({
313
+ key: t,
314
+ screens: [...o.get(t)?.values() ?? []].map((a) => ({
315
+ ...a,
316
+ actions: [...a.actions].sort((u, v) => me(u.verb) - me(v.verb) || u.verb.localeCompare(v.verb)),
317
+ // the root (the place without an id) first: what applies everywhere is what a reader looks for
318
+ scopes: [...a.scopes].sort((u, v) => +(v.id === null) - +(u.id === null))
319
+ })).sort((a, u) => a.key.localeCompare(u.key))
320
+ }));
321
+ }
322
+ const ts = {
323
+ class: "flex min-w-0 flex-col gap-group-gap",
324
+ "data-test": "effective-access"
325
+ }, ls = { class: "px-row-inset text-title3 font-semibold text-content-strong" }, ns = {
326
+ class: "block",
327
+ "data-test": "effective-actions"
328
+ }, cs = {
329
+ class: "block",
330
+ "data-test": "effective-sources"
331
+ }, rs = {
332
+ key: 0,
333
+ class: "mt-2 flex flex-col gap-1.5 border-l border-border-separator pl-3",
334
+ "data-test": "effective-why"
335
+ }, is = ["data-permission"], us = { class: "text-content" }, ds = {
336
+ key: 0,
337
+ class: "ml-2 text-content-muted"
338
+ }, ms = {
339
+ key: 0,
340
+ class: "contents",
341
+ "data-test": "effective-unavailable"
342
+ }, fs = {
343
+ class: "text-right text-footnote text-content-muted compact:text-left",
344
+ "data-test": "effective-reach"
345
+ }, ps = ["data-test"], vs = {
346
+ key: 0,
347
+ class: "contents",
348
+ "data-test": "effective-show-all"
349
+ }, _s = /* @__PURE__ */ Y({
350
+ __name: "EffectiveAccess",
351
+ props: {
352
+ effective: {},
353
+ name: {}
354
+ },
355
+ setup(l) {
356
+ const s = l, { t: o } = ee(), { catalogue: f } = pe(), t = J(), a = Ge(), u = j(() => os(f, s.effective)), v = R(!1), T = j(() => a.value && !v.value ? u.value.slice(0, 3) : u.value), L = R({}), S = (m) => m.actions.map((h) => t.permissionLabel(h.permission)).join(" · "), x = (m) => m.sources.map((h) => {
357
+ const _ = t.roleName({ key: h.roleKey, name: h.roleName });
358
+ return m.ownable ? `${_} (${t.qualifierNoun(h.qualifier).toLowerCase()})` : _;
359
+ }).join(", "), n = (m) => [m.qualifier ? t.qualifierNoun(m.qualifier) : "", m.scopes.map((h) => t.scopeLabel(h)).join(", ")].filter(Boolean).join(" · ");
360
+ return (m, h) => (i(), b("section", ts, [
361
+ A("h2", ls, w(e(o)("core.access.effective.title", { name: s.name })), 1),
362
+ u.value.length === 0 ? (i(), E(e(K), {
363
+ key: 0,
364
+ footer: e(o)("core.access.effective.footer")
365
+ }, {
366
+ default: y(() => [
367
+ $(e(V), {
368
+ layout: "setting",
369
+ label: e(o)("core.access.effective.empty")
370
+ }, null, 8, ["label"])
371
+ ]),
372
+ _: 1
373
+ }, 8, ["footer"])) : (i(), b(B, { key: 1 }, [
374
+ (i(!0), b(B, null, G(T.value, (_) => (i(), E(e(K), {
375
+ key: _.key,
376
+ header: e(t).groupLabel(_.key),
377
+ footer: _ === T.value[T.value.length - 1] ? e(o)("core.access.effective.footer") : void 0
378
+ }, {
379
+ default: y(() => [
380
+ (i(!0), b(B, null, G(_.screens, (p) => (i(), E(e(V), {
381
+ key: p.key,
382
+ layout: "setting",
383
+ "stack-on-compact": "",
384
+ label: e(t).screenLabel(p.key)
385
+ }, {
386
+ sub: y(() => [
387
+ A("span", ns, w(S(p)), 1),
388
+ A("span", cs, w(e(o)("core.access.effective.from_roles", { roles: x(p) })), 1),
389
+ L.value[p.key] ? (i(), b("ul", rs, [
390
+ (i(!0), b(B, null, G(p.actions, (N) => (i(), b("li", {
391
+ key: N.permission,
392
+ "data-permission": N.permission
393
+ }, [
394
+ A("span", us, w(e(t).permissionLabel(N.permission)), 1),
395
+ N.unavailable ? (i(), b("span", ds, w(e(o)("core.access.effective.unavailable")), 1)) : D("", !0),
396
+ (i(!0), b(B, null, G(N.grants, (k) => (i(), b("span", {
397
+ key: `${k.binding_id}-${k.scope.level}-${k.scope.id ?? 0}`,
398
+ class: "block text-content-muted"
399
+ }, w(e(o)("core.access.effective.why_row", {
400
+ role: e(t).roleName({ key: k.role_key, name: k.role_name }),
401
+ whose: e(t).qualifierNoun(p.ownable ? k.qualifier : "all"),
402
+ scope: e(t).scopeLabel(k.scope)
403
+ })), 1))), 128))
404
+ ], 8, is))), 128))
405
+ ])) : D("", !0)
406
+ ]),
407
+ default: y(() => [
408
+ p.allUnavailable ? (i(), b("span", ms, [
409
+ $(e(Ve), { tone: "warning" }, {
410
+ default: y(() => [
411
+ M(w(e(o)("core.access.effective.unavailable")), 1)
412
+ ]),
413
+ _: 1
414
+ })
415
+ ])) : D("", !0),
416
+ A("span", fs, w(n(p)), 1),
417
+ A("span", {
418
+ class: "contents",
419
+ "data-test": `why-${p.key}`
420
+ }, [
421
+ $(e(I), {
422
+ prominence: "secondary",
423
+ size: "sm",
424
+ onClick: (N) => L.value[p.key] = !L.value[p.key]
425
+ }, {
426
+ default: y(() => [
427
+ M(w(L.value[p.key] ? e(o)("core.access.effective.hide_why") : e(o)("core.access.effective.show_why")), 1)
428
+ ]),
429
+ _: 2
430
+ }, 1032, ["onClick"])
431
+ ], 8, ps)
432
+ ]),
433
+ _: 2
434
+ }, 1032, ["label"]))), 128))
435
+ ]),
436
+ _: 2
437
+ }, 1032, ["header", "footer"]))), 128)),
438
+ e(a) && u.value.length > 3 ? (i(), b("span", vs, [
439
+ $(e(I), {
440
+ prominence: "secondary",
441
+ class: "self-center",
442
+ onClick: h[0] || (h[0] = (_) => v.value = !v.value)
443
+ }, {
444
+ default: y(() => [
445
+ M(w(v.value ? e(o)("core.access.effective.fewer_modules") : e(o)("core.access.effective.all_modules", { count: u.value.length })), 1)
446
+ ]),
447
+ _: 1
448
+ })
449
+ ])) : D("", !0)
450
+ ], 64))
451
+ ]));
452
+ }
453
+ }), bs = {
454
+ class: "flex min-w-0 flex-col gap-group-gap",
455
+ "data-test": "access-panel"
456
+ }, gs = ["data-test"], hs = {
457
+ class: "contents",
458
+ "data-test": "add-role"
459
+ }, Fs = /* @__PURE__ */ Y({
460
+ __name: "PersonAccess",
461
+ props: {
462
+ subject: {},
463
+ name: {},
464
+ subjectLabel: {}
465
+ },
466
+ emits: ["loaded"],
467
+ setup(l, { expose: s, emit: o }) {
468
+ const f = l, t = o, { t: a } = ee(), u = J(), v = Oe(), T = ve(), L = j(() => f.subject.kind === "service" ? re.manageServiceBindings : re.manageBindings), S = R(!1), x = qe(async ({ signal: k, abandon: q }) => {
469
+ S.value = !1;
470
+ try {
471
+ const g = await T.access(f.subject, { signal: k });
472
+ return t("loaded", g.bindings.length), g;
473
+ } catch (g) {
474
+ if (!xe(g) || g.kind !== "notFound") throw g;
475
+ return S.value = !0, q();
476
+ }
477
+ }, { watch: () => f.subject.id }), n = le("addDialog"), m = le("removeDialog");
478
+ async function h(k) {
479
+ await T.unbind(f.subject, k.id), Z.success(a("core.access.removed")), await x.reload();
480
+ }
481
+ const _ = (k) => Z.error(v(k, { fallback: a("core.access.remove_failed") })), p = R(null), N = j(() => p.value ? a("core.access.remove_body", { name: f.name, role: u.roleName(p.value.role), scope: u.scopeLabel(p.value.scope) }) : "");
482
+ return s({ reload: x.reload }), (k, q) => (i(), b("div", bs, [
483
+ S.value ? (i(), E(e(Le), {
484
+ key: 0,
485
+ title: e(a)("core.resource.not_found.title"),
486
+ description: e(a)("core.resource.not_found.body"),
487
+ icon: "errorWarningLine",
488
+ "data-test": "access-not-found"
489
+ }, null, 8, ["title", "description"])) : (i(), E(e(je), {
490
+ key: 1,
491
+ state: e(x).state.value,
492
+ "skeleton-rows": 6,
493
+ "is-empty": () => !1,
494
+ onRetry: q[1] || (q[1] = (g) => e(x).reload())
495
+ }, {
496
+ default: y(({ value: g }) => [
497
+ $(e(K), {
498
+ header: e(a)("core.access.person_roles"),
499
+ footer: e(a)("core.access.roles_footer")
500
+ }, {
501
+ default: y(() => [
502
+ g.bindings.length === 0 ? (i(), E(e(V), {
503
+ key: 0,
504
+ layout: "setting",
505
+ label: e(a)("core.access.no_roles_title"),
506
+ sub: e(a)("core.access.no_roles_description")
507
+ }, null, 8, ["label", "sub"])) : D("", !0),
508
+ (i(!0), b(B, null, G(g.bindings, (O) => (i(), E(as, {
509
+ key: O.id,
510
+ binding: O
511
+ }, fe({ _: 2 }, [
512
+ g.can_manage ? {
513
+ name: "trailing",
514
+ fn: y(() => [
515
+ $(e(ne), { permission: L.value }, {
516
+ default: y(() => [
517
+ A("span", {
518
+ class: "contents",
519
+ "data-test": `remove-binding-${O.id}`
520
+ }, [
521
+ $(e(I), {
522
+ tone: "critical",
523
+ prominence: "secondary",
524
+ size: "sm",
525
+ onClick: (se) => (p.value = O, m.value?.present(O))
526
+ }, {
527
+ default: y(() => [
528
+ M(w(e(a)("core.access.remove")), 1)
529
+ ]),
530
+ _: 1
531
+ }, 8, ["onClick"])
532
+ ], 8, gs)
533
+ ]),
534
+ _: 2
535
+ }, 1032, ["permission"])
536
+ ]),
537
+ key: "0"
538
+ } : void 0
539
+ ]), 1032, ["binding"]))), 128)),
540
+ g.can_manage ? (i(), E(e(ne), {
541
+ key: 1,
542
+ permission: L.value
543
+ }, {
544
+ default: y(() => [
545
+ $(e(V), { layout: "stacked" }, {
546
+ default: y(() => [
547
+ A("span", hs, [
548
+ $(e(I), {
549
+ prominence: "secondary",
550
+ icon: "addLine",
551
+ onClick: q[0] || (q[0] = (O) => n.value?.present())
552
+ }, {
553
+ default: y(() => [
554
+ M(w(e(a)("core.access.add_role")), 1)
555
+ ]),
556
+ _: 1
557
+ })
558
+ ])
559
+ ]),
560
+ _: 1
561
+ })
562
+ ]),
563
+ _: 1
564
+ }, 8, ["permission"])) : D("", !0)
565
+ ]),
566
+ _: 2
567
+ }, 1032, ["header", "footer"]),
568
+ $(_s, {
569
+ effective: g.effective,
570
+ name: f.name
571
+ }, null, 8, ["effective", "name"])
572
+ ]),
573
+ _: 1
574
+ }, 8, ["state"])),
575
+ $(es, {
576
+ ref_key: "addDialog",
577
+ ref: n,
578
+ subject: f.subject,
579
+ "subject-label": f.subjectLabel ?? f.name,
580
+ onAdded: q[2] || (q[2] = (g) => e(x).reload())
581
+ }, null, 8, ["subject", "subject-label"]),
582
+ $(e($e), {
583
+ ref_key: "removeDialog",
584
+ ref: m,
585
+ tone: "critical",
586
+ title: e(a)("core.access.remove_title"),
587
+ message: N.value,
588
+ "confirm-label": e(a)("core.access.remove"),
589
+ action: h,
590
+ onFailed: _
591
+ }, null, 8, ["title", "message", "confirm-label"])
592
+ ]));
593
+ }
594
+ });
595
+ export {
596
+ as as _,
597
+ Fs as a,
598
+ U as b,
599
+ ve as u
600
+ };
@@ -4,25 +4,25 @@ import { a as ke } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang
4
4
  import { u as G } from "./platform-Dx6STiwY.js";
5
5
  import { _ as ee } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
6
6
  import { u as te } from "./useLoad-W4tfxmm5.js";
7
- import { i as S, d as T, c as qe } from "./index-Ok29ucE3.js";
7
+ import { i as S, d as T, c as qe } from "./index-Cmj9iZmT.js";
8
8
  import { u as ce } from "./FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js";
9
- import { _ as ue } from "./FormView.vue_vue_type_script_setup_true_lang-D31Hk3pJ.js";
10
- import { u as Ce, _ as Se, a as Ee, b as Ve } from "./useGroupSheet-C2NyqWRp.js";
11
- import { _ as H, p as Pe } from "./FormGroup.vue_vue_type_script_setup_true_lang-CSgT4ITL.js";
9
+ import { _ as ue } from "./FormView.vue_vue_type_script_setup_true_lang-nyz8EkzM.js";
10
+ import { u as Ce, _ as Se, a as Ee, b as Ve } from "./useGroupSheet-BVcNDWbP.js";
11
+ import { _ as H, p as Pe } from "./FormGroup.vue_vue_type_script_setup_true_lang-CNb2CK01.js";
12
12
  import { t as C } from "./toast-CqSDTWRX.js";
13
13
  import { u as W } from "./fieldMessages-DTXpWnBd.js";
14
- import { g as K } from "./options-Bu0XbEpN.js";
15
- import { _ as F } from "./TextField.vue_vue_type_script_setup_true_lang-BwfNNQEz.js";
14
+ import { g as K } from "./options-e_CAfvDQ.js";
15
+ import { _ as F } from "./TextField.vue_vue_type_script_setup_true_lang-CX3LdZLK.js";
16
16
  import { _ as pe } from "./IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js";
17
17
  import { u as ae } from "./format-D8X4zsx6.js";
18
- import { _ as X } from "./ActionRow.vue_vue_type_script_setup_true_lang-Bv-APkGf.js";
18
+ import { _ as X } from "./ActionRow.vue_vue_type_script_setup_true_lang-D8NCXX4p.js";
19
19
  import { i as Z } from "./error-Bb_dr_Ay.js";
20
20
  import { a as Ie } from "./leaveGuard-Cc8yeLxM.js";
21
21
  import { _ as Ne } from "./Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js";
22
22
  import { _ as J } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
23
- import { u as Ae, _ as Me } from "./useCommand-DyuPTosF.js";
23
+ import { u as Ae, _ as Me } from "./useCommand-CfG727e8.js";
24
24
  import { _ as Re } from "./AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js";
25
- import { _ as De } from "./SessionList.vue_vue_type_script_setup_true_lang-PuWIK-Wa.js";
25
+ import { _ as De } from "./SessionList.vue_vue_type_script_setup_true_lang-VvBB2EZz.js";
26
26
  import { _ as Le } from "./PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js";
27
27
  import { _ as Ue } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
28
28
  import { d as Fe, s as Ge, a as Be } from "./signInEvents-DWShrJox.js";