@authup/client-web-kit 1.0.0-beta.25 → 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 (61) hide show
  1. package/LICENSE +1 -1
  2. package/dist/components/entities/client/AClientForm.d.ts +1 -1
  3. package/dist/components/entities/identity-provider/AIdentityProviderForm.d.ts +1 -11
  4. package/dist/components/entities/identity-provider/AIdentityProviderForm.d.ts.map +1 -1
  5. package/dist/components/entities/identity-provider/AIdentityProviderLdapForm.d.ts +1 -1
  6. package/dist/components/entities/identity-provider/AIdentityProviderOAuth2Form.d.ts +1 -10
  7. package/dist/components/entities/identity-provider/AIdentityProviderOAuth2Form.d.ts.map +1 -1
  8. package/dist/components/entities/permission/APermissionCheck.d.ts +5 -5
  9. package/dist/components/entities/permission/APermissionCheck.d.ts.map +1 -1
  10. package/dist/components/entities/policy/APolicyBasicForm.vue.d.ts +3 -3
  11. package/dist/components/entities/policy/APolicyForm.vue.d.ts +4 -4
  12. package/dist/components/entities/policy/attribute-names/AAttributeNamesPolicyForm.vue.d.ts +3 -3
  13. package/dist/components/entities/policy/composite/ACompositePolicyForm.vue.d.ts +3 -3
  14. package/dist/components/entities/policy/date/ADatePolicyForm.vue.d.ts +3 -3
  15. package/dist/components/entities/policy/identity/AIdentityPolicyForm.vue.d.ts +3 -3
  16. package/dist/components/entities/policy/realm-match/ARealmMatchPolicyForm.vue.d.ts +6 -6
  17. package/dist/components/entities/policy/time/ATimePolicyForm.vue.d.ts +3 -3
  18. package/dist/components/entities/robot/ARobotForm.d.ts +1 -1
  19. package/dist/components/entities/user/AUserForm.d.ts +1 -1
  20. package/dist/components/index.d.ts +1 -0
  21. package/dist/components/index.d.ts.map +1 -1
  22. package/dist/components/utility/AFormSubmit.d.ts +1 -1
  23. package/dist/components/utility/form-input-list/AFormInputList.vue.d.ts +3 -3
  24. package/dist/components/utility/form-input-list/AFormInputListItem.vue.d.ts +3 -3
  25. package/dist/components/workflows/Login.vue.d.ts +353 -0
  26. package/dist/components/workflows/Login.vue.d.ts.map +1 -0
  27. package/dist/components/workflows/authorize/Authorize.vue.d.ts +488 -0
  28. package/dist/components/workflows/authorize/Authorize.vue.d.ts.map +1 -0
  29. package/dist/components/workflows/authorize/AuthorizeForm.vue.d.ts +83 -0
  30. package/dist/components/workflows/authorize/AuthorizeForm.vue.d.ts.map +1 -0
  31. package/dist/components/workflows/authorize/AuthorizeScope.vue.d.ts +27 -0
  32. package/dist/components/workflows/authorize/AuthorizeScope.vue.d.ts.map +1 -0
  33. package/dist/components/workflows/authorize/AuthorizeScopes.vue.d.ts +54 -0
  34. package/dist/components/workflows/authorize/AuthorizeScopes.vue.d.ts.map +1 -0
  35. package/dist/components/workflows/authorize/AuthorizeText.vue.d.ts +21 -0
  36. package/dist/components/workflows/authorize/AuthorizeText.vue.d.ts.map +1 -0
  37. package/dist/components/workflows/authorize/helpers.d.ts +10 -0
  38. package/dist/components/workflows/authorize/helpers.d.ts.map +1 -0
  39. package/dist/components/workflows/authorize/index.d.ts +3 -0
  40. package/dist/components/workflows/authorize/index.d.ts.map +1 -0
  41. package/dist/components/workflows/index.d.ts +3 -0
  42. package/dist/components/workflows/index.d.ts.map +1 -0
  43. package/dist/core/http-client/authentication-hook/index.d.ts +3 -0
  44. package/dist/core/http-client/authentication-hook/index.d.ts.map +1 -0
  45. package/dist/core/http-client/authentication-hook/install.d.ts +4 -0
  46. package/dist/core/http-client/authentication-hook/install.d.ts.map +1 -0
  47. package/dist/core/http-client/authentication-hook/singleton.d.ts +6 -0
  48. package/dist/core/http-client/authentication-hook/singleton.d.ts.map +1 -0
  49. package/dist/core/http-client/authentication-hook/types.d.ts +7 -0
  50. package/dist/core/http-client/authentication-hook/types.d.ts.map +1 -0
  51. package/dist/core/http-client/index.d.ts +1 -0
  52. package/dist/core/http-client/index.d.ts.map +1 -1
  53. package/dist/core/http-client/install.d.ts.map +1 -1
  54. package/dist/core/http-client/singleton.d.ts.map +1 -1
  55. package/dist/index.cjs +1311 -428
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.css +20 -0
  58. package/dist/index.mjs +1189 -313
  59. package/dist/index.mjs.map +1 -1
  60. package/dist/module.d.ts.map +1 -1
  61. 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
- import { Client, CookieName, getClientErrorCode, unsetHeader, ClientResponseErrorTokenHook, ClientResponseTokenHookEventName } from '@authup/core-http-kit';
10
+ import { Client, CookieName, ClientAuthenticationHook, ClientAuthenticationHookEventName } from '@authup/core-http-kit';
9
11
  import { defineStore, storeToRefs as storeToRefs$1 } from 'pinia';
