@authup/client-web-kit 1.0.0-beta.26 → 1.0.0-beta.27

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 (48) hide show
  1. package/dist/components/entities/client/AClientForm.d.ts +1 -1
  2. package/dist/components/entities/identity-provider/AIdentityProviderForm.d.ts +1 -11
  3. package/dist/components/entities/identity-provider/AIdentityProviderForm.d.ts.map +1 -1
  4. package/dist/components/entities/identity-provider/AIdentityProviderLdapForm.d.ts +1 -1
  5. package/dist/components/entities/identity-provider/AIdentityProviderOAuth2Form.d.ts +1 -10
  6. package/dist/components/entities/identity-provider/AIdentityProviderOAuth2Form.d.ts.map +1 -1
  7. package/dist/components/entities/permission/APermissionCheck.d.ts +5 -5
  8. package/dist/components/entities/permission/APermissionCheck.d.ts.map +1 -1
  9. package/dist/components/entities/policy/APolicyBasicForm.vue.d.ts +3 -3
  10. package/dist/components/entities/policy/APolicyForm.vue.d.ts +4 -4
  11. package/dist/components/entities/policy/attribute-names/AAttributeNamesPolicyForm.vue.d.ts +3 -3
  12. package/dist/components/entities/policy/composite/ACompositePolicyForm.vue.d.ts +3 -3
  13. package/dist/components/entities/policy/date/ADatePolicyForm.vue.d.ts +3 -3
  14. package/dist/components/entities/policy/identity/AIdentityPolicyForm.vue.d.ts +3 -3
  15. package/dist/components/entities/policy/realm-match/ARealmMatchPolicyForm.vue.d.ts +6 -6
  16. package/dist/components/entities/policy/time/ATimePolicyForm.vue.d.ts +3 -3
  17. package/dist/components/entities/robot/ARobotForm.d.ts +1 -1
  18. package/dist/components/entities/user/AUserForm.d.ts +1 -1
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.d.ts.map +1 -1
  21. package/dist/components/utility/AFormSubmit.d.ts +1 -1
  22. package/dist/components/utility/form-input-list/AFormInputList.vue.d.ts +3 -3
  23. package/dist/components/utility/form-input-list/AFormInputListItem.vue.d.ts +3 -3
  24. package/dist/components/workflows/Login.vue.d.ts +353 -0
  25. package/dist/components/workflows/Login.vue.d.ts.map +1 -0
  26. package/dist/components/workflows/authorize/Authorize.vue.d.ts +488 -0
  27. package/dist/components/workflows/authorize/Authorize.vue.d.ts.map +1 -0
  28. package/dist/components/workflows/authorize/AuthorizeForm.vue.d.ts +83 -0
  29. package/dist/components/workflows/authorize/AuthorizeForm.vue.d.ts.map +1 -0
  30. package/dist/components/workflows/authorize/AuthorizeScope.vue.d.ts +27 -0
  31. package/dist/components/workflows/authorize/AuthorizeScope.vue.d.ts.map +1 -0
  32. package/dist/components/workflows/authorize/AuthorizeScopes.vue.d.ts +54 -0
  33. package/dist/components/workflows/authorize/AuthorizeScopes.vue.d.ts.map +1 -0
  34. package/dist/components/workflows/authorize/AuthorizeText.vue.d.ts +21 -0
  35. package/dist/components/workflows/authorize/AuthorizeText.vue.d.ts.map +1 -0
  36. package/dist/components/workflows/authorize/helpers.d.ts +10 -0
  37. package/dist/components/workflows/authorize/helpers.d.ts.map +1 -0
  38. package/dist/components/workflows/authorize/index.d.ts +3 -0
  39. package/dist/components/workflows/authorize/index.d.ts.map +1 -0
  40. package/dist/components/workflows/index.d.ts +3 -0
  41. package/dist/components/workflows/index.d.ts.map +1 -0
  42. package/dist/index.cjs +1241 -393
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.css +20 -0
  45. package/dist/index.mjs +1094 -249
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/module.d.ts.map +1 -1
  48. package/package.json +22 -22
package/dist/index.mjs CHANGED
@@ -1,22 +1,221 @@
1
+ import installFormControl, { VCFormGroup, VCFormInput, buildFormSubmit, buildFormInputText, buildFormGroup, buildFormInput, buildFormTextarea, buildFormInputCheckbox, VCFormInputCheckbox } from '@vuecs/form-controls';
2
+ import { hasOwnProperty, isObject as isObject$1, merge, createMerger } from 'smob';
3
+ import { hasInjectionContext, inject as inject$3, provide as provide$2, defineComponent, reactive, resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, withModifiers, ref, computed, getCurrentScope, onScopeDispose, shallowRef, toRaw, isRef, isReactive, toRef, watchEffect, unref, onMounted, watch, onUnmounted, h, createElementBlock, renderSlot, createTextVNode, createCommentVNode, Fragment, renderList, mergeProps, getCurrentInstance, resolveDynamicComponent, nextTick, normalizeClass, toDisplayString, Suspense } from 'vue';
4
+ import installPagination, { buildPagination as buildPagination$1 } from '@vuecs/pagination';
1
5
  import { REALM_MASTER_NAME, EntityDefaultEventName, buildEntityChannelName, EntityType, IdentityProviderProtocol, IdentityProviderPreset, getIdentityProviderProtocolForPreset } from '@authup/core-kit';
2
- import { defineComponent, reactive, resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, withModifiers, hasInjectionContext, inject as inject$2, provide as provide$1, ref, computed, getCurrentScope, onScopeDispose, shallowRef, toRaw, isRef, isReactive, toRef, watchEffect, unref, onMounted, watch, onUnmounted, h, createElementBlock, renderSlot, createTextVNode, createCommentVNode, Fragment, renderList, mergeProps, getCurrentInstance, resolveDynamicComponent, nextTick, normalizeClass, toDisplayString } from 'vue';
3
6
  import { IVuelidate, useTranslationsForNestedValidations, useTranslationsForBaseValidation as useTranslationsForBaseValidation$1, getSeverity, install as install$1 } from '@ilingo/vuelidate';
4
- import { VCFormGroup, VCFormInput, buildFormSubmit, buildFormInputText, buildFormGroup, buildFormInput, buildFormTextarea, buildFormInputCheckbox, VCFormInputCheckbox } from '@vuecs/form-controls';
5
7
  import useVuelidate from '@vuelidate/core';
6
- import { maxLength, minLength, required, helpers, url, numeric, maxValue, minValue, email, sameAs } from '@vuelidate/validators';
8
+ import { maxLength, minLength, required, helpers, numeric, url, maxValue, minValue, email, sameAs } from '@vuelidate/validators';
7
9
  import { SlotName, buildList } from '@vuecs/list-controls';
8
10
  import { Client, CookieName, ClientAuthenticationHook, ClientAuthenticationHookEventName } from '@authup/core-http-kit';
9
11
  import { defineStore, storeToRefs as storeToRefs$1 } from 'pinia';
10
12
  import { PermissionMemoryProvider, PermissionChecker, PolicyEngine, TimePolicyInterval, isIntervalForDayOfWeek, isIntervalForDayOfMonth, isIntervalForDayOfYear, BuiltInPolicyType } from '@authup/access';
11
- import { OAuth2Error, isOpenIDProviderMetadata } from '@authup/specs';
12
- import { isObject as isObject$1, merge, createMerger } from 'smob';
13
- import { hasOwnProperty, extendObject, isObject as isObject$2, createNanoID } from '@authup/kit';
13
+ import { OAuth2Error, isOpenIDProviderMetadata, deserializeOAuth2Scope } from '@authup/specs';
14
+ import { hasOwnProperty as hasOwnProperty$1, extendObject, isObject as isObject$2, createNanoID, base64URLEncode } from '@authup/kit';
14
15
  import { SortDirection } from 'rapiq';
15
16
  import { ClientManager, buildEventFullName, EventNameSuffix } from '@authup/core-realtime-kit';
16
- import { buildPagination as buildPagination$1 } from '@vuecs/pagination';
17
17
  import Cookie from 'universal-cookie';
18
18
 
