@civic/auth 0.9.1-alpha.1 → 0.9.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nextjs/config.d.ts +0 -1
- package/dist/nextjs/config.d.ts.map +1 -1
- package/dist/react-router-7/components/UserButton.d.ts.map +1 -1
- package/dist/react-router-7/components/UserButton.js +1 -3
- package/dist/react-router-7/components/UserButton.js.map +1 -1
- package/dist/react-router-7/config.d.ts +2 -0
- package/dist/react-router-7/config.d.ts.map +1 -1
- package/dist/react-router-7/config.js.map +1 -1
- package/dist/react-router-7/cookies.d.ts +1 -1
- package/dist/react-router-7/cookies.d.ts.map +1 -1
- package/dist/react-router-7/cookies.js +9 -3
- package/dist/react-router-7/cookies.js.map +1 -1
- package/dist/react-router-7/routeHandler.d.ts.map +1 -1
- package/dist/react-router-7/routeHandler.js +5 -2
- package/dist/react-router-7/routeHandler.js.map +1 -1
- package/dist/react-router-7/useUser.d.ts +2 -0
- package/dist/react-router-7/useUser.d.ts.map +1 -1
- package/dist/react-router-7/useUser.js +11 -1
- package/dist/react-router-7/useUser.js.map +1 -1
- package/dist/reactjs/core/GlobalAuthManager.d.ts.map +1 -1
- package/dist/reactjs/core/GlobalAuthManager.js +1 -0
- package/dist/reactjs/core/GlobalAuthManager.js.map +1 -1
- package/dist/services/PKCE.d.ts.map +1 -1
- package/dist/services/PKCE.js +1 -4
- package/dist/services/PKCE.js.map +1 -1
- package/dist/shared/version.d.ts +1 -1
- package/dist/shared/version.d.ts.map +1 -1
- package/dist/shared/version.js +1 -1
- package/dist/shared/version.js.map +1 -1
- package/dist/vanillajs/auth/CivicAuth.d.ts.map +1 -1
- package/dist/vanillajs/auth/CivicAuth.js +32 -12
- package/dist/vanillajs/auth/CivicAuth.js.map +1 -1
- package/dist/vanillajs/auth/handlers/LogoutHandler.d.ts +57 -0
- package/dist/vanillajs/auth/handlers/LogoutHandler.d.ts.map +1 -0
- package/dist/vanillajs/auth/handlers/LogoutHandler.js +246 -0
- package/dist/vanillajs/auth/handlers/LogoutHandler.js.map +1 -0
- package/dist/vanillajs/iframe/IframeManager.d.ts.map +1 -1
- package/dist/vanillajs/iframe/IframeManager.js +1 -0
- package/dist/vanillajs/iframe/IframeManager.js.map +1 -1
- package/package.json +4 -3
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { IframeManager } from "../../iframe/IframeManager.js";
|
|
2
|
+
import { CivicAuthError, CivicAuthErrorCode } from "../types/AuthTypes.js";
|
|
3
|
+
import { createLogger as createLoggerFn } from "../../utils/logger.js";
|
|
4
|
+
/**
|
|
5
|
+
* LogoutHandler - Manages logout iframe using the same infrastructure as login
|
|
6
|
+
* Handles iframe creation, navigation, cleanup, and error handling for logout flows
|
|
7
|
+
*/
|
|
8
|
+
export class LogoutHandler {
|
|
9
|
+
config;
|
|
10
|
+
logger = createLoggerFn("logout-handler");
|
|
11
|
+
onLogoutComplete;
|
|
12
|
+
onLogoutError;
|
|
13
|
+
cleanup;
|
|
14
|
+
iframeManager;
|
|
15
|
+
iframeElement;
|
|
16
|
+
constructor(handlerConfig) {
|
|
17
|
+
this.config = handlerConfig.config;
|
|
18
|
+
this.logger = handlerConfig.logger;
|
|
19
|
+
this.onLogoutComplete = handlerConfig.onLogoutComplete;
|
|
20
|
+
this.onLogoutError = handlerConfig.onLogoutError;
|
|
21
|
+
this.cleanup = handlerConfig.cleanup;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Handles logout using a hidden iframe similar to how login handles authentication
|
|
25
|
+
*/
|
|
26
|
+
async handleLogoutIframe(logoutUrl) {
|
|
27
|
+
this.logger.info("🚪 Creating logout iframe using IframeManager", {
|
|
28
|
+
url: logoutUrl,
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
// Create a hidden container for the logout iframe
|
|
32
|
+
const container = this.createHiddenContainer();
|
|
33
|
+
// Create IframeManager in modal mode but keep it hidden
|
|
34
|
+
this.iframeManager = new IframeManager({
|
|
35
|
+
container: container,
|
|
36
|
+
displayMode: "modal",
|
|
37
|
+
iframeId: `${this.config.iframeId || "civic-auth-iframe"}-logout`,
|
|
38
|
+
onClose: () => {
|
|
39
|
+
this.logger.debug("Logout iframe close requested (should not happen for hidden iframe)");
|
|
40
|
+
// For logout, we don't expect user interaction, but handle it gracefully
|
|
41
|
+
this.cleanupLogoutIframe();
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
// Create the iframe using IframeManager
|
|
45
|
+
this.iframeElement = this.iframeManager.createIframe(logoutUrl);
|
|
46
|
+
// Keep the iframe hidden since this is a background logout
|
|
47
|
+
this.iframeManager.hide();
|
|
48
|
+
// Set up event handlers for the logout iframe
|
|
49
|
+
this.setupLogoutIframeEventHandlers();
|
|
50
|
+
this.setupLogoutNavigationMonitoring();
|
|
51
|
+
this.logger.info("✅ Logout iframe created successfully", {
|
|
52
|
+
url: logoutUrl,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const errorMessage = error instanceof Error
|
|
57
|
+
? error.message
|
|
58
|
+
: "Failed to create logout iframe";
|
|
59
|
+
this.logger.error("❌ Failed to create logout iframe", {
|
|
60
|
+
error: errorMessage,
|
|
61
|
+
});
|
|
62
|
+
this.onLogoutError(new CivicAuthError(errorMessage, CivicAuthErrorCode.LOGOUT_FAILED));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates a hidden container element for the logout iframe
|
|
67
|
+
*/
|
|
68
|
+
createHiddenContainer() {
|
|
69
|
+
const container = document.createElement("div");
|
|
70
|
+
container.id = "civic-logout-iframe-container";
|
|
71
|
+
container.style.display = "none";
|
|
72
|
+
container.style.position = "fixed";
|
|
73
|
+
container.style.left = "-9999px";
|
|
74
|
+
container.style.top = "-9999px";
|
|
75
|
+
container.style.width = "1px";
|
|
76
|
+
container.style.height = "1px";
|
|
77
|
+
container.style.overflow = "hidden";
|
|
78
|
+
container.style.pointerEvents = "none";
|
|
79
|
+
container.style.visibility = "hidden";
|
|
80
|
+
container.style.zIndex = "-1";
|
|
81
|
+
document.body.appendChild(container);
|
|
82
|
+
return container;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Sets up event handlers for the logout iframe
|
|
86
|
+
*/
|
|
87
|
+
setupLogoutIframeEventHandlers() {
|
|
88
|
+
if (!this.iframeElement)
|
|
89
|
+
return;
|
|
90
|
+
this.iframeElement.onload = () => {
|
|
91
|
+
this.logger.info("✅ Logout iframe loaded successfully", {
|
|
92
|
+
iframeSrc: this.iframeElement?.src,
|
|
93
|
+
});
|
|
94
|
+
// Try to detect redirect to our logout redirect URL
|
|
95
|
+
this.checkLogoutIframeRedirect();
|
|
96
|
+
};
|
|
97
|
+
this.iframeElement.onerror = (event) => {
|
|
98
|
+
this.logger.error("❌ Logout iframe load error", {
|
|
99
|
+
event,
|
|
100
|
+
iframeSrc: this.iframeElement?.src,
|
|
101
|
+
});
|
|
102
|
+
const error = new CivicAuthError("Logout iframe failed to load", CivicAuthErrorCode.LOGOUT_FAILED);
|
|
103
|
+
this.onLogoutError(error);
|
|
104
|
+
this.cleanupLogoutIframe();
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Cleans up the logout iframe and container
|
|
109
|
+
*/
|
|
110
|
+
cleanupLogoutIframe() {
|
|
111
|
+
this.logger.debug("🧹 Cleaning up logout iframe");
|
|
112
|
+
if (this.iframeManager) {
|
|
113
|
+
// Get the container before cleanup to remove it from DOM
|
|
114
|
+
const container = document.getElementById("civic-logout-iframe-container");
|
|
115
|
+
this.iframeManager.cleanup();
|
|
116
|
+
this.iframeManager = undefined;
|
|
117
|
+
// Remove the hidden container from DOM
|
|
118
|
+
if (container && container.parentNode) {
|
|
119
|
+
container.parentNode.removeChild(container);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (this.iframeElement) {
|
|
123
|
+
this.iframeElement = undefined;
|
|
124
|
+
}
|
|
125
|
+
this.logger.debug("✅ Logout iframe cleanup completed");
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get the current iframe element (for testing/debugging)
|
|
129
|
+
*/
|
|
130
|
+
getIframeElement() {
|
|
131
|
+
return this.iframeElement;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if logout iframe is currently active
|
|
135
|
+
*/
|
|
136
|
+
isLogoutActive() {
|
|
137
|
+
return !!(this.iframeManager && this.iframeElement);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Checks if the logout iframe has redirected to our logout redirect URL
|
|
141
|
+
*/
|
|
142
|
+
checkLogoutIframeRedirect() {
|
|
143
|
+
if (!this.config.logoutRedirectUrl) {
|
|
144
|
+
this.logger.debug("No logoutRedirectUrl configured, treating initial load as completion");
|
|
145
|
+
// If no logout redirect URL is configured, consider the initial load as completion
|
|
146
|
+
this.onLogoutComplete();
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
this.cleanupLogoutIframe();
|
|
149
|
+
}, 1000);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
const currentIframeHref = this.iframeElement?.contentWindow?.location.href;
|
|
154
|
+
if (currentIframeHref) {
|
|
155
|
+
this.logger.debug("Logout iframe current href accessible", {
|
|
156
|
+
href: currentIframeHref,
|
|
157
|
+
logoutRedirectUrl: this.config.logoutRedirectUrl,
|
|
158
|
+
startsWithLogoutRedirect: currentIframeHref.startsWith(this.config.logoutRedirectUrl),
|
|
159
|
+
});
|
|
160
|
+
if (currentIframeHref.startsWith(this.config.logoutRedirectUrl)) {
|
|
161
|
+
this.logger.info("✅ Logout iframe has navigated to logoutRedirectUrl - logout complete");
|
|
162
|
+
this.onLogoutComplete();
|
|
163
|
+
// Clean up the iframe after a short delay
|
|
164
|
+
setTimeout(() => {
|
|
165
|
+
this.cleanupLogoutIframe();
|
|
166
|
+
}, 500);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
this.logger.debug("Error checking logout iframe href (expected for cross-origin)", {
|
|
172
|
+
error: error instanceof Error ? error.message : String(error),
|
|
173
|
+
iframeSrc: this.iframeElement?.src,
|
|
174
|
+
logoutRedirectUrl: this.config.logoutRedirectUrl,
|
|
175
|
+
});
|
|
176
|
+
// This is expected when the iframe is on the OIDC provider domain
|
|
177
|
+
this.logger.debug("Logout iframe is on OIDC provider domain - using navigation monitoring", {
|
|
178
|
+
parentOrigin: window.location.origin,
|
|
179
|
+
logoutRedirectUrl: this.config.logoutRedirectUrl,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Sets up navigation monitoring to detect when logout iframe redirects to logoutRedirectUrl
|
|
185
|
+
* Similar to login's setupIframeNavigationMonitoring but for logout flow
|
|
186
|
+
*/
|
|
187
|
+
setupLogoutNavigationMonitoring() {
|
|
188
|
+
if (!this.config.logoutRedirectUrl) {
|
|
189
|
+
this.logger.debug("No logoutRedirectUrl configured, skipping navigation monitoring");
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
let monitoringInterval = undefined;
|
|
193
|
+
let lastKnownUrl = "";
|
|
194
|
+
const checkLogoutNavigation = () => {
|
|
195
|
+
if (!this.iframeElement?.contentWindow) {
|
|
196
|
+
if (monitoringInterval) {
|
|
197
|
+
clearInterval(monitoringInterval);
|
|
198
|
+
}
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
const currentUrl = this.iframeElement.contentWindow.location.href;
|
|
203
|
+
if (currentUrl !== lastKnownUrl) {
|
|
204
|
+
lastKnownUrl = currentUrl;
|
|
205
|
+
this.logger.debug("Logout iframe navigation detected", {
|
|
206
|
+
newUrl: currentUrl,
|
|
207
|
+
logoutRedirectUrl: this.config.logoutRedirectUrl,
|
|
208
|
+
isLogoutRedirectUrl: currentUrl.startsWith(this.config.logoutRedirectUrl),
|
|
209
|
+
});
|
|
210
|
+
// Check if iframe has navigated to our logout redirect URL
|
|
211
|
+
if (currentUrl.startsWith(this.config.logoutRedirectUrl)) {
|
|
212
|
+
this.logger.info("✅ Logout iframe navigated to logoutRedirectUrl - logout complete");
|
|
213
|
+
if (monitoringInterval) {
|
|
214
|
+
clearInterval(monitoringInterval);
|
|
215
|
+
}
|
|
216
|
+
this.onLogoutComplete();
|
|
217
|
+
// Clean up the iframe after a short delay
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
this.cleanupLogoutIframe();
|
|
220
|
+
}, 500);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
// Expected when iframe is on different origin
|
|
226
|
+
// Only log if we haven't seen this before
|
|
227
|
+
if (lastKnownUrl !== "cross-origin") {
|
|
228
|
+
lastKnownUrl = "cross-origin";
|
|
229
|
+
this.logger.debug("Logout iframe on cross-origin domain (expected during logout flow)", { logoutRedirectUrl: this.config.logoutRedirectUrl });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
// Check immediately and then every 100ms for faster detection
|
|
234
|
+
checkLogoutNavigation();
|
|
235
|
+
monitoringInterval = window.setInterval(checkLogoutNavigation, 100);
|
|
236
|
+
// Store cleanup function to clear monitoring
|
|
237
|
+
const originalCleanup = this.cleanupLogoutIframe.bind(this);
|
|
238
|
+
this.cleanupLogoutIframe = () => {
|
|
239
|
+
if (monitoringInterval) {
|
|
240
|
+
clearInterval(monitoringInterval);
|
|
241
|
+
}
|
|
242
|
+
originalCleanup();
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=LogoutHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogoutHandler.js","sourceRoot":"","sources":["../../../../src/vanillajs/auth/handlers/LogoutHandler.ts"],"names":[],"mappings":"AAAA,OAA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EAAE,CAAC;oBACpC,YAAY,GAAG,cAAc,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,oEAAoE,EACpE,EAAE,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CACrD,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,8DAA8D;QAC9D,qBAAqB,EAAE,CAAC;QACxB,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;QAEpE,6CAA6C;QAC7C,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,CAAC,mBAAmB,GAAG,GAAG,EAAE;YAC9B,IAAI,kBAAkB,EAAE,CAAC;gBACvB,aAAa,CAAC,kBAAkB,CAAC,CAAC;YACpC,CAAC;YACD,eAAe,EAAE,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { IframeManager } from \"../../iframe/IframeManager.js\";\nimport type { ProcessedCivicAuthConfig } from \"../types/AuthTypes.js\";\nimport { CivicAuthError, CivicAuthErrorCode } from \"../types/AuthTypes.js\";\nimport type { createLogger } from \"../../utils/logger.js\";\nimport { createLogger as createLoggerFn } from \"../../utils/logger.js\";\n\nexport interface LogoutHandlerConfig {\n config: ProcessedCivicAuthConfig;\n logger: ReturnType<typeof createLogger>;\n onLogoutComplete: () => void;\n onLogoutError: (error: Error) => void;\n cleanup: () => void;\n}\n\n/**\n * LogoutHandler - Manages logout iframe using the same infrastructure as login\n * Handles iframe creation, navigation, cleanup, and error handling for logout flows\n */\nexport class LogoutHandler {\n private config: ProcessedCivicAuthConfig;\n private logger = createLoggerFn(\"logout-handler\");\n private onLogoutComplete: () => void;\n private onLogoutError: (error: Error) => void;\n private cleanup: () => void;\n private iframeManager?: IframeManager;\n private iframeElement?: HTMLIFrameElement;\n\n constructor(handlerConfig: LogoutHandlerConfig) {\n this.config = handlerConfig.config;\n this.logger = handlerConfig.logger;\n this.onLogoutComplete = handlerConfig.onLogoutComplete;\n this.onLogoutError = handlerConfig.onLogoutError;\n this.cleanup = handlerConfig.cleanup;\n }\n\n /**\n * Handles logout using a hidden iframe similar to how login handles authentication\n */\n public async handleLogoutIframe(logoutUrl: string): Promise<void> {\n this.logger.info(\"🚪 Creating logout iframe using IframeManager\", {\n url: logoutUrl,\n });\n\n try {\n // Create a hidden container for the logout iframe\n const container = this.createHiddenContainer();\n\n // Create IframeManager in modal mode but keep it hidden\n this.iframeManager = new IframeManager({\n container: container,\n displayMode: \"modal\",\n iframeId: `${this.config.iframeId || \"civic-auth-iframe\"}-logout`,\n onClose: () => {\n this.logger.debug(\n \"Logout iframe close requested (should not happen for hidden iframe)\",\n );\n // For logout, we don't expect user interaction, but handle it gracefully\n this.cleanupLogoutIframe();\n },\n });\n\n // Create the iframe using IframeManager\n this.iframeElement = this.iframeManager.createIframe(logoutUrl);\n\n // Keep the iframe hidden since this is a background logout\n this.iframeManager.hide();\n\n // Set up event handlers for the logout iframe\n this.setupLogoutIframeEventHandlers();\n this.setupLogoutNavigationMonitoring();\n\n this.logger.info(\"✅ Logout iframe created successfully\", {\n url: logoutUrl,\n });\n } catch (error) {\n const errorMessage =\n error instanceof Error\n ? error.message\n : \"Failed to create logout iframe\";\n this.logger.error(\"❌ Failed to create logout iframe\", {\n error: errorMessage,\n });\n\n this.onLogoutError(\n new CivicAuthError(errorMessage, CivicAuthErrorCode.LOGOUT_FAILED),\n );\n }\n }\n\n /**\n * Creates a hidden container element for the logout iframe\n */\n private createHiddenContainer(): HTMLElement {\n const container = document.createElement(\"div\");\n container.id = \"civic-logout-iframe-container\";\n container.style.display = \"none\";\n container.style.position = \"fixed\";\n container.style.left = \"-9999px\";\n container.style.top = \"-9999px\";\n container.style.width = \"1px\";\n container.style.height = \"1px\";\n container.style.overflow = \"hidden\";\n container.style.pointerEvents = \"none\";\n container.style.visibility = \"hidden\";\n container.style.zIndex = \"-1\";\n\n document.body.appendChild(container);\n return container;\n }\n\n /**\n * Sets up event handlers for the logout iframe\n */\n private setupLogoutIframeEventHandlers(): void {\n if (!this.iframeElement) return;\n\n this.iframeElement.onload = () => {\n this.logger.info(\"✅ Logout iframe loaded successfully\", {\n iframeSrc: this.iframeElement?.src,\n });\n\n // Try to detect redirect to our logout redirect URL\n this.checkLogoutIframeRedirect();\n };\n\n this.iframeElement.onerror = (event) => {\n this.logger.error(\"❌ Logout iframe load error\", {\n event,\n iframeSrc: this.iframeElement?.src,\n });\n\n const error = new CivicAuthError(\n \"Logout iframe failed to load\",\n CivicAuthErrorCode.LOGOUT_FAILED,\n );\n\n this.onLogoutError(error);\n this.cleanupLogoutIframe();\n };\n }\n\n /**\n * Cleans up the logout iframe and container\n */\n public cleanupLogoutIframe(): void {\n this.logger.debug(\"🧹 Cleaning up logout iframe\");\n\n if (this.iframeManager) {\n // Get the container before cleanup to remove it from DOM\n const container = document.getElementById(\n \"civic-logout-iframe-container\",\n );\n\n this.iframeManager.cleanup();\n this.iframeManager = undefined;\n\n // Remove the hidden container from DOM\n if (container && container.parentNode) {\n container.parentNode.removeChild(container);\n }\n }\n\n if (this.iframeElement) {\n this.iframeElement = undefined;\n }\n\n this.logger.debug(\"✅ Logout iframe cleanup completed\");\n }\n\n /**\n * Get the current iframe element (for testing/debugging)\n */\n public getIframeElement(): HTMLIFrameElement | undefined {\n return this.iframeElement;\n }\n\n /**\n * Check if logout iframe is currently active\n */\n public isLogoutActive(): boolean {\n return !!(this.iframeManager && this.iframeElement);\n }\n\n /**\n * Checks if the logout iframe has redirected to our logout redirect URL\n */\n private checkLogoutIframeRedirect(): void {\n if (!this.config.logoutRedirectUrl) {\n this.logger.debug(\n \"No logoutRedirectUrl configured, treating initial load as completion\",\n );\n // If no logout redirect URL is configured, consider the initial load as completion\n this.onLogoutComplete();\n setTimeout(() => {\n this.cleanupLogoutIframe();\n }, 1000);\n return;\n }\n\n try {\n const currentIframeHref =\n this.iframeElement?.contentWindow?.location.href;\n\n if (currentIframeHref) {\n this.logger.debug(\"Logout iframe current href accessible\", {\n href: currentIframeHref,\n logoutRedirectUrl: this.config.logoutRedirectUrl,\n startsWithLogoutRedirect: currentIframeHref.startsWith(\n this.config.logoutRedirectUrl,\n ),\n });\n\n if (currentIframeHref.startsWith(this.config.logoutRedirectUrl)) {\n this.logger.info(\n \"✅ Logout iframe has navigated to logoutRedirectUrl - logout complete\",\n );\n this.onLogoutComplete();\n\n // Clean up the iframe after a short delay\n setTimeout(() => {\n this.cleanupLogoutIframe();\n }, 500);\n }\n }\n } catch (error) {\n this.logger.debug(\n \"Error checking logout iframe href (expected for cross-origin)\",\n {\n error: error instanceof Error ? error.message : String(error),\n iframeSrc: this.iframeElement?.src,\n logoutRedirectUrl: this.config.logoutRedirectUrl,\n },\n );\n // This is expected when the iframe is on the OIDC provider domain\n this.logger.debug(\n \"Logout iframe is on OIDC provider domain - using navigation monitoring\",\n {\n parentOrigin: window.location.origin,\n logoutRedirectUrl: this.config.logoutRedirectUrl,\n },\n );\n }\n }\n\n /**\n * Sets up navigation monitoring to detect when logout iframe redirects to logoutRedirectUrl\n * Similar to login's setupIframeNavigationMonitoring but for logout flow\n */\n private setupLogoutNavigationMonitoring(): void {\n if (!this.config.logoutRedirectUrl) {\n this.logger.debug(\n \"No logoutRedirectUrl configured, skipping navigation monitoring\",\n );\n return;\n }\n\n let monitoringInterval: number | undefined = undefined;\n let lastKnownUrl = \"\";\n\n const checkLogoutNavigation = () => {\n if (!this.iframeElement?.contentWindow) {\n if (monitoringInterval) {\n clearInterval(monitoringInterval);\n }\n return;\n }\n\n try {\n const currentUrl = this.iframeElement.contentWindow.location.href;\n\n if (currentUrl !== lastKnownUrl) {\n lastKnownUrl = currentUrl;\n this.logger.debug(\"Logout iframe navigation detected\", {\n newUrl: currentUrl,\n logoutRedirectUrl: this.config.logoutRedirectUrl,\n isLogoutRedirectUrl: currentUrl.startsWith(\n this.config.logoutRedirectUrl,\n ),\n });\n\n // Check if iframe has navigated to our logout redirect URL\n if (currentUrl.startsWith(this.config.logoutRedirectUrl)) {\n this.logger.info(\n \"✅ Logout iframe navigated to logoutRedirectUrl - logout complete\",\n );\n\n if (monitoringInterval) {\n clearInterval(monitoringInterval);\n }\n\n this.onLogoutComplete();\n\n // Clean up the iframe after a short delay\n setTimeout(() => {\n this.cleanupLogoutIframe();\n }, 500);\n }\n }\n } catch (error) {\n // Expected when iframe is on different origin\n // Only log if we haven't seen this before\n if (lastKnownUrl !== \"cross-origin\") {\n lastKnownUrl = \"cross-origin\";\n this.logger.debug(\n \"Logout iframe on cross-origin domain (expected during logout flow)\",\n { logoutRedirectUrl: this.config.logoutRedirectUrl },\n );\n }\n }\n };\n\n // Check immediately and then every 100ms for faster detection\n checkLogoutNavigation();\n monitoringInterval = window.setInterval(checkLogoutNavigation, 100);\n\n // Store cleanup function to clear monitoring\n const originalCleanup = this.cleanupLogoutIframe.bind(this);\n this.cleanupLogoutIframe = () => {\n if (monitoringInterval) {\n clearInterval(monitoringInterval);\n }\n originalCleanup();\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeManager.d.ts","sourceRoot":"","sources":["../../../src/vanillajs/iframe/IframeManager.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,CAAC;IACvB,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,qBAAa,aAAa;IAExB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAU;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAW;IAC9C,OAAO,CAAC,MAAM,CAAC,QAAQ,C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C,uBAAuB;IAQ/B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAOhC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAMjC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAMlC;;OAEG;IACI,iBAAiB,IAAI,OAAO;IAInC;;OAEG;IACI,eAAe,IAAI,MAAM,GAAG,IAAI;IAIvC;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;;OAGG;IACI,oBAAoB,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAI/C,gCAAgC,IAAI,IAAI;CAgDhD"}
|
|
@@ -61,6 +61,7 @@ export class IframeManager {
|
|
|
61
61
|
this.container.style.width = config.width || "auto";
|
|
62
62
|
this.container.style.height = config.height || "auto";
|
|
63
63
|
this.container.style.backgroundColor = "white";
|
|
64
|
+
this.container.style.background = "white";
|
|
64
65
|
this.container.style.borderRadius = IframeManager.BORDER_RADIUS;
|
|
65
66
|
this.container.style.overflow = "hidden";
|
|
66
67
|
this.container.style.transition = "all 0.5s ease-in-out";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IframeManager.js","sourceRoot":"","sources":["../../../src/vanillajs/iframe/IframeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,4CAA4C,EAAE,MAAM,gBAAgB,CAAC;AAW9E;;;GAGG;AACH,MAAM,OAAO,aAAa;IACxB,0CAA0C;IAClC,MAAM,CAAU,aAAa,GAAG,MAAM,CAAC;IACvC,MAAM,CAAU,WAAW,GAAG,OAAO,CAAC,CAAC,QAAQ;IAC/C,MAAM,CAAU,oBAAoB,GAAG,uBAAuB,CAAC;IAC/D,MAAM,CAAU,mBAAmB,GAAG,WAAW,CAAC;IACl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E;gBACd,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC1C,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACvD,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,qBAAqB;YAE9B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC","sourcesContent":["import { CivicIframeResizer } from \"./IframeResizer.js\";\nimport {\n createIframeShimmerLoader,\n createCloseButton,\n} from \"../ui/LoadingComponents.js\";\nimport { createLogger } from \"../utils/logger.js\";\nimport { WAIT_FOR_LOGIN_APP_BROWSER_DETECTION_TIMEOUT } from \"@/constants.js\";\n\nexport interface IframeConfig {\n container: HTMLElement;\n displayMode: \"embedded\" | \"modal\";\n width?: string;\n height?: string;\n iframeId?: string;\n onClose?: () => void;\n}\n\n/**\n * IframeManager - Manages iframe visual presentation and DOM lifecycle\n * Handles styling, positioning, UI components, and iframe element creation/cleanup\n */\nexport class IframeManager {\n // Constants for styling and configuration\n private static readonly MODAL_Z_INDEX = \"1050\";\n private static readonly MODAL_WIDTH = \"20rem\"; // 320px\n private static readonly MODAL_BACKDROP_COLOR = \"rgba(17, 24, 39, 0.5)\";\n private static readonly MODAL_BACKDROP_BLUR = \"blur(4px)\";\n private static readonly BORDER_RADIUS = \"24px\";\n private static readonly TRANSITION_DURATION = \"250ms\";\n private static readonly MODAL_MIN_HEIGHT = \"26px\";\n private static readonly EMBEDDED_MIN_HEIGHT = \"225px\";\n private static readonly IFRAME_READY_DELAY = 100; // ms\n\n private iframe: HTMLIFrameElement | null = null;\n private container: HTMLElement;\n private resizer: CivicIframeResizer | null = null;\n private displayMode: \"embedded\" | \"modal\";\n private keydownHandler?: (event: KeyboardEvent) => void;\n private clickHandler?: (event: MouseEvent) => void;\n private iframeId: string;\n private onClose?: () => void;\n private shimmerLoader: HTMLElement | null = null;\n private closeButton: HTMLButtonElement | null = null;\n private isIframeLoaded = false;\n private iframeReadyMessageListener?: (event: MessageEvent) => void;\n private logger: ReturnType<typeof createLogger>;\n // Store references to wrapper elements for styling control\n private contentWrapper: HTMLElement | null = null;\n private iframeWrapper: HTMLElement | null = null;\n // Preloading support\n private isPreloaded = false;\n private preloadUrl: string | null = null;\n public static browserCorsFailsSilentlyUrl: string | null = null;\n\n public static handleBrowserCorsFailsSilently(url: string): void {\n // Store the URL that caused CORS failure for later reference\n IframeManager.browserCorsFailsSilentlyUrl = url;\n }\n\n constructor(config: IframeConfig) {\n // we aren't going to render the iframe if the browser fails silently as we're redirecting\n\n this.container = config.container;\n this.displayMode = config.displayMode;\n this.iframeId = config.iframeId || \"civic-auth-iframe\";\n this.onClose = config.onClose;\n this.logger = createLogger(\"iframe\");\n this.initializeContainer(config);\n this.setupKeyboardHandlers();\n }\n\n private initializeContainer(config: IframeConfig): void {\n if (this.displayMode === \"modal\") {\n this.applyModalStyles();\n return;\n }\n\n // Embedded mode\n this.container.style.position = \"relative\";\n this.container.style.width = config.width || \"auto\";\n this.container.style.height = config.height || \"auto\";\n this.container.style.backgroundColor = \"white\";\n this.container.style.borderRadius = IframeManager.BORDER_RADIUS;\n this.container.style.overflow = \"hidden\";\n this.container.style.transition = \"all 0.5s ease-in-out\";\n }\n\n /**\n * Applies modal backdrop styles to create a full-screen overlay\n * Uses !important to override any existing styles\n */\n private applyModalStyles(): void {\n const modalStyles = {\n position: \"fixed\",\n left: \"0\",\n top: \"0\",\n width: \"100vw\",\n height: \"100vh\",\n \"z-index\": IframeManager.MODAL_Z_INDEX,\n display: \"flex\",\n \"align-items\": \"center\",\n \"justify-content\": \"center\",\n \"background-color\": IframeManager.MODAL_BACKDROP_COLOR,\n \"backdrop-filter\": IframeManager.MODAL_BACKDROP_BLUR,\n opacity: \"1\",\n transition: `opacity ${IframeManager.TRANSITION_DURATION} ease`,\n // Reset any conflicting styles that might prevent modal from working\n margin: \"0\",\n padding: \"0\",\n border: \"none\",\n \"border-radius\": \"0\",\n \"min-height\": \"100vh\",\n };\n\n Object.entries(modalStyles).forEach(([property, value]) => {\n this.container.style.setProperty(property, value, \"important\");\n });\n }\n\n private setupKeyboardHandlers(): void {\n if (this.displayMode === \"modal\") {\n this.keydownHandler = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n this.onClose?.();\n }\n };\n window.addEventListener(\"keydown\", this.keydownHandler);\n }\n }\n\n /**\n * Preloads an iframe in the background for instant display later\n * The iframe is created but kept completely hidden and non-interactable\n */\n public preloadIframe(url: string): HTMLIFrameElement {\n this.logger.debug(\"Preloading iframe in background\", { url });\n\n // Clean up any existing iframe content, but preserve container styles for modal mode\n this.cleanupIframeOnly();\n\n // Create new iframe for preloading\n this.iframe = document.createElement(\"iframe\");\n this.iframe.id = this.iframeId;\n this.iframe.src = url;\n this.iframe.setAttribute(\"data-testid\", \"civic-auth-iframe-with-resizer\");\n\n // Apply base iframe styles but keep it completely hidden for preloading\n this.applyIframeStyles();\n\n // Make iframe completely invisible and non-interactable during preload\n this.iframe.style.display = \"none\";\n this.iframe.style.visibility = \"hidden\";\n this.iframe.style.pointerEvents = \"none\";\n this.iframe.style.position = \"absolute\";\n this.iframe.style.left = \"-9999px\";\n this.iframe.style.top = \"-9999px\";\n\n // Add attributes that prevent scrollbars\n this.setIframeAttributes();\n\n // Add CSS to prevent scrollbars\n this.addScrollbarHidingStyles();\n\n // Set up message listener for iframe ready events (more reliable than onload)\n this.setupIframeMessageListener();\n\n // Set up iframe onload handler\n this.setupIframeOnloadHandler();\n\n // For preloading, we need to add the iframe to the DOM but keep it hidden\n // Create a minimal container structure without showing it\n if (this.displayMode === \"modal\") {\n this.setupModalIframeForPreload();\n } else {\n this.setupEmbeddedIframeForPreload();\n }\n\n // Initialize resizer - this will handle all the message-based resizing\n this.resizer = new CivicIframeResizer(this.iframe, this.container, () =>\n this.isShimmerActive(),\n );\n\n // Mark as preloaded\n this.isPreloaded = true;\n this.preloadUrl = url;\n\n // Keep the container hidden during preload\n this.hide();\n\n this.logger.debug(\"Iframe preloaded successfully\", { url });\n return this.iframe;\n }\n\n public createIframe(url: string): HTMLIFrameElement {\n // If we have a preloaded iframe, show it instantly (even if URL differs)\n // URLs may differ due to fresh PKCE challenges and other dynamic parameters\n if (this.isPreloaded && this.iframe) {\n this.logger.debug(\"Using preloaded iframe for instant display\", {\n preloadedUrl: this.preloadUrl,\n requestedUrl: url,\n urlsMatch: this.preloadUrl === url,\n });\n\n // Don't change iframe.src for preloaded iframes - use them as-is to avoid reload\n // The preloaded authentication flow will work perfectly without URL changes\n this.logger.debug(\"Using preloaded iframe without reload\", {\n preloadedUrl: this.preloadUrl,\n requestedUrl: url,\n action: \"skipping_url_change_to_prevent_reload\",\n });\n\n // Make the preloaded iframe visible and interactable\n this.iframe.style.display = \"block\";\n this.iframe.style.visibility = \"visible\";\n this.iframe.style.pointerEvents = \"auto\";\n this.iframe.style.position = \"relative\";\n this.iframe.style.left = \"0\";\n this.iframe.style.top = \"0\";\n\n // Show the wrappers that were hidden during preload\n if (this.displayMode === \"modal\") {\n if (this.contentWrapper) {\n this.contentWrapper.style.display = \"block\";\n // Apply modal visual styling that was skipped during preload\n this.applyModalVisualStyling();\n\n // Set up modal behaviors (backdrop click, etc.)\n this.setupModalBehaviors();\n }\n } else {\n if (this.iframeWrapper) {\n this.iframeWrapper.style.display = \"block\";\n // Apply wrapper styling that was skipped during preload\n this.applyIframeWrapperStyling();\n }\n }\n\n // Show the container\n this.show();\n\n // Reset preload state since we're now showing the iframe\n this.isPreloaded = false;\n this.preloadUrl = null;\n\n return this.iframe;\n }\n\n // Clean up any existing iframe content, but preserve container styles for modal mode\n this.cleanupIframeOnly();\n\n // Create new iframe\n this.iframe = document.createElement(\"iframe\");\n this.iframe.id = this.iframeId;\n this.iframe.src = url;\n this.iframe.setAttribute(\"data-testid\", \"civic-auth-iframe-with-resizer\");\n\n // Apply iframe styles\n this.applyIframeStyles();\n\n // Add attributes that prevent scrollbars\n this.setIframeAttributes();\n\n // Add CSS to prevent scrollbars\n this.addScrollbarHidingStyles();\n\n // Set up message listener for iframe ready events (more reliable than onload)\n this.setupIframeMessageListener();\n\n // Set up iframe onload handler\n this.setupIframeOnloadHandler();\n\n if (this.displayMode === \"modal\") {\n this.setupModalIframe();\n } else {\n this.setupEmbeddedIframe();\n }\n\n // Initialize resizer - this will handle all the message-based resizing\n this.resizer = new CivicIframeResizer(this.iframe, this.container, () =>\n this.isShimmerActive(),\n );\n\n // Show the iframe container for non-preloaded iframes\n // Note: For preloaded iframes, show() is called earlier in the createIframe method\n // For modal mode, setupModalIframe() handles visibility, but embedded mode needs explicit show()\n if (this.displayMode === \"embedded\") {\n this.show();\n }\n\n return this.iframe;\n }\n\n /**\n * Applies base styles to the iframe element\n */\n private applyIframeStyles(): void {\n if (!this.iframe) return;\n\n const baseStyles = {\n border: \"none\",\n display: \"block\",\n pointerEvents: \"auto\",\n width: \"100%\",\n minWidth: \"100%\",\n overflow: \"hidden\",\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n opacity: \"0\",\n transition: `opacity ${IframeManager.TRANSITION_DURATION} ease, height ${IframeManager.TRANSITION_DURATION} ease`,\n };\n\n Object.entries(baseStyles).forEach(([property, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required to handle dynamic CSS property assignment since CSSStyleDeclaration type doesn't fully capture all possible properties\n this.iframe!.style[property as any] = value;\n });\n\n // Set initial height based on display mode\n if (this.displayMode === \"modal\") {\n this.iframe!.style.height = IframeManager.MODAL_MIN_HEIGHT;\n this.iframe!.style.minHeight = IframeManager.MODAL_MIN_HEIGHT;\n } else {\n this.iframe!.style.height = \"auto\";\n this.iframe!.style.minHeight = IframeManager.EMBEDDED_MIN_HEIGHT; // Embedded mode minimum\n }\n }\n\n /**\n * Sets iframe attributes to prevent scrollbars\n */\n private setIframeAttributes(): void {\n if (!this.iframe) return;\n\n this.iframe.setAttribute(\"scrolling\", \"no\");\n this.iframe.setAttribute(\"frameborder\", \"0\");\n this.iframe.setAttribute(\"seamless\", \"seamless\");\n this.iframe.setAttribute(\n \"allow\",\n \"camera; screen-wake-lock; publickey-credentials-get *; publickey-credentials-create *\",\n );\n this.iframe.setAttribute(\"allowFullScreen\", \"true\");\n\n // Add additional CSS to prevent scrollbars\n this.iframe.style.cssText +=\n \"; -ms-overflow-style: none; scrollbar-width: none;\";\n }\n\n /**\n * Adds CSS styles to hide scrollbars across different browsers\n */\n private addScrollbarHidingStyles(): void {\n const iframeStyle = document.createElement(\"style\");\n iframeStyle.textContent = `\n iframe[id=\"${this.iframeId}\"] {\n -webkit-overflow-scrolling: touch !important;\n }\n iframe[id=\"${this.iframeId}\"]::webkit-scrollbar {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n `;\n document.head.appendChild(iframeStyle);\n }\n\n /**\n * Sets up the message listener for iframe ready events\n */\n private setupIframeMessageListener(): void {\n this.iframeReadyMessageListener = (event: MessageEvent) => {\n try {\n // Only handle messages from our iframe\n if (\n !this.iframe?.contentWindow ||\n event.source !== this.iframe.contentWindow\n ) {\n return;\n }\n\n const message = event.data;\n\n // Handle ready message from iframe resizer\n if (message.type === \"civic-iframe-ready\") {\n this.logger.debug(\"Iframe content is ready - hiding shimmer loader\");\n // wait a bit to ensure any initial loading is complete\n // to give the login-app time to send any post message signals\n setTimeout(() => {\n // Mark iframe as loaded FIRST to disable shimmer blocking\n this.markIframeAsLoaded();\n\n // Replay any blocked resize messages now that shimmer is inactive\n this.resizer?.replayBlockedMessages();\n this.resizer?.resize();\n }, WAIT_FOR_LOGIN_APP_BROWSER_DETECTION_TIMEOUT);\n }\n } catch (error) {\n this.logger.debug(\"Error processing iframe ready message:\", error);\n }\n };\n\n window.addEventListener(\"message\", this.iframeReadyMessageListener);\n }\n\n /**\n * Sets up the iframe onload handler with CSS injection\n */\n private setupIframeOnloadHandler(): void {\n if (!this.iframe) return;\n\n this.iframe.onload = () => {\n // Use a small delay to allow ready message to arrive first\n setTimeout(() => {\n if (!this.isIframeLoaded) {\n this.logger.debug(\n \"Iframe onload fired - hiding shimmer loader (fallback)\",\n );\n this.markIframeAsLoaded();\n }\n }, IframeManager.IFRAME_READY_DELAY);\n\n try {\n const iframeDoc =\n this.iframe?.contentDocument || this.iframe?.contentWindow?.document;\n if (iframeDoc && iframeDoc.head) {\n const style = iframeDoc.createElement(\"style\");\n style.textContent = `\n html, body {\n overflow: hidden !important;\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n -ms-overflow-style: none !important;\n scrollbar-width: none !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n body::-webkit-scrollbar {\n display: none !important;\n }\n * {\n box-sizing: border-box !important;\n }\n `;\n iframeDoc.head.appendChild(style);\n }\n } catch (error) {\n this.logger.debug(\n \"Could not inject CSS into iframe (likely cross-origin):\",\n error,\n );\n }\n };\n }\n\n /**\n * Sets up the iframe for modal display mode during preload\n * Creates the structure but keeps everything hidden\n */\n private setupModalIframeForPreload(): void {\n if (!this.iframe) return;\n\n // Create content wrapper for modal but keep it hidden\n this.contentWrapper = document.createElement(\"div\");\n this.contentWrapper.style.position = \"relative\";\n this.contentWrapper.style.overflow = \"hidden\";\n this.contentWrapper.style.width = IframeManager.MODAL_WIDTH;\n this.contentWrapper.style.display = \"none\"; // Keep hidden during preload\n\n // Create inner iframe wrapper\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = `all ${IframeManager.TRANSITION_DURATION} ease`;\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.MODAL_MIN_HEIGHT;\n\n // Add iframe to wrapper, then wrapper to content, then content to container\n this.iframeWrapper.appendChild(this.iframe);\n this.contentWrapper.appendChild(this.iframeWrapper);\n this.container.appendChild(this.contentWrapper);\n }\n\n /**\n * Sets up the iframe for embedded display mode during preload\n * Creates the structure but keeps everything hidden\n */\n private setupEmbeddedIframeForPreload(): void {\n if (!this.iframe) return;\n\n // Create wrapper but keep it hidden\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = \"all 0.5s ease-in-out\";\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.EMBEDDED_MIN_HEIGHT;\n this.iframeWrapper.style.display = \"none\"; // Keep hidden during preload\n\n // Add iframe to wrapper, then wrapper to container\n this.iframeWrapper.appendChild(this.iframe);\n this.container.appendChild(this.iframeWrapper);\n }\n\n /**\n * Sets up the iframe for modal display mode\n */\n private setupModalIframe(): void {\n if (!this.iframe) return;\n\n // Ensure modal is visible (in case it was hidden by cleanup)\n this.container.style.setProperty(\"display\", \"flex\", \"important\");\n\n // Create content wrapper for modal\n this.contentWrapper = document.createElement(\"div\");\n this.contentWrapper.style.position = \"relative\";\n this.contentWrapper.style.overflow = \"hidden\";\n this.contentWrapper.style.width = IframeManager.MODAL_WIDTH; // 320px like React version\n\n // Apply initial visual styling\n this.applyModalVisualStyling();\n\n // Create inner iframe wrapper to match React structure\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = `all ${IframeManager.TRANSITION_DURATION} ease`;\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.MODAL_MIN_HEIGHT; // Start small for modal mode\n\n // Apply initial wrapper styling\n this.applyIframeWrapperStyling();\n\n // Add shimmer loader for modal mode\n this.showShimmerLoader(this.iframeWrapper, \"white\");\n\n // Add iframe to wrapper, then wrapper to content, then content to container\n this.iframeWrapper.appendChild(this.iframe);\n this.contentWrapper.appendChild(this.iframeWrapper);\n this.container.appendChild(this.contentWrapper);\n\n this.setupModalBehaviors();\n }\n\n /**\n * Sets up modal-specific behaviors like click handlers and close button\n */\n private setupModalBehaviors(): void {\n if (!this.contentWrapper) return;\n\n // Stop propagation on content wrapper to prevent backdrop clicks\n this.contentWrapper.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n });\n\n // Add close button for modal mode (initially hidden if not loaded)\n if (this.onClose && !this.closeButton) {\n this.closeButton = createCloseButton(this.onClose);\n // Show close button immediately if iframe is already loaded, otherwise keep hidden\n this.closeButton.style.opacity = this.isIframeLoaded ? \"1\" : \"0\";\n this.contentWrapper.appendChild(this.closeButton);\n }\n\n // Add click-to-close functionality after content is added\n if (!this.clickHandler) {\n this.clickHandler = (e: MouseEvent) => {\n if (e.target === this.container) {\n // Only close if clicking the backdrop, not the iframe content\n this.onClose?.();\n }\n };\n this.container.addEventListener(\"click\", this.clickHandler);\n }\n }\n\n /**\n * Sets up the iframe for embedded display mode\n */\n private setupEmbeddedIframe(): void {\n if (!this.iframe) return;\n\n // Embedded mode - create wrapper with border radius and overflow hidden\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = \"all 0.5s ease-in-out\";\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.EMBEDDED_MIN_HEIGHT; // Embedded mode minimum\n\n // Apply initial wrapper styling\n this.applyIframeWrapperStyling();\n\n // Add shimmer loader for embedded mode with max width\n this.showShimmerLoader(\n this.iframeWrapper,\n \"white\",\n IframeManager.MODAL_WIDTH,\n );\n\n // Add iframe to wrapper, then wrapper to container\n this.iframeWrapper.appendChild(this.iframe);\n this.container.appendChild(this.iframeWrapper);\n }\n\n private showShimmerLoader(\n parentElement: HTMLElement,\n backgroundColor = \"white\",\n maxWidth?: string,\n ): void {\n if (!this.isIframeLoaded && !this.shimmerLoader) {\n this.shimmerLoader = createIframeShimmerLoader(backgroundColor, maxWidth);\n parentElement.appendChild(this.shimmerLoader);\n }\n }\n\n private hideShimmerLoader(): void {\n if (this.shimmerLoader && this.shimmerLoader.parentNode) {\n // Store reference for cleanup\n const shimmerElement = this.shimmerLoader;\n\n // Clear reference immediately to allow resize operations\n this.shimmerLoader = null;\n\n // Add fade-out transition before removing\n shimmerElement.style.opacity = \"0\";\n shimmerElement.style.transition = `opacity ${IframeManager.TRANSITION_DURATION} ease`;\n\n // Remove after transition completes\n setTimeout(() => {\n if (shimmerElement && shimmerElement.parentNode) {\n shimmerElement.parentNode.removeChild(shimmerElement);\n }\n }, parseInt(IframeManager.TRANSITION_DURATION));\n }\n }\n\n private markIframeAsLoaded(): void {\n if (IframeManager.browserCorsFailsSilentlyUrl) {\n return;\n }\n if (!this.isIframeLoaded) {\n this.isIframeLoaded = true;\n this.hideShimmerLoader();\n this.updateWrapperForLoadedContent();\n }\n }\n\n private updateWrapperForLoadedContent(): void {\n // Fade in the iframe\n if (this.iframe) {\n this.iframe.style.opacity = \"1\";\n }\n\n // Show close button for modal mode when content is loaded\n if (this.displayMode === \"modal\" && this.closeButton) {\n this.closeButton.style.opacity = \"1\";\n }\n\n // Find the iframe wrapper and update its styles for loaded content\n const iframeWrapper = this.iframe?.parentElement;\n if (iframeWrapper) {\n // Remove minimum height constraints to allow natural sizing\n if (this.displayMode === \"modal\") {\n iframeWrapper.style.minHeight = \"auto\";\n } else {\n // For embedded mode, keep some minimum but allow natural growth\n iframeWrapper.style.minHeight = \"auto\";\n }\n\n // Add border radius transition for loaded state (matching React implementation)\n iframeWrapper.style.borderRadius = IframeManager.BORDER_RADIUS;\n }\n }\n\n public hide(): void {\n if (this.displayMode === \"modal\") {\n // Hide immediately without transition\n this.container.style.transition = \"none\";\n this.container.style.opacity = \"0\";\n }\n this.container.style.display = \"none\";\n }\n\n public show(): void {\n if (this.displayMode === \"modal\") {\n // Show immediately, then fade in\n this.container.style.display = \"flex\";\n this.container.style.opacity = \"0\";\n this.container.style.transition = `opacity ${IframeManager.TRANSITION_DURATION} ease`;\n\n // Use setTimeout to ensure display change takes effect before opacity transition\n setTimeout(() => {\n this.container.style.opacity = \"1\";\n }, 10);\n } else {\n // For embedded mode, just show immediately\n this.container.style.display = \"block\";\n this.container.style.opacity = \"1\";\n\n // Fix: Ensure the iframe itself is also visible immediately for embedded mode\n // The iframe starts with opacity: 0 from applyIframeStyles, but embedded mode\n // should show the iframe immediately without waiting for loaded content\n if (this.iframe) {\n this.iframe.style.opacity = \"1\";\n }\n }\n }\n\n private cleanupIframeOnly(): void {\n if (this.resizer) {\n this.resizer.cleanup();\n this.resizer = null;\n }\n\n // Clean up shimmer loader\n this.hideShimmerLoader();\n\n // Clean up close button\n if (this.closeButton && this.closeButton.parentNode) {\n this.closeButton.parentNode.removeChild(this.closeButton);\n this.closeButton = null;\n }\n\n // Clean up message listener\n if (this.iframeReadyMessageListener) {\n window.removeEventListener(\"message\", this.iframeReadyMessageListener);\n this.iframeReadyMessageListener = undefined;\n }\n\n if (this.iframe && this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Reset loading state\n this.isIframeLoaded = false;\n\n // Reset preload state\n this.isPreloaded = false;\n this.preloadUrl = null;\n\n // Clear wrapper references\n this.contentWrapper = null;\n this.iframeWrapper = null;\n\n // Clear container content but DON'T reset styles for modal mode\n this.container.innerHTML = \"\";\n }\n\n public cleanup(): void {\n if (this.resizer) {\n this.resizer.cleanup();\n this.resizer = null;\n }\n\n // Clean up shimmer loader\n this.hideShimmerLoader();\n\n // Clean up close button\n if (this.closeButton && this.closeButton.parentNode) {\n this.closeButton.parentNode.removeChild(this.closeButton);\n this.closeButton = null;\n }\n\n // Clean up message listener\n if (this.iframeReadyMessageListener) {\n window.removeEventListener(\"message\", this.iframeReadyMessageListener);\n this.iframeReadyMessageListener = undefined;\n }\n\n if (this.iframe && this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Reset loading state\n this.isIframeLoaded = false;\n\n // Reset preload state\n this.isPreloaded = false;\n this.preloadUrl = null;\n\n // Remove keyboard event listener\n if (this.keydownHandler) {\n window.removeEventListener(\"keydown\", this.keydownHandler);\n this.keydownHandler = undefined;\n }\n\n // Remove click event listener\n if (this.clickHandler) {\n this.container.removeEventListener(\"click\", this.clickHandler);\n this.clickHandler = undefined;\n }\n\n // Clear wrapper references\n this.contentWrapper = null;\n this.iframeWrapper = null;\n\n // Clear container content and reset styles\n this.container.innerHTML = \"\";\n\n if (this.displayMode === \"modal\") {\n // Reset all modal-specific styles to ensure clean state\n this.resetModalStyles();\n }\n }\n\n /**\n * Resets all modal-specific styles by removing CSS properties that were set with !important\n */\n private resetModalStyles(): void {\n const modalStyleProperties = [\n \"position\",\n \"left\",\n \"top\",\n \"width\",\n \"height\",\n \"z-index\",\n \"display\",\n \"align-items\",\n \"justify-content\",\n \"background-color\",\n \"backdrop-filter\",\n \"opacity\",\n \"transition\",\n \"margin\",\n \"padding\",\n \"border\",\n \"border-radius\",\n \"min-height\",\n ];\n\n modalStyleProperties.forEach((property) => {\n this.container.style.removeProperty(property);\n });\n }\n\n public resize(): void {\n if (this.resizer) {\n this.resizer.resize();\n }\n }\n\n /**\n * Force show the shimmer loader and hide iframe content\n * Used when we want to mask non-login content\n */\n public forceShowLoader(): void {\n // Reset loading state to show shimmer\n this.isIframeLoaded = false;\n\n // Hide iframe content\n if (this.iframe) {\n this.iframe.style.opacity = \"0\";\n }\n\n // Hide close button\n if (this.displayMode === \"modal\" && this.closeButton) {\n this.closeButton.style.opacity = \"0\";\n }\n\n // Hide visual decorations (borders, shadows) when masking content\n if (this.displayMode === \"modal\") {\n this.removeModalVisualStyling();\n }\n this.removeIframeWrapperStyling();\n\n // Show shimmer loader\n if (this.iframeWrapper && !this.shimmerLoader) {\n this.showShimmerLoader(\n this.iframeWrapper,\n \"white\",\n this.displayMode === \"embedded\" ? IframeManager.MODAL_WIDTH : undefined,\n );\n }\n }\n\n /**\n * Force hide the shimmer loader and show iframe content\n * Used when we want to show the login app\n */\n public forceHideLoader(): void {\n // Restore visual decorations when showing content\n if (this.displayMode === \"modal\") {\n this.applyModalVisualStyling();\n }\n this.applyIframeWrapperStyling();\n\n this.markIframeAsLoaded();\n }\n\n /**\n * Applies visual styling (borders, shadows) to modal content wrapper\n */\n private applyModalVisualStyling(): void {\n if (!this.contentWrapper) return;\n\n this.contentWrapper.style.borderRadius = IframeManager.BORDER_RADIUS;\n this.contentWrapper.style.boxShadow =\n \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)\";\n }\n\n /**\n * Removes visual styling (borders, shadows) from modal content wrapper\n */\n private removeModalVisualStyling(): void {\n if (!this.contentWrapper) return;\n\n this.contentWrapper.style.borderRadius = \"0\";\n this.contentWrapper.style.boxShadow = \"none\";\n }\n\n /**\n * Applies visual styling (borders) to iframe wrapper\n */\n private applyIframeWrapperStyling(): void {\n if (!this.iframeWrapper) return;\n\n this.iframeWrapper.style.borderRadius = IframeManager.BORDER_RADIUS;\n }\n\n /**\n * Removes visual styling (borders) from iframe wrapper\n */\n private removeIframeWrapperStyling(): void {\n if (!this.iframeWrapper) return;\n\n this.iframeWrapper.style.borderRadius = \"0\";\n }\n\n /**\n * Check if an iframe is currently preloaded\n */\n public isIframePreloaded(): boolean {\n return this.isPreloaded;\n }\n\n /**\n * Get the URL of the preloaded iframe\n */\n public getPreloadedUrl(): string | null {\n return this.preloadUrl;\n }\n\n /**\n * Check if shimmer loader is currently active/showing\n */\n private isShimmerActive(): boolean {\n return !this.isIframeLoaded || !!this.shimmerLoader;\n }\n\n /**\n * Update the onClose handler for the iframe manager\n * This is useful when transitioning from preload to active authentication\n */\n public updateOnCloseHandler(onClose: () => void): void {\n this.onClose = onClose;\n }\n\n public showSubtlePopupFallbackIndicator(): void {\n if (!this.iframeWrapper && !this.contentWrapper) {\n this.logger.warn(\n \"Cannot show popup fallback indicator, no iframe wrapper or content wrapper found.\",\n );\n return;\n }\n\n const targetElement = this.iframeWrapper || this.contentWrapper;\n\n if (targetElement) {\n this.logger.debug(\"Showing popup fallback overlay.\");\n\n // Create overlay element\n const overlay = document.createElement(\"div\");\n overlay.id = \"civic-popup-fallback-overlay\";\n overlay.style.cssText = `\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: transparent;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n border-radius: ${IframeManager.BORDER_RADIUS};\n backdrop-filter: blur(.4px);\n opacity: 1;\n `;\n\n // Add overlay to target element\n targetElement.style.position = \"relative\";\n targetElement.appendChild(overlay);\n\n // Remove overlay quickly\n setTimeout(() => {\n if (overlay.parentNode) {\n overlay.parentNode.removeChild(overlay);\n }\n this.logger.debug(\"Popup fallback overlay removed.\");\n }, 500); // Remove after 500ms\n\n this.logger.debug(\"Popup fallback overlay displayed.\");\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IframeManager.js","sourceRoot":"","sources":["../../../src/vanillajs/iframe/IframeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,4CAA4C,EAAE,MAAM,gBAAgB,CAAC;AAW9E;;;GAGG;AACH,MAAM,OAAO,aAAa;IACxB,0CAA0C;IAClC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C5C,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG;;;;;;;;;;;;yBAYL,aAAa,CAAC,aAAa;;;OAG7C,CAAC;YAEF,gCAAgC;YAChC,aAAa,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;YAC1C,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAEnC,yBAAyB;YACzB,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC1C,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACvD,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,qBAAqB;YAE9B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACzD,CAAC;IACH,CAAC","sourcesContent":["import { CivicIframeResizer } from \"./IframeResizer.js\";\nimport {\n createIframeShimmerLoader,\n createCloseButton,\n} from \"../ui/LoadingComponents.js\";\nimport { createLogger } from \"../utils/logger.js\";\nimport { WAIT_FOR_LOGIN_APP_BROWSER_DETECTION_TIMEOUT } from \"@/constants.js\";\n\nexport interface IframeConfig {\n container: HTMLElement;\n displayMode: \"embedded\" | \"modal\";\n width?: string;\n height?: string;\n iframeId?: string;\n onClose?: () => void;\n}\n\n/**\n * IframeManager - Manages iframe visual presentation and DOM lifecycle\n * Handles styling, positioning, UI components, and iframe element creation/cleanup\n */\nexport class IframeManager {\n // Constants for styling and configuration\n private static readonly MODAL_Z_INDEX = \"1050\";\n private static readonly MODAL_WIDTH = \"20rem\"; // 320px\n private static readonly MODAL_BACKDROP_COLOR = \"rgba(17, 24, 39, 0.5)\";\n private static readonly MODAL_BACKDROP_BLUR = \"blur(4px)\";\n private static readonly BORDER_RADIUS = \"24px\";\n private static readonly TRANSITION_DURATION = \"250ms\";\n private static readonly MODAL_MIN_HEIGHT = \"26px\";\n private static readonly EMBEDDED_MIN_HEIGHT = \"225px\";\n private static readonly IFRAME_READY_DELAY = 100; // ms\n\n private iframe: HTMLIFrameElement | null = null;\n private container: HTMLElement;\n private resizer: CivicIframeResizer | null = null;\n private displayMode: \"embedded\" | \"modal\";\n private keydownHandler?: (event: KeyboardEvent) => void;\n private clickHandler?: (event: MouseEvent) => void;\n private iframeId: string;\n private onClose?: () => void;\n private shimmerLoader: HTMLElement | null = null;\n private closeButton: HTMLButtonElement | null = null;\n private isIframeLoaded = false;\n private iframeReadyMessageListener?: (event: MessageEvent) => void;\n private logger: ReturnType<typeof createLogger>;\n // Store references to wrapper elements for styling control\n private contentWrapper: HTMLElement | null = null;\n private iframeWrapper: HTMLElement | null = null;\n // Preloading support\n private isPreloaded = false;\n private preloadUrl: string | null = null;\n public static browserCorsFailsSilentlyUrl: string | null = null;\n\n public static handleBrowserCorsFailsSilently(url: string): void {\n // Store the URL that caused CORS failure for later reference\n IframeManager.browserCorsFailsSilentlyUrl = url;\n }\n\n constructor(config: IframeConfig) {\n // we aren't going to render the iframe if the browser fails silently as we're redirecting\n\n this.container = config.container;\n this.displayMode = config.displayMode;\n this.iframeId = config.iframeId || \"civic-auth-iframe\";\n this.onClose = config.onClose;\n this.logger = createLogger(\"iframe\");\n this.initializeContainer(config);\n this.setupKeyboardHandlers();\n }\n\n private initializeContainer(config: IframeConfig): void {\n if (this.displayMode === \"modal\") {\n this.applyModalStyles();\n return;\n }\n\n // Embedded mode\n this.container.style.position = \"relative\";\n this.container.style.width = config.width || \"auto\";\n this.container.style.height = config.height || \"auto\";\n this.container.style.backgroundColor = \"white\";\n this.container.style.background = \"white\";\n this.container.style.borderRadius = IframeManager.BORDER_RADIUS;\n this.container.style.overflow = \"hidden\";\n this.container.style.transition = \"all 0.5s ease-in-out\";\n }\n\n /**\n * Applies modal backdrop styles to create a full-screen overlay\n * Uses !important to override any existing styles\n */\n private applyModalStyles(): void {\n const modalStyles = {\n position: \"fixed\",\n left: \"0\",\n top: \"0\",\n width: \"100vw\",\n height: \"100vh\",\n \"z-index\": IframeManager.MODAL_Z_INDEX,\n display: \"flex\",\n \"align-items\": \"center\",\n \"justify-content\": \"center\",\n \"background-color\": IframeManager.MODAL_BACKDROP_COLOR,\n \"backdrop-filter\": IframeManager.MODAL_BACKDROP_BLUR,\n opacity: \"1\",\n transition: `opacity ${IframeManager.TRANSITION_DURATION} ease`,\n // Reset any conflicting styles that might prevent modal from working\n margin: \"0\",\n padding: \"0\",\n border: \"none\",\n \"border-radius\": \"0\",\n \"min-height\": \"100vh\",\n };\n\n Object.entries(modalStyles).forEach(([property, value]) => {\n this.container.style.setProperty(property, value, \"important\");\n });\n }\n\n private setupKeyboardHandlers(): void {\n if (this.displayMode === \"modal\") {\n this.keydownHandler = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n this.onClose?.();\n }\n };\n window.addEventListener(\"keydown\", this.keydownHandler);\n }\n }\n\n /**\n * Preloads an iframe in the background for instant display later\n * The iframe is created but kept completely hidden and non-interactable\n */\n public preloadIframe(url: string): HTMLIFrameElement {\n this.logger.debug(\"Preloading iframe in background\", { url });\n\n // Clean up any existing iframe content, but preserve container styles for modal mode\n this.cleanupIframeOnly();\n\n // Create new iframe for preloading\n this.iframe = document.createElement(\"iframe\");\n this.iframe.id = this.iframeId;\n this.iframe.src = url;\n this.iframe.setAttribute(\"data-testid\", \"civic-auth-iframe-with-resizer\");\n\n // Apply base iframe styles but keep it completely hidden for preloading\n this.applyIframeStyles();\n\n // Make iframe completely invisible and non-interactable during preload\n this.iframe.style.display = \"none\";\n this.iframe.style.visibility = \"hidden\";\n this.iframe.style.pointerEvents = \"none\";\n this.iframe.style.position = \"absolute\";\n this.iframe.style.left = \"-9999px\";\n this.iframe.style.top = \"-9999px\";\n\n // Add attributes that prevent scrollbars\n this.setIframeAttributes();\n\n // Add CSS to prevent scrollbars\n this.addScrollbarHidingStyles();\n\n // Set up message listener for iframe ready events (more reliable than onload)\n this.setupIframeMessageListener();\n\n // Set up iframe onload handler\n this.setupIframeOnloadHandler();\n\n // For preloading, we need to add the iframe to the DOM but keep it hidden\n // Create a minimal container structure without showing it\n if (this.displayMode === \"modal\") {\n this.setupModalIframeForPreload();\n } else {\n this.setupEmbeddedIframeForPreload();\n }\n\n // Initialize resizer - this will handle all the message-based resizing\n this.resizer = new CivicIframeResizer(this.iframe, this.container, () =>\n this.isShimmerActive(),\n );\n\n // Mark as preloaded\n this.isPreloaded = true;\n this.preloadUrl = url;\n\n // Keep the container hidden during preload\n this.hide();\n\n this.logger.debug(\"Iframe preloaded successfully\", { url });\n return this.iframe;\n }\n\n public createIframe(url: string): HTMLIFrameElement {\n // If we have a preloaded iframe, show it instantly (even if URL differs)\n // URLs may differ due to fresh PKCE challenges and other dynamic parameters\n if (this.isPreloaded && this.iframe) {\n this.logger.debug(\"Using preloaded iframe for instant display\", {\n preloadedUrl: this.preloadUrl,\n requestedUrl: url,\n urlsMatch: this.preloadUrl === url,\n });\n\n // Don't change iframe.src for preloaded iframes - use them as-is to avoid reload\n // The preloaded authentication flow will work perfectly without URL changes\n this.logger.debug(\"Using preloaded iframe without reload\", {\n preloadedUrl: this.preloadUrl,\n requestedUrl: url,\n action: \"skipping_url_change_to_prevent_reload\",\n });\n\n // Make the preloaded iframe visible and interactable\n this.iframe.style.display = \"block\";\n this.iframe.style.visibility = \"visible\";\n this.iframe.style.pointerEvents = \"auto\";\n this.iframe.style.position = \"relative\";\n this.iframe.style.left = \"0\";\n this.iframe.style.top = \"0\";\n\n // Show the wrappers that were hidden during preload\n if (this.displayMode === \"modal\") {\n if (this.contentWrapper) {\n this.contentWrapper.style.display = \"block\";\n // Apply modal visual styling that was skipped during preload\n this.applyModalVisualStyling();\n\n // Set up modal behaviors (backdrop click, etc.)\n this.setupModalBehaviors();\n }\n } else {\n if (this.iframeWrapper) {\n this.iframeWrapper.style.display = \"block\";\n // Apply wrapper styling that was skipped during preload\n this.applyIframeWrapperStyling();\n }\n }\n\n // Show the container\n this.show();\n\n // Reset preload state since we're now showing the iframe\n this.isPreloaded = false;\n this.preloadUrl = null;\n\n return this.iframe;\n }\n\n // Clean up any existing iframe content, but preserve container styles for modal mode\n this.cleanupIframeOnly();\n\n // Create new iframe\n this.iframe = document.createElement(\"iframe\");\n this.iframe.id = this.iframeId;\n this.iframe.src = url;\n this.iframe.setAttribute(\"data-testid\", \"civic-auth-iframe-with-resizer\");\n\n // Apply iframe styles\n this.applyIframeStyles();\n\n // Add attributes that prevent scrollbars\n this.setIframeAttributes();\n\n // Add CSS to prevent scrollbars\n this.addScrollbarHidingStyles();\n\n // Set up message listener for iframe ready events (more reliable than onload)\n this.setupIframeMessageListener();\n\n // Set up iframe onload handler\n this.setupIframeOnloadHandler();\n\n if (this.displayMode === \"modal\") {\n this.setupModalIframe();\n } else {\n this.setupEmbeddedIframe();\n }\n\n // Initialize resizer - this will handle all the message-based resizing\n this.resizer = new CivicIframeResizer(this.iframe, this.container, () =>\n this.isShimmerActive(),\n );\n\n // Show the iframe container for non-preloaded iframes\n // Note: For preloaded iframes, show() is called earlier in the createIframe method\n // For modal mode, setupModalIframe() handles visibility, but embedded mode needs explicit show()\n if (this.displayMode === \"embedded\") {\n this.show();\n }\n\n return this.iframe;\n }\n\n /**\n * Applies base styles to the iframe element\n */\n private applyIframeStyles(): void {\n if (!this.iframe) return;\n\n const baseStyles = {\n border: \"none\",\n display: \"block\",\n pointerEvents: \"auto\",\n width: \"100%\",\n minWidth: \"100%\",\n overflow: \"hidden\",\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n opacity: \"0\",\n transition: `opacity ${IframeManager.TRANSITION_DURATION} ease, height ${IframeManager.TRANSITION_DURATION} ease`,\n };\n\n Object.entries(baseStyles).forEach(([property, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required to handle dynamic CSS property assignment since CSSStyleDeclaration type doesn't fully capture all possible properties\n this.iframe!.style[property as any] = value;\n });\n\n // Set initial height based on display mode\n if (this.displayMode === \"modal\") {\n this.iframe!.style.height = IframeManager.MODAL_MIN_HEIGHT;\n this.iframe!.style.minHeight = IframeManager.MODAL_MIN_HEIGHT;\n } else {\n this.iframe!.style.height = \"auto\";\n this.iframe!.style.minHeight = IframeManager.EMBEDDED_MIN_HEIGHT; // Embedded mode minimum\n }\n }\n\n /**\n * Sets iframe attributes to prevent scrollbars\n */\n private setIframeAttributes(): void {\n if (!this.iframe) return;\n\n this.iframe.setAttribute(\"scrolling\", \"no\");\n this.iframe.setAttribute(\"frameborder\", \"0\");\n this.iframe.setAttribute(\"seamless\", \"seamless\");\n this.iframe.setAttribute(\n \"allow\",\n \"camera; screen-wake-lock; publickey-credentials-get *; publickey-credentials-create *\",\n );\n this.iframe.setAttribute(\"allowFullScreen\", \"true\");\n\n // Add additional CSS to prevent scrollbars\n this.iframe.style.cssText +=\n \"; -ms-overflow-style: none; scrollbar-width: none;\";\n }\n\n /**\n * Adds CSS styles to hide scrollbars across different browsers\n */\n private addScrollbarHidingStyles(): void {\n const iframeStyle = document.createElement(\"style\");\n iframeStyle.textContent = `\n iframe[id=\"${this.iframeId}\"] {\n -webkit-overflow-scrolling: touch !important;\n }\n iframe[id=\"${this.iframeId}\"]::webkit-scrollbar {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n `;\n document.head.appendChild(iframeStyle);\n }\n\n /**\n * Sets up the message listener for iframe ready events\n */\n private setupIframeMessageListener(): void {\n this.iframeReadyMessageListener = (event: MessageEvent) => {\n try {\n // Only handle messages from our iframe\n if (\n !this.iframe?.contentWindow ||\n event.source !== this.iframe.contentWindow\n ) {\n return;\n }\n\n const message = event.data;\n\n // Handle ready message from iframe resizer\n if (message.type === \"civic-iframe-ready\") {\n this.logger.debug(\"Iframe content is ready - hiding shimmer loader\");\n // wait a bit to ensure any initial loading is complete\n // to give the login-app time to send any post message signals\n setTimeout(() => {\n // Mark iframe as loaded FIRST to disable shimmer blocking\n this.markIframeAsLoaded();\n\n // Replay any blocked resize messages now that shimmer is inactive\n this.resizer?.replayBlockedMessages();\n this.resizer?.resize();\n }, WAIT_FOR_LOGIN_APP_BROWSER_DETECTION_TIMEOUT);\n }\n } catch (error) {\n this.logger.debug(\"Error processing iframe ready message:\", error);\n }\n };\n\n window.addEventListener(\"message\", this.iframeReadyMessageListener);\n }\n\n /**\n * Sets up the iframe onload handler with CSS injection\n */\n private setupIframeOnloadHandler(): void {\n if (!this.iframe) return;\n\n this.iframe.onload = () => {\n // Use a small delay to allow ready message to arrive first\n setTimeout(() => {\n if (!this.isIframeLoaded) {\n this.logger.debug(\n \"Iframe onload fired - hiding shimmer loader (fallback)\",\n );\n this.markIframeAsLoaded();\n }\n }, IframeManager.IFRAME_READY_DELAY);\n\n try {\n const iframeDoc =\n this.iframe?.contentDocument || this.iframe?.contentWindow?.document;\n if (iframeDoc && iframeDoc.head) {\n const style = iframeDoc.createElement(\"style\");\n style.textContent = `\n html, body {\n overflow: hidden !important;\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n -ms-overflow-style: none !important;\n scrollbar-width: none !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n body::-webkit-scrollbar {\n display: none !important;\n }\n * {\n box-sizing: border-box !important;\n }\n `;\n iframeDoc.head.appendChild(style);\n }\n } catch (error) {\n this.logger.debug(\n \"Could not inject CSS into iframe (likely cross-origin):\",\n error,\n );\n }\n };\n }\n\n /**\n * Sets up the iframe for modal display mode during preload\n * Creates the structure but keeps everything hidden\n */\n private setupModalIframeForPreload(): void {\n if (!this.iframe) return;\n\n // Create content wrapper for modal but keep it hidden\n this.contentWrapper = document.createElement(\"div\");\n this.contentWrapper.style.position = \"relative\";\n this.contentWrapper.style.overflow = \"hidden\";\n this.contentWrapper.style.width = IframeManager.MODAL_WIDTH;\n this.contentWrapper.style.display = \"none\"; // Keep hidden during preload\n\n // Create inner iframe wrapper\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = `all ${IframeManager.TRANSITION_DURATION} ease`;\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.MODAL_MIN_HEIGHT;\n\n // Add iframe to wrapper, then wrapper to content, then content to container\n this.iframeWrapper.appendChild(this.iframe);\n this.contentWrapper.appendChild(this.iframeWrapper);\n this.container.appendChild(this.contentWrapper);\n }\n\n /**\n * Sets up the iframe for embedded display mode during preload\n * Creates the structure but keeps everything hidden\n */\n private setupEmbeddedIframeForPreload(): void {\n if (!this.iframe) return;\n\n // Create wrapper but keep it hidden\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = \"all 0.5s ease-in-out\";\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.EMBEDDED_MIN_HEIGHT;\n this.iframeWrapper.style.display = \"none\"; // Keep hidden during preload\n\n // Add iframe to wrapper, then wrapper to container\n this.iframeWrapper.appendChild(this.iframe);\n this.container.appendChild(this.iframeWrapper);\n }\n\n /**\n * Sets up the iframe for modal display mode\n */\n private setupModalIframe(): void {\n if (!this.iframe) return;\n\n // Ensure modal is visible (in case it was hidden by cleanup)\n this.container.style.setProperty(\"display\", \"flex\", \"important\");\n\n // Create content wrapper for modal\n this.contentWrapper = document.createElement(\"div\");\n this.contentWrapper.style.position = \"relative\";\n this.contentWrapper.style.overflow = \"hidden\";\n this.contentWrapper.style.width = IframeManager.MODAL_WIDTH; // 320px like React version\n\n // Apply initial visual styling\n this.applyModalVisualStyling();\n\n // Create inner iframe wrapper to match React structure\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = `all ${IframeManager.TRANSITION_DURATION} ease`;\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.MODAL_MIN_HEIGHT; // Start small for modal mode\n\n // Apply initial wrapper styling\n this.applyIframeWrapperStyling();\n\n // Add shimmer loader for modal mode\n this.showShimmerLoader(this.iframeWrapper, \"white\");\n\n // Add iframe to wrapper, then wrapper to content, then content to container\n this.iframeWrapper.appendChild(this.iframe);\n this.contentWrapper.appendChild(this.iframeWrapper);\n this.container.appendChild(this.contentWrapper);\n\n this.setupModalBehaviors();\n }\n\n /**\n * Sets up modal-specific behaviors like click handlers and close button\n */\n private setupModalBehaviors(): void {\n if (!this.contentWrapper) return;\n\n // Stop propagation on content wrapper to prevent backdrop clicks\n this.contentWrapper.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n });\n\n // Add close button for modal mode (initially hidden if not loaded)\n if (this.onClose && !this.closeButton) {\n this.closeButton = createCloseButton(this.onClose);\n // Show close button immediately if iframe is already loaded, otherwise keep hidden\n this.closeButton.style.opacity = this.isIframeLoaded ? \"1\" : \"0\";\n this.contentWrapper.appendChild(this.closeButton);\n }\n\n // Add click-to-close functionality after content is added\n if (!this.clickHandler) {\n this.clickHandler = (e: MouseEvent) => {\n if (e.target === this.container) {\n // Only close if clicking the backdrop, not the iframe content\n this.onClose?.();\n }\n };\n this.container.addEventListener(\"click\", this.clickHandler);\n }\n }\n\n /**\n * Sets up the iframe for embedded display mode\n */\n private setupEmbeddedIframe(): void {\n if (!this.iframe) return;\n\n // Embedded mode - create wrapper with border radius and overflow hidden\n this.iframeWrapper = document.createElement(\"div\");\n this.iframeWrapper.style.position = \"relative\";\n this.iframeWrapper.style.overflow = \"hidden\";\n this.iframeWrapper.style.overflowX = \"hidden\";\n this.iframeWrapper.style.overflowY = \"hidden\";\n this.iframeWrapper.style.transition = \"all 0.5s ease-in-out\";\n this.iframeWrapper.style.width = \"100%\";\n this.iframeWrapper.style.height = \"auto\";\n this.iframeWrapper.style.minHeight = IframeManager.EMBEDDED_MIN_HEIGHT; // Embedded mode minimum\n\n // Apply initial wrapper styling\n this.applyIframeWrapperStyling();\n\n // Add shimmer loader for embedded mode with max width\n this.showShimmerLoader(\n this.iframeWrapper,\n \"white\",\n IframeManager.MODAL_WIDTH,\n );\n\n // Add iframe to wrapper, then wrapper to container\n this.iframeWrapper.appendChild(this.iframe);\n this.container.appendChild(this.iframeWrapper);\n }\n\n private showShimmerLoader(\n parentElement: HTMLElement,\n backgroundColor = \"white\",\n maxWidth?: string,\n ): void {\n if (!this.isIframeLoaded && !this.shimmerLoader) {\n this.shimmerLoader = createIframeShimmerLoader(backgroundColor, maxWidth);\n parentElement.appendChild(this.shimmerLoader);\n }\n }\n\n private hideShimmerLoader(): void {\n if (this.shimmerLoader && this.shimmerLoader.parentNode) {\n // Store reference for cleanup\n const shimmerElement = this.shimmerLoader;\n\n // Clear reference immediately to allow resize operations\n this.shimmerLoader = null;\n\n // Add fade-out transition before removing\n shimmerElement.style.opacity = \"0\";\n shimmerElement.style.transition = `opacity ${IframeManager.TRANSITION_DURATION} ease`;\n\n // Remove after transition completes\n setTimeout(() => {\n if (shimmerElement && shimmerElement.parentNode) {\n shimmerElement.parentNode.removeChild(shimmerElement);\n }\n }, parseInt(IframeManager.TRANSITION_DURATION));\n }\n }\n\n private markIframeAsLoaded(): void {\n if (IframeManager.browserCorsFailsSilentlyUrl) {\n return;\n }\n if (!this.isIframeLoaded) {\n this.isIframeLoaded = true;\n this.hideShimmerLoader();\n this.updateWrapperForLoadedContent();\n }\n }\n\n private updateWrapperForLoadedContent(): void {\n // Fade in the iframe\n if (this.iframe) {\n this.iframe.style.opacity = \"1\";\n }\n\n // Show close button for modal mode when content is loaded\n if (this.displayMode === \"modal\" && this.closeButton) {\n this.closeButton.style.opacity = \"1\";\n }\n\n // Find the iframe wrapper and update its styles for loaded content\n const iframeWrapper = this.iframe?.parentElement;\n if (iframeWrapper) {\n // Remove minimum height constraints to allow natural sizing\n if (this.displayMode === \"modal\") {\n iframeWrapper.style.minHeight = \"auto\";\n } else {\n // For embedded mode, keep some minimum but allow natural growth\n iframeWrapper.style.minHeight = \"auto\";\n }\n\n // Add border radius transition for loaded state (matching React implementation)\n iframeWrapper.style.borderRadius = IframeManager.BORDER_RADIUS;\n }\n }\n\n public hide(): void {\n if (this.displayMode === \"modal\") {\n // Hide immediately without transition\n this.container.style.transition = \"none\";\n this.container.style.opacity = \"0\";\n }\n this.container.style.display = \"none\";\n }\n\n public show(): void {\n if (this.displayMode === \"modal\") {\n // Show immediately, then fade in\n this.container.style.display = \"flex\";\n this.container.style.opacity = \"0\";\n this.container.style.transition = `opacity ${IframeManager.TRANSITION_DURATION} ease`;\n\n // Use setTimeout to ensure display change takes effect before opacity transition\n setTimeout(() => {\n this.container.style.opacity = \"1\";\n }, 10);\n } else {\n // For embedded mode, just show immediately\n this.container.style.display = \"block\";\n this.container.style.opacity = \"1\";\n\n // Fix: Ensure the iframe itself is also visible immediately for embedded mode\n // The iframe starts with opacity: 0 from applyIframeStyles, but embedded mode\n // should show the iframe immediately without waiting for loaded content\n if (this.iframe) {\n this.iframe.style.opacity = \"1\";\n }\n }\n }\n\n private cleanupIframeOnly(): void {\n if (this.resizer) {\n this.resizer.cleanup();\n this.resizer = null;\n }\n\n // Clean up shimmer loader\n this.hideShimmerLoader();\n\n // Clean up close button\n if (this.closeButton && this.closeButton.parentNode) {\n this.closeButton.parentNode.removeChild(this.closeButton);\n this.closeButton = null;\n }\n\n // Clean up message listener\n if (this.iframeReadyMessageListener) {\n window.removeEventListener(\"message\", this.iframeReadyMessageListener);\n this.iframeReadyMessageListener = undefined;\n }\n\n if (this.iframe && this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Reset loading state\n this.isIframeLoaded = false;\n\n // Reset preload state\n this.isPreloaded = false;\n this.preloadUrl = null;\n\n // Clear wrapper references\n this.contentWrapper = null;\n this.iframeWrapper = null;\n\n // Clear container content but DON'T reset styles for modal mode\n this.container.innerHTML = \"\";\n }\n\n public cleanup(): void {\n if (this.resizer) {\n this.resizer.cleanup();\n this.resizer = null;\n }\n\n // Clean up shimmer loader\n this.hideShimmerLoader();\n\n // Clean up close button\n if (this.closeButton && this.closeButton.parentNode) {\n this.closeButton.parentNode.removeChild(this.closeButton);\n this.closeButton = null;\n }\n\n // Clean up message listener\n if (this.iframeReadyMessageListener) {\n window.removeEventListener(\"message\", this.iframeReadyMessageListener);\n this.iframeReadyMessageListener = undefined;\n }\n\n if (this.iframe && this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Reset loading state\n this.isIframeLoaded = false;\n\n // Reset preload state\n this.isPreloaded = false;\n this.preloadUrl = null;\n\n // Remove keyboard event listener\n if (this.keydownHandler) {\n window.removeEventListener(\"keydown\", this.keydownHandler);\n this.keydownHandler = undefined;\n }\n\n // Remove click event listener\n if (this.clickHandler) {\n this.container.removeEventListener(\"click\", this.clickHandler);\n this.clickHandler = undefined;\n }\n\n // Clear wrapper references\n this.contentWrapper = null;\n this.iframeWrapper = null;\n\n // Clear container content and reset styles\n this.container.innerHTML = \"\";\n\n if (this.displayMode === \"modal\") {\n // Reset all modal-specific styles to ensure clean state\n this.resetModalStyles();\n }\n }\n\n /**\n * Resets all modal-specific styles by removing CSS properties that were set with !important\n */\n private resetModalStyles(): void {\n const modalStyleProperties = [\n \"position\",\n \"left\",\n \"top\",\n \"width\",\n \"height\",\n \"z-index\",\n \"display\",\n \"align-items\",\n \"justify-content\",\n \"background-color\",\n \"backdrop-filter\",\n \"opacity\",\n \"transition\",\n \"margin\",\n \"padding\",\n \"border\",\n \"border-radius\",\n \"min-height\",\n ];\n\n modalStyleProperties.forEach((property) => {\n this.container.style.removeProperty(property);\n });\n }\n\n public resize(): void {\n if (this.resizer) {\n this.resizer.resize();\n }\n }\n\n /**\n * Force show the shimmer loader and hide iframe content\n * Used when we want to mask non-login content\n */\n public forceShowLoader(): void {\n // Reset loading state to show shimmer\n this.isIframeLoaded = false;\n\n // Hide iframe content\n if (this.iframe) {\n this.iframe.style.opacity = \"0\";\n }\n\n // Hide close button\n if (this.displayMode === \"modal\" && this.closeButton) {\n this.closeButton.style.opacity = \"0\";\n }\n\n // Hide visual decorations (borders, shadows) when masking content\n if (this.displayMode === \"modal\") {\n this.removeModalVisualStyling();\n }\n this.removeIframeWrapperStyling();\n\n // Show shimmer loader\n if (this.iframeWrapper && !this.shimmerLoader) {\n this.showShimmerLoader(\n this.iframeWrapper,\n \"white\",\n this.displayMode === \"embedded\" ? IframeManager.MODAL_WIDTH : undefined,\n );\n }\n }\n\n /**\n * Force hide the shimmer loader and show iframe content\n * Used when we want to show the login app\n */\n public forceHideLoader(): void {\n // Restore visual decorations when showing content\n if (this.displayMode === \"modal\") {\n this.applyModalVisualStyling();\n }\n this.applyIframeWrapperStyling();\n\n this.markIframeAsLoaded();\n }\n\n /**\n * Applies visual styling (borders, shadows) to modal content wrapper\n */\n private applyModalVisualStyling(): void {\n if (!this.contentWrapper) return;\n\n this.contentWrapper.style.borderRadius = IframeManager.BORDER_RADIUS;\n this.contentWrapper.style.boxShadow =\n \"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)\";\n }\n\n /**\n * Removes visual styling (borders, shadows) from modal content wrapper\n */\n private removeModalVisualStyling(): void {\n if (!this.contentWrapper) return;\n\n this.contentWrapper.style.borderRadius = \"0\";\n this.contentWrapper.style.boxShadow = \"none\";\n }\n\n /**\n * Applies visual styling (borders) to iframe wrapper\n */\n private applyIframeWrapperStyling(): void {\n if (!this.iframeWrapper) return;\n\n this.iframeWrapper.style.borderRadius = IframeManager.BORDER_RADIUS;\n }\n\n /**\n * Removes visual styling (borders) from iframe wrapper\n */\n private removeIframeWrapperStyling(): void {\n if (!this.iframeWrapper) return;\n\n this.iframeWrapper.style.borderRadius = \"0\";\n }\n\n /**\n * Check if an iframe is currently preloaded\n */\n public isIframePreloaded(): boolean {\n return this.isPreloaded;\n }\n\n /**\n * Get the URL of the preloaded iframe\n */\n public getPreloadedUrl(): string | null {\n return this.preloadUrl;\n }\n\n /**\n * Check if shimmer loader is currently active/showing\n */\n private isShimmerActive(): boolean {\n return !this.isIframeLoaded || !!this.shimmerLoader;\n }\n\n /**\n * Update the onClose handler for the iframe manager\n * This is useful when transitioning from preload to active authentication\n */\n public updateOnCloseHandler(onClose: () => void): void {\n this.onClose = onClose;\n }\n\n public showSubtlePopupFallbackIndicator(): void {\n if (!this.iframeWrapper && !this.contentWrapper) {\n this.logger.warn(\n \"Cannot show popup fallback indicator, no iframe wrapper or content wrapper found.\",\n );\n return;\n }\n\n const targetElement = this.iframeWrapper || this.contentWrapper;\n\n if (targetElement) {\n this.logger.debug(\"Showing popup fallback overlay.\");\n\n // Create overlay element\n const overlay = document.createElement(\"div\");\n overlay.id = \"civic-popup-fallback-overlay\";\n overlay.style.cssText = `\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: transparent;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n border-radius: ${IframeManager.BORDER_RADIUS};\n backdrop-filter: blur(.4px);\n opacity: 1;\n `;\n\n // Add overlay to target element\n targetElement.style.position = \"relative\";\n targetElement.appendChild(overlay);\n\n // Remove overlay quickly\n setTimeout(() => {\n if (overlay.parentNode) {\n overlay.parentNode.removeChild(overlay);\n }\n this.logger.debug(\"Popup fallback overlay removed.\");\n }, 500); // Remove after 500ms\n\n this.logger.debug(\"Popup fallback overlay displayed.\");\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civic/auth",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"esbuild-plugin-css-modules": "^0.3.0",
|
|
78
78
|
"eslint": "^8.57.1",
|
|
79
79
|
"eslint-plugin-require-extensions": "^0.1.3",
|
|
80
|
-
"next": "^14.2.
|
|
80
|
+
"next": "^14.2.25",
|
|
81
81
|
"prettier": "^3.3.3",
|
|
82
82
|
"react": "18.3.1",
|
|
83
83
|
"react-dom": "18.3.1",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"lint": "eslint \"src/**/*.ts*\" \"test/**/*.ts*\" --max-warnings 0",
|
|
117
117
|
"lint:fix": "pnpm lint --fix",
|
|
118
118
|
"test:update": "vitest --update",
|
|
119
|
-
"generate-version": "npx tsx ./generateVersion.ts"
|
|
119
|
+
"generate-version": "npx tsx ./generateVersion.ts",
|
|
120
|
+
"audit": "pnpm audit --audit-level=high"
|
|
120
121
|
}
|
|
121
122
|
}
|