@firebase/auth 1.13.10 → 1.13.11-20261116185243

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 (82) hide show
  1. package/README.md +6 -13
  2. package/dist/browser-cjs/{index-D_utMrqy.js → index-CpWQky3K.js} +52 -21
  3. package/dist/browser-cjs/index-CpWQky3K.js.map +1 -0
  4. package/dist/browser-cjs/index.js +1 -1
  5. package/dist/browser-cjs/internal.js +1 -1
  6. package/dist/{cordova/test/integration/webdriver/util/js_load_condition.d.ts → browser-cjs/src/platform_browser/load_js_browser.d.ts} +7 -8
  7. package/dist/browser-cjs/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  8. package/dist/browser-cjs/test/integration/webdriver/util/idp_page.d.ts +2 -2
  9. package/dist/browser-cjs/test/integration/webdriver/util/ui_page.d.ts +2 -2
  10. package/dist/cordova/index.js +2 -2
  11. package/dist/cordova/internal.js +53 -22
  12. package/dist/cordova/internal.js.map +1 -1
  13. package/dist/cordova/{popup_redirect-7H-mFAlV.js → popup_redirect-CGTSpghz.js} +2 -2
  14. package/dist/cordova/{popup_redirect-7H-mFAlV.js.map → popup_redirect-CGTSpghz.js.map} +1 -1
  15. package/dist/{esm/test/integration/webdriver/util/js_load_condition.d.ts → cordova/src/platform_browser/load_js_browser.d.ts} +7 -8
  16. package/dist/cordova/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  17. package/dist/cordova/test/integration/webdriver/util/idp_page.d.ts +2 -2
  18. package/dist/cordova/test/integration/webdriver/util/ui_page.d.ts +2 -2
  19. package/dist/esm/{index-NmqYMaDt.js → index-B83XeA2v.js} +53 -22
  20. package/dist/esm/index-B83XeA2v.js.map +1 -0
  21. package/dist/esm/index.js +1 -1
  22. package/dist/esm/internal.js +2 -2
  23. package/dist/{browser-cjs/test/integration/webdriver/util/js_load_condition.d.ts → esm/src/platform_browser/load_js_browser.d.ts} +7 -8
  24. package/dist/esm/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  25. package/dist/esm/test/integration/webdriver/util/idp_page.d.ts +2 -2
  26. package/dist/esm/test/integration/webdriver/util/ui_page.d.ts +2 -2
  27. package/dist/index.webworker.js +1 -1
  28. package/dist/node/index.js +1 -1
  29. package/dist/node/internal.js +1 -1
  30. package/dist/node/src/platform_browser/load_js_browser.d.ts +24 -0
  31. package/dist/node/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  32. package/dist/node/test/integration/webdriver/util/idp_page.d.ts +2 -2
  33. package/dist/node/test/integration/webdriver/util/ui_page.d.ts +2 -2
  34. package/dist/node/{totp-c24YsbkT.js → totp-CkbqXM8U.js} +2 -2
  35. package/dist/node/{totp-c24YsbkT.js.map → totp-CkbqXM8U.js.map} +1 -1
  36. package/dist/node-esm/index.js +1 -1
  37. package/dist/node-esm/internal.js +2 -2
  38. package/dist/node-esm/{test/integration/webdriver/util/js_load_condition.d.ts → src/platform_browser/load_js_browser.d.ts} +7 -8
  39. package/dist/node-esm/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  40. package/dist/node-esm/test/integration/webdriver/util/idp_page.d.ts +2 -2
  41. package/dist/node-esm/test/integration/webdriver/util/ui_page.d.ts +2 -2
  42. package/dist/node-esm/{totp-DWW-ace_.js → totp-B65jY57a.js} +2 -2
  43. package/dist/node-esm/{totp-DWW-ace_.js.map → totp-B65jY57a.js.map} +1 -1
  44. package/dist/rn/{index-UkwZ-hC_.js → index-BI5SQ2TI.js} +2 -2
  45. package/dist/rn/{index-UkwZ-hC_.js.map → index-BI5SQ2TI.js.map} +1 -1
  46. package/dist/rn/index.js +1 -1
  47. package/dist/rn/internal.js +51 -20
  48. package/dist/rn/internal.js.map +1 -1
  49. package/dist/rn/src/platform_browser/load_js_browser.d.ts +24 -0
  50. package/dist/rn/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  51. package/dist/rn/test/integration/webdriver/util/idp_page.d.ts +2 -2
  52. package/dist/rn/test/integration/webdriver/util/ui_page.d.ts +2 -2
  53. package/dist/src/platform_browser/load_js_browser.d.ts +24 -0
  54. package/dist/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  55. package/dist/test/integration/webdriver/util/idp_page.d.ts +2 -2
  56. package/dist/test/integration/webdriver/util/ui_page.d.ts +2 -2
  57. package/dist/web-extension-cjs/index.js +1 -1
  58. package/dist/web-extension-cjs/internal.js +51 -20
  59. package/dist/web-extension-cjs/internal.js.map +1 -1
  60. package/dist/web-extension-cjs/{register-B6mm-2Ol.js → register-DRXqQWJe.js} +2 -2
  61. package/dist/web-extension-cjs/{register-B6mm-2Ol.js.map → register-DRXqQWJe.js.map} +1 -1
  62. package/dist/web-extension-cjs/src/platform_browser/load_js_browser.d.ts +24 -0
  63. package/dist/web-extension-cjs/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  64. package/dist/web-extension-cjs/test/integration/webdriver/util/idp_page.d.ts +2 -2
  65. package/dist/web-extension-cjs/test/integration/webdriver/util/ui_page.d.ts +2 -2
  66. package/dist/web-extension-esm/index.js +2 -2
  67. package/dist/web-extension-esm/internal.js +53 -22
  68. package/dist/web-extension-esm/internal.js.map +1 -1
  69. package/dist/web-extension-esm/{register-Cv6DpA4G.js → register-CWk4FQGj.js} +2 -2
  70. package/dist/web-extension-esm/{register-Cv6DpA4G.js.map → register-CWk4FQGj.js.map} +1 -1
  71. package/dist/web-extension-esm/src/platform_browser/load_js_browser.d.ts +24 -0
  72. package/dist/web-extension-esm/test/integration/webdriver/util/auth_driver.d.ts +9 -5
  73. package/dist/web-extension-esm/test/integration/webdriver/util/idp_page.d.ts +2 -2
  74. package/dist/web-extension-esm/test/integration/webdriver/util/ui_page.d.ts +2 -2
  75. package/package.json +3 -6
  76. package/dist/browser-cjs/index-D_utMrqy.js.map +0 -1
  77. package/dist/esm/index-NmqYMaDt.js.map +0 -1
  78. package/dist/node/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
  79. package/dist/rn/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
  80. package/dist/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
  81. package/dist/web-extension-cjs/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
  82. package/dist/web-extension-esm/test/integration/webdriver/util/js_load_condition.d.ts +0 -25
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-D_utMrqy.js');
5
+ var index = require('./index-CpWQky3K.js');
6
6
  require('@firebase/app');
