@arsedizioni/ars-utils 22.6.86 → 22.6.89

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 (79) hide show
  1. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +3158 -3344
  2. package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
  3. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +7616 -4772
  4. package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
  5. package/fesm2022/arsedizioni-ars-utils-core.date.mjs +321 -702
  6. package/fesm2022/arsedizioni-ars-utils-core.date.mjs.map +1 -1
  7. package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs +445 -590
  8. package/fesm2022/arsedizioni-ars-utils-core.markdown.mjs.map +1 -1
  9. package/fesm2022/arsedizioni-ars-utils-core.mjs +1735 -2370
  10. package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
  11. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs +1280 -1470
  12. package/fesm2022/arsedizioni-ars-utils-core.validators.mjs.map +1 -1
  13. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs +1097 -1528
  14. package/fesm2022/arsedizioni-ars-utils-evolution.common.mjs.map +1 -1
  15. package/fesm2022/arsedizioni-ars-utils-support.common.mjs +198 -294
  16. package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
  17. package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs +115 -117
  18. package/fesm2022/arsedizioni-ars-utils-ui.controls.date.mjs.map +1 -1
  19. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs +1607 -613
  20. package/fesm2022/arsedizioni-ars-utils-ui.controls.mjs.map +1 -1
  21. package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs +840 -367
  22. package/fesm2022/arsedizioni-ars-utils-ui.controls.tree.mjs.map +1 -1
  23. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs +1634 -651
  24. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.auth.mjs.map +1 -1
  25. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs +1255 -792
  26. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.mjs.map +1 -1
  27. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs +1410 -357
  28. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.prompt.mjs.map +1 -1
  29. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs +2401 -944
  30. package/fesm2022/arsedizioni-ars-utils-ui.dialogs.select.mjs.map +1 -1
  31. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs +1553 -741
  32. package/fesm2022/arsedizioni-ars-utils-ui.files.mjs.map +1 -1
  33. package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs +901 -430
  34. package/fesm2022/arsedizioni-ars-utils-ui.filters.mjs.map +1 -1
  35. package/fesm2022/arsedizioni-ars-utils-ui.help.mjs +737 -530
  36. package/fesm2022/arsedizioni-ars-utils-ui.help.mjs.map +1 -1
  37. package/fesm2022/arsedizioni-ars-utils-ui.mjs +6638 -1755
  38. package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
  39. package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs +1479 -1207
  40. package/fesm2022/arsedizioni-ars-utils-ui.navigation.mjs.map +1 -1
  41. package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs +1003 -270
  42. package/fesm2022/arsedizioni-ars-utils-ui.notifications.mjs.map +1 -1
  43. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +497 -278
  44. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
  45. package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs +48 -52
  46. package/fesm2022/arsedizioni-ars-utils-ui.paginator.mjs.map +1 -1
  47. package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs +464 -704
  48. package/fesm2022/arsedizioni-ars-utils-ui.shell.mjs.map +1 -1
  49. package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs +724 -657
  50. package/fesm2022/arsedizioni-ars-utils-ui.tinymce.mjs.map +1 -1
  51. package/fesm2022/arsedizioni-ars-utils.mjs +3 -19
  52. package/fesm2022/arsedizioni-ars-utils.mjs.map +1 -1
  53. package/package.json +1 -1
  54. package/types/arsedizioni-ars-utils-clipper.common.d.ts +1151 -1163
  55. package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1588 -1426
  56. package/types/arsedizioni-ars-utils-core.d.ts +1169 -1172
  57. package/types/arsedizioni-ars-utils-core.date.d.ts +204 -208
  58. package/types/arsedizioni-ars-utils-core.markdown.d.ts +128 -126
  59. package/types/arsedizioni-ars-utils-core.validators.d.ts +270 -236
  60. package/types/arsedizioni-ars-utils-evolution.common.d.ts +1054 -1067
  61. package/types/arsedizioni-ars-utils-support.common.d.ts +225 -234
  62. package/types/arsedizioni-ars-utils-ui.controls.d.ts +440 -278
  63. package/types/arsedizioni-ars-utils-ui.controls.date.d.ts +24 -28
  64. package/types/arsedizioni-ars-utils-ui.controls.tree.d.ts +172 -136
  65. package/types/arsedizioni-ars-utils-ui.d.ts +2035 -821
  66. package/types/arsedizioni-ars-utils-ui.dialogs.auth.d.ts +327 -322
  67. package/types/arsedizioni-ars-utils-ui.dialogs.d.ts +343 -347
  68. package/types/arsedizioni-ars-utils-ui.dialogs.prompt.d.ts +167 -167
  69. package/types/arsedizioni-ars-utils-ui.dialogs.select.d.ts +373 -367
  70. package/types/arsedizioni-ars-utils-ui.files.d.ts +335 -283
  71. package/types/arsedizioni-ars-utils-ui.filters.d.ts +232 -160
  72. package/types/arsedizioni-ars-utils-ui.help.d.ts +204 -211
  73. package/types/arsedizioni-ars-utils-ui.navigation.d.ts +811 -646
  74. package/types/arsedizioni-ars-utils-ui.notifications.d.ts +74 -78
  75. package/types/arsedizioni-ars-utils-ui.oauth.d.ts +102 -62
  76. package/types/arsedizioni-ars-utils-ui.paginator.d.ts +19 -22
  77. package/types/arsedizioni-ars-utils-ui.shell.d.ts +376 -382
  78. package/types/arsedizioni-ars-utils-ui.tinymce.d.ts +244 -231
  79. package/types/arsedizioni-ars-utils.d.ts +1 -3