19
- var _sfc_main$b = defineComponent({
19
+ /*
20
+ * Copyright (c) 2024-2024.
21
+ * Author Peter Placzek (tada5hi)
22
+ * For the full copyright and license information,
23
+ * view the LICENSE file that was distributed with this source code.
24
+ */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
25
+ /**
26
+ * Convert string to property path array.
27
+ *
28
+ * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
29
+ * @see https://github.com/chaijs/pathval
30
+ *
31
+ * @param segment
32
+ */ function pathToArray(segment) {
33
+ const str = segment.replace(/([^\\])\[/g, '$1.[');
34
+ const parts = str.match(/(\\\.|[^.]+?)+/g);
35
+ if (!parts) {
36
+ return [];
37
+ }
38
+ const result = [];
39
+ for(let i = 0; i < parts.length; i++){
40
+ if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
41
+ continue;
42
+ }
43
+ const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
44
+ if (regex) {
45
+ result.push(regex[1]);
46
+ } else {
47
+ result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
48
+ }
49
+ }
50
+ return result;
51
+ }
52
+ /*
53
+ * Copyright (c) 2024.
54
+ * Author Peter Placzek (tada5hi)
55
+ * For the full copyright and license information,
56
+ * view the LICENSE file that was distributed with this source code.
57
+ */ var Character;
58
+ (function(Character) {
59
+ Character["WILDCARD"] = "*";
60
+ Character["GLOBSTAR"] = "**";
61
+ })(Character || (Character = {}));
62
+ /*
63
+ * Copyright (c) 2024.
64
+ * Author Peter Placzek (tada5hi)
65
+ * For the full copyright and license information,
66
+ * view the LICENSE file that was distributed with this source code.
67
+ */ function isObject(input) {
68
+ return !!input && typeof input === 'object' && !Array.isArray(input);
69
+ }
70
+ function getPathValue(data, path) {
71
+ const parts = Array.isArray(path) ? path : pathToArray(path);
72
+ let res;
73
+ let temp = data;
74
+ let index = 0;
75
+ while(index < parts.length){
76
+ if (temp === null || typeof temp === 'undefined') {
77
+ break;
78
+ }
79
+ if (parts[index] in Object(temp)) {
80
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
81
+ // @ts-expect-error
82
+ temp = temp[parts[index]];
83
+ } else {
84
+ break;
85
+ }
86
+ if (index === parts.length - 1) {
87
+ res = temp;
88
+ }
89
+ index++;
90
+ }
91
+ return res;
92
+ }
93
+ const NUMBER_REGEX = /^\d+$/;
94
+ function setPathValue(data, path, value) {
95
+ const parts = Array.isArray(path) ? path : pathToArray(path);
96
+ let temp = data;
97
+ let index = 0;
98
+ while(index < parts.length){
99
+ /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
100
+ break;
101
+ }
102
+ const key = parts[index];
103
+ // [foo, '0']
104
+ if (typeof temp[key] === 'undefined') {
105
+ const match = NUMBER_REGEX.test(key);
106
+ if (match) {
107
+ temp[key] = [];
108
+ } else {
109
+ temp[key] = {};
110
+ }
111
+ }
112
+ if (index === parts.length - 1) {
113
+ temp[key] = value;
114
+ break;
115
+ }
116
+ index++;
117
+ temp = temp[key];
118
+ }
119
+ return data;
120
+ }
121
+
122
+ class Store {
123
+ /**
124
+ * Set options for all groups.
125
+ *
126
+ * @param items
127
+ */ setAll(items) {
128
+ const keys = Object.keys(items);
129
+ for(let i = 0; i < keys.length; i++){
130
+ this.setOptions(keys[i], items[keys[i]]);
131
+ }
132
+ }
133
+ /**
134
+ * Set options for a specific group.
135
+ *
136
+ * @param group
137
+ * @param options
138
+ */ setOptions(group, options) {
139
+ if (typeof this.data[group] === 'undefined') {
140
+ this.data[group] = {};
141
+ }
142
+ this.data[group] = options;
143
+ }
144
+ hasOptions(group) {
145
+ return hasOwnProperty(this.data, group);
146
+ }
147
+ getOptions(group) {
148
+ if (typeof this.data[group] !== 'undefined') {
149
+ return this.data[group];
150
+ }
151
+ return {};
152
+ }
153
+ hasOption(group, option) {
154
+ return typeof this.data[group] !== 'undefined' && hasOwnProperty(this.data[group], option);
155
+ }
156
+ getOption(group, option) {
157
+ if (typeof this.data[group] === 'undefined') {
158
+ return undefined;
159
+ }
160
+ return this.data[group][option];
161
+ }
162
+ constructor(){
163
+ this.data = {};
164
+ }
165
+ }
166
+ class StoreManager {
167
+ keys() {
168
+ return Object.keys(this.instances);
169
+ }
170
+ use(key) {
171
+ if (typeof this.instances[key] !== 'undefined') {
172
+ return this.instances[key];
173
+ }
174
+ this.instances[key] = new Store();
175
+ return this.instances[key];
176
+ }
177
+ constructor(){
178
+ this.instances = {};
179
+ }
180
+ }
181
+ function inject$2(key, instance) {
182
+ if (instance && instance._context && instance._context.provides && instance._context.provides[key]) {
183
+ return instance._context.provides[key];
184
+ }
185
+ if (hasInjectionContext()) {
186
+ return inject$3(key, undefined);
187
+ }
188
+ return undefined;
189
+ }
190
+ function provide$1(key, value, app) {
191
+ if (typeof app === 'undefined') {
192
+ const val = inject$2(key);
193
+ if (typeof val !== 'undefined') {
194
+ return;
195
+ }
196
+ provide$2(key, value);
197
+ return;
198
+ }
199
+ if (app && app._context && app._context.provides && app._context.provides[key]) {
200
+ return;
201
+ }
202
+ app.provide(key, value);
203
+ }
204
+ function getSymbol(key) {
205
+ return Symbol.for('VCStoreManager');
206
+ }
207
+ function installStoreManager(instance, key) {
208
+ const symbol = getSymbol();
209
+ let manager = inject$2(symbol, instance);
210
+ if (manager) {
211
+ return manager;
212
+ }
213
+ manager = new StoreManager();
214
+ provide$1(symbol, manager, instance);
215
+ return manager;
216
+ }
217
+
218
+ var _sfc_main$h = defineComponent({
20
219
  components: {
21
220
  IVuelidate,
22
221
  VCFormInput,
@@ -69,10 +268,10 @@ var _export_sfc = (sfc, props) => {
69
268
  return target;
70
269
  };
71
270
 
72
- const _hoisted_1$7 = [
271
+ const _hoisted_1$c = [
73
272
  "disabled"
74
273
  ];
75
- function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
274
+ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
76
275
  const _component_VCFormInput = resolveComponent("VCFormInput");
77
276
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
78
277
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -102,7 +301,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
102
301
  createElementVNode("i", {
103
302
  class: "fa fa-minus"
104
303
  }, null, -1)
105
- ]), 8, _hoisted_1$7)
304
+ ]), 8, _hoisted_1$c)
106
305
  ]),
107
306
  _: 1
108
307
  }, 8, [
@@ -121,10 +320,10 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
121
320
  "validation"
122
321
  ]);
123
322
  }