10
- import { OAuth2Error, isJWKErrorCode, isOpenIDProviderMetadata } from '@authup/specs';
11
12
  import { PermissionMemoryProvider, PermissionChecker, PolicyEngine, TimePolicyInterval, isIntervalForDayOfWeek, isIntervalForDayOfMonth, isIntervalForDayOfYear, BuiltInPolicyType } from '@authup/access';
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]) {
@@ -153,20 +352,24 @@ function provide(key, value, app) {
153
352
  app.provide(key, value);
154
353
  }
155
354
 
156
- const HTTPClientSymbol = Symbol.for('AuthupHTTPClient');
157
- function provideHTTPClient(client, app) {
158
- provide(HTTPClientSymbol, client, app);
159
- }
160
- function hasHTTPClient(app) {
161
- return !!inject$1(HTTPClientSymbol, app);
162
- }
163
- function injectHTTPClient(app) {
164
- const instance = inject$1(HTTPClientSymbol, app);
355
+ const sym$2 = Symbol.for('AuthupHTTPClientAuthenticationHook');
356
+ function injectHTTPClientAuthenticationHook(app) {
357
+ const instance = inject$1(sym$2, app);
165
358
  if (!instance) {
166
- throw new Error('The api client has not been injected.');
359
+ throw new Error('The http client authentication hook has not been injected in the app context.');
167
360
  }
168
361
  return instance;
169
362
  }
363
+ function hasHTTPClientAuthenticationHook(app) {
364
+ try {
365
+ return !!injectHTTPClientAuthenticationHook(app);
366
+ } catch (e) {
367
+ return false;
368
+ }
369
+ }
370
+ function provideHTTPClientAuthenticationHook(refresher, app) {
371
+ provide(sym$2, refresher, app);
372
+ }
170
373
 
171
374
  /*
172
375
  * Copyright (c) 2024.
@@ -534,6 +737,7 @@ function tryOnScopeDispose(fn) {
534
737
  return false;
535
738
  }
536
739
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
740
+ const noop = ()=>{};
537
741
 
538
742
  function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
539
743
  const watchingDependencies = autoUpdateDependencies ? [
@@ -764,71 +968,93 @@ function storeToRefs(store) {
764
968
  return refs;
765
969
  }
766
970
 
767
- function installHTTPClient(app, options = {}) {
768
- if (hasHTTPClient(app)) {
971
+ function installHTTPClientAuthenticationHook(app, options = {}) {
972
+ if (hasHTTPClientAuthenticationHook(app)) {
769
973
  return;
770
974
  }
771
- const client = new Client({
772
- baseURL: options.baseURL
773
- });
774
975
  const storeFactory = injectStoreFactory(app);
775
976
  const store = storeFactory(options.pinia);
776
977
  const { refreshToken } = storeToRefs$1(store);
777
- client.on('responseError', (err)=>{
778
- const { request } = err;
779
- const code = getClientErrorCode(err);
780
- if (isJWKErrorCode(code)) {
781
- return store.logout().then(()=>{
782
- if (request.headers) {
783
- unsetHeader(request.headers, 'authorization');
784
- return client.request(request);
785
- }
786
- return Promise.reject(err);
787
- });
788
- }
789
- return Promise.reject(err);
790
- });
791
- const tokenHook = new ClientResponseErrorTokenHook({
978
+ const hook = new ClientAuthenticationHook({
792
979
  baseURL: options.baseURL,
793
980
  tokenCreator: ()=>{
794
981
  if (!refreshToken.value) {
795
982
  throw new Error('No refresh token available.');
796
983
  }
984
+ const client = new Client({
985
+ baseURL: options.baseURL
986
+ });
797
987
  return client.token.createWithRefreshToken({
798
988
  refresh_token: refreshToken.value
799
989
  });
800
990
  },
801
991
  timer: !options.isServer
802
992
  });
803
- tokenHook.on(ClientResponseTokenHookEventName.REFRESH_FINISHED, (response)=>{
993
+ hook.on(ClientAuthenticationHookEventName.REFRESH_FINISHED, (response)=>{
804
994
  store.applyTokenGrantResponse(response);
805
995
  });
806
- tokenHook.on(ClientResponseTokenHookEventName.REFRESH_FAILED, ()=>{
807
- Promise.resolve().then(()=>store.logout());
996
+ let isSelfCallee = false;
997
+ hook.on(ClientAuthenticationHookEventName.HEADER_UNSET, ()=>{
998
+ if (!isSelfCallee) {
999
+ Promise.resolve().then(()=>store.logout());
1000
+ }
808
1001
  });
809
1002
  const storeDispatcher = injectStoreDispatcher(app);
810
1003
  const handleAccessTokenEvent = ()=>{
1004
+ isSelfCallee = true;
811
1005
  if (store.accessToken) {
812
- client.setAuthorizationHeader({
1006
+ hook.enable();
1007
+ hook.setAuthorizationHeader({
813
1008
  type: 'Bearer',
814
1009
  token: store.accessToken
815
1010
  });
816
- tokenHook.mount(client);
817
1011
  } else {
818
- client.unsetAuthorizationHeader();
819
- tokenHook.unmount(client);
1012
+ hook.disable();
1013
+ hook.unsetAuthorizationHeader();
820
1014
  }
1015
+ isSelfCallee = false;
821
1016
  };
822
1017
  const handleAccessTokenExpireDateEvent = ()=>{
823
1018
  if (store.accessTokenExpireDate) {
824
1019
  const expiresIn = Math.floor((store.accessTokenExpireDate.getTime() - Date.now()) / 1000);
825
- tokenHook.setTimer(expiresIn);
1020
+ hook.setTimer(expiresIn);
826
1021
  }
827
1022
  };
828
1023
  storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_UPDATED, ()=>handleAccessTokenEvent());
829
1024
  storeDispatcher.on(StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED, ()=>handleAccessTokenExpireDateEvent());
830
1025
  handleAccessTokenEvent();
831
1026
  handleAccessTokenExpireDateEvent();
1027
+ provideHTTPClientAuthenticationHook(hook, app);
1028
+ }
1029
+
1030
+ const HTTPClientSymbol = Symbol.for('AuthupHTTPClient');
1031
+ function provideHTTPClient(client, app) {
1032
+ provide(HTTPClientSymbol, client, app);
1033
+ }
1034
+ function hasHTTPClient(app) {
1035
+ try {
1036
+ return !!injectHTTPClient(app);
1037
+ } catch (e) {
1038
+ return false;
1039
+ }
1040
+ }
1041
+ function injectHTTPClient(app) {
1042
+ const instance = inject$1(HTTPClientSymbol, app);
1043
+ if (!instance) {
1044
+ throw new Error('The api client has not been injected.');
1045
+ }
1046
+ return instance;
1047
+ }
1048
+
1049
+ function installHTTPClient(app, options = {}) {
1050
+ if (hasHTTPClient(app)) {
1051
+ return;
1052
+ }
1053
+ const client = new Client({
1054
+ baseURL: options.baseURL
1055
+ });
1056
+ const authenticationHook = injectHTTPClientAuthenticationHook(app);
1057
+ authenticationHook.attach(client);
832
1058
  provideHTTPClient(client, app);
833
1059
  }
834
1060
 
@@ -915,142 +1141,36 @@ var TranslatorTranslationDefaultKey = /*#__PURE__*/ function(TranslatorTranslati
915
1141
  return TranslatorTranslationDefaultKey;
916
1142
  }({});
917
1143
 
918
- /*
919
- * Copyright (c) 2024-2024.
920
- * Author Peter Placzek (tada5hi)
921
- * For the full copyright and license information,
922
- * view the LICENSE file that was distributed with this source code.
923
- */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
924
- /**
925
- * Convert string to property path array.
926
- *
927
- * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
928
- * @see https://github.com/chaijs/pathval
929
- *
930
- * @param segment
931
- */ function pathToArray(segment) {
932
- const str = segment.replace(/([^\\])\[/g, '$1.[');
933
- const parts = str.match(/(\\\.|[^.]+?)+/g);
934
- if (!parts) {
935
- return [];
1144
+ class MemoryStore {
1145
+ async get(context) {
1146
+ if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
1147
+ return undefined;
1148
+ }
1149
+ const output = getPathValue(this.data[context.locale][context.group], context.key);
1150
+ if (typeof output === 'string') {
1151
+ return output;
1152
+ }
1153
+ return undefined;
936
1154
  }
937
- const result = [];
938
- for(let i = 0; i < parts.length; i++){
939
- if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
940
- continue;
1155
+ async set(context) {
1156
+ this.initLines(context.group, context.locale);
1157
+ setPathValue(this.data[context.locale][context.group], context.key, context.value);
1158
+ }
1159
+ initLines(group, locale) {
1160
+ if (typeof this.data[locale] === 'undefined') {
1161
+ this.data[locale] = {};
941
1162
  }
942
- const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
943
- if (regex) {
944
- result.push(regex[1]);
945
- } else {
946
- result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
1163
+ if (typeof this.data[locale][group] === 'undefined') {
1164
+ this.data[locale][group] = {};
947
1165
  }
948
1166
  }
949
- return result;
1167
+ async getLocales() {
1168
+ return Object.keys(this.data);
1169
+ }
1170
+ constructor(options){
1171
+ this.data = options.data;
1172
+ }
950
1173
  }
951
- /*
952
- * Copyright (c) 2024.
953
- * Author Peter Placzek (tada5hi)
954
- * For the full copyright and license information,
955
- * view the LICENSE file that was distributed with this source code.
956
- */ var Character;
957
- (function(Character) {
958
- Character["WILDCARD"] = "*";
959
- Character["GLOBSTAR"] = "**";
960
- })(Character || (Character = {}));
961
- /*
962
- * Copyright (c) 2024.
963
- * Author Peter Placzek (tada5hi)
964
- * For the full copyright and license information,
965
- * view the LICENSE file that was distributed with this source code.
966
- */ function isObject(input) {
967
- return !!input && typeof input === 'object' && !Array.isArray(input);
968
- }
969
- function getPathValue(data, path) {
970
- const parts = Array.isArray(path) ? path : pathToArray(path);
971
- let res;
972
- let temp = data;
973
- let index = 0;
974
- while(index < parts.length){
975
- if (temp === null || typeof temp === 'undefined') {
976
- break;
977
- }
978
- if (parts[index] in Object(temp)) {
979
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
980
- // @ts-expect-error
981
- temp = temp[parts[index]];
982
- } else {
983
- break;
984
- }
985
- if (index === parts.length - 1) {
986
- res = temp;
987
- }
988
- index++;
989
- }
990
- return res;
991
- }
992
- const NUMBER_REGEX = /^\d+$/;
993
- function setPathValue(data, path, value) {
994
- const parts = Array.isArray(path) ? path : pathToArray(path);
995
- let temp = data;
996
- let index = 0;
997
- while(index < parts.length){
998
- /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
999
- break;
1000
- }
1001
- const key = parts[index];
1002
- // [foo, '0']
1003
- if (typeof temp[key] === 'undefined') {
1004
- const match = NUMBER_REGEX.test(key);
1005
- if (match) {
1006
- temp[key] = [];
1007
- } else {
1008
- temp[key] = {};
1009
- }
1010
- }
1011
- if (index === parts.length - 1) {
1012
- temp[key] = value;
1013
- break;
1014
- }
1015
- index++;
1016
- temp = temp[key];
1017
- }
1018
- return data;
1019
- }
1020
-
1021
- class MemoryStore {
1022
- async get(context) {
1023
- if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
1024
- return undefined;
1025
- }
1026
- const output = getPathValue(this.data[context.locale][context.group], context.key);
1027
- if (typeof output === 'string') {
1028
- return output;
1029
- }
1030
- return undefined;
1031
- }
1032
- async set(context) {
1033
- this.initLines(context.group, context.locale);
1034
- setPathValue(this.data[context.locale][context.group], context.key, context.value);
1035
- }
1036
- initLines(group, locale) {
1037
- if (typeof this.data[locale] === 'undefined') {
1038
- this.data[locale] = {};
1039
- }
1040
- if (typeof this.data[locale][group] === 'undefined') {
1041
- this.data[locale][group] = {};
1042
- }
1043
- }
1044
- async getLocales() {
1045
- return Object.keys(this.data);
1046
- }
1047
- constructor(options){
1048
- this.data = options.data;
1049
- }
1050
- }
1051
-
1052
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
1053
- const noop = ()=>{};
1054
1174
 
1055
1175
  function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1056
1176
  let options;
@@ -1061,8 +1181,8 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1061
1181
  } else {
1062
1182
  options = {};
1063
1183
  }
1064
- const { lazy = false, evaluating = void 0, shallow = true, onError = noop } = options;
1065
- const started = ref(!lazy);
1184
+ const { lazy = false, flush = "pre", evaluating = void 0, shallow = true, onError = noop } = options;
1185
+ const started = shallowRef(!lazy);
1066
1186
  const current = shallow ? shallowRef(initialState) : ref(initialState);
1067
1187
  let counter = 0;
1068
1188
  watchEffect(async (onInvalidate)=>{
@@ -1089,6 +1209,8 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1089
1209
  if (evaluating && counterAtBeginning === counter) evaluating.value = false;
1090
1210
  hasFinished = true;
1091
1211
  }
1212
+ }, {
1213
+ flush
1092
1214
  });
1093
1215
  if (lazy) {
1094
1216
  return computed(()=>{
@@ -1102,7 +1224,7 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1102
1224
 
1103
1225
  function inject(key, instance) {
1104
1226
  if (hasInjectionContext()) {
1105
- return inject$2(key, undefined);
1227
+ return inject$3(key, undefined);
1106
1228
  }
1107
1229
  return undefined;
1108
1230
  }
@@ -1264,7 +1386,7 @@ function extractVuelidateResultsFromChild(vuelidate, child, keys) {
1264
1386
  const childKeys = keys ?? Object.keys(childResults).filter((key)=>!key.startsWith('$'));
1265
1387
  const result = {};
1266
1388
  for(let i = 0; i < childKeys.length; i++){
1267
- if (hasOwnProperty(childResults, childKeys[i])) {
1389
+ if (hasOwnProperty$1(childResults, childKeys[i])) {
1268
1390
  result[childKeys[i]] = childResults[childKeys[i]].$model;
1269
1391
  }
1270
1392
  }
@@ -1432,8 +1554,8 @@ function createPermissionCheckerReactiveFn(ctx = {}) {
1432
1554
  try {
1433
1555
  computePromise = store.permissionChecker.preCheckOneOf({
1434
1556
  ...ctx,
1435
- data: {
1436
- ...ctx.data || {},
1557
+ input: {
1558
+ ...ctx.input || {},
1437
1559
  identity
1438
1560
  }
1439
1561
  }).then(()=>true).catch(()=>false);
@@ -1506,7 +1628,7 @@ function installSocketManager(app, options) {
1506
1628
  * @param name
1507
1629
  * @param $slots
1508
1630
  */ function hasNormalizedSlot(name, $slots = {}) {
1509
- return hasOwnProperty($slots, name);
1631
+ return hasOwnProperty$1($slots, name);
1510
1632
  }
1511
1633
  /**
1512
1634
  * Returns VNodes for named slot either scoped or unscoped
@@ -1517,7 +1639,7 @@ function installSocketManager(app, options) {
1517
1639
  *
1518
1640
  * @returns {Array} VNodes
1519
1641
  */ function normalizeSlot(name, scope = {}, $slots = {}) {
1520
- if (hasOwnProperty($slots, name)) {
1642
+ if (hasOwnProperty$1($slots, name)) {
1521
1643
  return $slots[name](scope);
1522
1644
  }
1523
1645
  return [];
@@ -1567,7 +1689,7 @@ const ATranslationDefault = defineComponent({
1567
1689
  }
1568
1690
  });
1569
1691
 
1570
- var _sfc_main$a = defineComponent({
1692
+ var _sfc_main$g = defineComponent({
1571
1693
  components: {
1572
1694
  ATranslationDefault,
1573
1695
  AFormInputListItem
@@ -1646,35 +1768,35 @@ var _sfc_main$a = defineComponent({
1646
1768
  }
1647
1769
  });
1648
1770
 
1649
- const _hoisted_1$6 = {
1771
+ const _hoisted_1$b = {
1650
1772
  class: "d-flex flex-column gap-2"
1651
1773
  };
1652
- const _hoisted_2$5 = {
1774
+ const _hoisted_2$a = {
1653
1775
  class: "d-flex flex-row"
1654
1776
  };
1655
- const _hoisted_3$5 = {
1777
+ const _hoisted_3$8 = {
1656
1778
  class: "align-self-end"
1657
1779
  };
1658
- const _hoisted_4$4 = {
1780
+ const _hoisted_4$6 = {
1659
1781
  class: "ms-auto"
1660
1782
  };
1661
- const _hoisted_5$2 = [
1783
+ const _hoisted_5$3 = [
1662
1784
  "disabled"
1663
1785
  ];
1664
- const _hoisted_6$1 = {
1786
+ const _hoisted_6$2 = {
1665
1787
  class: "d-flex flex-column gap-1"
1666
1788
  };
1667
- function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1789
+ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
1668
1790
  const _component_ATranslationDefault = resolveComponent("ATranslationDefault");
1669
1791
  const _component_AFormInputListItem = resolveComponent("AFormInputListItem");
1670
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
1671
- createElementVNode("div", _hoisted_2$5, [
1672
- 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, [
1673
1795
  renderSlot(_ctx.$slots, "label", {}, ()=>[
1674
1796
  _cache[1] || (_cache[1] = createTextVNode(" Names "))
1675
1797
  ])
1676
1798
  ]),
1677
- createElementVNode("div", _hoisted_4$4, [
1799
+ createElementVNode("div", _hoisted_4$6, [
1678
1800
  createElementVNode("button", {
1679
1801
  class: "btn btn-xs btn-primary",
1680
1802
  type: "button",
@@ -1690,10 +1812,10 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1690
1812
  createVNode(_component_ATranslationDefault, {
1691
1813
  name: "add"
1692
1814
  })
1693
- ], 8, _hoisted_5$2)
1815
+ ], 8, _hoisted_5$3)
1694
1816
  ])
1695
1817
  ]),
1696
- createElementVNode("div", _hoisted_6$1, [
1818
+ createElementVNode("div", _hoisted_6$2, [
1697
1819
  _ctx.items.length === 0 ? renderSlot(_ctx.$slots, "noItems", {
1698
1820
  key: 0
1699
1821
  }, ()=>[
@@ -1729,10 +1851,10 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
1729
1851
  ])
1730
1852
  ]);
1731
1853
  }
1732
- var AFormInputList = /* @__PURE__ */ _export_sfc(_sfc_main$a, [
1854
+ var AFormInputList = /* @__PURE__ */ _export_sfc(_sfc_main$g, [
1733
1855
  [
1734
1856
  "render",
1735
- _sfc_render$a
1857
+ _sfc_render$f
1736
1858
  ]
1737
1859
  ]);
1738
1860
 
@@ -2084,7 +2206,7 @@ function create$1(context) {
2084
2206
  });
2085
2207
  const client = injectHTTPClient();
2086
2208
  let domainAPI;
2087
- if (hasOwnProperty(client, context.type)) {
2209
+ if (hasOwnProperty$1(client, context.type)) {
2088
2210
  domainAPI = client[context.type];
2089
2211
  }
2090
2212
  let query;
@@ -2094,7 +2216,7 @@ function create$1(context) {
2094
2216
  meta.value.busy = true;
2095
2217
  try {
2096
2218
  let filters;
2097
- 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') {
2098
2220
  // todo: queryFilters should customize full filters object!
2099
2221
  filters = context.queryFilters(input.filters.name);
2100
2222
  }
@@ -2316,7 +2438,7 @@ function defineEntityVProps() {
2316
2438
  function create(ctx) {
2317
2439
  const client = injectHTTPClient();
2318
2440
  let domainAPI;
2319
- if (hasOwnProperty(client, ctx.type)) {
2441
+ if (hasOwnProperty$1(client, ctx.type)) {
2320
2442
  domainAPI = client[ctx.type];
2321
2443
  }
2322
2444
  const entity = ref(undefined);
@@ -2330,7 +2452,7 @@ function create(ctx) {
2330
2452
  realmId = isRef(ctx.realmId) ? ctx.realmId.value : ctx.realmId;
2331
2453
  }
2332
2454
  if (!realmId && entity.value) {
2333
- 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') {
2334
2456
  return entity.value.realm_id;
2335
2457
  }
2336
2458
  }
@@ -3507,7 +3629,7 @@ const AClientForm = defineComponent({
3507
3629
  required
3508
3630
  },
3509
3631
  redirect_uri: {
3510
- url,
3632
+ // todo: url is required!
3511
3633
  maxLength: maxLength(2000)
3512
3634
  },
3513
3635
  is_confidential: {},
@@ -3902,7 +4024,7 @@ const APermissionCheck = defineComponent({
3902
4024
  ],
3903
4025
  required: true
3904
4026
  },
3905
- data: {
4027
+ input: {
3906
4028
  type: Object
3907
4029
  },
3908
4030
  options: {
@@ -3913,7 +4035,7 @@ const APermissionCheck = defineComponent({
3913
4035
  const fn = createPermissionCheckerReactiveFn();
3914
4036
  const isPermitted = computed(()=>fn({
3915
4037
  name: props.name,
3916
- data: props.data,
4038
+ input: props.input,
3917
4039
  options: props.options
3918
4040
  }));
3919
4041
  return ()=>{
@@ -5675,7 +5797,7 @@ const AIdentityProviderPreset = defineComponent({
5675
5797
  }
5676
5798
  });
5677
5799
 
5678
- var _sfc_main$9 = defineComponent({
5800
+ var _sfc_main$f = defineComponent({
5679
5801
  components: {
5680
5802
  AIdentityProviderPreset,
5681
5803
  AIdentityProviderProtocol
@@ -5709,28 +5831,28 @@ var _sfc_main$9 = defineComponent({
5709
5831
  }
5710
5832
  });
5711
5833
 
5712
- const _hoisted_1$5 = {
5834
+ const _hoisted_1$a = {
5713
5835
  class: "d-flex flex-column gap-2"
5714
5836
  };
5715
- const _hoisted_2$4 = {
5837
+ const _hoisted_2$9 = {
5716
5838
  class: "d-flex flex-row gap-2 flex-wrap"
5717
5839
  };
5718
- const _hoisted_3$4 = [
5840
+ const _hoisted_3$7 = [
5719
5841
  "onClick"
5720
5842
  ];
5721
- const _hoisted_4$3 = {
5843
+ const _hoisted_4$5 = {
5722
5844
  class: "d-flex flex-row gap-2 flex-wrap"
5723
5845
  };
5724
- const _hoisted_5$1 = [
5846
+ const _hoisted_5$2 = [
5725
5847
  "onClick"
5726
5848
  ];
5727
- function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5849
+ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
5728
5850
  const _component_AIdentityProviderProtocol = resolveComponent("AIdentityProviderProtocol");
5729
5851
  const _component_AIdentityProviderPreset = resolveComponent("AIdentityProviderPreset");
5730
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
5852
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
5731
5853
  createElementVNode("div", null, [
5732
5854
  _cache[0] || (_cache[0] = createElementVNode("h6", null, "Protocols", -1)),
5733
- createElementVNode("div", _hoisted_2$4, [
5855
+ createElementVNode("div", _hoisted_2$9, [
5734
5856
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.protocols, (item, key)=>{
5735
5857
  return openBlock(), createBlock(_component_AIdentityProviderProtocol, {
5736
5858
  key,
@@ -5757,7 +5879,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5757
5879
  }, null, 2)
5758
5880
  ]),
5759
5881
  createElementVNode("div", null, toDisplayString(props.name), 1)
5760
- ], 10, _hoisted_3$4)
5882
+ ], 10, _hoisted_3$7)
5761
5883
  ]),
5762
5884
  _: 2
5763
5885
  }, 1032, [
@@ -5768,7 +5890,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5768
5890
  ]),
5769
5891
  createElementVNode("div", null, [
5770
5892
  _cache[1] || (_cache[1] = createElementVNode("h6", null, "Presets", -1)),
5771
- createElementVNode("div", _hoisted_4$3, [
5893
+ createElementVNode("div", _hoisted_4$5, [
5772
5894
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.presets, (item, key)=>{
5773
5895
  return openBlock(), createBlock(_component_AIdentityProviderPreset, {
5774
5896
  key,
@@ -5795,7 +5917,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5795
5917
  }, null, 2)
5796
5918
  ]),
5797
5919
  createElementVNode("div", null, toDisplayString(props.name), 1)
5798
- ], 10, _hoisted_5$1)
5920
+ ], 10, _hoisted_5$2)
5799
5921
  ]),
5800
5922
  _: 2
5801
5923
  }, 1032, [
@@ -5806,10 +5928,10 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
5806
5928
  ])
5807
5929
  ]);
5808
5930
  }
5809
- var AIdentityProviderPicker = /* @__PURE__ */ _export_sfc(_sfc_main$9, [
5931
+ var AIdentityProviderPicker = /* @__PURE__ */ _export_sfc(_sfc_main$f, [
5810
5932
  [
5811
5933
  "render",
5812
- _sfc_render$9
5934
+ _sfc_render$e
5813
5935
  ],
5814
5936
  [
5815
5937
  "__scopeId",
@@ -6085,10 +6207,6 @@ const AIdentityProviderOAuth2Form = defineComponent({
6085
6207
  type: String,
6086
6208
  default: undefined
6087
6209
  },
6088
- apiUrl: {
6089
- type: String,
6090
- default: 'http://localhost:3001'
6091
- },
6092
6210
  protocol: {
6093
6211
  type: String,
6094
6212
  default: IdentityProviderProtocol.OAUTH2
@@ -6126,7 +6244,7 @@ const AIdentityProviderOAuth2Form = defineComponent({
6126
6244
  if (!manager.data.value) {
6127
6245
  return '';
6128
6246
  }
6129
- return apiClient.identityProvider.getAuthorizeUri(props.apiUrl, manager.data.value.id);
6247
+ return apiClient.identityProvider.getAuthorizeUri(manager.data.value.id);
6130
6248
  });
6131
6249
  const basicFieldsNode = ref(null);
6132
6250
  onChange(preset, ()=>{
@@ -6324,10 +6442,6 @@ const AIdentityProviderForm = defineComponent({
6324
6442
  },
6325
6443
  realmId: {
6326
6444
  type: String
6327
- },
6328
- apiUrl: {
6329
- type: String,
6330
- default: 'http://localhost:3001'
6331
6445
  }
6332
6446
  },
6333
6447
  emits: [
@@ -6390,7 +6504,6 @@ const AIdentityProviderForm = defineComponent({
6390
6504
  realmId: props.realmId,
6391
6505
  protocol: protocol.value,
6392
6506
  preset: preset.value,
6393
- apiUrl: props.apiUrl,
6394
6507
  onCreated: (el)=>{
6395
6508
  entity.value = el;
6396
6509
  setup.emit('created', el);
@@ -6730,7 +6843,7 @@ const AIdentityProviderRoleAssignments = defineComponent({
6730
6843
  }
6731
6844
  });
6732
6845
 
6733
- var _sfc_main$8 = defineComponent({
6846
+ var _sfc_main$e = defineComponent({
6734
6847
  components: {
6735
6848
  AFormInputList
6736
6849
  },
@@ -6771,7 +6884,7 @@ var _sfc_main$8 = defineComponent({
6771
6884
  }
6772
6885
  });
6773
6886
 
6774
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
6887
+ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
6775
6888
  const _component_AFormInputList = resolveComponent("AFormInputList");
6776
6889
  return openBlock(), createBlock(_component_AFormInputList, {
6777
6890
  names: _ctx.vuelidate.names.$model,
@@ -6782,14 +6895,14 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
6782
6895
  "onChanged"
6783
6896
  ]);
6784
6897
  }
6785
- var AAttributeNamesPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$8, [
6898
+ var AAttributeNamesPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$e, [
6786
6899
  [
6787
6900
  "render",
6788
- _sfc_render$8
6901
+ _sfc_render$d
6789
6902
  ]
6790
6903
  ]);
6791
6904
 
6792
- var _sfc_main$7 = defineComponent({
6905
+ var _sfc_main$d = defineComponent({
6793
6906
  components: {
6794
6907
  APolicyChildrenPicker: APolicyPicker,
6795
6908
  VCFormGroup,
@@ -6875,7 +6988,7 @@ var _sfc_main$7 = defineComponent({
6875
6988
  }
6876
6989
  });
6877
6990
 
6878
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
6991
+ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
6879
6992
  const _component_APolicyChildrenPicker = resolveComponent("APolicyChildrenPicker");
6880
6993
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
6881
6994
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -6916,14 +7029,14 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
6916
7029
  ])
6917
7030
  ]);
6918
7031
  }
6919
- var ACompositePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [
7032
+ var ACompositePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$d, [
6920
7033
  [
6921
7034
  "render",
6922
- _sfc_render$7
7035
+ _sfc_render$c
6923
7036
  ]
6924
7037
  ]);
6925
7038
 
6926
- var _sfc_main$6 = defineComponent({
7039
+ var _sfc_main$c = defineComponent({
6927
7040
  components: {
6928
7041
  VCFormInput,
6929
7042
  VCFormGroup,
@@ -6970,7 +7083,7 @@ var _sfc_main$6 = defineComponent({
6970
7083
  }
6971
7084
  });
6972
7085
 
6973
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
7086
+ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
6974
7087
  const _component_VCFormInput = resolveComponent("VCFormInput");
6975
7088
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
6976
7089
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -7041,14 +7154,14 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
7041
7154
  ])
7042
7155
  ]);
7043
7156
  }
7044
- var ADatePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$6, [
7157
+ var ADatePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$c, [
7045
7158
  [
7046
7159
  "render",
7047
- _sfc_render$6
7160
+ _sfc_render$b
7048
7161
  ]
7049
7162
  ]);
7050
7163
 
7051
- var _sfc_main$5 = defineComponent({
7164
+ var _sfc_main$b = defineComponent({
7052
7165
  components: {
7053
7166
  AFormInputList
7054
7167
  },
@@ -7089,7 +7202,7 @@ var _sfc_main$5 = defineComponent({
7089
7202
  }
7090
7203
  });
7091
7204
 
7092
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
7205
+ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
7093
7206
  const _component_AFormInputList = resolveComponent("AFormInputList");
7094
7207
  return openBlock(), createBlock(_component_AFormInputList, {
7095
7208
  names: _ctx.vuelidate.types.$model,
@@ -7105,14 +7218,14 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
7105
7218
  "onChanged"
7106
7219
  ]);
7107
7220
  }
7108
- var AIdentityPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [
7221
+ var AIdentityPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$b, [
7109
7222
  [
7110
7223
  "render",
7111
- _sfc_render$5
7224
+ _sfc_render$a
7112
7225
  ]
7113
7226
  ]);
7114
7227
 
7115
- var _sfc_main$4 = defineComponent({
7228
+ var _sfc_main$a = defineComponent({
7116
7229
  components: {
7117
7230
  AFormInputList,
7118
7231
  VCFormGroup,
@@ -7174,31 +7287,31 @@ var _sfc_main$4 = defineComponent({
7174
7287
  }
7175
7288
  });
7176
7289
 
7177
- const _hoisted_1$4 = {
7290
+ const _hoisted_1$9 = {
7178
7291
  class: "row"
7179
7292
  };
7180
- const _hoisted_2$3 = {
7293
+ const _hoisted_2$8 = {
7181
7294
  class: "col-7"
7182
7295
  };
7183
- const _hoisted_3$3 = {
7296
+ const _hoisted_3$6 = {
7184
7297
  class: "col-5"
7185
7298
  };
7186
- const _hoisted_4$2 = [
7299
+ const _hoisted_4$4 = [
7187
7300
  "for"
7188
7301
  ];
7189
- const _hoisted_5 = [
7302
+ const _hoisted_5$1 = [
7190
7303
  "for"
7191
7304
  ];
7192
- const _hoisted_6 = [
7305
+ const _hoisted_6$1 = [
7193
7306
  "for"
7194
7307
  ];
7195
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7308
+ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
7196
7309
  const _component_AFormInputList = resolveComponent("AFormInputList");
7197
7310
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7198
7311
  const _component_IVuelidate = resolveComponent("IVuelidate");
7199
7312
  const _component_VCFormInputCheckbox = resolveComponent("VCFormInputCheckbox");
7200
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
7201
- createElementVNode("div", _hoisted_2$3, [
7313
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
7314
+ createElementVNode("div", _hoisted_2$8, [
7202
7315
  createVNode(_component_IVuelidate, {
7203
7316
  validation: _ctx.vuelidate.attributeName
7204
7317
  }, {
@@ -7227,7 +7340,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7227
7340
  "validation"
7228
7341
  ])
7229
7342
  ]),
7230
- createElementVNode("div", _hoisted_3$3, [
7343
+ createElementVNode("div", _hoisted_3$6, [
7231
7344
  createVNode(_component_IVuelidate, {
7232
7345
  validation: _ctx.vuelidate.attributeNameStrict
7233
7346
  }, {
@@ -7247,7 +7360,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7247
7360
  label: withCtx((iProps)=>[
7248
7361
  createElementVNode("label", {
7249
7362
  for: iProps.id
7250
- }, " 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)
7251
7364
  ]),
7252
7365
  _: 1
7253
7366
  }, 8, [
@@ -7288,7 +7401,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7288
7401
  createTextVNode(" Determines if resources with null realm-id/name value should match all identity realms."),
7289
7402
  createElementVNode("br", null, null, -1),
7290
7403
  createTextVNode(" If true, any identity realm can access resources with null realm-id/name values. ")
7291
- ]), 8, _hoisted_5)
7404
+ ]), 8, _hoisted_5$1)
7292
7405
  ]),
7293
7406
  _: 1
7294
7407
  }, 8, [
@@ -7329,7 +7442,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7329
7442
  createTextVNode(" Specifies whether the master realm of an identity should match all realm-id/name attributes, including null."),
7330
7443
  createElementVNode("br", null, null, -1),
7331
7444
  createTextVNode(" If true, the master realm can access any resource regardless of its realm value. ")
7332
- ]), 8, _hoisted_6)
7445
+ ]), 8, _hoisted_6$1)
7333
7446
  ]),
7334
7447
  _: 1
7335
7448
  }, 8, [
@@ -7350,14 +7463,14 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
7350
7463
  ])
7351
7464
  ]);
7352
7465
  }
7353
- var ARealmMatchPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$4, [
7466
+ var ARealmMatchPolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$a, [
7354
7467
  [
7355
7468
  "render",
7356
- _sfc_render$4
7469
+ _sfc_render$9
7357
7470
  ]
7358
7471
  ]);
7359
7472
 
7360
- var _sfc_main$3 = defineComponent({
7473
+ var _sfc_main$9 = defineComponent({
7361
7474
  components: {
7362
7475
  VCFormInput,
7363
7476
  VCFormGroup,
@@ -7445,22 +7558,22 @@ var _sfc_main$3 = defineComponent({
7445
7558
  }
7446
7559
  });
7447
7560
 
7448
- const _hoisted_1$3 = {
7561
+ const _hoisted_1$8 = {
7449
7562
  class: "row"
7450
7563
  };
7451
- const _hoisted_2$2 = {
7564
+ const _hoisted_2$7 = {
7452
7565
  key: 0,
7453
7566
  class: "col"
7454
7567
  };
7455
- const _hoisted_3$2 = {
7568
+ const _hoisted_3$5 = {
7456
7569
  key: 1,
7457
7570
  class: "col"
7458
7571
  };
7459
- const _hoisted_4$1 = {
7572
+ const _hoisted_4$3 = {
7460
7573
  key: 2,
7461
7574
  class: "col"
7462
7575
  };
7463
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7576
+ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
7464
7577
  const _component_VCFormInput = resolveComponent("VCFormInput");
7465
7578
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7466
7579
  const _component_IVuelidate = resolveComponent("IVuelidate");
@@ -7563,8 +7676,8 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7563
7676
  }, 8, [
7564
7677
  "validation"
7565
7678
  ]),
7566
- createElementVNode("div", _hoisted_1$3, [
7567
- _ctx.displayIntervalForDayOfWeek ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
7679
+ createElementVNode("div", _hoisted_1$8, [
7680
+ _ctx.displayIntervalForDayOfWeek ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
7568
7681
  createVNode(_component_IVuelidate, {
7569
7682
  validation: _ctx.vuelidate.dayOfWeek
7570
7683
  }, {
@@ -7599,7 +7712,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7599
7712
  "validation"
7600
7713
  ])
7601
7714
  ])) : createCommentVNode("", true),
7602
- _ctx.displayIntervalForDayOfMonth ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
7715
+ _ctx.displayIntervalForDayOfMonth ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
7603
7716
  createVNode(_component_IVuelidate, {
7604
7717
  validation: _ctx.vuelidate.dayOfMonth
7605
7718
  }, {
@@ -7634,7 +7747,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7634
7747
  "validation"
7635
7748
  ])
7636
7749
  ])) : createCommentVNode("", true),
7637
- _ctx.displayIntervalForDayOfYear ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
7750
+ _ctx.displayIntervalForDayOfYear ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
7638
7751
  createVNode(_component_IVuelidate, {
7639
7752
  validation: _ctx.vuelidate.dayOfYear
7640
7753
  }, {
@@ -7672,10 +7785,10 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
7672
7785
  ])
7673
7786
  ]);
7674
7787
  }
7675
- var ATimePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$3, [
7788
+ var ATimePolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$9, [
7676
7789
  [
7677
7790
  "render",
7678
- _sfc_render$3
7791
+ _sfc_render$8
7679
7792
  ]
7680
7793
  ]);
7681
7794
 
@@ -7698,7 +7811,7 @@ const APolicy = defineComponent({
7698
7811
  }
7699
7812
  });
7700
7813
 
7701
- var _sfc_main$2 = defineComponent({
7814
+ var _sfc_main$8 = defineComponent({
7702
7815
  props: {
7703
7816
  type: {
7704
7817
  type: String
@@ -7744,20 +7857,20 @@ var _sfc_main$2 = defineComponent({
7744
7857
  }
7745
7858
  });
7746
7859
 
7747
- const _hoisted_1$2 = {
7860
+ const _hoisted_1$7 = {
7748
7861
  class: "d-flex flex-column gap-2"
7749
7862
  };
7750
- const _hoisted_2$1 = {
7863
+ const _hoisted_2$6 = {
7751
7864
  class: "d-flex flex-row gap-2 flex-wrap"
7752
7865
  };
7753
- const _hoisted_3$1 = [
7866
+ const _hoisted_3$4 = [
7754
7867
  "onClick"
7755
7868
  ];
7756
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
7757
- 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, [
7758
7871
  createElementVNode("div", null, [
7759
7872
  _cache[0] || (_cache[0] = createElementVNode("h6", null, "Type", -1)),
7760
- createElementVNode("div", _hoisted_2$1, [
7873
+ createElementVNode("div", _hoisted_2$6, [
7761
7874
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, key)=>{
7762
7875
  return openBlock(), createElementBlock("div", {
7763
7876
  key,
@@ -7772,16 +7885,16 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
7772
7885
  ])
7773
7886
  }, [
7774
7887
  createElementVNode("div", null, toDisplayString(item.value), 1)
7775
- ], 10, _hoisted_3$1);
7888
+ ], 10, _hoisted_3$4);
7776
7889
  }), 128))
7777
7890
  ])
7778
7891
  ])
7779
7892
  ]);
7780
7893
  }
7781
- var APolicyTypePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [
7894
+ var APolicyTypePicker = /* @__PURE__ */ _export_sfc(_sfc_main$8, [
7782
7895
  [
7783
7896
  "render",
7784
- _sfc_render$2
7897
+ _sfc_render$7
7785
7898
  ],
7786
7899
  [
7787
7900
  "__scopeId",
@@ -7789,7 +7902,7 @@ var APolicyTypePicker = /* @__PURE__ */ _export_sfc(_sfc_main$2, [
7789
7902
  ]
7790
7903
  ]);
7791
7904
 
7792
- var _sfc_main$1 = defineComponent({
7905
+ var _sfc_main$7 = defineComponent({
7793
7906
  components: {
7794
7907
  ARealmPicker,
7795
7908
  VCFormInput,
@@ -7873,28 +7986,28 @@ var _sfc_main$1 = defineComponent({
7873
7986
  }
7874
7987
  });
7875
7988
 
7876
- const _hoisted_1$1 = {
7989
+ const _hoisted_1$6 = {
7877
7990
  class: "row"
7878
7991
  };
7879
- const _hoisted_2 = {
7992
+ const _hoisted_2$5 = {
7880
7993
  class: "col"
7881
7994
  };
7882
- const _hoisted_3 = [
7995
+ const _hoisted_3$3 = [
7883
7996
  "for"
7884
7997
  ];
7885
- const _hoisted_4 = {
7998
+ const _hoisted_4$2 = {
7886
7999
  key: 0,
7887
8000
  class: "col"
7888
8001
  };
7889
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8002
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
7890
8003
  const _component_VCFormInput = resolveComponent("VCFormInput");
7891
8004
  const _component_VCFormGroup = resolveComponent("VCFormGroup");
7892
8005
  const _component_IVuelidate = resolveComponent("IVuelidate");
7893
8006
  const _component_VCFormTextarea = resolveComponent("VCFormTextarea");
7894
8007
  const _component_VCFormInputCheckbox = resolveComponent("VCFormInputCheckbox");
7895
8008
  const _component_ARealmPicker = resolveComponent("ARealmPicker");
7896
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
7897
- createElementVNode("div", _hoisted_2, [
8009
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
8010
+ createElementVNode("div", _hoisted_2$5, [
7898
8011
  createVNode(_component_IVuelidate, {
7899
8012
  validation: _ctx.vuelidate.name
7900
8013
  }, {
@@ -8008,7 +8121,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8008
8121
  label: withCtx((iProps)=>[
8009
8122
  createElementVNode("label", {
8010
8123
  for: iProps.id
8011
- }, " Invert? ", 8, _hoisted_3)
8124
+ }, " Invert? ", 8, _hoisted_3$3)
8012
8125
  ]),
8013
8126
  _: 1
8014
8127
  }, 8, [
@@ -8027,7 +8140,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8027
8140
  "validation"
8028
8141
  ])
8029
8142
  ]),
8030
- !_ctx.realmId && !_ctx.isEditing ? (openBlock(), createElementBlock("div", _hoisted_4, [
8143
+ !_ctx.realmId && !_ctx.isEditing ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
8031
8144
  createVNode(_component_IVuelidate, {
8032
8145
  validation: _ctx.vuelidate.invert
8033
8146
  }, {
@@ -8062,14 +8175,14 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
8062
8175
  ])) : createCommentVNode("", true)
8063
8176
  ]);
8064
8177
  }
8065
- var APolicyBasicForm = /* @__PURE__ */ _export_sfc(_sfc_main$1, [
8178
+ var APolicyBasicForm = /* @__PURE__ */ _export_sfc(_sfc_main$7, [
8066
8179
  [
8067
8180
  "render",
8068
- _sfc_render$1
8181
+ _sfc_render$6
8069
8182
  ]
8070
8183
  ]);
8071
8184
 
8072
- var _sfc_main = defineComponent({
8185
+ var _sfc_main$6 = defineComponent({
8073
8186
  components: {
8074
8187
  AFormSubmit,
8075
8188
  APolicyTypePicker,
@@ -8145,13 +8258,13 @@ var _sfc_main = defineComponent({
8145
8258
  }
8146
8259
  });
8147
8260
 
8148
- const _hoisted_1 = {
8261
+ const _hoisted_1$5 = {
8149
8262
  class: "d-flex flex-column"
8150
8263
  };
8151
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8264
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
8152
8265
  const _component_APolicyBasicForm = resolveComponent("APolicyBasicForm");
8153
8266
  const _component_AFormSubmit = resolveComponent("AFormSubmit");
8154
- return openBlock(), createElementBlock("div", _hoisted_1, [
8267
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
8155
8268
  _cache[0] || (_cache[0] = createElementVNode("h6", null, "General", -1)),
8156
8269
  createVNode(_component_APolicyBasicForm, {
8157
8270
  entity: _ctx.data
@@ -8184,10 +8297,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
8184
8297
  ])
8185
8298
  ]);
8186
8299
  }
8187
- var APolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main, [
8300
+ var APolicyForm = /* @__PURE__ */ _export_sfc(_sfc_main$6, [
8188
8301
  [
8189
8302
  "render",
8190
- _sfc_render
8303
+ _sfc_render$5
8191
8304
  ]
8192
8305
  ]);
8193
8306
 
@@ -9444,6 +9557,11 @@ function install(app, options) {
9444
9557
  cookieGet: options.cookieGet,
9445
9558
  cookieUnset: options.cookieUnset
9446
9559
  });
9560
+ installHTTPClientAuthenticationHook(app, {
9561
+ pinia: options.pinia,
9562
+ baseURL: options.baseURL,
9563
+ isServer: options.isServer
9564
+ });
9447
9565
  installHTTPClient(app, {
9448
9566
  pinia: options.pinia,
9449
9567
  baseURL: options.baseURL,
@@ -9453,11 +9571,769 @@ function install(app, options) {
9453
9571
  locale: options.translatorLocale
9454
9572
  });
9455
9573
  installComponents(app, options.components);
9574
+ installStoreManager(app);
9575
+ app.use(installFormControl);
9576
+ app.use(installPagination);
9456
9577
  }
9457
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
+
9458
10334
  var index = {
9459
10335
  install
9460
10336
  };
9461
10337
 
9462
- 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, hasNormalizedSlot, hasStoreFactory, inject$1 as inject, injectHTTPClient, injectSocketManager, injectStore, injectStoreDispatcher, injectStoreFactory, injectTranslatorLocale, install, installHTTPClient, installSocketManager, installStore, installTranslator, isQuerySortedDescByDate, isSocketManagerUsable, mergeEntityCollectionRenderOptions, normalizeSlot, onChange, provide, provideHTTPClient, 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 };
9463
10339
  //# sourceMappingURL=index.mjs.map