@@ -1,288 +1,507 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, NgZone, output, input, signal, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import * as i1 from '@angular/material/button';
5
- import { MatButtonModule } from '@angular/material/button';
6
- import { LoginOAuthType, EnvironmentService } from '@arsedizioni/ars-utils/core';
7
- import { DialogService } from '@arsedizioni/ars-utils/ui.dialogs';
8
- import { MsalBroadcastService, MsalService, MSAL_INSTANCE, MSAL_GUARD_CONFIG, MSAL_INTERCEPTOR_CONFIG } from '@azure/msal-angular';
9
- import { PublicClientApplication, BrowserCacheLocation, InteractionType, EventType } from '@azure/msal-browser';
10
- import { filter } from 'rxjs';
11
- import { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';
12
- import * as i1$1 from '@arsedizioni/ars-utils/ui';
13
- import { FlexLayoutModule } from '@arsedizioni/ars-utils/ui';
14
- import * as i2 from '@angular/material/progress-bar';
15
- import { MatProgressBarModule } from '@angular/material/progress-bar';
16
-
17
- /** Default Azure app registration — overridable via EnvironmentService. */
18
- const DEFAULT_MS_CLIENT_ID = '6b2c080f-6ab0-4511-a9df-0bce69db5833';
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, NgZone, afterNextRender, inject, input, output, signal } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import * as i1$1 from "@angular/material/button";
5
+ import { MatButtonModule } from "@angular/material/button";
6
+ import { EnvironmentService, LoginOAuthType } from "@arsedizioni/ars-utils/core";
7
+ import { DialogService } from "@arsedizioni/ars-utils/ui.dialogs";
8
+ import { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalService } from "@azure/msal-angular";
9
+ import { BrowserCacheLocation, EventType, InteractionType, PublicClientApplication } from "@azure/msal-browser";
10
+ import { filter } from "rxjs";
11
+ import { broadcastResponseToMainFrame } from "@azure/msal-browser/redirect-bridge";
12
+ import * as i1 from "@arsedizioni/ars-utils/ui";
13
+ import { FlexLayoutModule } from "@arsedizioni/ars-utils/ui";
14
+ import * as i2 from "@angular/material/progress-bar";
15
+ import { MatProgressBarModule } from "@angular/material/progress-bar";
16
+ const DEFAULT_MS_CLIENT_ID = "6b2c080f-6ab0-4511-a9df-0bce69db5833";
19
17
  const MS_AUTH_SCOPE = `api://${DEFAULT_MS_CLIENT_ID}/AngularSPAAuthScope`;
20
18
  function MSALInstanceFactory(environment) {
21
- return new PublicClientApplication({
22
- auth: {
23
- clientId: environment.msalClientId ?? DEFAULT_MS_CLIENT_ID,
24
- authority: environment.msalAuthority ?? 'https://login.microsoftonline.com/common',
25
- redirectUri: environment.appLoginRedirectUri,
26
- },
27
- cache: {
28
- cacheLocation: BrowserCacheLocation.LocalStorage
29
- }
30
- });
19
+ return new PublicClientApplication({
20
+ auth: {
21
+ clientId: environment.msalClientId ?? DEFAULT_MS_CLIENT_ID,
22
+ authority: environment.msalAuthority ?? "https://login.microsoftonline.com/common",
23
+ redirectUri: environment.appLoginRedirectUri
24
+ },
25
+ cache: { cacheLocation: BrowserCacheLocation.LocalStorage }
26
+ });
31
27
  }
32
28
  function MSALInterceptorConfigFactory(environment) {
33
- return {
34
- interactionType: InteractionType.Popup,
35
- protectedResourceMap: new Map([
36
- [environment.appServiceLoginUri, [MS_AUTH_SCOPE]],
37
- ["https://graph.microsoft.com/v2.0/me", ["user.read"]],
38
- ])
39
- };
29
+ return {
30
+ interactionType: InteractionType.Popup,
31
+ protectedResourceMap: /* @__PURE__ */ new Map([[environment.appServiceLoginUri, [MS_AUTH_SCOPE]], ["https://graph.microsoft.com/v2.0/me", ["user.read"]]])
32
+ };
40
33
  }