7
7
  require('@firebase/util');
8
8
  require('@firebase/logger');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-D_utMrqy.js');
5
+ var index = require('./index-CpWQky3K.js');
6
6
  var util = require('@firebase/util');
7
7
  require('@firebase/app');
8
8
  require('@firebase/logger');
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright 2020 Google LLC
3
+ * Copyright 2026 Google LLC
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -14,12 +14,11 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { Condition } from 'selenium-webdriver';
18
17
  /**
19
- * A condition that looks for the presence of a specified function. This is
20
- * used with WebDriver .wait() as a proxy for determining when the JS has
21
- * finished loading in a page.
18
+ * Loads an external script by inserting a script tag into the page. The script
19
+ * URL is set through the Firebase Trusted Types policy when Trusted Types are
20
+ * supported, so that this works on pages that enforce Trusted Types.
21
+ *
22
+ * @internal
22
23
  */
23
- export declare class JsLoadCondition extends Condition<boolean> {
24
- constructor(globalValue: string);
25
- }
24
+ export declare function _loadJSInBrowser(url: string): Promise<Event>;
@@ -14,16 +14,20 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { Auth, User, Persistence } from '@firebase/auth';
18
- import { WebDriver } from 'selenium-webdriver';
17
+ import type { Auth, User, Persistence } from '@firebase/auth';
18
+ import type { Browser, BrowserContext, Page } from 'playwright';
19
19
  export declare const START_FUNCTION = "startAuth";