124
- var AFormInputListItem = /* @__PURE__ */ _export_sfc(_sfc_main$b, [
323
+ var AFormInputListItem = /* @__PURE__ */ _export_sfc(_sfc_main$h, [
125
324
  [
126
325
  "render",
127
- _sfc_render$b
326
+ _sfc_render$g
128
327
  ]
129
328
  ]);
130
329
 
@@ -133,7 +332,7 @@ function inject$1(key, instance) {
133
332
  return instance._context.provides[key];
134
333
  }
135
334
  if (hasInjectionContext()) {
136
- return inject$2(key, undefined);
335
+ return inject$3(key, undefined);
137
336
  }
138
337
  return undefined;
139
338
  }
@@ -144,7 +343,7 @@ function provide(key, value, app) {
144
343
  if (typeof val !== 'undefined') {
145
344
  return;
146
345
  }
147
- provide$1(key, value);
346
+ provide$2(key, value);
148
347
  return;
149
348
  }
150
349
  if (app && app._context && app._context.provides && app._context.provides[key]) {
@@ -538,6 +737,7 @@ function tryOnScopeDispose(fn) {
538
737
  return false;
539
738
  }
540
739
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
740
+ const noop = ()=>{};
541
741
 
542
742
  function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
543
743
  const watchingDependencies = autoUpdateDependencies ? [
@@ -941,109 +1141,6 @@ var TranslatorTranslationDefaultKey = /*#__PURE__*/ function(TranslatorTranslati
941
1141
  return TranslatorTranslationDefaultKey;
942
1142
  }({});
943
1143
 
944
- /*
945
- * Copyright (c) 2024-2024.
946
- * Author Peter Placzek (tada5hi)
947
- * For the full copyright and license information,
948
- * view the LICENSE file that was distributed with this source code.
949
- */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
950
- /**
951
- * Convert string to property path array.
952
- *
953
- * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
954
- * @see https://github.com/chaijs/pathval
955
- *
956
- * @param segment
957
- */ function pathToArray(segment) {
958
- const str = segment.replace(/([^\\])\[/g, '$1.[');
959
- const parts = str.match(/(\\\.|[^.]+?)+/g);
960
- if (!parts) {
961
- return [];
962
- }
963
- const result = [];
964
- for(let i = 0; i < parts.length; i++){
965
- if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
966
- continue;
967
- }
968
- const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
969
- if (regex) {
970
- result.push(regex[1]);
971
- } else {
972
- result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
973
- }
974
- }
975
- return result;
976
- }
977
- /*
978
- * Copyright (c) 2024.
979
- * Author Peter Placzek (tada5hi)
980
- * For the full copyright and license information,
981
- * view the LICENSE file that was distributed with this source code.
982
- */ var Character;
983
- (function(Character) {
984
- Character["WILDCARD"] = "*";
985
- Character["GLOBSTAR"] = "**";
986
- })(Character || (Character = {}));
987
- /*
988
- * Copyright (c) 2024.
989
- * Author Peter Placzek (tada5hi)
990
- * For the full copyright and license information,
991
- * view the LICENSE file that was distributed with this source code.
992
- */ function isObject(input) {
993
- return !!input && typeof input === 'object' && !Array.isArray(input);
994
- }
995
- function getPathValue(data, path) {
996
- const parts = Array.isArray(path) ? path : pathToArray(path);
997
- let res;
998
- let temp = data;
999
- let index = 0;
1000
- while(index < parts.length){
1001
- if (temp === null || typeof temp === 'undefined') {
1002
- break;
1003
- }
1004
- if (parts[index] in Object(temp)) {
1005
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1006
- // @ts-expect-error
1007
- temp = temp[parts[index]];
1008
- } else {
1009
- break;
1010
- }
1011
- if (index === parts.length - 1) {
1012
- res = temp;
1013
- }
1014
- index++;
1015
- }
1016
- return res;
1017
- }
1018
- const NUMBER_REGEX = /^\d+$/;
1019
- function setPathValue(data, path, value) {
1020
- const parts = Array.isArray(path) ? path : pathToArray(path);
1021
- let temp = data;
1022
- let index = 0;
1023
- while(index < parts.length){
1024
- /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
1025
- break;
1026
- }
1027
- const key = parts[index];
1028
- // [foo, '0']
1029
- if (typeof temp[key] === 'undefined') {
1030
- const match = NUMBER_REGEX.test(key);
1031
- if (match) {
1032
- temp[key] = [];
1033
- } else {
1034
- temp[key] = {};
1035
- }
1036
- }
1037
- if (index === parts.length - 1) {
1038
- temp[key] = value;
1039
- break;
1040
- }
1041
- index++;
1042
- temp = temp[key];
1043
- }
1044
- return data;
1045
- }
1046
-
1047
1144
  class MemoryStore {
1048
1145
  async get(context) {
1049
1146
  if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
@@ -1075,9 +1172,6 @@ class MemoryStore {
1075
1172
  }
1076
1173
  }
1077
1174
 
1078
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
1079
- const noop = ()=>{};
1080
-
1081
1175
  function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1082
1176
  let options;
1083
1177
  if (isRef(optionsOrRef)) {
@@ -1087,8 +1181,8 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1087
1181
  } else {
1088
1182
  options = {};
1089
1183
  }
1090
- const { lazy = false, evaluating = void 0, shallow = true, onError = noop } = options;
1091
- const started = ref(!lazy);
1184
+ const { lazy = false, flush = "pre", evaluating = void 0, shallow = true, onError = noop } = options;
1185
+ const started = shallowRef(!lazy);
1092
1186
  const current = shallow ? shallowRef(initialState) : ref(initialState);
1093
1187
  let counter = 0;
1094
1188
  watchEffect(async (onInvalidate)=>{
@@ -1115,6 +1209,8 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1115
1209
  if (evaluating && counterAtBeginning === counter) evaluating.value = false;
1116
1210
  hasFinished = true;
1117
1211
  }
1212
+ }, {
1213
+ flush
1118
1214
  });
1119
1215
  if (lazy) {
1120
1216
  return computed(()=>{
@@ -1128,7 +1224,7 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1128
1224
 
1129
1225
  function inject(key, instance) {
1130
1226
  if (hasInjectionContext()) {
1131
- return inject$2(key, undefined);
1227
+ return inject$3(key, undefined);
1132
1228
  }
1133
1229
  return undefined;
1134
1230
  }
@@ -1290,7 +1386,7 @@ function extractVuelidateResultsFromChild(vuelidate, child, keys) {
1290
1386
  const childKeys = keys ?? Object.keys(childResults).filter((key)=>!key.startsWith('$'));
1291
1387
  const result = {};
1292
1388
  for(let i = 0; i < childKeys.length; i++){
1293
- if (hasOwnProperty(childResults, childKeys[i])) {
1389
+ if (hasOwnProperty$1(childResults, childKeys[i])) {
1294
1390
  result[childKeys[i]] = childResults[childKeys[i]].$model;
1295
1391
  }
1296
1392
  }
@@ -1458,8 +1554,8 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
1458
1554
  try {
1459
1555
  computePromise = store.permissionChecker.preCheckOneOf({
1460
1556
  ...ctx,
1461
- data: {
1462
- ...ctx.data || {},
1557
+ input: {
1558
+ ...ctx.input || {},
1463
1559
  identity
1464
1560
  }
1465
1561
  }).then(()=>true).catch(()=>false);
@@ -1532,7 +1628,7 @@ function installSocketManager(app, options) {
1532
1628
  * @param name
1533
1629
  * @param $slots
1534
1630
  */ function hasNormalizedSlot(name, $slots = {}) {
1535
- return hasOwnProperty($slots, name);
1631
+ return hasOwnProperty$1($slots, name);
1536
1632
  }
1537
1633
  /**
1538
1634
  * Returns VNodes for named slot either scoped or unscoped
@@ -1543,7 +1639,7 @@ function installSocketManager(app, options) {
1543
1639
  *
1544
1640
  * @returns {Array} VNodes
1545
1641
  */ function normalizeSlot(name, scope = {}, $slots = {}) {
1546
- if (hasOwnProperty($slots, name)) {
1642
+ if (hasOwnProperty$1($slots, name)) {
1547
1643
  return $slots[name](scope);
1548
1644
  }
1549
1645
  return [];
@@ -1593,7 +1689,7 @@ const ATranslationDefault = defineComponent({
1593
1689
  }
1594
1690
  });
1595
1691
 
1596
- var _sfc_main$a = defineComponent({
1692
+ var _sfc_main$g = defineComponent({
1597
1693
  components: {
1598
1694
  ATranslationDefault,
1599
1695
  AFormInputListItem
@@ -1672,35 +1768,35 @@ var _sfc_main$a = defineComponent({
1672
1768
  }
1673
1769
  });
1674
1770
 
1675
- const _hoisted_1$6 = {
1771
+ const _hoisted_1$b = {
1676
1772
  class: "d-flex flex-column gap-2"
1677
1773
  };
1678
- const _hoisted_2$5 = {
1774
+ const _hoisted_2$a = {
1679
1775
  class: "d-flex flex-row"
1680
1776
  };
1681
- const _hoisted_3$5 = {
1777
+ const _hoisted_3$8 = {
1682
1778
  class: "align-self-end"
1683
1779
  };
1684
- const _hoisted_4$4 = {
1780
+ const _hoisted_4$6 = {
1685
1781
  class: "ms-auto"
1686
1782
  };
1687
- const _hoisted_5$2 = [
1783
+ const _hoisted_5$3 = [
1688
1784
  "disabled"
1689
1785
  ];
1690
- const _hoisted_6$1 = {
1786
+ const _hoisted_6$2 = {
1691
1787
  class: "d-flex flex-column gap-1"
1692
1788
  };
1693
- function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1789
+ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
1694
1790
  const _component_ATranslationDefault = resolveComponent("ATranslationDefault");
1695
1791
  const _component_AFormInputListItem = resolveComponent("AFormInputListItem");
1696
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
1697
- createElementVNode("div", _hoisted_2$5, [
1698
- createElementVNode("div", _hoisted_3$5, [
1792
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
1793
+ createElementVNode("div", _hoisted_2$a, [
1794
+ createElementVNode("div", _hoisted_3$8, [
1699
1795
  renderSlot(_ctx.$slots, "label", {}, ()=>[
1700
1796
  _cache[1] || (_cache[1] = createTextVNode(" Names "))
1701
1797
  ])
1702
1798
  ]),
1703
- createElementVNode("div", _hoisted_4$4, [
1799
+ createElementVNode("div", _hoisted_4$6, [
1704
1800
  createElementVNode("button", {
1705
1801
  class: "btn btn-xs btn-primary",
1706
1802
  type: "button",
@@ -1716,10 +1812,10 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1716
1812
  createVNode(_component_ATranslationDefault, {
1717
1813
  name: "add"
1718
1814
  })
1719
- ], 8, _hoisted_5$2)
1815
+ ], 8, _hoisted_5$3)
1720
1816
  ])
1721
1817
  ]),
1722
- createElementVNode("div", _hoisted_6$1, [
1818
+ createElementVNode("div", _hoisted_6$2, [
1723
1819
  _ctx.items.length === 0 ? renderSlot(_ctx.$slots, "noItems", {
1724
1820
  key: 0
1725
1821
  }, ()=>[
@@ -1755,10 +1851,10 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1755
1851
  ])
1756
1852
  ]);
1757
1853
  }
1758
- var AFormInputList = /* @__PURE__ */ _export_sfc(_sfc_main$a, [
1854
+ var AFormInputList = /* @__PURE__ */ _export_sfc(_sfc_main$g, [
1759
1855
  [
1760
1856
  "render",
1761
- _sfc_render$a
1857
+ _sfc_render$f
1762
1858
  ]
1763
1859
  ]);
1764
1860
 
@@ -2110,7 +2206,7 @@ function create$1(context) {
2110
2206
  });
2111
2207
  const client = injectHTTPClient();
2112
2208
  let domainAPI;
2113
- if (hasOwnProperty(client, context.type)) {
2209
+ if (hasOwnProperty$1(client, context.type)) {
2114
2210
  domainAPI = client[context.type];
2115
2211
  }
2116
2212
  let query;
@@ -2120,7 +2216,7 @@ function create$1(context) {
2120
2216
  meta.value.busy = true;
2121
2217
  try {
2122
2218
  let filters;
2123
- if (context.queryFilters && input.filters && hasOwnProperty(input.filters, 'name') && typeof input.filters.name === 'string') {
2219
+ if (context.queryFilters && input.filters && hasOwnProperty$1(input.filters, 'name') && typeof input.filters.name === 'string') {
2124
2220
  // todo: queryFilters should customize full filters object!
2125
2221
  filters = context.queryFilters(input.filters.name);
2126
2222
  }
@@ -2342,7 +2438,7 @@ function defineEntityVProps() {
2342
2438
  function create(ctx) {
2343
2439
  const client = injectHTTPClient();
2344
2440
  let domainAPI;
2345
- if (hasOwnProperty(client, ctx.type)) {
2441
+ if (hasOwnProperty$1(client, ctx.type)) {
2346
2442
  domainAPI = client[ctx.type];
2347
2443
  }
2348
2444
  const entity = ref(undefined);
@@ -2356,7 +2452,7 @@ function create(ctx) {
2356
2452
  realmId = isRef(ctx.realmId) ? ctx.realmId.value : ctx.realmId;
2357
2453
  }
2358
2454
  if (!realmId && entity.value) {
2359
- if (hasOwnProperty(entity.value, 'realm_id') && typeof entity.value.realm_id === 'string') {
2455
+ if (hasOwnProperty$1(entity.value, 'realm_id') && typeof entity.value.realm_id === 'string') {
2360
2456
  return entity.value.realm_id;
2361
2457
  }
2362
2458
  }
@@ -3533,7 +3629,7 @@ const AClientForm = defineComponent({
3533
3629
  required
3534
3630
  },
3535
3631
  redirect_uri: {
3536
- url,
3632
+ // todo: url is required!
3537
3633
  maxLength: maxLength(2000)
3538
3634
  },
3539
3635
  is_confidential: {},
@@ -3928,7 +4024,7 @@ const APermissionCheck = defineComponent({
3928
4024
  ],
3929
4025
  required: true
3930
4026
  },
3931
- data: {
4027
+ input: {
3932
4028
  type: Object
3933
4029
  },
3934
4030
  options: {
@@ -3939,7 +4035,7 @@ const APermissionCheck = defineComponent({
3939
4035
  const fn = createPermissionCheckerReactiveFn();
3940
4036
  const isPermitted = computed(()=>fn({
3941
4037
  name: props.name,
3942
- data: props.data,
4038
+ input: props.input,
3943
4039
  options: props.options
3944
4040
  }));
3945
4041
  return ()=>{
@@ -5701,7 +5797,7 @@ const AIdentityProviderPreset = defineComponent({
5701
5797
  }
5702
5798
  });
5703
5799
 
5704
- var _sfc_main$9 = defineComponent({
5800
+ var _sfc_main$f = defineComponent({
5705
5801
  components: {
5706
5802
  AIdentityProviderPreset,
5707
5803
  AIdentityProviderProtocol
@@ -5735,28 +5831,28 @@ var _sfc_main$9 = defineComponent({
5735
5831
  }
5736
5832
  });
5737
5833
 
5738
- const _hoisted_1$5 = {
5834
+ const _hoisted_1$a = {
5739
5835
  class: "d-flex flex-column gap-2"
5740
5836
  };
5741
- const _hoisted_2$4 = {
5837
+ const _hoisted_2$9 = {
5742
5838
  class: "d-flex flex-row gap-2 flex-wrap"
5743
5839
  };
5744
- const _hoisted_3$4 = [
5840
+ const _hoisted_3$7 = [
5745
5841
  "onClick"
5746
5842
  ];
5747
- const _hoisted_4$3 = {
5843
+ const _hoisted_4$5 = {
5748
5844
  class: "d-flex flex-row gap-2 flex-wrap"
5749
5845
  };
5750
- const _hoisted_5$1 = [
5846
+ const _hoisted_5$2 = [
5751
5847
  "onClick"
5752
5848
  ];
5753
- function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5849
+ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
5754
5850
  const _component_AIdentityProviderProtocol = resolveComponent("AIdentityProviderProtocol");
5755
5851
  const _component_AIdentityProviderPreset = resolveComponent("AIdentityProviderPreset");
5756
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
5852
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
5757
5853
  createElementVNode("div", null, [
5758
5854
  _cache[0] || (_cache[0] = createElementVNode("h6", null, "Protocols", -1)),
5759
- createElementVNode("div", _hoisted_2$4, [
5855
+ createElementVNode("div", _hoisted_2$9, [
5760
5856
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.protocols, (item, key)=>{
5761
5857
  return openBlock(), createBlock(_component_AIdentityProviderProtocol, {
5762
5858
  key,
@@ -5783,7 +5879,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5783
5879
  }, null, 2)
5784
5880
  ]),
5785
5881
  createElementVNode("div", null, toDisplayString(props.name), 1)
5786
- ], 10, _hoisted_3$4)
5882
+ ], 10, _hoisted_3$7)
5787
5883
  ]),
5788
5884
  _: 2
5789
5885
  }, 1032, [
@@ -5794,7 +5890,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5794
5890
  ]),
5795
5891
  createElementVNode("div", null, [
5796
5892
  _cache[1] || (_cache[1] = createElementVNode("h6", null, "Presets", -1)),
5797
- createElementVNode("div", _hoisted_4$3, [
5893
+ createElementVNode("div", _hoisted_4$5, [
5798
5894
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (item, key)=>{
5799
5895
  return openBlock(), createBlock(_component_AIdentityProviderPreset, {
5800
5896
  key,
@@ -5821,7 +5917,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5821
5917
  }, null, 2)
5822
5918
  ]),
5823
5919
  createElementVNode("div", null, toDisplayString(props.name), 1)
5824
- ], 10, _hoisted_5$1)
5920
+ ], 10, _hoisted_5$2)
5825
5921
  ]),
5826
5922
  _: 2
5827
5923
  }, 1032, [
@@ -5832,10 +5928,10 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5832
5928
  ])
5833
5929
  ]);
5834
5930
  }
5835
- var AIdentityProviderPicker = /* @__PURE__ */ _export_sfc(_sfc_main$9, [
5931
+ var AIdentityProviderPicker = /* @__PURE__ */ _export_sfc(_sfc_main$f, [
5836
5932
  [
5837
5933
  "render",
5838
- _sfc_render$9
5934
+ _sfc_render$e
5839
5935
  ],
5840
5936
  [
5841
5937
  "__scopeId",
@@ -6111,10 +6207,6 @@ const AIdentityProviderOAuth2Form = defineComponent({
6111
6207
  type: String,
6112
6208
  default: undefined
6113
6209
  },
6114
- apiUrl: {
6115
- type: String,
6116
- default: 'http://localhost:3001'
6117
- },
6118
6210
  protocol: {
6119
6211
  type: String,
6120
6212
  default: IdentityProviderProtocol.OAUTH2
@@ -6152,7 +6244,7 @@ const AIdentityProviderOAuth2Form = defineComponent({
6152
6244
  if (!manager.data.value) {
6153
6245
  return '';
6154
6246
  }
6155
- return apiClient.identityProvider.getAuthorizeUri(props.apiUrl, manager.data.value.id);
6247
+ return apiClient.identityProvider.getAuthorizeUri(manager.data.value.id);
6156
6248
  });
6157
6249
  const basicFieldsNode = ref(null);
6158
6250
  onChange(preset, ()=>{
@@ -6350,10 +6442,6 @@ const AIdentityProviderForm = defineComponent({
6350
6442
  },
6351
6443
  realmId: {
6352
6444
  type: String
6353
- },
6354
- apiUrl: {
6355
- type: String,
6356
- default: 'http://localhost:3001'
6357
6445
  }
6358
6446
  },
6359
6447
  emits: [
@@ -6416,7 +6504,6 @@ const AIdentityProviderForm = defineComponent({
6416
6504
  realmId: props.realmId,
6417
6505
  protocol: protocol.value,
6418
6506
  preset: preset.value,
6419
- apiUrl: props.apiUrl,
6420
6507
  onCreated: (el)=>{
6421
6508
  entity.value = el;
6422
6509
  setup.emit('created', el);
@@ -6756,7 +6843,7 @@ const AIdentityProviderRoleAssignments = defineComponent({
6756
6843
  }
6757
6844
  });
6758
6845
 
6759
- var _sfc_main$8 = defineComponent({
6846
+ var _sfc_main$e = defineComponent({
6760
6847
  components: {
6761
6848
  AFormInputList
6762
6849
  },
@@ -6797,7 +6884,7 @@ var _sfc_main$8 = defineComponent({
6797
6884
  }
6798
6885
  });
6799
6886
 
6800
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
6887
+ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
6801
6888
  const _component_AFormInputList = resolveComponent("AFormInputList");
6802
6889
  return openBlock(), createBlock(_component_AFormInputList, {
6803
6890
  names: _ctx.vuelidate.names.$model,
@@ -6808,14 +6895,14 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
6808
6895
  "onChanged"
6809
6896
  ]);
6810
6897
  }
6811
- var AAttributeNamesPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [
6898
+ var AAttributeNamesPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [
6812
6899
  [
6813
6900
  "render",
6814
- _sfc_render$8
6901
+ _sfc_render$d
6815
6902
  ]
6816
6903
  ]);
6817
6904
 
6818
- var _sfc_main$7 = defineComponent({
6905
+ var _sfc_main$d = defineComponent({
6819
6906
  components: {
6820
6907
  APolicyChildrenPicker: APolicyPicker,
6821
6908
  VCFormGroup,
@@ -6901,7 +6988,7 @@ var _sfc_main$7 = defineComponent({
6901
6988
  }
6902
6989
  });
6903
6990
 
6904
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
6991
+ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
6905
6992
  const _component_APolicyChildrenPicker = resolveComponent("APolicyChildrenPicker");
6906
6993
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
6907
6994
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -6942,14 +7029,14 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
6942
7029
  ])
6943
7030
  ]);
6944
7031
  }
6945
- var ACompositePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [
7032
+ var ACompositePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$d, [
6946
7033
  [
6947
7034
  "render",
6948
- _sfc_render$7
7035
+ _sfc_render$c
6949
7036
  ]
6950
7037
  ]);
6951
7038
 
6952
- var _sfc_main$6 = defineComponent({
7039
+ var _sfc_main$c = defineComponent({
6953
7040
  components: {
6954
7041
  VCFormInput,
6955
7042
  VCFormGroup,
@@ -6996,7 +7083,7 @@ var _sfc_main$6 = defineComponent({
6996
7083
  }
6997
7084
  });
6998
7085
 
6999
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
7086
+ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
7000
7087
  const _component_VCFormInput = resolveComponent("VCFormInput");
7001
7088
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7002
7089
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -7067,14 +7154,14 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
7067
7154
  ])
7068
7155
  ]);
7069
7156
  }
7070
- var ADatePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$6, [
7157
+ var ADatePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$c, [
7071
7158
  [
7072
7159
  "render",
7073
- _sfc_render$6
7160
+ _sfc_render$b
7074
7161
  ]
7075
7162
  ]);
7076
7163
 
7077
- var _sfc_main$5 = defineComponent({
7164
+ var _sfc_main$b = defineComponent({
7078
7165
  components: {
7079
7166
  AFormInputList
7080
7167
  },
@@ -7115,7 +7202,7 @@ var _sfc_main$5 = defineComponent({
7115
7202
  }
7116
7203
  });
7117
7204
 
7118
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
7205
+ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
7119
7206
  const _component_AFormInputList = resolveComponent("AFormInputList");
7120
7207
  return openBlock(), createBlock(_component_AFormInputList, {
7121
7208
  names: _ctx.vuelidate.types.$model,
@@ -7131,14 +7218,14 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
7131
7218
  "onChanged"
7132
7219
  ]);
7133
7220
  }
7134
- var AIdentityPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [
7221
+ var AIdentityPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$b, [
7135
7222
  [
7136
7223
  "render",
7137
- _sfc_render$5
7224
+ _sfc_render$a
7138
7225
  ]
7139
7226
  ]);
7140
7227
 
7141
- var _sfc_main$4 = defineComponent({
7228
+ var _sfc_main$a = defineComponent({
7142
7229
  components: {
7143
7230
  AFormInputList,
7144
7231
  VCFormGroup,
@@ -7200,31 +7287,31 @@ var _sfc_main$4 = defineComponent({
7200
7287
  }
7201
7288
  });
7202
7289
 
7203
- const _hoisted_1$4 = {
7290
+ const _hoisted_1$9 = {
7204
7291
  class: "row"
7205
7292
  };
7206
- const _hoisted_2$3 = {
7293
+ const _hoisted_2$8 = {
7207
7294
  class: "col-7"
7208
7295
  };
7209
- const _hoisted_3$3 = {
7296
+ const _hoisted_3$6 = {
7210
7297
  class: "col-5"
7211
7298
  };
7212
- const _hoisted_4$2 = [
7299
+ const _hoisted_4$4 = [
7213
7300
  "for"
7214
7301
  ];
7215
- const _hoisted_5 = [
7302
+ const _hoisted_5$1 = [
7216
7303
  "for"
7217
7304
  ];
7218
- const _hoisted_6 = [
7305
+ const _hoisted_6$1 = [
7219
7306
  "for"
7220
7307
  ];
7221
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7308
+ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
7222
7309
  const _component_AFormInputList = resolveComponent("AFormInputList");
7223
7310
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7224
7311
  const _component_IVuelidate = resolveComponent("IVuelidate");
7225
7312
  const _component_VCFormInputCheckbox = resolveComponent("VCFormInputCheckbox");
7226
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
7227
- createElementVNode("div", _hoisted_2$3, [
7313
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
7314
+ createElementVNode("div", _hoisted_2$8, [
7228
7315
  createVNode(_component_IVuelidate, {
7229
7316
  validation: _ctx.vuelidate.attributeName
7230
7317
  }, {
@@ -7253,7 +7340,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7253
7340
  "validation"
7254
7341
  ])
7255
7342
  ]),
7256
- createElementVNode("div", _hoisted_3$3, [
7343
+ createElementVNode("div", _hoisted_3$6, [
7257
7344
  createVNode(_component_IVuelidate, {
7258
7345
  validation: _ctx.vuelidate.attributeNameStrict
7259
7346
  }, {
@@ -7273,7 +7360,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7273
7360
  label: withCtx((iProps)=>[
7274
7361
  createElementVNode("label", {
7275
7362
  for: iProps.id
7276
- }, " Only match if the attribute is strict equal to the name? ", 8, _hoisted_4$2)
7363
+ }, " Only match if the attribute is strict equal to the name? ", 8, _hoisted_4$4)
7277
7364
  ]),
7278
7365
  _: 1
7279
7366
  }, 8, [
@@ -7314,7 +7401,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7314
7401
  createTextVNode(" Determines if resources with null realm-id/name value should match all identity realms."),
7315
7402
  createElementVNode("br", null, null, -1),
7316
7403
  createTextVNode(" If true, any identity realm can access resources with null realm-id/name values. ")
7317
- ]), 8, _hoisted_5)
7404
+ ]), 8, _hoisted_5$1)
7318
7405
  ]),
7319
7406
  _: 1
7320
7407
  }, 8, [
@@ -7355,7 +7442,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7355
7442
  createTextVNode(" Specifies whether the master realm of an identity should match all realm-id/name attributes, including null."),
7356
7443
  createElementVNode("br", null, null, -1),
7357
7444
  createTextVNode(" If true, the master realm can access any resource regardless of its realm value. ")
7358
- ]), 8, _hoisted_6)
7445
+ ]), 8, _hoisted_6$1)
7359
7446
  ]),
7360
7447
  _: 1
7361
7448
  }, 8, [
@@ -7376,14 +7463,14 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7376
7463
  ])
7377
7464
  ]);
7378
7465
  }
7379
- var ARealmMatchPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$4, [
7466
+ var ARealmMatchPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [
7380
7467
  [
7381
7468
  "render",
7382
- _sfc_render$4
7469
+ _sfc_render$9
7383
7470
  ]
7384
7471
  ]);
7385
7472
 
7386
- var _sfc_main$3 = defineComponent({
7473
+ var _sfc_main$9 = defineComponent({
7387
7474
  components: {
7388
7475
  VCFormInput,
7389
7476
  VCFormGroup,
@@ -7471,22 +7558,22 @@ var _sfc_main$3 = defineComponent({
7471
7558
  }
7472
7559
  });
7473
7560
 
7474
- const _hoisted_1$3 = {
7561
+ const _hoisted_1$8 = {
7475
7562
  class: "row"
7476
7563
  };
7477
- const _hoisted_2$2 = {
7564
+ const _hoisted_2$7 = {
7478
7565
  key: 0,
7479
7566
  class: "col"
7480
7567
  };
7481
- const _hoisted_3$2 = {
7568
+ const _hoisted_3$5 = {
7482
7569
  key: 1,
7483
7570
  class: "col"
7484
7571
  };
7485
- const _hoisted_4$1 = {
7572
+ const _hoisted_4$3 = {
7486
7573
  key: 2,
7487
7574
  class: "col"
7488
7575
  };
7489
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7576
+ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
7490
7577
  const _component_VCFormInput = resolveComponent("VCFormInput");
7491
7578
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7492
7579
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -7589,8 +7676,8 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7589
7676
  }, 8, [
7590
7677
  "validation"
7591
7678
  ]),
7592
- createElementVNode("div", _hoisted_1$3, [
7593
- _ctx.displayIntervalForDayOfWeek ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
7679
+ createElementVNode("div", _hoisted_1$8, [
7680
+ _ctx.displayIntervalForDayOfWeek ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
7594
7681
  createVNode(_component_IVuelidate, {
7595
7682
  validation: _ctx.vuelidate.dayOfWeek
7596
7683
  }, {
@@ -7625,7 +7712,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7625
7712
  "validation"
7626
7713
  ])
7627
7714
  ])) : createCommentVNode("", true),
7628
- _ctx.displayIntervalForDayOfMonth ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
7715
+ _ctx.displayIntervalForDayOfMonth ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
7629
7716
  createVNode(_component_IVuelidate, {
7630
7717
  validation: _ctx.vuelidate.dayOfMonth
7631
7718
  }, {
@@ -7660,7 +7747,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7660
7747
  "validation"
7661
7748
  ])
7662
7749
  ])) : createCommentVNode("", true),
7663
- _ctx.displayIntervalForDayOfYear ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
7750
+ _ctx.displayIntervalForDayOfYear ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
7664
7751
  createVNode(_component_IVuelidate, {
7665
7752
  validation: _ctx.vuelidate.dayOfYear
7666
7753
  }, {
@@ -7698,10 +7785,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7698
7785
  ])
7699
7786
  ]);
7700
7787
  }
7701
- var ATimePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$3, [
7788
+ var ATimePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$9, [
7702
7789
  [
7703
7790
  "render",
7704
- _sfc_render$3
7791
+ _sfc_render$8
7705
7792
  ]
7706
7793
  ]);
7707
7794
 
@@ -7724,7 +7811,7 @@ const APolicy = defineComponent({
7724
7811
  }
7725
7812
  });
7726
7813
 
7727
- var _sfc_main$2 = defineComponent({
7814
+ var _sfc_main$8 = defineComponent({
7728
7815
  props: {
7729
7816
  type: {
7730
7817
  type: String
@@ -7770,20 +7857,20 @@ var _sfc_main$2 = defineComponent({
7770
7857
  }
7771
7858
  });
7772
7859
 
7773
- const _hoisted_1$2 = {
7860
+ const _hoisted_1$7 = {
7774
7861
  class: "d-flex flex-column gap-2"
7775
7862
  };
7776
- const _hoisted_2$1 = {
7863
+ const _hoisted_2$6 = {
7777
7864
  class: "d-flex flex-row gap-2 flex-wrap"
7778
7865
  };
7779
- const _hoisted_3$1 = [
7866
+ const _hoisted_3$4 = [
7780
7867
  "onClick"
7781
7868
  ];
7782
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
7783
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
7869
+ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
7870
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
7784
7871
  createElementVNode("div", null, [
7785
7872
  _cache[0] || (_cache[0] = createElementVNode("h6", null, "Type", -1)),
7786
- createElementVNode("div", _hoisted_2$1, [
7873
+ createElementVNode("div", _hoisted_2$6, [
7787
7874
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, key)=>{
7788
7875
  return openBlock(), createElementBlock("div", {
7789
7876
  key,
@@ -7798,16 +7885,16 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
7798
7885
  ])
7799
7886
  }, [
7800
7887
  createElementVNode("div", null, toDisplayString(item.value), 1)
7801
- ], 10, _hoisted_3$1);
7888
+ ], 10, _hoisted_3$4);
7802
7889
  }), 128))
7803
7890
  ])
7804
7891
  ])
7805
7892
  ]);
7806
7893
  }
7807
- var APolicyTypePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [
7894
+ var APolicyTypePicker = /* @__PURE__ */ _export_sfc(_sfc_main$8, [
7808
7895
  [
7809
7896
  "render",
7810
- _sfc_render$2
7897
+ _sfc_render$7
7811
7898
  ],
7812
7899
  [
7813
7900
  "__scopeId",
@@ -7815,7 +7902,7 @@ var APolicyTypePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [
7815
7902
  ]
7816
7903
  ]);
7817
7904
 
7818
- var _sfc_main$1 = defineComponent({
7905
+ var _sfc_main$7 = defineComponent({
7819
7906
  components: {
7820
7907
  ARealmPicker,
7821
7908
  VCFormInput,
@@ -7899,28 +7986,28 @@ var _sfc_main$1 = defineComponent({
7899
7986
  }
7900
7987
  });
7901
7988
 
7902
- const _hoisted_1$1 = {
7989
+ const _hoisted_1$6 = {
7903
7990
  class: "row"
7904
7991
  };
7905
- const _hoisted_2 = {
7992
+ const _hoisted_2$5 = {
7906
7993
  class: "col"
7907
7994
  };
7908
- const _hoisted_3 = [
7995
+ const _hoisted_3$3 = [
7909
7996
  "for"
7910
7997
  ];
7911
- const _hoisted_4 = {
7998
+ const _hoisted_4$2 = {
7912
7999
  key: 0,
7913
8000
  class: "col"
7914
8001
  };
7915
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8002
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
7916
8003
  const _component_VCFormInput = resolveComponent("VCFormInput");
7917
8004
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7918
8005
  const _component_IVuelidate = resolveComponent("IVuelidate");
7919
8006
  const _component_VCFormTextarea = resolveComponent("VCFormTextarea");
7920
8007
  const _component_VCFormInputCheckbox = resolveComponent("VCFormInputCheckbox");
7921
8008
  const _component_ARealmPicker = resolveComponent("ARealmPicker");
7922
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
7923
- createElementVNode("div", _hoisted_2, [
8009
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
8010
+ createElementVNode("div", _hoisted_2$5, [
7924
8011
  createVNode(_component_IVuelidate, {
7925
8012
  validation: _ctx.vuelidate.name
7926
8013
  }, {
@@ -8034,7 +8121,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8034
8121
  label: withCtx((iProps)=>[
8035
8122
  createElementVNode("label", {
8036
8123
  for: iProps.id
8037
- }, " Invert? ", 8, _hoisted_3)
8124
+ }, " Invert? ", 8, _hoisted_3$3)
8038
8125
  ]),
8039
8126
  _: 1
8040
8127
  }, 8, [
@@ -8053,7 +8140,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8053
8140
  "validation"
8054
8141
  ])
8055
8142
  ]),
8056
- !_ctx.realmId && !_ctx.isEditing ? (openBlock(), createElementBlock("div", _hoisted_4, [
8143
+ !_ctx.realmId && !_ctx.isEditing ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
8057
8144
  createVNode(_component_IVuelidate, {
8058
8145
  validation: _ctx.vuelidate.invert
8059
8146
  }, {
@@ -8088,14 +8175,14 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8088
8175
  ])) : createCommentVNode("", true)
8089
8176
  ]);
8090
8177
  }
8091
- var APolicyBasicForm = /* @__PURE__ */ _export_sfc(_sfc_main$1, [
8178
+ var APolicyBasicForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [
8092
8179
  [
8093
8180
  "render",
8094
- _sfc_render$1
8181
+ _sfc_render$6
8095
8182
  ]
8096
8183
  ]);
8097
8184
 
8098
- var _sfc_main = defineComponent({
8185
+ var _sfc_main$6 = defineComponent({
8099
8186
  components: {
8100
8187
  AFormSubmit,
8101
8188
  APolicyTypePicker,
@@ -8171,13 +8258,13 @@ var _sfc_main = defineComponent({
8171
8258
  }
8172
8259
  });
8173
8260
 
8174
- const _hoisted_1 = {
8261
+ const _hoisted_1$5 = {
8175
8262
  class: "d-flex flex-column"
8176
8263
  };
8177
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8264
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
8178
8265
  const _component_APolicyBasicForm = resolveComponent("APolicyBasicForm");
8179
8266
  const _component_AFormSubmit = resolveComponent("AFormSubmit");
8180
- return openBlock(), createElementBlock("div", _hoisted_1, [
8267
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
8181
8268
  _cache[0] || (_cache[0] = createElementVNode("h6", null, "General", -1)),
8182
8269
  createVNode(_component_APolicyBasicForm, {
8183
8270
  entity: _ctx.data
@@ -8210,10 +8297,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8210
8297
  ])
8211
8298
  ]);
8212
8299
  }
8213
- var APolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main, [
8300
+ var APolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$6, [
8214
8301
  [
8215
8302
  "render",
8216
- _sfc_render
8303
+ _sfc_render$5
8217
8304
  ]
8218
8305
  ]);
8219
8306
 
@@ -9484,11 +9571,769 @@ function install(app, options) {
9484
9571
  locale: options.translatorLocale
9485
9572
  });
9486
9573
  installComponents(app, options.components);
9574
+ installStoreManager(app);
9575
+ app.use(installFormControl);
9576
+ app.use(installPagination);
9487
9577
  }
9488
9578
 
9579
+ var _sfc_main$5 = defineComponent({
9580
+ components: {
9581
+ ARealmPicker,
9582
+ APagination,
9583
+ ATitle,
9584
+ IVuelidate,
9585
+ AIdentityProviders,
9586
+ AIdentityProviderIcon
9587
+ },
9588
+ props: {
9589
+ codeRequest: {
9590
+ type: Object
9591
+ }
9592
+ },
9593
+ emits: [
9594
+ 'done',
9595
+ 'failed'
9596
+ ],
9597
+ setup (props, { emit }) {
9598
+ const apiClient = injectHTTPClient();
9599
+ const store = injectStore();
9600
+ const form = reactive({
9601
+ name: '',
9602
+ password: '',
9603
+ realm_id: ''
9604
+ });
9605
+ const vuelidate = useVuelidate({
9606
+ name: {
9607
+ required,
9608
+ minLength: minLength(3),
9609
+ maxLength: maxLength(255)
9610
+ },
9611
+ password: {
9612
+ required,
9613
+ minLength: minLength(3),
9614
+ maxLength: maxLength(255)
9615
+ },
9616
+ realm_id: {}
9617
+ }, form);
9618
+ const busy = ref(false);
9619
+ const realmId = computed(()=>{
9620
+ if (props.codeRequest && props.codeRequest.realm_id) {
9621
+ return props.codeRequest.realm_id;
9622
+ }
9623
+ return form.realm_id;
9624
+ });
9625
+ const identityProviderQuery = ref({});
9626
+ const resetIdentityProviderQuery = ()=>{
9627
+ identityProviderQuery.value = {
9628
+ filters: {
9629
+ realm_id: realmId.value || '',
9630
+ protocol: `!${IdentityProviderProtocol.LDAP}`,
9631
+ enabled: true
9632
+ }
9633
+ };
9634
+ };
9635
+ resetIdentityProviderQuery();
9636
+ const identityProviderRef = ref(null);
9637
+ const updateIdentityProviderList = ()=>{
9638
+ if (identityProviderRef.value) {
9639
+ identityProviderRef.value.load();
9640
+ }
9641
+ };
9642
+ const updateRealmId = (realmId)=>{
9643
+ form.realm_id = Array.isArray(realmId) ? realmId[0] : realmId;
9644
+ resetIdentityProviderQuery();
9645
+ nextTick(()=>{
9646
+ updateIdentityProviderList();
9647
+ });
9648
+ };
9649
+ const submit = async ()=>{
9650
+ try {
9651
+ await store.login({
9652
+ name: form.name,
9653
+ password: form.password,
9654
+ realmId: form.realm_id
9655
+ });
9656
+ emit('done');
9657
+ } catch (e) {
9658
+ emit('failed', e instanceof Error ? e.message : 'The login operation failed');
9659
+ }
9660
+ };
9661
+ const buildIdentityProviderURL = (id)=>{
9662
+ let authorizeURL = apiClient.identityProvider.getAuthorizeUri(id);
9663
+ if (props.codeRequest) {
9664
+ const serialized = base64URLEncode(JSON.stringify(props.codeRequest));
9665
+ authorizeURL += `?codeRequest=${serialized}`;
9666
+ }
9667
+ return authorizeURL;
9668
+ };
9669
+ return {
9670
+ updateRealmId,
9671
+ vuelidate,
9672
+ form,
9673
+ submit,
9674
+ busy,
9675
+ identityProviderQuery,
9676
+ identityProviderRef,
9677
+ buildIdentityProviderURL
9678
+ };
9679
+ }
9680
+ });
9681
+
9682
+ const _hoisted_1$4 = {
9683
+ class: "d-flex flex-row"
9684
+ };
9685
+ const _hoisted_2$4 = [
9686
+ "href"
9687
+ ];
9688
+ const _hoisted_3$2 = {
9689
+ class: "d-flex flex-column"
9690
+ };
9691
+ const _hoisted_4$1 = {
9692
+ class: "text-center mb-1"
9693
+ };
9694
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
9695
+ const _component_VCFormInput = resolveComponent("VCFormInput");
9696
+ const _component_VCFormGroup = resolveComponent("VCFormGroup");
9697
+ const _component_IVuelidate = resolveComponent("IVuelidate");
9698
+ const _component_VCFormSubmit = resolveComponent("VCFormSubmit");
9699
+ const _component_ARealmPicker = resolveComponent("ARealmPicker");
9700
+ const _component_ATitle = resolveComponent("ATitle");
9701
+ const _component_APagination = resolveComponent("APagination");
9702
+ const _component_AIdentityProviderIcon = resolveComponent("AIdentityProviderIcon");
9703
+ const _component_AIdentityProviders = resolveComponent("AIdentityProviders");
9704
+ return openBlock(), createElementBlock("div", null, [
9705
+ _cache[7] || (_cache[7] = createElementVNode("div", {
9706
+ class: "text-center"
9707
+ }, [
9708
+ createElementVNode("h1", {
9709
+ class: "fw-bold"
9710
+ }, " Login ")
9711
+ ], -1)),
9712
+ createElementVNode("form", {
9713
+ onSubmit: _cache[3] || (_cache[3] = withModifiers((...args)=>_ctx.submit && _ctx.submit(...args), [
9714
+ "prevent"
9715
+ ]))
9716
+ }, [
9717
+ createVNode(_component_IVuelidate, {
9718
+ validation: _ctx.vuelidate.name
9719
+ }, {
9720
+ default: withCtx((props)=>[
9721
+ createVNode(_component_VCFormGroup, {
9722
+ "validation-messages": props.data,
9723
+ "validation-severity": props.severity
9724
+ }, {
9725
+ label: withCtx(()=>_cache[4] || (_cache[4] = [
9726
+ createTextVNode(" Name ")
9727
+ ])),
9728
+ default: withCtx(()=>[
9729
+ createVNode(_component_VCFormInput, {
9730
+ modelValue: _ctx.vuelidate.name.$model,
9731
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>_ctx.vuelidate.name.$model = $event)
9732
+ }, null, 8, [
9733
+ "modelValue"
9734
+ ])
9735
+ ]),
9736
+ _: 2
9737
+ }, 1032, [
9738
+ "validation-messages",
9739
+ "validation-severity"
9740
+ ])
9741
+ ]),
9742
+ _: 1
9743
+ }, 8, [
9744
+ "validation"
9745
+ ]),
9746
+ createVNode(_component_IVuelidate, {
9747
+ validation: _ctx.vuelidate.password
9748
+ }, {
9749
+ default: withCtx((props)=>[
9750
+ createVNode(_component_VCFormGroup, {
9751
+ "validation-messages": props.data,
9752
+ "validation-severity": props.severity
9753
+ }, {
9754
+ label: withCtx(()=>_cache[5] || (_cache[5] = [
9755
+ createTextVNode(" Password ")
9756
+ ])),
9757
+ default: withCtx(()=>[
9758
+ createVNode(_component_VCFormInput, {
9759
+ modelValue: _ctx.vuelidate.password.$model,
9760
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event)=>_ctx.vuelidate.password.$model = $event),
9761
+ type: "password"
9762
+ }, null, 8, [
9763
+ "modelValue"
9764
+ ])
9765
+ ]),
9766
+ _: 2
9767
+ }, 1032, [
9768
+ "validation-messages",
9769
+ "validation-severity"
9770
+ ])
9771
+ ]),
9772
+ _: 1
9773
+ }, 8, [
9774
+ "validation"
9775
+ ]),
9776
+ createVNode(_component_VCFormSubmit, {
9777
+ modelValue: _ctx.busy,
9778
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event)=>_ctx.busy = $event),
9779
+ invalid: _ctx.vuelidate.$invalid,
9780
+ "create-text": "Submit",
9781
+ "create-button-class": {
9782
+ value: "btn btn-sm btn-dark btn-block",
9783
+ presets: {
9784
+ bootstrap: false
9785
+ }
9786
+ },
9787
+ "create-icon-class": "fa-solid fa-right-to-bracket",
9788
+ submit: _ctx.submit
9789
+ }, null, 8, [
9790
+ "modelValue",
9791
+ "invalid",
9792
+ "submit"
9793
+ ]),
9794
+ _cache[6] || (_cache[6] = createElementVNode("hr", null, null, -1)),
9795
+ !_ctx.codeRequest || !_ctx.codeRequest.realm_id ? (openBlock(), createBlock(_component_ARealmPicker, {
9796
+ key: 0,
9797
+ value: _ctx.form.realm_id,
9798
+ onChange: _ctx.updateRealmId
9799
+ }, null, 8, [
9800
+ "value",
9801
+ "onChange"
9802
+ ])) : createCommentVNode("", true),
9803
+ createVNode(_component_AIdentityProviders, {
9804
+ ref: "identityProviderRef",
9805
+ query: _ctx.identityProviderQuery,
9806
+ footer: false
9807
+ }, {
9808
+ header: withCtx(()=>[
9809
+ createVNode(_component_ATitle, {
9810
+ text: "Identity Providers"
9811
+ })
9812
+ ]),
9813
+ footer: withCtx((props)=>[
9814
+ createVNode(_component_APagination, {
9815
+ busy: props.busy,
9816
+ meta: props.meta,
9817
+ load: props.load,
9818
+ total: props.total
9819
+ }, null, 8, [
9820
+ "busy",
9821
+ "meta",
9822
+ "load",
9823
+ "total"
9824
+ ])
9825
+ ]),
9826
+ body: withCtx((props)=>[
9827
+ createElementVNode("div", _hoisted_1$4, [
9828
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.data, (item, key)=>{
9829
+ return openBlock(), createElementBlock("div", {
9830
+ key
9831
+ }, [
9832
+ createElementVNode("a", {
9833
+ href: _ctx.buildIdentityProviderURL(item.id),
9834
+ class: "btn btn-dark btn-xs p-2 me-1 identity-provider-box bg-dark"
9835
+ }, [
9836
+ createElementVNode("div", _hoisted_3$2, [
9837
+ createElementVNode("div", _hoisted_4$1, [
9838
+ createVNode(_component_AIdentityProviderIcon, {
9839
+ class: "fa-2x",
9840
+ entity: item
9841
+ }, null, 8, [
9842
+ "entity"
9843
+ ])
9844
+ ]),
9845
+ createElementVNode("div", null, toDisplayString(item.name), 1)
9846
+ ])
9847
+ ], 8, _hoisted_2$4)
9848
+ ]);
9849
+ }), 128))
9850
+ ])
9851
+ ]),
9852
+ _: 1
9853
+ }, 8, [
9854
+ "query"
9855
+ ])
9856
+ ], 32)
9857
+ ]);
9858
+ }
9859
+ var Login = /* @__PURE__ */ _export_sfc(_sfc_main$5, [
9860
+ [
9861
+ "render",
9862
+ _sfc_render$4
9863
+ ],
9864
+ [
9865
+ "__scopeId",
9866
+ "data-v-957a0486"
9867
+ ]
9868
+ ]);
9869
+
9870
+ var _sfc_main$4 = defineComponent({
9871
+ props: {
9872
+ entity: {
9873
+ type: Object,
9874
+ required: true
9875
+ },
9876
+ requested: {
9877
+ type: Array,
9878
+ default: ()=>[]
9879
+ }
9880
+ },
9881
+ setup (props) {
9882
+ const isEnabled = computed(()=>props.requested.indexOf(props.entity.name) !== -1);
9883
+ return {
9884
+ isEnabled
9885
+ };
9886
+ }
9887
+ });
9888
+
9889
+ const _hoisted_1$3 = {
9890
+ class: "text-center"
9891
+ };
9892
+ const _hoisted_2$3 = {
9893
+ key: 0
9894
+ };
9895
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
9896
+ return openBlock(), createElementBlock("div", null, [
9897
+ createElementVNode("div", _hoisted_1$3, [
9898
+ createElementVNode("i", {
9899
+ class: normalizeClass([
9900
+ "fa-solid",
9901
+ {
9902
+ "fa-check text-success": _ctx.isEnabled,
9903
+ "fa-times text-danger": !_ctx.isEnabled
9904
+ }
9905
+ ])
9906
+ }, null, 2)
9907
+ ]),
9908
+ createElementVNode("div", null, [
9909
+ createElementVNode("strong", null, toDisplayString(_ctx.entity.name), 1),
9910
+ _ctx.entity.description ? (openBlock(), createElementBlock("p", _hoisted_2$3, toDisplayString(_ctx.entity.description), 1)) : createCommentVNode("", true)
9911
+ ])
9912
+ ]);
9913
+ }
9914
+ var AuthorizeScope = /* @__PURE__ */ _export_sfc(_sfc_main$4, [
9915
+ [
9916
+ "render",
9917
+ _sfc_render$3
9918
+ ]
9919
+ ]);
9920
+
9921
+ var _sfc_main$3 = defineComponent({
9922
+ components: {
9923
+ AuthorizeScope
9924
+ },
9925
+ props: {
9926
+ client: {
9927
+ type: Object,
9928
+ required: true
9929
+ },
9930
+ scopesAvailable: {
9931
+ type: Array
9932
+ },
9933
+ scopesRequested: {
9934
+ type: [
9935
+ String,
9936
+ Array
9937
+ ]
9938
+ }
9939
+ },
9940
+ setup (props) {
9941
+ const httpClient = injectHTTPClient();
9942
+ const scopesRequestedNormalized = computed(()=>{
9943
+ if (!props.scopesRequested) {
9944
+ return [];
9945
+ }
9946
+ return Array.isArray(props.scopesRequested) ? props.scopesRequested : deserializeOAuth2Scope(props.scopesRequested);
9947
+ });
9948
+ const scopesAvailableNormalized = ref([]);
9949
+ const resolveScopesAvailable = async ()=>{
9950
+ if (props.scopesAvailable) {
9951
+ scopesAvailableNormalized.value = props.scopesAvailable;
9952
+ return;
9953
+ }
9954
+ if (props.client.id) {
9955
+ const { data: clientScopes } = await httpClient.clientScope.getMany({
9956
+ filters: {
9957
+ client_id: props.client.id
9958
+ },
9959
+ include: [
9960
+ 'scope'
9961
+ ]
9962
+ });
9963
+ scopesAvailableNormalized.value = clientScopes.map((clientScope)=>clientScope.scope);
9964
+ }
9965
+ };
9966
+ Promise.resolve().then(()=>resolveScopesAvailable());
9967
+ return {
9968
+ scopesRequestedNormalized,
9969
+ scopesAvailableNormalized
9970
+ };
9971
+ }
9972
+ });
9973
+
9974
+ const _hoisted_1$2 = {
9975
+ key: 0
9976
+ };
9977
+ const _hoisted_2$2 = {
9978
+ class: "flex-column"
9979
+ };
9980
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
9981
+ const _component_AuthorizeScope = resolveComponent("AuthorizeScope");
9982
+ return _ctx.scopesAvailableNormalized.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
9983
+ createElementVNode("div", null, [
9984
+ _cache[0] || (_cache[0] = createTextVNode(" This will allow the ")),
9985
+ createElementVNode("strong", null, toDisplayString(_ctx.client.name), 1),
9986
+ _cache[1] || (_cache[1] = createTextVNode(" application to "))
9987
+ ]),
9988
+ createElementVNode("div", _hoisted_2$2, [
9989
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scopesAvailableNormalized, (item)=>{
9990
+ return openBlock(), createBlock(_component_AuthorizeScope, {
9991
+ key: item.id,
9992
+ entity: item,
9993
+ class: "d-flex flex-row gap-1",
9994
+ requested: _ctx.scopesRequestedNormalized
9995
+ }, null, 8, [
9996
+ "entity",
9997
+ "requested"
9998
+ ]);
9999
+ }), 128))
10000
+ ])
10001
+ ])) : createCommentVNode("", true);
10002
+ }
10003
+ var AuthorizeScopes = /* @__PURE__ */ _export_sfc(_sfc_main$3, [
10004
+ [
10005
+ "render",
10006
+ _sfc_render$2
10007
+ ]
10008
+ ]);
10009
+
10010
+ var _sfc_main$2 = defineComponent({
10011
+ components: {
10012
+ AuthorizeScopes
10013
+ },
10014
+ props: {
10015
+ client: {
10016
+ type: Object,
10017
+ required: true
10018
+ },
10019
+ scopes: {
10020
+ type: Array
10021
+ },
10022
+ codeRequest: {
10023
+ type: Object,
10024
+ required: true
10025
+ }
10026
+ },
10027
+ setup (props) {
10028
+ const httpClient = injectHTTPClient();
10029
+ const abort = ()=>{
10030
+ const url = new URL(`${props.codeRequest.redirect_uri}`);
10031
+ url.searchParams.set('error', 'access_denied');
10032
+ url.searchParams.set('error_description', 'The resource owner or authorization server denied the request');
10033
+ if (props.codeRequest.state) {
10034
+ url.searchParams.set('state', props.codeRequest.state);
10035
+ }
10036
+ if (typeof window !== 'undefined') {
10037
+ window.location.href = url.href;
10038
+ }
10039
+ };
10040
+ const authorize = async ()=>{
10041
+ try {
10042
+ const response = await httpClient.authorize.confirm({
10043
+ response_type: props.codeRequest.response_type,
10044
+ client_id: props.client.id,
10045
+ redirect_uri: props.codeRequest.redirect_uri,
10046
+ ...props.codeRequest.state ? {
10047
+ state: props.codeRequest.state
10048
+ } : {},
10049
+ ...props.codeRequest.scope ? {
10050
+ scope: props.codeRequest.scope
10051
+ } : {}
10052
+ });
10053
+ const { url } = response;
10054
+ if (typeof window !== 'undefined') {
10055
+ window.location.href = url;
10056
+ }
10057
+ } catch (e) {
10058
+ // todo: show toast :)
10059
+ }
10060
+ };
10061
+ return {
10062
+ authorize,
10063
+ abort
10064
+ };
10065
+ }
10066
+ });
10067
+
10068
+ const _hoisted_1$1 = {
10069
+ class: "flex-column d-flex gap-2"
10070
+ };
10071
+ const _hoisted_2$1 = {
10072
+ class: "text-center"
10073
+ };
10074
+ const _hoisted_3$1 = {
10075
+ class: "fw-bold"
10076
+ };
10077
+ const _hoisted_4 = {
10078
+ class: "mt-auto"
10079
+ };
10080
+ const _hoisted_5 = {
10081
+ class: "d-flex flex-row"
10082
+ };
10083
+ const _hoisted_6 = {
10084
+ class: "ms-1"
10085
+ };
10086
+ const _hoisted_7 = {
10087
+ class: "d-flex flex-row"
10088
+ };
10089
+ const _hoisted_8 = {
10090
+ class: "ms-1"
10091
+ };
10092
+ const _hoisted_9 = {
10093
+ class: "d-flex flex-row"
10094
+ };
10095
+ const _hoisted_10 = {
10096
+ class: "ms-1"
10097
+ };
10098
+ const _hoisted_11 = {
10099
+ class: "row"
10100
+ };
10101
+ const _hoisted_12 = {
10102
+ class: "col-6"
10103
+ };
10104
+ const _hoisted_13 = {
10105
+ class: "col-6"
10106
+ };
10107
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
10108
+ const _component_AuthorizeScopes = resolveComponent("AuthorizeScopes");
10109
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
10110
+ createElementVNode("div", _hoisted_2$1, [
10111
+ _cache[2] || (_cache[2] = createElementVNode("h5", {
10112
+ class: "text-secondary mb-1"
10113
+ }, " Application ", -1)),
10114
+ createElementVNode("h1", _hoisted_3$1, toDisplayString(_ctx.client.name), 1)
10115
+ ]),
10116
+ createVNode(_component_AuthorizeScopes, {
10117
+ client: _ctx.client,
10118
+ "scopes-requested": _ctx.codeRequest.scope,
10119
+ "scopes-available": _ctx.scopes
10120
+ }, null, 8, [
10121
+ "client",
10122
+ "scopes-requested",
10123
+ "scopes-available"
10124
+ ]),
10125
+ createElementVNode("div", _hoisted_4, [
10126
+ createElementVNode("div", _hoisted_5, [
10127
+ _cache[4] || (_cache[4] = createElementVNode("div", null, [
10128
+ createElementVNode("i", {
10129
+ class: "fa-solid fa-link"
10130
+ })
10131
+ ], -1)),
10132
+ createElementVNode("div", _hoisted_6, [
10133
+ createElementVNode("small", null, [
10134
+ _cache[3] || (_cache[3] = createTextVNode(" Once authorized, you will be redirected to: ")),
10135
+ createElementVNode("strong", null, toDisplayString(_ctx.codeRequest.redirect_uri), 1)
10136
+ ])
10137
+ ])
10138
+ ]),
10139
+ createElementVNode("div", _hoisted_7, [
10140
+ _cache[7] || (_cache[7] = createElementVNode("div", null, [
10141
+ createElementVNode("i", {
10142
+ class: "fa fa-solid fa-lock"
10143
+ })
10144
+ ], -1)),
10145
+ createElementVNode("div", _hoisted_8, [
10146
+ createElementVNode("small", null, [
10147
+ _cache[5] || (_cache[5] = createTextVNode(" This application is governed by the ")),
10148
+ createElementVNode("strong", null, toDisplayString(_ctx.client.name), 1),
10149
+ _cache[6] || (_cache[6] = createTextVNode(" application's Privacy Policy and Terms of Service. "))
10150
+ ])
10151
+ ])
10152
+ ]),
10153
+ createElementVNode("div", _hoisted_9, [
10154
+ _cache[8] || (_cache[8] = createElementVNode("div", null, [
10155
+ createElementVNode("i", {
10156
+ class: "fa fa-solid fa-clock"
10157
+ })
10158
+ ], -1)),
10159
+ createElementVNode("div", _hoisted_10, [
10160
+ createElementVNode("small", null, " Active since " + toDisplayString(_ctx.client.created_at), 1)
10161
+ ])
10162
+ ])
10163
+ ]),
10164
+ createElementVNode("div", _hoisted_11, [
10165
+ createElementVNode("div", _hoisted_12, [
10166
+ createElementVNode("button", {
10167
+ type: "button",
10168
+ class: "btn btn-block btn-secondary",
10169
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args)=>_ctx.abort && _ctx.abort(...args), [
10170
+ "prevent"
10171
+ ]))
10172
+ }, " Abort ")
10173
+ ]),
10174
+ createElementVNode("div", _hoisted_13, [
10175
+ createElementVNode("button", {
10176
+ type: "button",
10177
+ class: "btn btn-block btn-primary",
10178
+ onClick: _cache[1] || (_cache[1] = withModifiers((...args)=>_ctx.authorize && _ctx.authorize(...args), [
10179
+ "prevent"
10180
+ ]))
10181
+ }, " Authorize ")
10182
+ ])
10183
+ ])
10184
+ ]);
10185
+ }
10186
+ var AuthorizeForm = /* @__PURE__ */ _export_sfc(_sfc_main$2, [
10187
+ [
10188
+ "render",
10189
+ _sfc_render$1
10190
+ ]
10191
+ ]);
10192
+
10193
+ var _sfc_main$1 = defineComponent({
10194
+ props: {
10195
+ isError: {
10196
+ type: Boolean
10197
+ },
10198
+ message: {
10199
+ type: String,
10200
+ required: true
10201
+ }
10202
+ }
10203
+ });
10204
+
10205
+ const _hoisted_1 = {
10206
+ class: "flex-column"
10207
+ };
10208
+ const _hoisted_2 = {
10209
+ class: "text-center"
10210
+ };
10211
+ const _hoisted_3 = {
10212
+ class: "text-center fs-6 p-3"
10213
+ };
10214
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
10215
+ return openBlock(), createElementBlock("div", _hoisted_1, [
10216
+ createElementVNode("div", _hoisted_2, [
10217
+ createElementVNode("i", {
10218
+ class: normalizeClass([
10219
+ "fa-solid fa-10x",
10220
+ {
10221
+ "fa-exclamation text-danger": _ctx.isError,
10222
+ "fa-info text-info": !_ctx.isError
10223
+ }
10224
+ ])
10225
+ }, null, 2)
10226
+ ]),
10227
+ createElementVNode("div", _hoisted_3, toDisplayString(_ctx.message), 1)
10228
+ ]);
10229
+ }
10230
+ var AuthorizeText = /* @__PURE__ */ _export_sfc(_sfc_main$1, [
10231
+ [
10232
+ "render",
10233
+ _sfc_render
10234
+ ]
10235
+ ]);
10236
+
10237
+ const wrapChild = (child)=>h('div', {
10238
+ class: 'd-flex align-items-center justify-content-center h-100'
10239
+ }, [
10240
+ h('div', {
10241
+ class: 'authorize'
10242
+ }, [
10243
+ child
10244
+ ])
10245
+ ]);
10246
+ var _sfc_main = defineComponent({
10247
+ components: {
10248
+ AuthorizeText,
10249
+ AuthorizeForm,
10250
+ Login
10251
+ },
10252
+ props: {
10253
+ codeRequest: {
10254
+ type: Object
10255
+ },
10256
+ client: {
10257
+ type: Object
10258
+ },
10259
+ clientId: {
10260
+ type: String
10261
+ },
10262
+ scopes: {
10263
+ type: Array
10264
+ },
10265
+ error: {
10266
+ type: Object
10267
+ }
10268
+ },
10269
+ emits: [
10270
+ 'redirect'
10271
+ ],
10272
+ setup (props) {
10273
+ const httpClient = injectHTTPClient();
10274
+ const store = injectStore();
10275
+ const { loggedIn } = storeToRefs$1(store);
10276
+ const error = ref(null);
10277
+ const client = ref(null);
10278
+ const resolve = async ()=>{
10279
+ if (props.error) {
10280
+ error.value = props.error;
10281
+ return;
10282
+ }
10283
+ if (props.client) {
10284
+ client.value = props.client;
10285
+ }
10286
+ if (props.clientId) {
10287
+ try {
10288
+ client.value = await httpClient.client.getOne(props.clientId);
10289
+ } catch (e) {
10290
+ if (e instanceof Error) {
10291
+ error.value = e;
10292
+ }
10293
+ }
10294
+ }
10295
+ };
10296
+ Promise.resolve().then(()=>resolve());
10297
+ return ()=>{
10298
+ if (error.value) {
10299
+ return wrapChild(h(AuthorizeText, {
10300
+ message: error.value.message,
10301
+ isError: true
10302
+ }));
10303
+ }
10304
+ if (!props.codeRequest) {
10305
+ return [];
10306
+ }
10307
+ if (!loggedIn.value) {
10308
+ return wrapChild(h(Suspense, {}, {
10309
+ default: ()=>h(Login, {
10310
+ codeRequest: props.codeRequest
10311
+ }),
10312
+ fallback: ()=>h(AuthorizeText, {
10313
+ message: 'Loading...'
10314
+ })
10315
+ }));
10316
+ }
10317
+ if (!client.value) {
10318
+ return [];
10319
+ }
10320
+ return wrapChild(h(Suspense, {}, {
10321
+ default: ()=>h(AuthorizeForm, {
10322
+ codeRequest: props.codeRequest,
10323
+ client: client.value,
10324
+ scopes: props.scopes
10325
+ }),
10326
+ fallback: ()=>h(AuthorizeText, {
10327
+ message: 'Loading...'
10328
+ })
10329
+ }));
10330
+ };
10331
+ }
10332
+ });
10333
+
9489
10334
  var index = {
9490
10335
  install
9491
10336
  };
9492
10337
 
9493
- export { AAttributeNamesPolicyForm, AClient, AClientForm, AClientPermissionAssignment, AClientPermissionAssignments, AClientPicker, AClientRoleAssignment, AClientRoleAssignments, AClientScope, AClientScopeAssignment, AClientScopeAssignments, AClientScopes, AClients, ACompositePolicyForm, ADatePolicyForm, AEntityDelete, AFormInputList, AFormInputListItem, AFormSubmit, AIdentityPolicyForm, AIdentityProvider, AIdentityProviderForm, AIdentityProviderIcon, AIdentityProviderLdapForm, AIdentityProviderOAuth2Form, AIdentityProviderPreset, AIdentityProviderProtocol, AIdentityProviderRoleAssignment, AIdentityProviderRoleAssignments, AIdentityProviders, APagination, APermission, APermissionCheck, APermissionClientAssignments, APermissionForm, APermissionRobotAssignments, APermissionRoleAssignments, APermissionUserAssignments, APermissions, APolicies, APolicy, APolicyForm, APolicyTypePicker, ARealm, ARealmForm, ARealmMatchPolicyForm, ARealmPicker, ARealms, ARobot, ARobotForm, ARobotPermissionAssignment, ARobotPermissionAssignments, ARobotRoleAssignment, ARobotRoleAssignments, ARobots, ARole, ARoleClientAssignments, ARoleForm, ARolePermissionAssignment, ARolePermissionAssignments, ARoleRobotAssignments, ARoleUserAssignments, ARoles, AScope, AScopeClientAssignments, AScopeForm, AScopes, ASearch, ATimePolicyForm, ATitle, AUser, AUserForm, AUserPasswordForm, AUserPermissionAssignment, AUserPermissionAssignments, AUserRoleAssignment, AUserRoleAssignments, AUsers, EntityRecordError, HTTPClientSymbol, LanguageSwitcherDropdown, STORE_ID, SocketClientSymbol, StoreDispatcherEventName, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, assignFormProperties, buildEntityCollectionCreatedHandler, buildEntityCollectionDeletedHandler, buildEntityCollectionUpdatedHandler, buildEntityVSlotProps, buildFormSubmitWithTranslations, createFormSubmitTranslations, createPermissionCheckerReactiveFn, createStore, createStoreDispatcher, index as default, defineEntityCollectionManager, defineEntityCollectionVEmitOptions, defineEntityCollectionVProps, defineEntityManager, defineEntityPicker, defineEntityPickerVEmitOptions, defineEntityPickerVProps, defineEntitySocketManager, defineEntityVEmitOptions, defineEntityVProps, extractVuelidateResultsFromChild, getVuelidateSeverity, hasHTTPClient, hasHTTPClientAuthenticationHook, hasNormalizedSlot, hasStoreFactory, inject$1 as inject, injectHTTPClient, injectHTTPClientAuthenticationHook, injectSocketManager, injectStore, injectStoreDispatcher, injectStoreFactory, injectTranslatorLocale, install, installHTTPClient, installHTTPClientAuthenticationHook, installSocketManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketManagerUsable, mergeEntityCollectionRenderOptions, normalizeSlot, onChange, provide, provideHTTPClient, provideHTTPClientAuthenticationHook, provideSocketManager, provideStoreDispatcher, provideStoreFactory, renderToggleButton, storeToRefs, useIsEditing, usePermissionCheck, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, useUpdatedAt, wrapFnWithBusyState };
10338
+ export { AAttributeNamesPolicyForm, _sfc_main as AAuthorize, AuthorizeText as AAuthorizeText, AClient, AClientForm, AClientPermissionAssignment, AClientPermissionAssignments, AClientPicker, AClientRoleAssignment, AClientRoleAssignments, AClientScope, AClientScopeAssignment, AClientScopeAssignments, AClientScopes, AClients, ACompositePolicyForm, ADatePolicyForm, AEntityDelete, AFormInputList, AFormInputListItem, AFormSubmit, AIdentityPolicyForm, AIdentityProvider, AIdentityProviderForm, AIdentityProviderIcon, AIdentityProviderLdapForm, AIdentityProviderOAuth2Form, AIdentityProviderPreset, AIdentityProviderProtocol, AIdentityProviderRoleAssignment, AIdentityProviderRoleAssignments, AIdentityProviders, Login as ALogin, APagination, APermission, APermissionCheck, APermissionClientAssignments, APermissionForm, APermissionRobotAssignments, APermissionRoleAssignments, APermissionUserAssignments, APermissions, APolicies, APolicy, APolicyForm, APolicyTypePicker, ARealm, ARealmForm, ARealmMatchPolicyForm, ARealmPicker, ARealms, ARobot, ARobotForm, ARobotPermissionAssignment, ARobotPermissionAssignments, ARobotRoleAssignment, ARobotRoleAssignments, ARobots, ARole, ARoleClientAssignments, ARoleForm, ARolePermissionAssignment, ARolePermissionAssignments, ARoleRobotAssignments, ARoleUserAssignments, ARoles, AScope, AScopeClientAssignments, AScopeForm, AScopes, ASearch, ATimePolicyForm, ATitle, AUser, AUserForm, AUserPasswordForm, AUserPermissionAssignment, AUserPermissionAssignments, AUserRoleAssignment, AUserRoleAssignments, AUsers, EntityRecordError, HTTPClientSymbol, LanguageSwitcherDropdown, STORE_ID, SocketClientSymbol, StoreDispatcherEventName, TranslatorTranslationClientKey, TranslatorTranslationDefaultKey, TranslatorTranslationGroup, TranslatorTranslationVuecsKey, VuelidateCustomRule, VuelidateCustomRuleKey, assignFormProperties, buildEntityCollectionCreatedHandler, buildEntityCollectionDeletedHandler, buildEntityCollectionUpdatedHandler, buildEntityVSlotProps, buildFormSubmitWithTranslations, createFormSubmitTranslations, createPermissionCheckerReactiveFn, createStore, createStoreDispatcher, index as default, defineEntityCollectionManager, defineEntityCollectionVEmitOptions, defineEntityCollectionVProps, defineEntityManager, defineEntityPicker, defineEntityPickerVEmitOptions, defineEntityPickerVProps, defineEntitySocketManager, defineEntityVEmitOptions, defineEntityVProps, extractVuelidateResultsFromChild, getVuelidateSeverity, hasHTTPClient, hasHTTPClientAuthenticationHook, hasNormalizedSlot, hasStoreFactory, inject$1 as inject, injectHTTPClient, injectHTTPClientAuthenticationHook, injectSocketManager, injectStore, injectStoreDispatcher, injectStoreFactory, injectTranslatorLocale, install, installHTTPClient, installHTTPClientAuthenticationHook, installSocketManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketManagerUsable, mergeEntityCollectionRenderOptions, normalizeSlot, onChange, provide, provideHTTPClient, provideHTTPClientAuthenticationHook, provideSocketManager, provideStoreDispatcher, provideStoreFactory, renderToggleButton, storeToRefs, useIsEditing, usePermissionCheck, useTranslation, useTranslationsForBaseValidation, useTranslationsForGroup, useTranslationsForNestedValidation, useUpdatedAt, wrapFnWithBusyState };
9494
10339
  //# sourceMappingURL=index.mjs.map