41
34
  function MSALGuardConfigFactory() {
42
- return {
43
- interactionType: InteractionType.Popup,
44
- authRequest: {
45
- scopes: ["user.read"]
46
- }
47
- };
48
- }
49
- class LoginOAuthComponent {
50
- constructor() {
51
- this.destroyRef = inject(DestroyRef);
52
- this.msalBroadcastService = inject(MsalBroadcastService);
53
- this.msaLService = inject(MsalService);
54
- this.dialogService = inject(DialogService);
55
- this.ngZone = inject(NgZone);
56
- /** Emitted when OAuth authentication succeeds. */
57
- this.success = output();
58
- /** Whether to show the introductory info panel. */
59
- this.showInfo = input(true, /* @ts-ignore */
60
- ...(ngDevMode ? [{ debugName: "showInfo" }] : /* istanbul ignore next */ []));
61
- /** Application name displayed in the info panel. */
62
- this.applicationName = input(/* @ts-ignore */
63
- ...(ngDevMode ? [undefined, { debugName: "applicationName" }] : /* istanbul ignore next */ []));
64
- /** Whether to trigger `initialize()` automatically on mount. */
65
- this.autoInitialize = input(false, /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "autoInitialize" }] : /* istanbul ignore next */ []));
67
- /** Whether the Microsoft login button is shown. */
68
- this.allowMicrosoft = input(true, /* @ts-ignore */
69
- ...(ngDevMode ? [{ debugName: "allowMicrosoft" }] : /* istanbul ignore next */ []));
70
- /** Whether the Google login button is shown. */
71
- this.allowGoogle = input(true, /* @ts-ignore */
72
- ...(ngDevMode ? [{ debugName: "allowGoogle" }] : /* istanbul ignore next */ []));
73
- /** Google OAuth client id. Override per deployment. */
74
- this.googleClientId = input('71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com', /* @ts-ignore */
75
- ...(ngDevMode ? [{ debugName: "googleClientId" }] : /* istanbul ignore next */ []));
76
- /** MSAL access-token scope requested after login. */
77
- this.msalScope = input(MS_AUTH_SCOPE, /* @ts-ignore */
78
- ...(ngDevMode ? [{ debugName: "msalScope" }] : /* istanbul ignore next */ []));
79
- this.oauthReady = signal(false, /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "oauthReady" }] : /* istanbul ignore next */ []));
81
- this.oauthMicrosoftReady = signal(false, /* @ts-ignore */
82
- ...(ngDevMode ? [{ debugName: "oauthMicrosoftReady" }] : /* istanbul ignore next */ []));
83
- this.oauthGoogleReady = signal(false, /* @ts-ignore */
84
- ...(ngDevMode ? [{ debugName: "oauthGoogleReady" }] : /* istanbul ignore next */ []));
85
- this.msalBroadcastService.msalSubject$
86
- .pipe(filter((msg) => msg.eventType === EventType.LOGOUT_FAILURE ||
87
- msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE), takeUntilDestroyed(this.destroyRef))
88
- .subscribe((r) => {
89
- if (r?.payload) {
90
- const error = r.payload;
91
- this.dialogService.error(error?.message ?? 'Errore di autenticazione Microsoft');
92
- }
93
- });
94
- afterNextRender(() => {
95
- if (this.autoInitialize()) {
96
- this.initialize();
97
- }
98
- });
99
- }
100
- /**
101
- * Initialize OAuth providers (Microsoft MSAL and Google GSI).
102
- * Safe to call multiple times — already-initialized providers are skipped.
103
- * Must be public so the host component can trigger it manually when `autoInitialize` is false.
104
- */
105
- initialize() {
106
- this.oauthReady.set(true);
107
- // Initialize the Microsoft stack only when allowed and not already done.
108
- if (this.allowMicrosoft() && !this.oauthMicrosoftReady()) {
109
- this.msaLService.initialize()
110
- .pipe(takeUntilDestroyed(this.destroyRef))
111
- .subscribe({
112
- next: () => this.oauthMicrosoftReady.set(true),
113
- error: (error) => this.dialogService.error(error?.message ?? 'Errore di inizializzazione Microsoft'),
114
- });
115
- }
116
- // Load the Google GSI script only when allowed and not already done.
117
- if (this.allowGoogle() && !this.oauthGoogleReady()) {
118
- // @ts-ignore — define the callback BEFORE the script loads so GSI can find it
119
- window.onGoogleLibraryLoad = () => {
120
- // @ts-ignore
121
- google.accounts.id.initialize({
122
- client_id: this.googleClientId(),
123
- cancel_on_tap_outside: true,
124
- auto_select: false,
125
- callback: (r) => {
126
- this.ngZone.run(() => {
127
- this.success.emit({ type: LoginOAuthType.Google, token: r.credential });
128
- });
129
- }
130
- });
131
- this.googleButtonWrapper = createFakeGoogleWrapper();
132
- this.ngZone.run(() => this.oauthGoogleReady.set(true));
133
- };
134
- // Reuse the script tag if a previous instance already added it.
135
- const existing = document.querySelector('script[data-gsi="ars"]');
136
- if (existing) {
137
- // @ts-ignore — library already present: run the callback directly
138
- if (window.google?.accounts?.id)
139
- window.onGoogleLibraryLoad();
140
- }
141
- else {
142
- const script = document.createElement('script');
143
- script.src = 'https://accounts.google.com/gsi/client';
144
- script.async = true;
145
- script.defer = true;
146
- script.dataset['gsi'] = 'ars';
147
- script.onerror = () => this.ngZone.run(() => this.dialogService.error('Impossibile caricare il servizio di accesso Google.'));
148
- // Append and LEAVE it in the DOM so the browser actually fetches it.
149
- document.body.appendChild(script);
150
- }
151
- }
152
- }
153
- /**
154
- * Trigger a Microsoft (MSAL) login popup and acquire an access token on success.
155
- */
156
- loginMSAL() {
157
- // Clear any in-progress interaction flag that may have been left by a previous incomplete popup
158
- sessionStorage.removeItem('msal.interaction.status');
159
- this.msaLService.loginPopup()
160
- .pipe(takeUntilDestroyed(this.destroyRef))
161
- .subscribe({
162
- next: (r) => {
163
- try {
164
- this.msaLService.instance.setActiveAccount(r.account);
165
- this.msaLService.acquireTokenSilent({
166
- scopes: [this.msalScope()],
167
- account: r.account
168
- }).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
169
- next: (tokenResult) => {
170
- this.success.emit({ type: LoginOAuthType.Microsoft, token: tokenResult.accessToken });
171
- },
172
- error: (error) => {
173
- this.dialogService.error(error.message);
174
- }
175
- });
176
- }
177
- catch (error) {
178
- this.dialogService.error(error.message);
179
- }
180
- },
181
- error: (error) => {
182
- this.dialogService.error(error.message);
183
- }
184
- });
185
- }
186
- /**
187
- * Trigger the hidden Google GSI button to open the Google sign-in flow.
188
- */
189
- loginGoogle() {
190
- // Use the wrapper click to avoid an "Illegal invocation" exception.
191
- // Guard: the button only exists once the GSI library has loaded.
192
- if (!this.googleButtonWrapper) {
193
- this.dialogService.error('Il servizio di accesso Google non è ancora pronto.');
194
- return;
195
- }
196
- this.googleButtonWrapper.click();
197
- }
198
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LoginOAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
199
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: LoginOAuthComponent, isStandalone: true, selector: "login-oauth", inputs: { showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, applicationName: { classPropertyName: "applicationName", publicName: "applicationName", isSignal: true, isRequired: false, transformFunction: null }, autoInitialize: { classPropertyName: "autoInitialize", publicName: "autoInitialize", isSignal: true, isRequired: false, transformFunction: null }, allowMicrosoft: { classPropertyName: "allowMicrosoft", publicName: "allowMicrosoft", isSignal: true, isRequired: false, transformFunction: null }, allowGoogle: { classPropertyName: "allowGoogle", publicName: "allowGoogle", isSignal: true, isRequired: false, transformFunction: null }, googleClientId: { classPropertyName: "googleClientId", publicName: "googleClientId", isSignal: true, isRequired: false, transformFunction: null }, msalScope: { classPropertyName: "msalScope", publicName: "msalScope", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { success: "success" }, providers: [
200
- {
201
- provide: MSAL_INSTANCE,
202
- deps: [EnvironmentService],
203
- useFactory: MSALInstanceFactory
204
- },
205
- {
206
- provide: MSAL_GUARD_CONFIG,
207
- useFactory: MSALGuardConfigFactory
208
- },
209
- {
210
- provide: MSAL_INTERCEPTOR_CONFIG,
211
- deps: [EnvironmentService],
212
- useFactory: MSALInterceptorConfigFactory
213
- },
214
- MsalService,
215
- MsalBroadcastService
216
- ], ngImport: i0, template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
35
+ return {
36
+ interactionType: InteractionType.Popup,
37
+ authRequest: { scopes: ["user.read"] }
38
+ };
217
39
  }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LoginOAuthComponent, decorators: [{
219
- type: Component,
220
- args: [{ selector: 'login-oauth', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
221
- {
222
- provide: MSAL_INSTANCE,
223
- deps: [EnvironmentService],
224
- useFactory: MSALInstanceFactory
225
- },
226
- {
227
- provide: MSAL_GUARD_CONFIG,
228
- useFactory: MSALGuardConfigFactory
229
- },
230
- {
231
- provide: MSAL_INTERCEPTOR_CONFIG,
232
- deps: [EnvironmentService],
233
- useFactory: MSALInterceptorConfigFactory
234
- },
235
- MsalService,
236
- MsalBroadcastService
237
- ], imports: [
238
- MatButtonModule
239
- ], template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"] }]
240
- }], ctorParameters: () => [], propDecorators: { success: [{ type: i0.Output, args: ["success"] }], showInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInfo", required: false }] }], applicationName: [{ type: i0.Input, args: [{ isSignal: true, alias: "applicationName", required: false }] }], autoInitialize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoInitialize", required: false }] }], allowMicrosoft: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMicrosoft", required: false }] }], allowGoogle: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowGoogle", required: false }] }], googleClientId: [{ type: i0.Input, args: [{ isSignal: true, alias: "googleClientId", required: false }] }], msalScope: [{ type: i0.Input, args: [{ isSignal: true, alias: "msalScope", required: false }] }] } });
40
+ var LoginOAuthComponent = class LoginOAuthComponent {
41
+ constructor() {
42
+ this.destroyRef = inject(DestroyRef);
43
+ this.msalBroadcastService = inject(MsalBroadcastService);
44
+ this.msaLService = inject(MsalService);
45
+ this.dialogService = inject(DialogService);
46
+ this.ngZone = inject(NgZone);
47
+ this.success = output();
48
+ this.showInfo = input(true, ...ngDevMode ? [{ debugName: "showInfo" }] : /* istanbul ignore next */ []);
49
+ this.applicationName = input(...ngDevMode ? [void 0, { debugName: "applicationName" }] : /* istanbul ignore next */ []);
50
+ this.autoInitialize = input(false, ...ngDevMode ? [{ debugName: "autoInitialize" }] : /* istanbul ignore next */ []);
51
+ this.allowMicrosoft = input(true, ...ngDevMode ? [{ debugName: "allowMicrosoft" }] : /* istanbul ignore next */ []);
52
+ this.allowGoogle = input(true, ...ngDevMode ? [{ debugName: "allowGoogle" }] : /* istanbul ignore next */ []);
53
+ this.googleClientId = input("71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com", ...ngDevMode ? [{ debugName: "googleClientId" }] : /* istanbul ignore next */ []);
54
+ this.msalScope = input(MS_AUTH_SCOPE, ...ngDevMode ? [{ debugName: "msalScope" }] : /* istanbul ignore next */ []);
55
+ this.oauthReady = signal(false, ...ngDevMode ? [{ debugName: "oauthReady" }] : /* istanbul ignore next */ []);
56
+ this.oauthMicrosoftReady = signal(false, ...ngDevMode ? [{ debugName: "oauthMicrosoftReady" }] : /* istanbul ignore next */ []);
57
+ this.oauthGoogleReady = signal(false, ...ngDevMode ? [{ debugName: "oauthGoogleReady" }] : /* istanbul ignore next */ []);
58
+ this.msalBroadcastService.msalSubject$.pipe(filter((msg) => msg.eventType === EventType.LOGOUT_FAILURE || msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE), takeUntilDestroyed(this.destroyRef)).subscribe((r) => {
59
+ if (r?.payload) {
60
+ const error = r.payload;
61
+ this.dialogService.error(error?.message ?? "Errore di autenticazione Microsoft");
62
+ }
63
+ });
64
+ afterNextRender(() => {
65
+ if (this.autoInitialize()) this.initialize();
66
+ });
67
+ }
68
+ initialize() {
69
+ this.oauthReady.set(true);
70
+ if (this.allowMicrosoft() && !this.oauthMicrosoftReady()) this.msaLService.initialize().pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
71
+ next: () => this.oauthMicrosoftReady.set(true),
72
+ error: (error) => this.dialogService.error(error?.message ?? "Errore di inizializzazione Microsoft")
73
+ });
74
+ if (this.allowGoogle() && !this.oauthGoogleReady()) {
75
+ window.onGoogleLibraryLoad = () => {
76
+ google.accounts.id.initialize({
77
+ client_id: this.googleClientId(),
78
+ cancel_on_tap_outside: true,
79
+ auto_select: false,
80
+ callback: (r) => {
81
+ this.ngZone.run(() => {
82
+ this.success.emit({
83
+ type: LoginOAuthType.Google,
84
+ token: r.credential
85
+ });
86
+ });
87
+ }
88
+ });
89
+ this.googleButtonWrapper = createFakeGoogleWrapper();
90
+ this.ngZone.run(() => this.oauthGoogleReady.set(true));
91
+ };
92
+ if (document.querySelector("script[data-gsi=\"ars\"]")) {
93
+ if (window.google?.accounts?.id) window.onGoogleLibraryLoad();
94
+ } else {
95
+ const script = document.createElement("script");
96
+ script.src = "https://accounts.google.com/gsi/client";
97
+ script.async = true;
98
+ script.defer = true;
99
+ script.dataset["gsi"] = "ars";
100
+ script.onerror = () => this.ngZone.run(() => this.dialogService.error("Impossibile caricare il servizio di accesso Google."));
101
+ document.body.appendChild(script);
102
+ }
103
+ }
104
+ }
105
+ loginMSAL() {
106
+ sessionStorage.removeItem("msal.interaction.status");
107
+ this.msaLService.loginPopup().pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
108
+ next: (r) => {
109
+ try {
110
+ this.msaLService.instance.setActiveAccount(r.account);
111
+ this.msaLService.acquireTokenSilent({
112
+ scopes: [this.msalScope()],
113
+ account: r.account
114
+ }).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
115
+ next: (tokenResult) => {
116
+ this.success.emit({
117
+ type: LoginOAuthType.Microsoft,
118
+ token: tokenResult.accessToken
119
+ });
120
+ },
121
+ error: (error) => {
122
+ this.dialogService.error(error.message);
123
+ }
124
+ });
125
+ } catch (error) {
126
+ this.dialogService.error(error.message);
127
+ }
128
+ },
129
+ error: (error) => {
130
+ this.dialogService.error(error.message);
131
+ }
132
+ });
133
+ }
134
+ loginGoogle() {
135
+ if (!this.googleButtonWrapper) {
136
+ this.dialogService.error("Il servizio di accesso Google non è ancora pronto.");
137
+ return;
138
+ }
139
+ this.googleButtonWrapper.click();
140
+ }
141
+ static {
142
+ this.ɵfac = i0.ɵɵngDeclareFactory({
143
+ minVersion: "12.0.0",
144
+ version: "22.2.1",
145
+ ngImport: i0,
146
+ type: LoginOAuthComponent,
147
+ deps: [],
148
+ target: i0.ɵɵFactoryTarget.Component
149
+ });
150
+ }
151
+ static {
152
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
153
+ minVersion: "17.0.0",
154
+ version: "22.2.1",
155
+ type: LoginOAuthComponent,
156
+ isStandalone: true,
157
+ selector: "login-oauth",
158
+ inputs: {
159
+ showInfo: {
160
+ classPropertyName: "showInfo",
161
+ publicName: "showInfo",
162
+ isSignal: true,
163
+ isRequired: false,
164
+ transformFunction: null
165
+ },
166
+ applicationName: {
167
+ classPropertyName: "applicationName",
168
+ publicName: "applicationName",
169
+ isSignal: true,
170
+ isRequired: false,
171
+ transformFunction: null
172
+ },
173
+ autoInitialize: {
174
+ classPropertyName: "autoInitialize",
175
+ publicName: "autoInitialize",
176
+ isSignal: true,
177
+ isRequired: false,
178
+ transformFunction: null
179
+ },
180
+ allowMicrosoft: {
181
+ classPropertyName: "allowMicrosoft",
182
+ publicName: "allowMicrosoft",
183
+ isSignal: true,
184
+ isRequired: false,
185
+ transformFunction: null
186
+ },
187
+ allowGoogle: {
188
+ classPropertyName: "allowGoogle",
189
+ publicName: "allowGoogle",
190
+ isSignal: true,
191
+ isRequired: false,
192
+ transformFunction: null
193
+ },
194
+ googleClientId: {
195
+ classPropertyName: "googleClientId",
196
+ publicName: "googleClientId",
197
+ isSignal: true,
198
+ isRequired: false,
199
+ transformFunction: null
200
+ },
201
+ msalScope: {
202
+ classPropertyName: "msalScope",
203
+ publicName: "msalScope",
204
+ isSignal: true,
205
+ isRequired: false,
206
+ transformFunction: null
207
+ }
208
+ },
209
+ outputs: { success: "success" },
210
+ providers: [
211
+ {
212
+ provide: MSAL_INSTANCE,
213
+ deps: [EnvironmentService],
214
+ useFactory: MSALInstanceFactory
215
+ },
216
+ {
217
+ provide: MSAL_GUARD_CONFIG,
218
+ useFactory: MSALGuardConfigFactory
219
+ },
220
+ {
221
+ provide: MSAL_INTERCEPTOR_CONFIG,
222
+ deps: [EnvironmentService],
223
+ useFactory: MSALInterceptorConfigFactory
224
+ },
225
+ MsalService,
226
+ MsalBroadcastService
227
+ ],
228
+ ngImport: i0,
229
+ template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n",
230
+ styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"],
231
+ dependencies: [{
232
+ kind: "ngmodule",
233
+ type: MatButtonModule
234
+ }, {
235
+ kind: "component",
236
+ type: i1$1.MatButton,
237
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
238
+ inputs: ["matButton"],
239
+ exportAs: ["matButton", "matAnchor"]
240
+ }],
241
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
242
+ });
243
+ }
244
+ };
245
+ i0.ɵɵngDeclareClassMetadata({
246
+ minVersion: "12.0.0",
247
+ version: "22.2.1",
248
+ ngImport: i0,
249
+ type: LoginOAuthComponent,
250
+ decorators: [{
251
+ type: Component,
252
+ args: [{
253
+ selector: "login-oauth",
254
+ standalone: true,
255
+ changeDetection: ChangeDetectionStrategy.OnPush,
256
+ providers: [
257
+ {
258
+ provide: MSAL_INSTANCE,
259
+ deps: [EnvironmentService],
260
+ useFactory: MSALInstanceFactory
261
+ },
262
+ {
263
+ provide: MSAL_GUARD_CONFIG,
264
+ useFactory: MSALGuardConfigFactory
265
+ },
266
+ {
267
+ provide: MSAL_INTERCEPTOR_CONFIG,
268
+ deps: [EnvironmentService],
269
+ useFactory: MSALInterceptorConfigFactory
270
+ },
271
+ MsalService,
272
+ MsalBroadcastService
273
+ ],
274
+ imports: [MatButtonModule],
275
+ template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n",
276
+ styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"]
277
+ }]
278
+ }],
279
+ ctorParameters: () => [],
280
+ propDecorators: {
281
+ success: [{
282
+ type: i0.Output,
283
+ args: ["success"]
284
+ }],
285
+ showInfo: [{
286
+ type: i0.Input,
287
+ args: [{
288
+ isSignal: true,
289
+ alias: "showInfo",
290
+ required: false
291
+ }]
292
+ }],
293
+ applicationName: [{
294
+ type: i0.Input,
295
+ args: [{
296
+ isSignal: true,
297
+ alias: "applicationName",
298
+ required: false
299
+ }]
300
+ }],
301
+ autoInitialize: [{
302
+ type: i0.Input,
303
+ args: [{
304
+ isSignal: true,
305
+ alias: "autoInitialize",
306
+ required: false
307
+ }]
308
+ }],
309
+ allowMicrosoft: [{
310
+ type: i0.Input,
311
+ args: [{
312
+ isSignal: true,
313
+ alias: "allowMicrosoft",
314
+ required: false
315
+ }]
316
+ }],
317
+ allowGoogle: [{
318
+ type: i0.Input,
319
+ args: [{
320
+ isSignal: true,
321
+ alias: "allowGoogle",
322
+ required: false
323
+ }]
324
+ }],
325
+ googleClientId: [{
326
+ type: i0.Input,
327
+ args: [{
328
+ isSignal: true,
329
+ alias: "googleClientId",
330
+ required: false
331
+ }]
332
+ }],
333
+ msalScope: [{
334
+ type: i0.Input,
335
+ args: [{
336
+ isSignal: true,
337
+ alias: "msalScope",
338
+ required: false
339
+ }]
340
+ }]
341
+ }
342
+ });
241
343
  const createFakeGoogleWrapper = () => {
242
- const googleLoginWrapper = document.createElement("div");
243
- googleLoginWrapper.style.display = "none";
244
- googleLoginWrapper.classList.add("custom-google-button");
245
- document.body.appendChild(googleLoginWrapper);
246
- // Render the (invisible) GSI button inside our wrapper.
247
- // @ts-ignore
248
- window.google.accounts.id.renderButton(googleLoginWrapper, {
249
- type: "icon",
250
- width: "200",
251
- });
252
- const googleLoginWrapperButton = googleLoginWrapper.querySelector("div[role=button]");
253
- return {
254
- click: () => googleLoginWrapperButton?.click(),
255
- };
344
+ const googleLoginWrapper = document.createElement("div");
345
+ googleLoginWrapper.style.display = "none";
346
+ googleLoginWrapper.classList.add("custom-google-button");
347
+ document.body.appendChild(googleLoginWrapper);
348
+ window.google.accounts.id.renderButton(googleLoginWrapper, {
349
+ type: "icon",
350
+ width: "200"
351
+ });
352
+ const googleLoginWrapperButton = googleLoginWrapper.querySelector("div[role=button]");
353
+ return { click: () => googleLoginWrapperButton?.click() };
256
354
  };