20
- /** Helper wrapper around the WebDriver object */
20
+ /** Helper wrapper around the Playwright Page and BrowserContext objects */
21
21
  export declare class AuthDriver {
22
- webDriver: WebDriver;
23
- start(browser: string): Promise<void>;
22
+ browser: Browser;
23
+ context: BrowserContext;
24
+ page: Page;
25
+ start(browserName: string): Promise<void>;
24
26
  stop(): Promise<void>;
25
27
  call<T>(fn: string, ...args: unknown[]): Promise<T>;
26
28
  callNoWait(fn: string, ...args: unknown[]): Promise<void>;
29
+ waitForGlobal(globalValue: string): Promise<void>;
30
+ wait(condition: () => Promise<boolean> | boolean, timeoutMs?: number): Promise<void>;
27
31
  getAuthSnapshot(): Promise<Auth>;
28
32
  getUserSnapshot(): Promise<User>;
29
33
  reset(): Promise<void>;
@@ -14,11 +14,11 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { WebDriver } from 'selenium-webdriver';
17
+ import type { AuthDriver } from './auth_driver';
18
18
  export declare class IdPPage {
19
19
  private readonly driver;
20
20
  static PAGE_TITLE: string;
21
- constructor(driver: WebDriver);
21
+ constructor(driver: AuthDriver);
22
22
  pageLoad(): Promise<void>;
23
23
  clickAddAccount(): Promise<void>;
24
24
  clickSignIn(): Promise<void>;
@@ -14,10 +14,10 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { WebDriver } from 'selenium-webdriver';
17
+ import type { AuthDriver } from './auth_driver';
18
18
  export declare class UiPage {
19
19
  private readonly driver;
20
- constructor(driver: WebDriver);
20
+ constructor(driver: AuthDriver);
21
21
  clickGuestSignIn(): Promise<void>;
22
22
  clickGoogleSignIn(): Promise<void>;
23
23
  clickPhoneSignIn(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { _getProvider, getApp } from '@firebase/app';
2
- import { _ as _linkWithRedirect, a as _reauthenticateWithRedirect, b as _signInWithRedirect, r as registerAuth, i as initializeAuth, c as cordovaPopupRedirectResolver, d as indexedDBLocalPersistence } from './popup_redirect-7H-mFAlV.js';
3
- export { A as ActionCodeOperation, e as ActionCodeURL, f as AuthCredential, g as AuthErrorCodes, E as EmailAuthCredential, h as EmailAuthProvider, F as FacebookAuthProvider, j as FactorId, G as GithubAuthProvider, k as GoogleAuthProvider, O as OAuthCredential, l as OAuthProvider, m as OperationType, P as PhoneAuthCredential, n as ProviderId, S as SAMLAuthProvider, o as SignInMethod, T as TwitterAuthProvider, p as applyActionCode, q as beforeAuthStateChanged, s as browserLocalPersistence, t as browserSessionPersistence, u as checkActionCode, v as confirmPasswordReset, w as connectAuthEmulator, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getIdToken, H as getIdTokenResult, I as getMultiFactorResolver, J as getRedirectResult, K as inMemoryPersistence, L as initializeRecaptchaConfig, M as isSignInWithEmailLink, N as linkWithCredential, Q as multiFactor, R as onAuthStateChanged, U as onIdTokenChanged, V as parseActionCodeURL, W as prodErrorMap, X as reauthenticateWithCredential, Y as reload, Z as revokeAccessToken, $ as sendEmailVerification, a0 as sendPasswordResetEmail, a1 as sendSignInLinkToEmail, a2 as setPersistence, a3 as signInAnonymously, a4 as signInWithCredential, a5 as signInWithCustomToken, a6 as signInWithEmailAndPassword, a7 as signInWithEmailLink, a8 as signOut, a9 as unlink, aa as updateCurrentUser, ab as updateEmail, ac as updatePassword, ad as updateProfile, ae as useDeviceLanguage, af as validatePassword, ag as verifyBeforeUpdateEmail, ah as verifyPasswordResetCode } from './popup_redirect-7H-mFAlV.js';
2
+ import { _ as _linkWithRedirect, a as _reauthenticateWithRedirect, b as _signInWithRedirect, r as registerAuth, i as initializeAuth, c as cordovaPopupRedirectResolver, d as indexedDBLocalPersistence } from './popup_redirect-CGTSpghz.js';
3
+ export { A as ActionCodeOperation, e as ActionCodeURL, f as AuthCredential, g as AuthErrorCodes, E as EmailAuthCredential, h as EmailAuthProvider, F as FacebookAuthProvider, j as FactorId, G as GithubAuthProvider, k as GoogleAuthProvider, O as OAuthCredential, l as OAuthProvider, m as OperationType, P as PhoneAuthCredential, n as ProviderId, S as SAMLAuthProvider, o as SignInMethod, T as TwitterAuthProvider, p as applyActionCode, q as beforeAuthStateChanged, s as browserLocalPersistence, t as browserSessionPersistence, u as checkActionCode, v as confirmPasswordReset, w as connectAuthEmulator, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getIdToken, H as getIdTokenResult, I as getMultiFactorResolver, J as getRedirectResult, K as inMemoryPersistence, L as initializeRecaptchaConfig, M as isSignInWithEmailLink, N as linkWithCredential, Q as multiFactor, R as onAuthStateChanged, U as onIdTokenChanged, V as parseActionCodeURL, W as prodErrorMap, X as reauthenticateWithCredential, Y as reload, Z as revokeAccessToken, $ as sendEmailVerification, a0 as sendPasswordResetEmail, a1 as sendSignInLinkToEmail, a2 as setPersistence, a3 as signInAnonymously, a4 as signInWithCredential, a5 as signInWithCustomToken, a6 as signInWithEmailAndPassword, a7 as signInWithEmailLink, a8 as signOut, a9 as unlink, aa as updateCurrentUser, ab as updateEmail, ac as updatePassword, ad as updateProfile, ae as useDeviceLanguage, af as validatePassword, ag as verifyBeforeUpdateEmail, ah as verifyPasswordResetCode } from './popup_redirect-CGTSpghz.js';
4
4
  import '@firebase/util';
5
5
  import '@firebase/component';
6
6
  import '@firebase/logger';
@@ -1,7 +1,7 @@
1
- import { ai as _performApiRequest, aj as _addTidIfNecessary, ak as Delay, al as MockReCaptcha, am as _window, an as _assert, ao as isV2, ap as _createError, aq as _recaptchaV2ScriptUrl, ar as _loadJS, as as _generateCallbackName, at as _castAuth, au as _isHttpOrHttps, av as _isWorker, aw as getRecaptchaParams, ax as _assertLinkedStatus, N as linkWithCredential, ay as _serverAppCurrentUserOperationNotSupportedError, X as reauthenticateWithCredential, a4 as signInWithCredential, az as _link, aA as _initializeRecaptchaConfig, aB as FAKE_TOKEN, aC as startEnrollPhoneMfa, aD as handleRecaptchaFlow, aE as sendPhoneVerificationCode, P as PhoneAuthCredential, aF as _assertInstanceOf, aG as _withDefaultResolver, aH as AbstractPopupRedirectOperation, aI as debugAssert, aJ as _generateEventId, aK as FederatedAuthProvider, aL as _getProjectConfig, aM as _fail, aN as _getCurrentUrl, aO as _gapiScriptUrl, aP as _emulatorUrl, aQ as _isChromeIOS, aR as _isFirefox, aS as _isIOSStandalone, t as browserSessionPersistence, aT as _getRedirectResult, aU as _overrideRedirectResult, aV as _getRedirectUrl, aW as _setWindowLocation, aX as AuthEventManager, aY as _isMobileBrowser, aZ as _isSafari, a_ as _isIOS, a$ as debugFail, b0 as finalizeEnrollPhoneMfa, b1 as startEnrollTotpMfa, b2 as finalizeEnrollTotpMfa, r as registerAuth, i as initializeAuth, d as indexedDBLocalPersistence, s as browserLocalPersistence, q as beforeAuthStateChanged, U as onIdTokenChanged, w as connectAuthEmulator, b3 as _setExternalJSProvider } from './popup_redirect-7H-mFAlV.js';
2
- export { A as ActionCodeOperation, e as ActionCodeURL, f as AuthCredential, g as AuthErrorCodes, b4 as AuthImpl, E as EmailAuthCredential, h as EmailAuthProvider, F as FacebookAuthProvider, j as FactorId, b5 as FetchProvider, G as GithubAuthProvider, k as GoogleAuthProvider, O as OAuthCredential, l as OAuthProvider, m as OperationType, n as ProviderId, b6 as SAMLAuthCredential, S as SAMLAuthProvider, o as SignInMethod, T as TwitterAuthProvider, b7 as UserImpl, b8 as _getClientVersion, b9 as _getInstance, ba as _persistenceKeyName, p as applyActionCode, u as checkActionCode, v as confirmPasswordReset, c as cordovaPopupRedirectResolver, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getIdToken, H as getIdTokenResult, I as getMultiFactorResolver, J as getRedirectResult, K as inMemoryPersistence, L as initializeRecaptchaConfig, M as isSignInWithEmailLink, bb as linkWithRedirect, Q as multiFactor, R as onAuthStateChanged, V as parseActionCodeURL, W as prodErrorMap, bc as reauthenticateWithRedirect, Y as reload, Z as revokeAccessToken, $ as sendEmailVerification, a0 as sendPasswordResetEmail, a1 as sendSignInLinkToEmail, a2 as setPersistence, a3 as signInAnonymously, a5 as signInWithCustomToken, a6 as signInWithEmailAndPassword, a7 as signInWithEmailLink, bd as signInWithRedirect, a8 as signOut, a9 as unlink, aa as updateCurrentUser, ab as updateEmail, ac as updatePassword, ad as updateProfile, ae as useDeviceLanguage, af as validatePassword, ag as verifyBeforeUpdateEmail, ah as verifyPasswordResetCode } from './popup_redirect-7H-mFAlV.js';
1
+ import { ai as _performApiRequest, aj as _addTidIfNecessary, ak as Delay, al as MockReCaptcha, am as _window, an as _assert, ao as isV2, ap as _createError, aq as _recaptchaV2ScriptUrl, ar as _loadJS, as as _generateCallbackName, at as _castAuth, au as _isHttpOrHttps, av as _isWorker, aw as getRecaptchaParams, ax as _assertLinkedStatus, N as linkWithCredential, ay as _serverAppCurrentUserOperationNotSupportedError, X as reauthenticateWithCredential, a4 as signInWithCredential, az as _link, aA as _initializeRecaptchaConfig, aB as FAKE_TOKEN, aC as startEnrollPhoneMfa, aD as handleRecaptchaFlow, aE as sendPhoneVerificationCode, P as PhoneAuthCredential, aF as _assertInstanceOf, aG as _withDefaultResolver, aH as AbstractPopupRedirectOperation, aI as debugAssert, aJ as _generateEventId, aK as FederatedAuthProvider, aL as _getProjectConfig, aM as _fail, aN as _getCurrentUrl, aO as _gapiScriptUrl, aP as _emulatorUrl, aQ as _isChromeIOS, aR as _isFirefox, aS as _isIOSStandalone, t as browserSessionPersistence, aT as _getRedirectResult, aU as _overrideRedirectResult, aV as _getRedirectUrl, aW as _setWindowLocation, aX as AuthEventManager, aY as _isMobileBrowser, aZ as _isSafari, a_ as _isIOS, a$ as debugFail, b0 as finalizeEnrollPhoneMfa, b1 as startEnrollTotpMfa, b2 as finalizeEnrollTotpMfa, r as registerAuth, i as initializeAuth, d as indexedDBLocalPersistence, s as browserLocalPersistence, q as beforeAuthStateChanged, U as onIdTokenChanged, w as connectAuthEmulator, b3 as _setExternalJSProvider } from './popup_redirect-CGTSpghz.js';
2
+ export { A as ActionCodeOperation, e as ActionCodeURL, f as AuthCredential, g as AuthErrorCodes, b4 as AuthImpl, E as EmailAuthCredential, h as EmailAuthProvider, F as FacebookAuthProvider, j as FactorId, b5 as FetchProvider, G as GithubAuthProvider, k as GoogleAuthProvider, O as OAuthCredential, l as OAuthProvider, m as OperationType, n as ProviderId, b6 as SAMLAuthCredential, S as SAMLAuthProvider, o as SignInMethod, T as TwitterAuthProvider, b7 as UserImpl, b8 as _getClientVersion, b9 as _getInstance, ba as _persistenceKeyName, p as applyActionCode, u as checkActionCode, v as confirmPasswordReset, c as cordovaPopupRedirectResolver, x as createUserWithEmailAndPassword, y as debugErrorMap, z as deleteUser, B as fetchSignInMethodsForEmail, C as getAdditionalUserInfo, D as getIdToken, H as getIdTokenResult, I as getMultiFactorResolver, J as getRedirectResult, K as inMemoryPersistence, L as initializeRecaptchaConfig, M as isSignInWithEmailLink, bb as linkWithRedirect, Q as multiFactor, R as onAuthStateChanged, V as parseActionCodeURL, W as prodErrorMap, bc as reauthenticateWithRedirect, Y as reload, Z as revokeAccessToken, $ as sendEmailVerification, a0 as sendPasswordResetEmail, a1 as sendSignInLinkToEmail, a2 as setPersistence, a3 as signInAnonymously, a5 as signInWithCustomToken, a6 as signInWithEmailAndPassword, a7 as signInWithEmailLink, bd as signInWithRedirect, a8 as signOut, a9 as unlink, aa as updateCurrentUser, ab as updateEmail, ac as updatePassword, ad as updateProfile, ae as useDeviceLanguage, af as validatePassword, ag as verifyBeforeUpdateEmail, ah as verifyPasswordResetCode } from './popup_redirect-CGTSpghz.js';
3
3
  import { querystring, getModularInstance, getUA, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
4
- import { _isFirebaseServerApp, SDK_VERSION, _getProvider, getApp } from '@firebase/app';
4
+ import { _isFirebaseServerApp, SDK_VERSION, _setTrustedScriptSrc, _getProvider, getApp } from '@firebase/app';
5
5
  import '@firebase/component';
6
6
  import '@firebase/logger';
7
7
 
@@ -1852,6 +1852,55 @@ function _isEmptyString(input) {
1852
1852
  return typeof input === 'undefined' || input?.length === 0;
1853
1853
  }
1854
1854
 
1855
+ /**
1856
+ * @license
1857
+ * Copyright 2026 Google LLC
1858
+ *
1859
+ * Licensed under the Apache License, Version 2.0 (the "License");
1860
+ * you may not use this file except in compliance with the License.
1861
+ * You may obtain a copy of the License at
1862
+ *
1863
+ * http://www.apache.org/licenses/LICENSE-2.0
1864
+ *
1865
+ * Unless required by applicable law or agreed to in writing, software
1866
+ * distributed under the License is distributed on an "AS IS" BASIS,
1867
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1868
+ * See the License for the specific language governing permissions and
1869
+ * limitations under the License.
1870
+ */
1871
+ function getScriptParentElement() {
1872
+ return document.getElementsByTagName('head')?.[0] ?? document;
1873
+ }
1874
+ /**
1875
+ * Loads an external script by inserting a script tag into the page. The script
1876
+ * URL is set through the Firebase Trusted Types policy when Trusted Types are
1877
+ * supported, so that this works on pages that enforce Trusted Types.
1878
+ *
1879
+ * @internal
1880
+ */
1881
+ function _loadJSInBrowser(url) {
1882
+ // TODO: consider adding timeout support & cancellation
1883
+ return new Promise((resolve, reject) => {
1884
+ const el = document.createElement('script');
1885
+ try {
1886
+ _setTrustedScriptSrc(el, url);
1887
+ }
1888
+ catch (e) {
1889
+ reject(e);
1890
+ return;
1891
+ }
1892
+ el.onload = resolve;
1893
+ el.onerror = e => {
1894
+ const error = _createError("internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1895
+ error.customData = e;
1896
+ reject(error);
1897
+ };
1898
+ el.type = 'text/javascript';
1899
+ el.charset = 'UTF-8';
1900
+ getScriptParentElement().appendChild(el);
1901
+ });
1902
+ }
1903
+
1855
1904
  /**
1856
1905
  * @license
1857
1906
  * Copyright 2021 Google LLC
@@ -1933,26 +1982,8 @@ function getAuth(app = getApp()) {
1933
1982
  }
1934
1983
  return auth;
1935
1984
  }
1936
- function getScriptParentElement() {
1937
- return document.getElementsByTagName('head')?.[0] ?? document;
1938
- }
1939
1985
  _setExternalJSProvider({
1940
- loadJS(url) {
1941
- // TODO: consider adding timeout support & cancellation
1942
- return new Promise((resolve, reject) => {
1943
- const el = document.createElement('script');
1944
- el.setAttribute('src', url);
1945
- el.onload = resolve;
1946
- el.onerror = e => {
1947
- const error = _createError("internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1948
- error.customData = e;
1949
- reject(error);
1950
- };
1951
- el.type = 'text/javascript';
1952
- el.charset = 'UTF-8';
1953
- getScriptParentElement().appendChild(el);
1954
- });
1955
- },
1986
+ loadJS: _loadJSInBrowser,
1956
1987
  gapiScript: 'https://apis.google.com/js/api.js',
1957
1988
  recaptchaV2Script: 'https://www.google.com/recaptcha/api.js',
1958
1989
  recaptchaEnterpriseScript: 'https://www.google.com/recaptcha/enterprise.js?render='