257
-
258
- class LoginOAuthOkMSComponent {
259
- constructor() {
260
- /** Message displayed while the popup is completing authentication. */
261
- this.message = input('Accesso in corso...', /* @ts-ignore */
262
- ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
263
- // MSAL v5 popup flow: parse the auth response from the URL and send
264
- // it back to the opener window via BroadcastChannel, then close the popup.
265
- // The promise can reject (e.g. COOP misconfiguration); log instead of
266
- // leaving an unhandled rejection that silently strands the popup.
267
- broadcastResponseToMainFrame().catch((error) => {
268
- console.error('Errore durante la comunicazione della risposta di autenticazione:', error);
269
- });
270
- }
271
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LoginOAuthOkMSComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
272
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: LoginOAuthOkMSComponent, isStandalone: true, selector: "app-login-oauth-ok-ms", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" ></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"], dependencies: [{ kind: "ngmodule", type: FlexLayoutModule }, { kind: "directive", type: i1$1.FxLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg] ", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$1.FxLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg] ", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1$1.FxFlexFillDirective, selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg] ", inputs: ["fxFlexFill", "fxFill", "fxFlexFill.xs", "fxFlexFill.sm", "fxFlexFill.md", "fxFlexFill.lg", "fxFlexFill.xl", "fxFlexFill.lt-sm", "fxFlexFill.lt-md", "fxFlexFill.lt-lg", "fxFlexFill.lt-xl", "fxFlexFill.gt-xs", "fxFlexFill.gt-sm", "fxFlexFill.gt-md", "fxFlexFill.gt-lg"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
273
- }
274
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LoginOAuthOkMSComponent, decorators: [{
275
- type: Component,
276
- args: [{ selector: 'app-login-oauth-ok-ms', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FlexLayoutModule, MatProgressBarModule], template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" ></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"] }]
277
- }], ctorParameters: () => [], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
278
-
279
- /*
280
- * Public API Surface of @arsedizioni/ars-utils/ui.oauth
281
- */
282
-
283
- /**
284
- * Generated bundle index. Do not edit.
285
- */
286
-
355
+ var LoginOAuthOkMSComponent = class LoginOAuthOkMSComponent {
356
+ constructor() {
357
+ this.message = input("Accesso in corso...", ...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
358
+ broadcastResponseToMainFrame().catch((error) => {
359
+ console.error("Errore durante la comunicazione della risposta di autenticazione:", error);
360
+ });
361
+ }
362
+ static {
363
+ this.ɵfac = i0.ɵɵngDeclareFactory({
364
+ minVersion: "12.0.0",
365
+ version: "22.2.1",
366
+ ngImport: i0,
367
+ type: LoginOAuthOkMSComponent,
368
+ deps: [],
369
+ target: i0.ɵɵFactoryTarget.Component
370
+ });
371
+ }
372
+ static {
373
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
374
+ minVersion: "17.1.0",
375
+ version: "22.2.1",
376
+ type: LoginOAuthOkMSComponent,
377
+ isStandalone: true,
378
+ selector: "app-login-oauth-ok-ms",
379
+ inputs: { message: {
380
+ classPropertyName: "message",
381
+ publicName: "message",
382
+ isSignal: true,
383
+ isRequired: false,
384
+ transformFunction: null
385
+ } },
386
+ ngImport: i0,
387
+ template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" ></mat-progress-bar>\r\n </div>\r\n</div>\r\n",
388
+ styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"],
389
+ dependencies: [
390
+ {
391
+ kind: "ngmodule",
392
+ type: FlexLayoutModule
393
+ },
394
+ {
395
+ kind: "directive",
396
+ type: i1.FxLayoutDirective,
397
+ selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg] ",
398
+ inputs: [
399
+ "fxLayout",
400
+ "fxLayout.xs",
401
+ "fxLayout.sm",
402
+ "fxLayout.md",
403
+ "fxLayout.lg",
404
+ "fxLayout.xl",
405
+ "fxLayout.lt-sm",
406
+ "fxLayout.lt-md",
407
+ "fxLayout.lt-lg",
408
+ "fxLayout.lt-xl",
409
+ "fxLayout.gt-xs",
410
+ "fxLayout.gt-sm",
411
+ "fxLayout.gt-md",
412
+ "fxLayout.gt-lg"
413
+ ]
414
+ },
415
+ {
416
+ kind: "directive",
417
+ type: i1.FxLayoutAlignDirective,
418
+ selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg] ",
419
+ inputs: [
420
+ "fxLayoutAlign",
421
+ "fxLayoutAlign.xs",
422
+ "fxLayoutAlign.sm",
423
+ "fxLayoutAlign.md",
424
+ "fxLayoutAlign.lg",
425
+ "fxLayoutAlign.xl",
426
+ "fxLayoutAlign.lt-sm",
427
+ "fxLayoutAlign.lt-md",
428
+ "fxLayoutAlign.lt-lg",
429
+ "fxLayoutAlign.lt-xl",
430
+ "fxLayoutAlign.gt-xs",
431
+ "fxLayoutAlign.gt-sm",
432
+ "fxLayoutAlign.gt-md",
433
+ "fxLayoutAlign.gt-lg"
434
+ ]
435
+ },
436
+ {
437
+ kind: "directive",
438
+ type: i1.FxFlexFillDirective,
439
+ selector: " [fxFlexFill], [fxFill], [fxFlexFill.xs], [fxFlexFill.sm], [fxFlexFill.md], [fxFlexFill.lg], [fxFlexFill.xl], [fxFlexFill.lt-sm], [fxFlexFill.lt-md], [fxFlexFill.lt-lg], [fxFlexFill.lt-xl], [fxFlexFill.gt-xs], [fxFlexFill.gt-sm], [fxFlexFill.gt-md], [fxFlexFill.gt-lg] ",
440
+ inputs: [
441
+ "fxFlexFill",
442
+ "fxFill",
443
+ "fxFlexFill.xs",
444
+ "fxFlexFill.sm",
445
+ "fxFlexFill.md",
446
+ "fxFlexFill.lg",
447
+ "fxFlexFill.xl",
448
+ "fxFlexFill.lt-sm",
449
+ "fxFlexFill.lt-md",
450
+ "fxFlexFill.lt-lg",
451
+ "fxFlexFill.lt-xl",
452
+ "fxFlexFill.gt-xs",
453
+ "fxFlexFill.gt-sm",
454
+ "fxFlexFill.gt-md",
455
+ "fxFlexFill.gt-lg"
456
+ ]
457
+ },
458
+ {
459
+ kind: "ngmodule",
460
+ type: MatProgressBarModule
461
+ },
462
+ {
463
+ kind: "component",
464
+ type: i2.MatProgressBar,
465
+ selector: "mat-progress-bar",
466
+ inputs: [
467
+ "color",
468
+ "value",
469
+ "bufferValue",
470
+ "mode"
471
+ ],
472
+ outputs: ["animationEnd"],
473
+ exportAs: ["matProgressBar"]
474
+ }
475
+ ],
476
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
477
+ });
478
+ }
479
+ };
480
+ i0.ɵɵngDeclareClassMetadata({
481
+ minVersion: "12.0.0",
482
+ version: "22.2.1",
483
+ ngImport: i0,
484
+ type: LoginOAuthOkMSComponent,
485
+ decorators: [{
486
+ type: Component,
487
+ args: [{
488
+ selector: "app-login-oauth-ok-ms",
489
+ changeDetection: ChangeDetectionStrategy.OnPush,
490
+ imports: [FlexLayoutModule, MatProgressBarModule],
491
+ template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" ></mat-progress-bar>\r\n </div>\r\n</div>\r\n",
492
+ styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"]
493
+ }]
494
+ }],
495
+ ctorParameters: () => [],
496
+ propDecorators: { message: [{
497
+ type: i0.Input,
498
+ args: [{
499
+ isSignal: true,
500
+ alias: "message",
501
+ required: false
502
+ }]
503
+ }] }
504
+ });
287
505
  export { LoginOAuthComponent, LoginOAuthOkMSComponent, MSALGuardConfigFactory, MSALInstanceFactory, MSALInterceptorConfigFactory };
288
- //# sourceMappingURL=arsedizioni-ars-utils-ui.oauth.mjs.map
506
+
507
+ //# sourceMappingURL=arsedizioni-ars-utils-ui.oauth.mjs.map