hibp 14.0.3 → 14.1.1

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 (64) hide show
  1. package/API.md +9 -0
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +14 -9
  4. package/dist/browser/hibp.module.js +1 -1
  5. package/dist/browser/hibp.module.js.map +1 -1
  6. package/dist/browser/hibp.umd.js +1 -1
  7. package/dist/browser/hibp.umd.js.map +1 -1
  8. package/dist/cjs/api/fetch-polyfill.cjs +31 -0
  9. package/dist/cjs/api/fetch-polyfill.cjs.map +1 -0
  10. package/dist/cjs/api/haveibeenpwned/fetch-from-api.cjs +10 -4
  11. package/dist/cjs/api/haveibeenpwned/fetch-from-api.cjs.map +1 -1
  12. package/dist/cjs/api/pwnedpasswords/fetch-from-api.cjs +18 -11
  13. package/dist/cjs/api/pwnedpasswords/fetch-from-api.cjs.map +1 -1
  14. package/dist/cjs/breach.cjs +2 -0
  15. package/dist/cjs/breach.cjs.map +1 -1
  16. package/dist/cjs/breached-account.cjs +4 -0
  17. package/dist/cjs/breached-account.cjs.map +1 -1
  18. package/dist/cjs/breaches.cjs +4 -0
  19. package/dist/cjs/breaches.cjs.map +1 -1
  20. package/dist/cjs/data-classes.cjs +2 -0
  21. package/dist/cjs/data-classes.cjs.map +1 -1
  22. package/dist/cjs/hibp.d.cts +55 -1
  23. package/dist/cjs/package.json.cjs +1 -1
  24. package/dist/cjs/paste-account.cjs +2 -0
  25. package/dist/cjs/paste-account.cjs.map +1 -1
  26. package/dist/cjs/pwned-password-range.cjs +4 -0
  27. package/dist/cjs/pwned-password-range.cjs.map +1 -1
  28. package/dist/cjs/pwned-password.cjs +2 -0
  29. package/dist/cjs/pwned-password.cjs.map +1 -1
  30. package/dist/cjs/search.cjs +5 -0
  31. package/dist/cjs/search.cjs.map +1 -1
  32. package/dist/cjs/subscription-status.cjs +2 -0
  33. package/dist/cjs/subscription-status.cjs.map +1 -1
  34. package/dist/esm/api/fetch-polyfill.js +29 -0
  35. package/dist/esm/api/fetch-polyfill.js.map +1 -0
  36. package/dist/esm/api/haveibeenpwned/fetch-from-api.js +9 -3
  37. package/dist/esm/api/haveibeenpwned/fetch-from-api.js.map +1 -1
  38. package/dist/esm/api/pwnedpasswords/fetch-from-api.js +17 -10
  39. package/dist/esm/api/pwnedpasswords/fetch-from-api.js.map +1 -1
  40. package/dist/esm/breach.js +2 -0
  41. package/dist/esm/breach.js.map +1 -1
  42. package/dist/esm/breached-account.js +4 -0
  43. package/dist/esm/breached-account.js.map +1 -1
  44. package/dist/esm/breaches.js +4 -0
  45. package/dist/esm/breaches.js.map +1 -1
  46. package/dist/esm/data-classes.js +2 -0
  47. package/dist/esm/data-classes.js.map +1 -1
  48. package/dist/esm/hibp.d.ts +55 -1
  49. package/dist/esm/package.json.js +1 -1
  50. package/dist/esm/paste-account.js +2 -0
  51. package/dist/esm/paste-account.js.map +1 -1
  52. package/dist/esm/pwned-password-range.js +4 -0
  53. package/dist/esm/pwned-password-range.js.map +1 -1
  54. package/dist/esm/pwned-password.js +2 -0
  55. package/dist/esm/pwned-password.js.map +1 -1
  56. package/dist/esm/search.js +5 -0
  57. package/dist/esm/search.js.map +1 -1
  58. package/dist/esm/subscription-status.js +2 -0
  59. package/dist/esm/subscription-status.js.map +1 -1
  60. package/package.json +26 -24
  61. package/dist/cjs/api/web-fetch.cjs +0 -14
  62. package/dist/cjs/api/web-fetch.cjs.map +0 -1
  63. package/dist/esm/api/web-fetch.js +0 -10
  64. package/dist/esm/api/web-fetch.js.map +0 -1
package/API.md CHANGED
@@ -100,6 +100,7 @@ with an Error
100
100
  | breachName | <code>string</code> | the name of a breach in the system |
101
101
  | [options] | <code>object</code> | a configuration object |
102
102
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
103
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
103
104
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
104
105
 
105
106
  **Example**
@@ -138,6 +139,7 @@ an Error
138
139
  | [options.apiKey] | <code>string</code> | an API key from https://haveibeenpwned.com/API/Key (default: undefined) |
139
140
  | [options.domain] | <code>string</code> | a domain by which to filter the results (default: all domains) |
140
141
  | [options.includeUnverified] | <code>boolean</code> | include "unverified" breaches in the results (default: true) |
142
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
141
143
  | [options.truncate] | <code>boolean</code> | truncate the results to only include the name of each breach (default: true) |
142
144
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
143
145
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
@@ -203,6 +205,7 @@ objects (an empty array if no breaches were found), or rejects with an Error
203
205
  | [options] | <code>object</code> | a configuration object |
204
206
  | [options.domain] | <code>string</code> | a domain by which to filter the results (default: all domains) |
205
207
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
208
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
206
209
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
207
210
 
208
211
  **Example**
@@ -245,6 +248,7 @@ Error
245
248
  | --- | --- | --- |
246
249
  | [options] | <code>object</code> | a configuration object |
247
250
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
251
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
248
252
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
249
253
 
250
254
  **Example**
@@ -282,6 +286,7 @@ Error
282
286
  | [options] | <code>object</code> | a configuration object |
283
287
  | [options.apiKey] | <code>string</code> | an API key from https://haveibeenpwned.com/API/Key (default: undefined) |
284
288
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
289
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
285
290
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
286
291
 
287
292
  **Example**
@@ -338,6 +343,7 @@ password data set, or rejects with an Error
338
343
  | [options.addPadding] | <code>boolean</code> | ask the remote API to add padding to the response to obscure the password prefix (default: `false`) |
339
344
  | [options.mode] | <code>&#x27;sha1&#x27;</code> \| <code>&#x27;ntlm&#x27;</code> | return SHA-1 or NTLM hashes (default: `sha1`) |
340
345
  | [options.baseUrl] | <code>string</code> | a custom base URL for the pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`) |
346
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
341
347
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
342
348
 
343
349
  **Example**
@@ -382,6 +388,7 @@ the password has been exposed in a breach, or rejects with an Error
382
388
  | [options] | <code>object</code> | a configuration object |
383
389
  | [options.addPadding] | <code>boolean</code> | ask the remote API to add padding to the response to obscure the password prefix (default: `false`) |
384
390
  | [options.baseUrl] | <code>string</code> | a custom base URL for the pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`) |
391
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
385
392
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
386
393
 
387
394
  **Example**
@@ -430,6 +437,7 @@ rejects with an Error
430
437
  | [options.domain] | <code>string</code> | a domain by which to filter the breach results (default: all domains) |
431
438
  | [options.truncate] | <code>boolean</code> | truncate the breach results to only include the name of each breach (default: true) |
432
439
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
440
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
433
441
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
434
442
 
435
443
  **Example**
@@ -481,6 +489,7 @@ subscription status object, or rejects with an Error
481
489
  | [options] | <code>object</code> | a configuration object |
482
490
  | [options.apiKey] | <code>string</code> | an API key from https://haveibeenpwned.com/API/Key (default: undefined) |
483
491
  | [options.baseUrl] | <code>string</code> | a custom base URL for the haveibeenpwned.com API endpoints (default: `https://haveibeenpwned.com/api/v3`) |
492
+ | [options.timeoutMs] | <code>number</code> | timeout for the request in milliseconds (default: none) |
484
493
  | [options.userAgent] | <code>string</code> | a custom string to send as the User-Agent field in the request headers (default: `hibp <version>`) |
485
494
 
486
495
  **Example**
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 14.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#464](https://github.com/wKovacs64/hibp/pull/464) [`1dd6547`](https://github.com/wKovacs64/hibp/commit/1dd65475a93a32a0ddcd93bf1696869b266372cf) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Fix consumption from Next.js client components.
8
+
9
+ ## 14.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#462](https://github.com/wKovacs64/hibp/pull/462) [`b6076f2`](https://github.com/wKovacs64/hibp/commit/b6076f21449dac656a2f65137c67af240ae81ed2) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Add the `timeoutMs` option to all modules, allowing the consumer to specify a timeout for the underlying network request (in milliseconds). Requests that take longer than the sppecified timeout period will throw/reject. There is no default timeout, as `fetch` itself has no timeout by default and providing one would be arbitrary, unexpected, and a breaking change.
14
+
15
+ - [#458](https://github.com/wKovacs64/hibp/pull/458) [`0a82b8d`](https://github.com/wKovacs64/hibp/commit/0a82b8d9ea7240735defebf48677e3a00c9634e2) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Only polyfill global `fetch` on Node.js v18, and use `undici` instead of `@remix-run/web-fetch`. This also enables use of `hibp` in web workers and extension background threads.
16
+
17
+ ### Patch Changes
18
+
19
+ - [#461](https://github.com/wKovacs64/hibp/pull/461) [`aa90167`](https://github.com/wKovacs64/hibp/commit/aa90167cbaffc21bf6e99877bafc00ce7b14dc86) Thanks [@wKovacs64](https://github.com/wKovacs64)! - Fix a bug in `pwnedPassword` and `pwnedPasswordRange` modules where the `addPadding` and `userAgent` options could not be used simultaneously.
20
+
3
21
  ## 14.0.3
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -232,15 +232,20 @@ Thanks goes to these wonderful people
232
232
  <!-- prettier-ignore-start -->
233
233
  <!-- markdownlint-disable -->
234
234
  <table>
235
- <tr>
236
- <td align="center"><a href="https://github.com/wKovacs64"><img src="https://avatars.githubusercontent.com/u/1288694?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Justin Hall</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=wKovacs64" title="Code">💻</a> <a href="https://github.com/wKovacs64/hibp/commits?author=wKovacs64" title="Documentation">📖</a> <a href="#infra-wKovacs64" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-wKovacs64" title="Maintenance">🚧</a> <a href="https://github.com/wKovacs64/hibp/pulls?q=is%3Apr+reviewed-by%3AwKovacs64" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/wKovacs64/hibp/commits?author=wKovacs64" title="Tests">⚠️</a></td>
237
- <td align="center"><a href="https://www.troyhunt.com"><img src="https://avatars.githubusercontent.com/u/273244?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Troy Hunt</b></sub></a><br /><a href="#data-troyhunt" title="Data">🔣</a></td>
238
- <td align="center"><a href="https://jellekralt.com"><img src="https://avatars.githubusercontent.com/u/214558?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jelle Kralt</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=jellekralt" title="Code">💻</a></td>
239
- <td align="center"><a href="https://github.com/timaschew"><img src="https://avatars.githubusercontent.com/u/110870?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anton W</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/issues?q=author%3Atimaschew" title="Bug reports">🐛</a></td>
240
- <td align="center"><a href="https://github.com/danieladams456"><img src="https://avatars.githubusercontent.com/u/3953840?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daniel Adams</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=danieladams456" title="Code">💻</a></td>
241
- <td align="center"><a href="https://twitter.com/d0gb3r7"><img src="https://avatars.githubusercontent.com/u/454308?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Markus Dolic</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/issues?q=author%3Ayelworc" title="Bug reports">🐛</a></td>
242
- <td align="center"><a href="https://github.com/textbook/about"><img src="https://avatars.githubusercontent.com/u/785939?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jonathan Sharpe</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=textbook" title="Code">💻</a></td>
243
- </tr>
235
+ <tbody>
236
+ <tr>
237
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/wKovacs64"><img src="https://avatars.githubusercontent.com/u/1288694?v=4?s=100" width="100px;" alt="Justin Hall"/><br /><sub><b>Justin Hall</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=wKovacs64" title="Code">💻</a> <a href="https://github.com/wKovacs64/hibp/commits?author=wKovacs64" title="Documentation">📖</a> <a href="#infra-wKovacs64" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-wKovacs64" title="Maintenance">🚧</a> <a href="https://github.com/wKovacs64/hibp/pulls?q=is%3Apr+reviewed-by%3AwKovacs64" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/wKovacs64/hibp/commits?author=wKovacs64" title="Tests">⚠️</a></td>
238
+ <td align="center" valign="top" width="14.28%"><a href="https://www.troyhunt.com"><img src="https://avatars.githubusercontent.com/u/273244?v=4?s=100" width="100px;" alt="Troy Hunt"/><br /><sub><b>Troy Hunt</b></sub></a><br /><a href="#data-troyhunt" title="Data">🔣</a></td>
239
+ <td align="center" valign="top" width="14.28%"><a href="https://jellekralt.com"><img src="https://avatars.githubusercontent.com/u/214558?v=4?s=100" width="100px;" alt="Jelle Kralt"/><br /><sub><b>Jelle Kralt</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=jellekralt" title="Code">💻</a></td>
240
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/timaschew"><img src="https://avatars.githubusercontent.com/u/110870?v=4?s=100" width="100px;" alt="Anton W"/><br /><sub><b>Anton W</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/issues?q=author%3Atimaschew" title="Bug reports">🐛</a></td>
241
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/danieladams456"><img src="https://avatars.githubusercontent.com/u/3953840?v=4?s=100" width="100px;" alt="Daniel Adams"/><br /><sub><b>Daniel Adams</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=danieladams456" title="Code">💻</a></td>
242
+ <td align="center" valign="top" width="14.28%"><a href="https://twitter.com/d0gb3r7"><img src="https://avatars.githubusercontent.com/u/454308?v=4?s=100" width="100px;" alt="Markus Dolic"/><br /><sub><b>Markus Dolic</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/issues?q=author%3Ayelworc" title="Bug reports">🐛</a></td>
243
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/textbook/about"><img src="https://avatars.githubusercontent.com/u/785939?v=4?s=100" width="100px;" alt="Jonathan Sharpe"/><br /><sub><b>Jonathan Sharpe</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/commits?author=textbook" title="Code">💻</a></td>
244
+ </tr>
245
+ <tr>
246
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/ArcadeRenegade"><img src="https://avatars.githubusercontent.com/u/13874898?v=4?s=100" width="100px;" alt="Ryan"/><br /><sub><b>Ryan</b></sub></a><br /><a href="https://github.com/wKovacs64/hibp/issues?q=author%3AArcadeRenegade" title="Bug reports">🐛</a></td>
247
+ </tr>
248
+ </tbody>
244
249
  </table>
245
250
 
246
251
  <!-- markdownlint-restore -->
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof window?window.fetch:async function(t,e){return(await Promise.resolve().then((function(){return _}))).fetch(t,e)};const e="hibp",n="14.0.3",r=new Map,s={headers:r,status:400,statusText:"Bad request — the account does not comply with an acceptable format."},o={headers:r,status:401,body:{statusCode:401,message:"Access denied due to missing hibp-api-key."}},i={headers:r,status:403,statusText:"Forbidden - access denied."},u={headers:r,status:404},a={headers:new Map([["retry-after","2"]]),status:429,body:{statusCode:429,message:"Rate limit is exceeded. Try again in 2 seconds."}};class h extends Error{retryAfterSeconds;constructor(t,e,n){super(e,n),this.name=this.constructor.name,this.retryAfterSeconds="string"==typeof t?Number.parseInt(t,10):void 0}}async function c(r,c={}){const{apiKey:f,baseUrl:l="https://haveibeenpwned.com/api/v3",userAgent:d}=c,p={};f&&(p["HIBP-API-Key"]=f),d&&(p["User-Agent"]=d),d||"undefined"!=typeof navigator||(p["User-Agent"]=`${e} ${n}`);const g={headers:p},m=`${l.replace(/\/$/g,"")}${r}`,A=await t(m,g);if(A.ok)return A.json();switch(A.status){case s.status:throw Error(s.statusText);case o.status:{const t=await A.json();throw Error(t.message)}case i.status:{const t=A.headers.get("cf-ray");if(t)throw Error(function(t){return`Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${t})`}(t));throw Error(i.statusText)}case u.status:return null;case a.status:{const t=await A.json(),e=A.headers.get("retry-after");throw new h(e,t.message)}default:throw Error(A.statusText)}}function f(t,e={}){return c("/breach/"+encodeURIComponent(t),e)}function l(t,e={}){const{apiKey:n,domain:r,includeUnverified:s=!0,truncate:o=!0,baseUrl:i,userAgent:u}=e,a=`/breachedaccount/${encodeURIComponent(t)}?`,h=[];return r&&h.push("domain="+encodeURIComponent(r)),s||h.push("includeUnverified=false"),o||h.push("truncateResponse=false"),c(`${a}${h.join("&")}`,{apiKey:n,baseUrl:i,userAgent:u})}function d(t={}){const{domain:e,baseUrl:n,userAgent:r}=t,s=[];return e&&s.push("domain="+encodeURIComponent(e)),c("/breaches?"+s.join("&"),{baseUrl:n,userAgent:r})}function p(t={}){return c("/dataclasses",t)}function g(t,e={}){return c("/pasteaccount/"+encodeURIComponent(t),e)}const m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="ARRAYBUFFER not supported by this environment",b="UINT8ARRAY not supported by this environment";function w(t,e,n,r){let s,o,i;const u=e||[0],a=(n=n||0)>>>3,h=-1===r?3:0;for(s=0;t.length>s;s+=1)i=s+a,o=i>>>2,o>=u.length&&u.push(0),u[o]|=t[s]<<8*(h+r*(i%4));return{value:u,binLen:8*t.length+n}}function U(t,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;if(0!=t.length%2)throw Error("String of HEX type must be in byte increments");const a=e||[0],h=(n=n||0)>>>3,c=-1===r?3:0;for(s=0;t.length>s;s+=2){if(o=parseInt(t.substr(s,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(u=(s>>>1)+h,i=u>>>2;i>=a.length;)a.push(0);a[i]|=o<<8*(c+r*(u%4))}return{value:a,binLen:4*t.length+n}}(t,e,r,n)};case"TEXT":return function(t,r,s){return function(t,e,n,r,s){let o,i,u,a,h,c,f,l,d=0;const p=n||[0],g=(r=r||0)>>>3;if("UTF8"===e)for(f=-1===s?3:0,u=0;t.length>u;u+=1)for(o=t.charCodeAt(u),i=[],128>o?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||o>=57344?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(u)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),a=0;i.length>a;a+=1){for(c=d+g,h=c>>>2;h>=p.length;)p.push(0);p[h]|=i[a]<<8*(f+s*(c%4)),d+=1}else for(f=-1===s?2:0,l="UTF16LE"===e&&1!==s||"UTF16LE"!==e&&1===s,u=0;t.length>u;u+=1){for(o=t.charCodeAt(u),!0===l&&(a=255&o,o=a<<8|o>>>8),c=d+g,h=c>>>2;h>=p.length;)p.push(0);p[h]|=o<<8*(f+s*(c%4)),d+=2}return{value:p,binLen:8*d+r}}(t,e,r,s,n)};case"B64":return function(t,e,r){return function(t,e,n,r){let s,o,i,u,a,h,c,f=0;const l=e||[0],d=(n=n||0)>>>3,p=-1===r?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&t.length>g)throw Error("Invalid '=' found in base-64 string");for(o=0;t.length>o;o+=4){for(a=t.substr(o,4),u=0,i=0;a.length>i;i+=1)s=m.indexOf(a.charAt(i)),u|=s<<18-6*i;for(i=0;a.length-1>i;i+=1){for(c=f+d,h=c>>>2;h>=l.length;)l.push(0);l[h]|=(u>>>16-8*i&255)<<8*(p+r*(c%4)),f+=1}}return{value:l,binLen:8*f+n}}(t,e,r,n)};case"BYTES":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;const a=e||[0],h=(n=n||0)>>>3,c=-1===r?3:0;for(o=0;t.length>o;o+=1)s=t.charCodeAt(o),u=o+h,i=u>>>2,i>=a.length&&a.push(0),a[i]|=s<<8*(c+r*(u%4));return{value:a,binLen:8*t.length+n}}(t,e,r,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error(A)}return function(t,e,r){return function(t,e,n,r){return w(new Uint8Array(t),e,n,r)}(t,e,r,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error(b)}return function(t,e,r){return w(t,e,r,n)};default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function E(t,e,n,r){switch(t){case"HEX":return function(t){return function(t,e,n,r){const s="0123456789abcdef";let o,i,u="";const a=e/8,h=-1===n?3:0;for(o=0;a>o;o+=1)i=t[o>>>2]>>>8*(h+n*(o%4)),u+=s.charAt(i>>>4&15)+s.charAt(15&i);return r.outputUpper?u.toUpperCase():u}(t,e,n,r)};case"B64":return function(t){return function(t,e,n,r){let s,o,i,u,a,h="";const c=e/8,f=-1===n?3:0;for(s=0;c>s;s+=3)for(u=c>s+1?t[s+1>>>2]:0,a=c>s+2?t[s+2>>>2]:0,i=(t[s>>>2]>>>8*(f+n*(s%4))&255)<<16|(u>>>8*(f+n*((s+1)%4))&255)<<8|a>>>8*(f+n*((s+2)%4))&255,o=0;4>o;o+=1)h+=8*s+6*o>e?r.b64Pad:m.charAt(i>>>6*(3-o)&63);return h}(t,e,n,r)};case"BYTES":return function(t){return function(t,e,n){let r,s,o="";const i=e/8,u=-1===n?3:0;for(r=0;i>r;r+=1)s=t[r>>>2]>>>8*(u+n*(r%4))&255,o+=String.fromCharCode(s);return o}(t,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error(A)}return function(t){return function(t,e,n){let r;const s=e/8,o=new ArrayBuffer(s),i=new Uint8Array(o),u=-1===n?3:0;for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(u+n*(r%4))&255;return o}(t,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error(b)}return function(t){return function(t,e,n){let r;const s=e/8,o=-1===n?3:0,i=new Uint8Array(s);for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(o+n*(r%4))&255;return i}(t,e,n)};default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function y(t){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=t||{},r="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw Error(r);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw Error(r);e.outputLen=n.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}class R{constructor(t,e,n){const r=n||{};if(this.t=e,this.i=r.encoding||"UTF8",this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let e,n=0;const r=this.T>>>5,s=this.F(t,this.h,this.u),o=s.binLen,i=s.value,u=o>>>5;for(e=0;u>e;e+=r)o>=n+this.T&&(this.m=this.g(i.slice(e,e+r),this.m),n+=this.T);return this.A+=n,this.h=i.slice(n>>>5),this.u=o%this.T,this.l=!0,this}getHash(t,e){let n,r,s=this.B;const o=y(e);if(this.v){if(-1===o.outputLen)throw Error("Output length must be specified in options");s=o.outputLen}const i=E(t,s,this.H,o);if(this.p&&this.C)return i(this.C(o));for(r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),s),n=1;this.numRounds>n;n+=1)this.v&&s%32!=0&&(r[r.length-1]&=16777215>>>24-s%32),r=this.Y(r,s,0,this.L(this.o),s);return i(r)}setHMACKey(t,e,n){if(!this.M)throw Error("Variant does not support HMAC");if(this.l)throw Error("Cannot set MAC key after calling update");const r=U(e,(n||{}).encoding||"UTF8",this.H);this.N(r(t))}N(t){const e=this.T>>>3,n=e/4-1;let r;if(1!==this.numRounds)throw Error("Cannot set numRounds with MAC");if(this.p)throw Error("MAC key already set");for(t.binLen/8>e&&(t.value=this.Y(t.value,t.binLen,0,this.L(this.o),this.B));n>=t.value.length;)t.value.push(0);for(r=0;n>=r;r+=1)this.U[r]=909522486^t.value[r],this.R[r]=1549556828^t.value[r];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(t,e){const n=y(e);return E(t,this.B,this.H,n)(this.S())}S(){let t;if(!this.p)throw Error("Cannot call getHMAC without first setting MAC key");const e=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.R,this.L(this.o)),t=this.Y(e,this.B,this.T,t,this.B),t}}function T(t,e){return t<<e|t>>>32-e}function v(t,e,n){return t^e^n}function B(t,e,n){return t&e^t&n^e&n}function C(t,e){const n=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function F(t,e,n,r,s){const o=(65535&t)+(65535&e)+(65535&n)+(65535&r)+(65535&s);return(65535&(t>>>16)+(e>>>16)+(n>>>16)+(r>>>16)+(s>>>16)+(o>>>16))<<16|65535&o}function L(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function H(t,e){let n,r,s,o,i,u,a;const h=[];for(n=e[0],r=e[1],s=e[2],o=e[3],i=e[4],a=0;80>a;a+=1)h[a]=16>a?t[a]:T(h[a-3]^h[a-8]^h[a-14]^h[a-16],1),u=20>a?F(T(n,5),(c=r)&s^~c&o,i,1518500249,h[a]):40>a?F(T(n,5),v(r,s,o),i,1859775393,h[a]):60>a?F(T(n,5),B(r,s,o),i,2400959708,h[a]):F(T(n,5),v(r,s,o),i,3395469782,h[a]),i=o,o=s,s=T(r,30),r=n,n=u;var c;return e[0]=C(n,e[0]),e[1]=C(r,e[1]),e[2]=C(s,e[2]),e[3]=C(o,e[3]),e[4]=C(i,e[4]),e}function I(t,e,n,r){let s;const o=15+(e+65>>>9<<4),i=e+n;for(;o>=t.length;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[o]=4294967295&i,t[o-1]=i/4294967296|0,s=0;t.length>s;s+=16)r=H(t.slice(s,s+16),r);return r}class Y extends R{constructor(t,e,n){if("SHA-1"!==t)throw Error("Chosen SHA variant is not supported");super(t,e,n);const r=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=U(this.t,this.i,this.H),this.g=H,this.I=function(t){return t.slice()},this.L=L,this.Y=I,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,r.hmacKey&&this.N(function(t,e,n,r){const s="hmacKey must include a value and format";if(!e)throw Error(s);if(void 0===e.value||!e.format)throw Error(s);return U(e.format,e.encoding||"UTF8",n)(e.value)}(0,r.hmacKey,this.H))}}const S={status:400,body:"The hash prefix was not in a valid format"};async function x(e,n={}){const{baseUrl:r,userAgent:s,addPadding:o=!1,mode:i="sha1"}=n,u=await async function(e,n={}){const{baseUrl:r="https://api.pwnedpasswords.com",userAgent:s,addPadding:o=!1,mode:i="sha1"}=n,u=Object.assign({},s?{headers:{"User-Agent":s}}:{},o?{headers:{"Add-Padding":"true"}}:{}),a=`${r.replace(/\/$/g,"")}${e}?mode=${i}`,h=await t(a,u);if(h.ok)return h.text();if(h.status===S.status){const t=await h.text();throw Error(t)}throw Error(h.statusText)}("/range/"+encodeURIComponent(e),{baseUrl:r,userAgent:s,addPadding:o,mode:i});return u.split("\n").filter(Boolean).reduce(((t,e)=>{const[n,r]=e.split(":");return t[n]=Number.parseInt(r,10),t}),{})}async function P(t,e={}){const n=new Y("SHA-1","TEXT");n.update(t);const r=n.getHash("HEX",{outputUpper:!0}),s=r.slice(0,5),o=r.slice(5);return(await x(s,e))[o]||0}async function N(t,e={}){const{apiKey:n,domain:r,truncate:s=!0,baseUrl:o,userAgent:i}=e,[u,a]=await Promise.all([l(t,{apiKey:n,domain:r,truncate:s,baseUrl:o,userAgent:i}),/^.+@.+$/.test(t)?g(t,{apiKey:n,baseUrl:o,userAgent:i}):null]);return{breaches:u,pastes:a}}async function $(t={}){return c("/subscription/status",t)}const{ReadableStream:M}=globalThis,{FormData:k,Blob:K,File:X}=globalThis,{Headers:j,Request:O,Response:q}=globalThis;var D=globalThis.fetch.bind(globalThis),_=Object.freeze({__proto__:null,Blob:K,File:X,FormData:k,Headers:j,ReadableStream:M,Request:O,Response:q,default:D});export{h as RateLimitError,f as breach,l as breachedAccount,d as breaches,p as dataClasses,g as pasteAccount,P as pwnedPassword,x as pwnedPasswordRange,N as search,$ as subscriptionStatus};
1
+ const t="hibp",e="14.1.1";function n(){if("undefined"!=typeof process&&process.versions?.node?.startsWith("18.")){const{File:t,fetch:e,FormData:n,Headers:r,Request:s,Response:o}=require("undici");global.File=t,global.Headers=r,global.Request=s,global.Response=o,global.fetch=e,global.FormData=n}}const r=new Map,s={headers:r,status:400,statusText:"Bad request — the account does not comply with an acceptable format."},o={headers:r,status:401,body:{statusCode:401,message:"Access denied due to missing hibp-api-key."}},i={headers:r,status:403,statusText:"Forbidden - access denied."},u={headers:r,status:404},a={headers:new Map([["retry-after","2"]]),status:429,body:{statusCode:429,message:"Rate limit is exceeded. Try again in 2 seconds."}};n();class h extends Error{retryAfterSeconds;constructor(t,e,n){super(e,n),this.name=this.constructor.name,this.retryAfterSeconds="string"==typeof t?Number.parseInt(t,10):void 0}}async function c(n,r={}){const{apiKey:c,baseUrl:f="https://haveibeenpwned.com/api/v3",timeoutMs:l,userAgent:d}=r,p={};c&&(p["HIBP-API-Key"]=c),d&&(p["User-Agent"]=d),d||"undefined"!=typeof navigator||(p["User-Agent"]=`${t} ${e}`);const g={headers:p,...l?{signal:AbortSignal.timeout(l)}:{}},m=`${f.replace(/\/$/g,"")}${n}`,A=await fetch(m,g);if(A.ok)return A.json();switch(A.status){case s.status:throw Error(s.statusText);case o.status:{const t=await A.json();throw Error(t.message)}case i.status:{const t=A.headers.get("cf-ray");if(t)throw Error(function(t){return`Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${t})`}(t));throw Error(i.statusText)}case u.status:return null;case a.status:{const t=await A.json(),e=A.headers.get("retry-after");throw new h(e,t.message)}default:throw Error(A.statusText)}}function f(t,e={}){return c("/breach/"+encodeURIComponent(t),e)}function l(t,e={}){const{apiKey:n,domain:r,includeUnverified:s=!0,timeoutMs:o,truncate:i=!0,baseUrl:u,userAgent:a}=e,h=`/breachedaccount/${encodeURIComponent(t)}?`,f=[];return r&&f.push("domain="+encodeURIComponent(r)),s||f.push("includeUnverified=false"),i||f.push("truncateResponse=false"),c(`${h}${f.join("&")}`,{apiKey:n,baseUrl:u,timeoutMs:o,userAgent:a})}function d(t={}){const{domain:e,baseUrl:n,timeoutMs:r,userAgent:s}=t,o=[];return e&&o.push("domain="+encodeURIComponent(e)),c("/breaches?"+o.join("&"),{baseUrl:n,timeoutMs:r,userAgent:s})}function p(t={}){return c("/dataclasses",t)}function g(t,e={}){return c("/pasteaccount/"+encodeURIComponent(t),e)}const m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A="ARRAYBUFFER not supported by this environment",b="UINT8ARRAY not supported by this environment";function w(t,e,n,r){let s,o,i;const u=e||[0],a=(n=n||0)>>>3,h=-1===r?3:0;for(s=0;t.length>s;s+=1)i=s+a,o=i>>>2,o>=u.length&&u.push(0),u[o]|=t[s]<<8*(h+r*(i%4));return{value:u,binLen:8*t.length+n}}function U(t,e,n){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;if(0!=t.length%2)throw Error("String of HEX type must be in byte increments");const a=e||[0],h=(n=n||0)>>>3,c=-1===r?3:0;for(s=0;t.length>s;s+=2){if(o=parseInt(t.substr(s,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(u=(s>>>1)+h,i=u>>>2;i>=a.length;)a.push(0);a[i]|=o<<8*(c+r*(u%4))}return{value:a,binLen:4*t.length+n}}(t,e,r,n)};case"TEXT":return function(t,r,s){return function(t,e,n,r,s){let o,i,u,a,h,c,f,l,d=0;const p=n||[0],g=(r=r||0)>>>3;if("UTF8"===e)for(f=-1===s?3:0,u=0;t.length>u;u+=1)for(o=t.charCodeAt(u),i=[],128>o?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||o>=57344?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(u)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),a=0;i.length>a;a+=1){for(c=d+g,h=c>>>2;h>=p.length;)p.push(0);p[h]|=i[a]<<8*(f+s*(c%4)),d+=1}else for(f=-1===s?2:0,l="UTF16LE"===e&&1!==s||"UTF16LE"!==e&&1===s,u=0;t.length>u;u+=1){for(o=t.charCodeAt(u),!0===l&&(a=255&o,o=a<<8|o>>>8),c=d+g,h=c>>>2;h>=p.length;)p.push(0);p[h]|=o<<8*(f+s*(c%4)),d+=2}return{value:p,binLen:8*d+r}}(t,e,r,s,n)};case"B64":return function(t,e,r){return function(t,e,n,r){let s,o,i,u,a,h,c,f=0;const l=e||[0],d=(n=n||0)>>>3,p=-1===r?3:0,g=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==g&&t.length>g)throw Error("Invalid '=' found in base-64 string");for(o=0;t.length>o;o+=4){for(a=t.substr(o,4),u=0,i=0;a.length>i;i+=1)s=m.indexOf(a.charAt(i)),u|=s<<18-6*i;for(i=0;a.length-1>i;i+=1){for(c=f+d,h=c>>>2;h>=l.length;)l.push(0);l[h]|=(u>>>16-8*i&255)<<8*(p+r*(c%4)),f+=1}}return{value:l,binLen:8*f+n}}(t,e,r,n)};case"BYTES":return function(t,e,r){return function(t,e,n,r){let s,o,i,u;const a=e||[0],h=(n=n||0)>>>3,c=-1===r?3:0;for(o=0;t.length>o;o+=1)s=t.charCodeAt(o),u=o+h,i=u>>>2,i>=a.length&&a.push(0),a[i]|=s<<8*(c+r*(u%4));return{value:a,binLen:8*t.length+n}}(t,e,r,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error(A)}return function(t,e,r){return function(t,e,n,r){return w(new Uint8Array(t),e,n,r)}(t,e,r,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error(b)}return function(t,e,r){return w(t,e,r,n)};default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function E(t,e,n,r){switch(t){case"HEX":return function(t){return function(t,e,n,r){const s="0123456789abcdef";let o,i,u="";const a=e/8,h=-1===n?3:0;for(o=0;a>o;o+=1)i=t[o>>>2]>>>8*(h+n*(o%4)),u+=s.charAt(i>>>4&15)+s.charAt(15&i);return r.outputUpper?u.toUpperCase():u}(t,e,n,r)};case"B64":return function(t){return function(t,e,n,r){let s,o,i,u,a,h="";const c=e/8,f=-1===n?3:0;for(s=0;c>s;s+=3)for(u=c>s+1?t[s+1>>>2]:0,a=c>s+2?t[s+2>>>2]:0,i=(t[s>>>2]>>>8*(f+n*(s%4))&255)<<16|(u>>>8*(f+n*((s+1)%4))&255)<<8|a>>>8*(f+n*((s+2)%4))&255,o=0;4>o;o+=1)h+=8*s+6*o>e?r.b64Pad:m.charAt(i>>>6*(3-o)&63);return h}(t,e,n,r)};case"BYTES":return function(t){return function(t,e,n){let r,s,o="";const i=e/8,u=-1===n?3:0;for(r=0;i>r;r+=1)s=t[r>>>2]>>>8*(u+n*(r%4))&255,o+=String.fromCharCode(s);return o}(t,e,n)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw Error(A)}return function(t){return function(t,e,n){let r;const s=e/8,o=new ArrayBuffer(s),i=new Uint8Array(o),u=-1===n?3:0;for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(u+n*(r%4))&255;return o}(t,e,n)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw Error(b)}return function(t){return function(t,e,n){let r;const s=e/8,o=-1===n?3:0,i=new Uint8Array(s);for(r=0;s>r;r+=1)i[r]=t[r>>>2]>>>8*(o+n*(r%4))&255;return i}(t,e,n)};default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function y(t){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},n=t||{},r="Output length must be a multiple of 8";if(e.outputUpper=n.outputUpper||!1,n.b64Pad&&(e.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw Error(r);e.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw Error(r);e.outputLen=n.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}class R{constructor(t,e,n){const r=n||{};if(this.t=e,this.i=r.encoding||"UTF8",this.numRounds=r.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw Error("numRounds must a integer >= 1");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let e,n=0;const r=this.T>>>5,s=this.F(t,this.h,this.u),o=s.binLen,i=s.value,u=o>>>5;for(e=0;u>e;e+=r)o>=n+this.T&&(this.m=this.g(i.slice(e,e+r),this.m),n+=this.T);return this.A+=n,this.h=i.slice(n>>>5),this.u=o%this.T,this.l=!0,this}getHash(t,e){let n,r,s=this.B;const o=y(e);if(this.v){if(-1===o.outputLen)throw Error("Output length must be specified in options");s=o.outputLen}const i=E(t,s,this.H,o);if(this.p&&this.C)return i(this.C(o));for(r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),s),n=1;this.numRounds>n;n+=1)this.v&&s%32!=0&&(r[r.length-1]&=16777215>>>24-s%32),r=this.Y(r,s,0,this.L(this.o),s);return i(r)}setHMACKey(t,e,n){if(!this.M)throw Error("Variant does not support HMAC");if(this.l)throw Error("Cannot set MAC key after calling update");const r=U(e,(n||{}).encoding||"UTF8",this.H);this.N(r(t))}N(t){const e=this.T>>>3,n=e/4-1;let r;if(1!==this.numRounds)throw Error("Cannot set numRounds with MAC");if(this.p)throw Error("MAC key already set");for(t.binLen/8>e&&(t.value=this.Y(t.value,t.binLen,0,this.L(this.o),this.B));n>=t.value.length;)t.value.push(0);for(r=0;n>=r;r+=1)this.U[r]=909522486^t.value[r],this.R[r]=1549556828^t.value[r];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(t,e){const n=y(e);return E(t,this.B,this.H,n)(this.S())}S(){let t;if(!this.p)throw Error("Cannot call getHMAC without first setting MAC key");const e=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.R,this.L(this.o)),t=this.Y(e,this.B,this.T,t,this.B),t}}function T(t,e){return t<<e|t>>>32-e}function v(t,e,n){return t^e^n}function C(t,e,n){return t&e^t&n^e&n}function F(t,e){const n=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(n>>>16))<<16|65535&n}function B(t,e,n,r,s){const o=(65535&t)+(65535&e)+(65535&n)+(65535&r)+(65535&s);return(65535&(t>>>16)+(e>>>16)+(n>>>16)+(r>>>16)+(s>>>16)+(o>>>16))<<16|65535&o}function L(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function H(t,e){let n,r,s,o,i,u,a;const h=[];for(n=e[0],r=e[1],s=e[2],o=e[3],i=e[4],a=0;80>a;a+=1)h[a]=16>a?t[a]:T(h[a-3]^h[a-8]^h[a-14]^h[a-16],1),u=20>a?B(T(n,5),(c=r)&s^~c&o,i,1518500249,h[a]):40>a?B(T(n,5),v(r,s,o),i,1859775393,h[a]):60>a?B(T(n,5),C(r,s,o),i,2400959708,h[a]):B(T(n,5),v(r,s,o),i,3395469782,h[a]),i=o,o=s,s=T(r,30),r=n,n=u;var c;return e[0]=F(n,e[0]),e[1]=F(r,e[1]),e[2]=F(s,e[2]),e[3]=F(o,e[3]),e[4]=F(i,e[4]),e}function I(t,e,n,r){let s;const o=15+(e+65>>>9<<4),i=e+n;for(;o>=t.length;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[o]=4294967295&i,t[o-1]=i/4294967296|0,s=0;t.length>s;s+=16)r=H(t.slice(s,s+16),r);return r}class M extends R{constructor(t,e,n){if("SHA-1"!==t)throw Error("Chosen SHA variant is not supported");super(t,e,n);const r=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=U(this.t,this.i,this.H),this.g=H,this.I=function(t){return t.slice()},this.L=L,this.Y=I,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,r.hmacKey&&this.N(function(t,e,n,r){const s="hmacKey must include a value and format";if(!e)throw Error(s);if(void 0===e.value||!e.format)throw Error(s);return U(e.format,e.encoding||"UTF8",n)(e.value)}(0,r.hmacKey,this.H))}}const Y={status:400,body:"The hash prefix was not in a valid format"};async function S(t,e={}){const{baseUrl:n,timeoutMs:r,userAgent:s,addPadding:o=!1,mode:i="sha1"}=e,u=await async function(t,e={}){const{baseUrl:n="https://api.pwnedpasswords.com",timeoutMs:r,userAgent:s,addPadding:o=!1,mode:i="sha1"}=e,u={headers:{...s?{"User-Agent":s}:{},...o?{"Add-Padding":"true"}:{}},...r?{signal:AbortSignal.timeout(r)}:{}},a=`${n.replace(/\/$/g,"")}${t}?mode=${i}`,h=await fetch(a,u);if(h.ok)return h.text();if(h.status===Y.status){const t=await h.text();throw Error(t)}throw Error(h.statusText)}("/range/"+encodeURIComponent(t),{baseUrl:n,timeoutMs:r,userAgent:s,addPadding:o,mode:i});return u.split("\n").filter(Boolean).reduce(((t,e)=>{const[n,r]=e.split(":");return t[n]=Number.parseInt(r,10),t}),{})}async function x(t,e={}){const n=new M("SHA-1","TEXT");n.update(t);const r=n.getHash("HEX",{outputUpper:!0}),s=r.slice(0,5),o=r.slice(5);return(await S(s,e))[o]||0}async function N(t,e={}){const{apiKey:n,domain:r,truncate:s=!0,baseUrl:o,timeoutMs:i,userAgent:u}=e,[a,h]=await Promise.all([l(t,{apiKey:n,domain:r,truncate:s,baseUrl:o,timeoutMs:i,userAgent:u}),/^.+@.+$/.test(t)?g(t,{apiKey:n,baseUrl:o,timeoutMs:i,userAgent:u}):null]);return{breaches:a,pastes:h}}async function P(t={}){return c("/subscription/status",t)}n();export{h as RateLimitError,f as breach,l as breachedAccount,d as breaches,p as dataClasses,g as pasteAccount,x as pwnedPassword,S as pwnedPasswordRange,N as search,P as subscriptionStatus};
2
2
  //# sourceMappingURL=hibp.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hibp.module.js","sources":["../../src/api/web-fetch.ts","../../src/api/haveibeenpwned/responses.ts","../../src/api/haveibeenpwned/fetch-from-api.ts","../../src/breach.ts","../../src/breached-account.ts","../../src/breaches.ts","../../src/data-classes.ts","../../src/paste-account.ts","../../node_modules/jssha/dist/sha1.mjs","../../src/api/pwnedpasswords/responses.ts","../../src/pwned-password-range.ts","../../src/api/pwnedpasswords/fetch-from-api.ts","../../src/pwned-password.ts","../../src/search.ts","../../src/subscription-status.ts","../../node_modules/@remix-run/web-stream/src/lib.js","../../node_modules/@remix-run/web-fetch/src/package.ts","../../node_modules/@remix-run/web-fetch/src/lib.js"],"sourcesContent":["// This can probably be removed in favor of Node's native fetch once we drop\n// support for v18. https://x.com/ebey_jacob/status/1709975146939973909?s=20\n\n/* c8 ignore next */\nexport default typeof window !== 'undefined' ? window.fetch : fetchWrapper;\n\nasync function fetchWrapper(\n input: string | URL,\n init?: RequestInit | undefined,\n): Promise<Response> {\n const webFetchExports = await import('@remix-run/web-fetch');\n return webFetchExports.fetch(input, init);\n}\n","/**\n * Known potential responses from the remote API.\n *\n * Unfortunately, the API does not send a decent human-readable message back\n * with each response, but they are documented on the website:\n * https://haveibeenpwned.com/api/v3#ResponseCodes\n *\n * These objects simply provide a mapping between the HTTP response status code\n * and the corresponding human-readable message so we can throw a more\n * descriptive error for the consumer. (They are also leveraged in our tests.)\n */\n\nimport type { ResponseBody } from './types.js';\n\n/** @internal */\nexport interface HaveIBeenPwnedApiResponse {\n headers: Map<string, string>;\n status: number;\n statusText?: string;\n body?: ResponseBody;\n}\n\nconst emptyHeaders = new Map<string, string>();\n\n/** @internal */\nexport const BAD_REQUEST: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 400,\n statusText:\n 'Bad request — the account does not comply with an acceptable format.',\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const UNAUTHORIZED: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 401,\n body: {\n statusCode: 401,\n message: 'Access denied due to missing hibp-api-key.',\n },\n};\n\n/** @internal */\nexport const FORBIDDEN: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 403,\n statusText: 'Forbidden - access denied.',\n};\n\n/** @internal */\nexport const BLOCKED: HaveIBeenPwnedApiResponse = {\n headers: new Map([['cf-ray', 'someRayId']]),\n status: 403,\n};\n\n/** @internal */\nexport const NOT_FOUND: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 404,\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const TOO_MANY_REQUESTS: HaveIBeenPwnedApiResponse = {\n headers: new Map([['retry-after', '2']]),\n status: 429,\n body: {\n statusCode: 429,\n message: 'Rate limit is exceeded. Try again in 2 seconds.',\n },\n};\n","import fetch from '../web-fetch.js';\nimport { name, version } from '../../../package.json';\nimport {\n BAD_REQUEST,\n UNAUTHORIZED,\n FORBIDDEN,\n NOT_FOUND,\n TOO_MANY_REQUESTS,\n} from './responses.js';\nimport type { ApiData, ErrorData } from './types.js';\n\n/**\n * Custom error thrown when the haveibeenpwned.com API responds with 429 Too\n * Many Requests. See the `retryAfterSeconds` property for the number of seconds\n * to wait before attempting the request again.\n *\n * @see https://haveibeenpwned.com/API/v3#RateLimiting\n */\nexport class RateLimitError extends Error {\n /**\n * The number of seconds to wait before attempting the request again. May be\n * `undefined` if the API does not provide a `retry-after` header, but this\n * should never happen.\n */\n public retryAfterSeconds: number | undefined;\n\n constructor(\n retryAfter: ReturnType<Headers['get']>,\n message: string | undefined,\n options?: ErrorOptions,\n ) {\n super(message, options);\n this.name = this.constructor.name;\n this.retryAfterSeconds =\n typeof retryAfter === 'string'\n ? Number.parseInt(retryAfter, 10) /* c8 ignore start */\n : undefined; /* c8 ignore stop */\n }\n}\n\nfunction blockedWithRayId(rayId: string) {\n return `Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${rayId})`;\n}\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns an Object (data found).\n * HTTP status code 404 returns null (no data found).\n * HTTP status code 400 throws an Error (bad request).\n * HTTP status code 401 throws an Error (unauthorized).\n * HTTP status code 403 throws an Error (forbidden).\n * HTTP status code 429 throws an Error (too many requests).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<ApiData>} a Promise which resolves to the data resulting\n * from the query (or null for 404 Not Found responses), or rejects with an\n * Error\n */\nexport async function fetchFromApi(\n endpoint: string,\n options: {\n apiKey?: string;\n baseUrl?: string;\n userAgent?: string;\n } = {},\n): Promise<ApiData> {\n const {\n apiKey,\n baseUrl = 'https://haveibeenpwned.com/api/v3',\n userAgent,\n } = options;\n const headers: Record<string, string> = {};\n\n if (apiKey) {\n headers['HIBP-API-Key'] = apiKey;\n }\n\n if (userAgent) {\n headers['User-Agent'] = userAgent;\n }\n\n // Provide a default User-Agent when running outside the browser\n if (!userAgent && typeof navigator === 'undefined') {\n headers['User-Agent'] = `${name} ${version}`;\n }\n\n const config = { headers };\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}`;\n const response = await fetch(url, config);\n\n if (response.ok) return response.json() as Promise<ApiData>;\n\n switch (response.status) {\n case BAD_REQUEST.status: {\n throw new Error(BAD_REQUEST.statusText);\n }\n case UNAUTHORIZED.status: {\n const body = (await response.json()) as unknown as ErrorData;\n throw new Error(body.message);\n }\n case FORBIDDEN.status: {\n const rayId = response.headers.get('cf-ray');\n if (rayId) throw new Error(blockedWithRayId(rayId));\n throw new Error(FORBIDDEN.statusText);\n }\n case NOT_FOUND.status: {\n return null;\n }\n case TOO_MANY_REQUESTS.status: {\n const body = (await response.json()) as unknown as ErrorData;\n const retryAfter = response.headers.get('retry-after');\n throw new RateLimitError(retryAfter, body.message);\n }\n default: {\n throw new Error(response.statusText);\n }\n }\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing a breach.\n *\n * @typedef {object} Breach\n * @property {string} Name\n * @property {string} Title\n * @property {string} Domain\n * @property {string} BreachDate\n * @property {string} AddedDate\n * @property {string} ModifiedDate\n * @property {number} PwnCount\n * @property {string} Description\n * @property {string[]} DataClasses\n * @property {boolean} IsVerified\n * @property {boolean} IsFabricated\n * @property {boolean} IsSensitive\n * @property {boolean} IsRetired\n * @property {boolean} IsSpamList\n * @property {boolean} IsMalware\n * @property {boolean} IsSubscriptionFree\n * @property {string} LogoPath\n */\n\n/**\n * Fetches data for a specific breach event.\n *\n * @param {string} breachName the name of a breach in the system\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach>|Promise<null>)} a Promise which resolves to an\n * object representing a breach (or null if no breach was found), or rejects\n * with an Error\n * @example\n * try {\n * const data = await breach(\"Adobe\");\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breach(\n breachName: string,\n options: {\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach | null> {\n return fetchFromApi(\n `/breach/${encodeURIComponent(breachName)}`,\n options,\n ) as Promise<Breach | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches breach data for a specific account.\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {string} account a username or email address\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {boolean} [options.includeUnverified] include \"unverified\" breaches in\n * the results (default: true)\n * @param {boolean} [options.truncate] truncate the results to only include\n * the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach[]> | Promise<null>)} a Promise which resolves to an\n * array of breach objects (or null if no breaches were found), or rejects with\n * an Error\n * @example\n * try {\n * const data = await breachedAccount(\"foo\", { apiKey: \"my-api-key\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breachedAccount(\"bar\", {\n * includeUnverified: false,\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breachedAccount(\"baz\", {\n * apiKey: \"my-api-key\",\n * domain: \"adobe.com\",\n * truncate: false,\n * userAgent: \"my-app 1.0\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breachedAccount(\n account: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * include \"unverified\" breaches in the results (default: true)\n */\n includeUnverified?: boolean;\n /**\n * truncate the results to only include the name of each breach (default:\n * true)\n */\n truncate?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach[] | null> {\n const {\n apiKey,\n domain,\n includeUnverified = true,\n truncate = true,\n baseUrl,\n userAgent,\n } = options;\n const endpoint = `/breachedaccount/${encodeURIComponent(account)}?`;\n const params: string[] = [];\n\n if (domain) {\n params.push(`domain=${encodeURIComponent(domain)}`);\n }\n\n if (!includeUnverified) {\n params.push('includeUnverified=false');\n }\n\n if (!truncate) {\n params.push('truncateResponse=false');\n }\n\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n apiKey,\n baseUrl,\n userAgent,\n }) as Promise<Breach[] | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches all breach events in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<Breach[]>} a Promise which resolves to an array of breach\n * objects (an empty array if no breaches were found), or rejects with an Error\n * @example\n * try {\n * const data = await breaches();\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breaches({ domain: \"adobe.com\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breaches(\n options: {\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach[]> {\n const { domain, baseUrl, userAgent } = options;\n const endpoint = '/breaches?';\n const params: string[] = [];\n\n if (domain) {\n params.push(`domain=${encodeURIComponent(domain)}`);\n }\n\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n baseUrl,\n userAgent,\n }) as Promise<Breach[]>;\n}\n","import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches all data classes in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<string[]> | Promise<null>)} a Promise which resolves to an\n * array of strings (or null if no data classes were found), or rejects with an\n * Error\n * @example\n * try {\n * const data = await dataClasses();\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function dataClasses(\n options: {\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<string[] | null> {\n return fetchFromApi('/dataclasses', options) as Promise<string[] | null>;\n}\n","import type { Paste } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing a paste.\n *\n * @typedef {object} Paste\n * @property {string} Id\n * @property {string} Source\n * @property {string} Title\n * @property {string} Date\n * @property {number} EmailCount\n */\n\n/**\n * Fetches paste data for a specific account (email address).\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `pasteaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {string} email the email address to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Paste[]> | Promise<null>)} a Promise which resolves to an\n * array of paste objects (or null if no pastes were found), or rejects with an\n * Error\n * @example\n * try {\n * const data = await pasteAccount(\"foo@bar.com\", { apiKey: \"my-api-key\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await pasteAccount(\"foo@bar.com\", {\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function pasteAccount(\n email: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Paste[] | null> {\n return fetchFromApi(\n `/pasteaccount/${encodeURIComponent(email)}`,\n options,\n ) as Promise<Paste[] | null>;\n}\n","/**\n * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202,\n * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1.\n *\n * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors\n * Distributed under the BSD License\n * See http://caligatio.github.com/jsSHA/ for more information\n */\nconst t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",r=\"ARRAYBUFFER not supported by this environment\",n=\"UINT8ARRAY not supported by this environment\";function i(t,r,n,i){let e,s,o;const h=r||[0],u=(n=n||0)>>>3,f=-1===i?3:0;for(e=0;e<t.length;e+=1)o=e+u,s=o>>>2,h.length<=s&&h.push(0),h[s]|=t[e]<<8*(f+i*(o%4));return{value:h,binLen:8*t.length+n}}function e(e,s,o){switch(s){case\"UTF8\":case\"UTF16BE\":case\"UTF16LE\":break;default:throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\")}switch(e){case\"HEX\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;if(0!=t.length%2)throw new Error(\"String of HEX type must be in byte increments\");const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(e=0;e<t.length;e+=2){if(s=parseInt(t.substr(e,2),16),isNaN(s))throw new Error(\"String of HEX type contains invalid characters\");for(h=(e>>>1)+f,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+i*(h%4))}return{value:u,binLen:4*t.length+n}}(t,r,n,o)};case\"TEXT\":return function(t,r,n){return function(t,r,n,i,e){let s,o,h,u,f,c,a,w,E=0;const l=n||[0],A=(i=i||0)>>>3;if(\"UTF8\"===r)for(a=-1===e?3:0,h=0;h<t.length;h+=1)for(s=t.charCodeAt(h),o=[],128>s?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u<o.length;u+=1){for(c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=o[u]<<8*(a+e*(c%4)),E+=1}else for(a=-1===e?2:0,w=\"UTF16LE\"===r&&1!==e||\"UTF16LE\"!==r&&1===e,h=0;h<t.length;h+=1){for(s=t.charCodeAt(h),!0===w&&(u=255&s,s=u<<8|s>>>8),c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=s<<8*(a+e*(c%4)),E+=2}return{value:l,binLen:8*E+i}}(t,s,r,n,o)};case\"B64\":return function(r,n,i){return function(r,n,i,e){let s,o,h,u,f,c,a,w=0;const E=n||[0],l=(i=i||0)>>>3,A=-1===e?3:0,p=r.indexOf(\"=\");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error(\"Invalid character in base-64 string\");if(r=r.replace(/=/g,\"\"),-1!==p&&p<r.length)throw new Error(\"Invalid '=' found in base-64 string\");for(o=0;o<r.length;o+=4){for(f=r.substr(o,4),u=0,h=0;h<f.length;h+=1)s=t.indexOf(f.charAt(h)),u|=s<<18-6*h;for(h=0;h<f.length-1;h+=1){for(a=w+l,c=a>>>2;E.length<=c;)E.push(0);E[c]|=(u>>>16-8*h&255)<<8*(A+e*(a%4)),w+=1}}return{value:E,binLen:8*w+i}}(r,n,i,o)};case\"BYTES\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(s=0;s<t.length;s+=1)e=t.charCodeAt(s),h=s+f,o=h>>>2,u.length<=o&&u.push(0),u[o]|=e<<8*(c+i*(h%4));return{value:u,binLen:8*t.length+n}}(t,r,n,o)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t,r,n){return function(t,r,n,e){return i(new Uint8Array(t),r,n,e)}(t,r,n,o)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t,r,n){return i(t,r,n,o)};default:throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function s(i,e,s,o){switch(i){case\"HEX\":return function(t){return function(t,r,n,i){const e=\"0123456789abcdef\";let s,o,h=\"\";const u=r/8,f=-1===n?3:0;for(s=0;s<u;s+=1)o=t[s>>>2]>>>8*(f+n*(s%4)),h+=e.charAt(o>>>4&15)+e.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,e,s,o)};case\"B64\":return function(r){return function(r,n,i,e){let s,o,h,u,f,c=\"\";const a=n/8,w=-1===i?3:0;for(s=0;s<a;s+=3)for(u=s+1<a?r[s+1>>>2]:0,f=s+2<a?r[s+2>>>2]:0,h=(r[s>>>2]>>>8*(w+i*(s%4))&255)<<16|(u>>>8*(w+i*((s+1)%4))&255)<<8|f>>>8*(w+i*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=n?t.charAt(h>>>6*(3-o)&63):e.b64Pad;return c}(r,e,s,o)};case\"BYTES\":return function(t){return function(t,r,n){let i,e,s=\"\";const o=r/8,h=-1===n?3:0;for(i=0;i<o;i+=1)e=t[i>>>2]>>>8*(h+n*(i%4))&255,s+=String.fromCharCode(e);return s}(t,e,s)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t){return function(t,r,n){let i;const e=r/8,s=new ArrayBuffer(e),o=new Uint8Array(s),h=-1===n?3:0;for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(h+n*(i%4))&255;return s}(t,e,s)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t){return function(t,r,n){let i;const e=r/8,s=-1===n?3:0,o=new Uint8Array(e);for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(s+n*(i%4))&255;return o}(t,e,s)};default:throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function o(t){const r={outputUpper:!1,b64Pad:\"=\",outputLen:-1},n=t||{},i=\"Output length must be a multiple of 8\";if(r.outputUpper=n.outputUpper||!1,n.b64Pad&&(r.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);r.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);r.outputLen=n.shakeLen}if(\"boolean\"!=typeof r.outputUpper)throw new Error(\"Invalid outputUpper formatting option\");if(\"string\"!=typeof r.b64Pad)throw new Error(\"Invalid b64Pad formatting option\");return r}class h{constructor(t,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||\"UTF8\",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error(\"numRounds must a integer >= 1\");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let r,n=0;const i=this.T>>>5,e=this.F(t,this.h,this.u),s=e.binLen,o=e.value,h=s>>>5;for(r=0;r<h;r+=i)n+this.T<=s&&(this.m=this.g(o.slice(r,r+i),this.m),n+=this.T);return this.A+=n,this.h=o.slice(n>>>5),this.u=s%this.T,this.l=!0,this}getHash(t,r){let n,i,e=this.B;const h=o(r);if(this.v){if(-1===h.outputLen)throw new Error(\"Output length must be specified in options\");e=h.outputLen}const u=s(t,e,this.H,h);if(this.p&&this.C)return u(this.C(h));for(i=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),e),n=1;n<this.numRounds;n+=1)this.v&&e%32!=0&&(i[i.length-1]&=16777215>>>24-e%32),i=this.Y(i,e,0,this.L(this.o),e);return u(i)}setHMACKey(t,r,n){if(!this.M)throw new Error(\"Variant does not support HMAC\");if(this.l)throw new Error(\"Cannot set MAC key after calling update\");const i=e(r,(n||{}).encoding||\"UTF8\",this.H);this.N(i(t))}N(t){const r=this.T>>>3,n=r/4-1;let i;if(1!==this.numRounds)throw new Error(\"Cannot set numRounds with MAC\");if(this.p)throw new Error(\"MAC key already set\");for(r<t.binLen/8&&(t.value=this.Y(t.value,t.binLen,0,this.L(this.o),this.B));t.value.length<=n;)t.value.push(0);for(i=0;i<=n;i+=1)this.U[i]=909522486^t.value[i],this.R[i]=1549556828^t.value[i];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(t,r){const n=o(r);return s(t,this.B,this.H,n)(this.S())}S(){let t;if(!this.p)throw new Error(\"Cannot call getHMAC without first setting MAC key\");const r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.R,this.L(this.o)),t=this.Y(r,this.B,this.T,t,this.B),t}}function u(t,r){return t<<r|t>>>32-r}function f(t,r,n){return t^r^n}function c(t,r,n){return t&r^t&n^r&n}function a(t,r){const n=(65535&t)+(65535&r);return(65535&(t>>>16)+(r>>>16)+(n>>>16))<<16|65535&n}function w(t,r,n,i,e){const s=(65535&t)+(65535&r)+(65535&n)+(65535&i)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(s>>>16))<<16|65535&s}function E(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function l(t,r){let n,i,e,s,o,h,E;const l=[];for(n=r[0],i=r[1],e=r[2],s=r[3],o=r[4],E=0;E<80;E+=1)l[E]=E<16?t[E]:u(l[E-3]^l[E-8]^l[E-14]^l[E-16],1),h=E<20?w(u(n,5),(A=i)&e^~A&s,o,1518500249,l[E]):E<40?w(u(n,5),f(i,e,s),o,1859775393,l[E]):E<60?w(u(n,5),c(i,e,s),o,2400959708,l[E]):w(u(n,5),f(i,e,s),o,3395469782,l[E]),o=s,s=e,e=u(i,30),i=n,n=h;var A;return r[0]=a(n,r[0]),r[1]=a(i,r[1]),r[2]=a(e,r[2]),r[3]=a(s,r[3]),r[4]=a(o,r[4]),r}function A(t,r,n,i){let e;const s=15+(r+65>>>9<<4),o=r+n;for(;t.length<=s;)t.push(0);for(t[r>>>5]|=128<<24-r%32,t[s]=4294967295&o,t[s-1]=o/4294967296|0,e=0;e<t.length;e+=16)i=l(t.slice(e,e+16),i);return i}class p extends h{constructor(t,r,n){if(\"SHA-1\"!==t)throw new Error(\"Chosen SHA variant is not supported\");super(t,r,n);const i=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=e(this.t,this.i,this.H),this.g=l,this.I=function(t){return t.slice()},this.L=E,this.Y=A,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,i.hmacKey&&this.N(function(t,r,n,i){const s=t+\" must include a value and format\";if(!r){if(!i)throw new Error(s);return i}if(void 0===r.value||!r.format)throw new Error(s);return e(r.format,r.encoding||\"UTF8\",n)(r.value)}(\"hmacKey\",i.hmacKey,this.H))}}export{p as default};\n","/**\n * Known potential responses from the remote API.\n *\n * https://haveibeenpwned.com/api/v3#PwnedPasswords\n *\n */\n\n/** @internal */\nexport interface PwnedPasswordsApiResponse {\n status: number;\n body?: string;\n}\n\n/** @internal */\nexport const BAD_REQUEST: PwnedPasswordsApiResponse = {\n status: 400,\n body: 'The hash prefix was not in a valid format',\n};\n","import { fetchFromApi } from './api/pwnedpasswords/fetch-from-api.js';\n\nexport type PwnedPasswordSuffixes = Record<string, number>;\n\n/**\n * An object mapping an exposed password hash suffix (corresponding to a given\n * hash prefix) to how many times it occurred in the Pwned Passwords repository.\n *\n * @typedef {Object.<string, number>} PwnedPasswordSuffixes\n */\n\n/**\n * Fetches the SHA-1 or NTLM hash suffixes for the given 5-character hash\n * prefix.\n *\n * When a password hash with the same first 5 characters is found in the Pwned\n * Passwords repository, the API will respond with an HTTP 200 and include the\n * suffix of every hash beginning with the specified prefix, followed by a count\n * of how many times it appears in the data set. This function parses the\n * response and returns a more structured format.\n *\n * @param {string} prefix the first 5 characters of a password hash (case\n * insensitive)\n * @param {object} [options] a configuration object\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {'sha1' | 'ntlm'} [options.mode] return SHA-1 or NTLM hashes\n * (default: `sha1`)\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<PwnedPasswordSuffixes>} a Promise which resolves to an\n * object mapping the `suffix` that when matched with the prefix composes the\n * complete hash, to the `count` of how many times it appears in the breached\n * password data set, or rejects with an Error\n *\n * @example\n * try {\n * const results = await pwnedPasswordRange(\"5BAA6\");\n * // results will have the following shape:\n * // {\n * // \"003D68EB55068C33ACE09247EE4C639306B\": 3,\n * // \"012C192B2F16F82EA0EB9EF18D9D539B0DD\": 1,\n * // ...\n * // }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const suffix = \"1E4C9B93F3F0682250B6CF8331B7EE68FD8\";\n * const results = await pwnedPasswordRange(\"5BAA6\");\n * const numPwns = results[suffix] || 0;\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/api/v3#SearchingPwnedPasswordsByRange\n */\nexport async function pwnedPasswordRange(\n prefix: string,\n options: {\n /**\n * ask the remote API to add padding to the response to obscure the password\n * prefix (default: `false`)\n */\n addPadding?: boolean;\n /**\n * return SHA-1 or NTLM hashes (default: `sha1`)\n */\n mode?: 'sha1' | 'ntlm';\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<PwnedPasswordSuffixes> {\n const { baseUrl, userAgent, addPadding = false, mode = 'sha1' } = options;\n\n const data = await fetchFromApi(`/range/${encodeURIComponent(prefix)}`, {\n baseUrl,\n userAgent,\n addPadding,\n mode,\n });\n\n // create array from lines of text in response body\n const results = data.split('\\n').filter(Boolean);\n\n // convert into an object mapping suffix to count for each line\n return results.reduce<PwnedPasswordSuffixes>((acc, row) => {\n const [suffix, countString] = row.split(':');\n acc[suffix] = Number.parseInt(countString, 10);\n return acc;\n }, {});\n}\n","import fetch from '../web-fetch.js';\nimport { BAD_REQUEST } from './responses.js';\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns plain text (data found).\n * HTTP status code 400 throws an Error (bad request).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {'sha1' | 'ntlm'} [options.mode] return SHA-1 or NTLM hashes\n * (default: `sha1`)\n * @returns {Promise<string>} a Promise which resolves to the data resulting\n * from the query, or rejects with an Error\n */\nexport async function fetchFromApi(\n endpoint: string,\n options: {\n baseUrl?: string;\n userAgent?: string;\n addPadding?: boolean;\n mode?: 'sha1' | 'ntlm';\n } = {},\n): Promise<string> {\n const {\n baseUrl = 'https://api.pwnedpasswords.com',\n userAgent,\n addPadding = false,\n mode = 'sha1',\n } = options;\n\n const config = Object.assign(\n {},\n userAgent ? { headers: { 'User-Agent': userAgent } } : {},\n addPadding ? { headers: { 'Add-Padding': 'true' } } : {},\n );\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}?mode=${mode}`;\n const response = await fetch(url, config);\n\n if (response.ok) return response.text();\n\n if (response.status === BAD_REQUEST.status) {\n const text = await response.text();\n throw new Error(text);\n }\n\n throw new Error(response.statusText);\n}\n","import JSSHA from 'jssha/dist/sha1';\nimport { pwnedPasswordRange } from './pwned-password-range.js';\n\n/**\n * Fetches the number of times the the given password has been exposed in a\n * breach (0 indicating no exposure). The password is given in plain text, but\n * only the first 5 characters of its SHA-1 hash will be submitted to the API.\n *\n * @param {string} password a password in plain text\n * @param {object} [options] a configuration object\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<number>} a Promise which resolves to the number of times\n * the password has been exposed in a breach, or rejects with an Error\n * @example\n * try {\n * const numPwns = await pwnedPassword(\"f00b4r\");\n * // truthy check or numeric condition\n * if (numPwns) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/api/v3#PwnedPasswords\n */\nexport async function pwnedPassword(\n password: string,\n options: {\n /**\n * ask the remote API to add padding to the response to obscure the password\n * prefix (default: `false`)\n */\n addPadding?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<number> {\n /* eslint-disable */\n // @ts-expect-error: JSSHA types are busted\n const sha1 = new JSSHA('SHA-1', 'TEXT');\n sha1.update(password);\n const hash = sha1.getHash('HEX', { outputUpper: true });\n const prefix = hash.slice(0, 5);\n const suffix = hash.slice(5);\n\n const range = await pwnedPasswordRange(prefix, options);\n return range[suffix] || 0;\n /* eslint-enable */\n}\n","import type { Breach, Paste } from './api/haveibeenpwned/types.js';\nimport { breachedAccount } from './breached-account.js';\nimport { pasteAccount } from './paste-account.js';\n\nexport interface SearchResults {\n breaches: Breach[] | null;\n pastes: Paste[] | null;\n}\n\n/**\n * An object representing search results.\n *\n * @typedef {object} SearchResults\n * @property {(Breach[] | null)} breaches\n * @property {(Paste[] | null)} pastes\n */\n\n/**\n * Fetches all breaches and all pastes associated with the provided account\n * (email address or username). Note that the remote API does not support\n * querying pastes by username (only email addresses), so in the event the\n * provided account is not a valid email address, only breach data is queried\n * and the \"pastes\" field of the resulting object will always be null. This is\n * exactly how searching via the current web interface behaves, which this\n * convenience method is designed to mimic.\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` and\n * `pasteaccount` endpoints. The `apiKey` option here is not explicitly\n * required, but direct requests made without it will fail (unless you specify a\n * `baseUrl` to a proxy that inserts a valid API key on your behalf).\n *\n * @param {string} account an email address or username\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the breach\n * results (default: all domains)\n * @param {boolean} [options.truncate] truncate the breach results to only\n * include the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the\n * User-Agent field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SearchResults>} a Promise which resolves to an object\n * containing a \"breaches\" key (which can be null or an array of breach objects)\n * and a \"pastes\" key (which can be null or an array of paste objects), or\n * rejects with an Error\n * @example\n * try {\n * const data = await search(\"foo\", { apiKey: \"my-api-key\" });\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await search(\"nobody@nowhere.com\", {\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * truncate: false,\n * });\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/\n */\nexport async function search(\n account: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * truncate the results to only include the name of each breach (default:\n * true)\n */\n truncate?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<SearchResults> {\n const { apiKey, domain, truncate = true, baseUrl, userAgent } = options;\n\n const [breaches, pastes] = await Promise.all([\n breachedAccount(account, { apiKey, domain, truncate, baseUrl, userAgent }),\n // This email regex is garbage but it seems to be what the API uses:\n /^.+@.+$/.test(account)\n ? pasteAccount(account, { apiKey, baseUrl, userAgent })\n : null,\n ]);\n\n return { breaches, pastes };\n}\n","import type { SubscriptionStatus } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing the status of your HIBP subscription.\n *\n * @typedef {object} SubscriptionStatus\n * @property {string} SubscriptionName\n * @property {string} Description\n * @property {string} SubscribedUntil\n * @property {number} Rpm\n * @property {number} DomainSearchMaxBreachedAccounts\n */\n\n/**\n * Fetches the current status of your HIBP subscription (API key).\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `subscription/status` endpoint.\n * The `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SubscriptionStatus>} a Promise which resolves to a\n * subscription status object, or rejects with an Error\n * @example\n * try {\n * const data = await subscriptionStatus({ apiKey: \"my-api-key\" });\n * // ...\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await subscriptionStatus({\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * // ...\n * } catch (err) {\n * // ...\n * }\n */\nexport async function subscriptionStatus(\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n) {\n const endpoint = '/subscription/status';\n\n return fetchFromApi(endpoint, options) as Promise<SubscriptionStatus>;\n}\n","export const {\n ReadableStream,\n ReadableStreamDefaultReader,\n // @ts-ignore\n ReadableStreamBYOBReader,\n // @ts-ignore\n ReadableStreamBYOBRequest,\n // @ts-ignore\n ReadableByteStreamController,\n ReadableStreamDefaultController,\n TransformStream,\n TransformStreamDefaultController,\n WritableStream,\n WritableStreamDefaultWriter,\n WritableStreamDefaultController,\n ByteLengthQueuingStrategy,\n CountQueuingStrategy,\n TextEncoderStream,\n TextDecoderStream,\n} = globalThis\n","export const { FormData, Blob, File } = globalThis\nexport { ReadableStream } from \"@remix-run/web-stream\"\n\n\n","// On the web we just export native fetch implementation\nexport { ReadableStream, Blob, FormData, File } from './package.js';\nexport const { Headers, Request, Response } = globalThis;\nexport default globalThis.fetch.bind(globalThis)\n"],"names":["fetch","window","async","input","init","Promise","emptyHeaders","Map","BAD_REQUEST","headers","status","statusText","UNAUTHORIZED","body","statusCode","message","FORBIDDEN","NOT_FOUND","TOO_MANY_REQUESTS","RateLimitError","Error","retryAfterSeconds","constructor","retryAfter","options","super","this","name","Number","parseInt","undefined","fetchFromApi","endpoint","apiKey","baseUrl","userAgent","navigator","version","config","url","replace","response","ok","json","rayId","get","blockedWithRayId","breach","breachName","encodeURIComponent","breachedAccount","account","domain","includeUnverified","truncate","params","push","join","breaches","dataClasses","pasteAccount","email","t","r","n","i","e","s","o","h","u","f","length","value","binLen","c","substr","isNaN","a","w","E","l","A","charCodeAt","p","indexOf","search","charAt","ArrayBuffer","Uint8Array","outputUpper","toUpperCase","b64Pad","String","fromCharCode","outputLen","shakeLen","encoding","numRounds","U","R","update","T","F","m","g","slice","getHash","B","v","H","C","Y","I","L","setHMACKey","M","N","getHMAC","S","hmacKey","format","pwnedPasswordRange","prefix","addPadding","mode","data","Object","assign","text","split","filter","Boolean","reduce","acc","row","suffix","countString","pwnedPassword","password","sha1","JSSHA","hash","pastes","all","test","subscriptionStatus","ReadableStream","globalThis","FormData","Blob","File","Headers","Request","Response","lib","bind"],"mappings":"AAIA,IAAeA,EAAkB,oBAAXC,OAAyBA,OAAOD,MAEtDE,eACEC,EACAC,GAGA,aAD8BC,gDACPL,MAAMG,EAAOC,EACtC,4BCUME,EAAe,IAAIC,IAGZC,EAAyC,CACpDC,QAASH,EACTI,OAAQ,IACRC,WACE,wEAUSC,EAA0C,CACrDH,QAASH,EACTI,OAAQ,IACRG,KAAM,CACJC,WAAY,IACZC,QAAS,+CAKAC,EAAuC,CAClDP,QAASH,EACTI,OAAQ,IACRC,WAAY,8BAUDM,EAAuC,CAClDR,QAASH,EACTI,OAAQ,KAUGQ,EAA+C,CAC1DT,QAAS,IAAIF,IAAI,CAAC,CAAC,cAAe,OAClCG,OAAQ,IACRG,KAAM,CACJC,WAAY,IACZC,QAAS,oDC7DP,MAAOI,UAAuBC,MAM3BC,kBAEPC,YACEC,EACAR,EACAS,GAEAC,MAAMV,EAASS,GACfE,KAAKC,KAAOD,KAAKJ,YAAYK,KAC7BD,KAAKL,kBACmB,iBAAfE,EACHK,OAAOC,SAASN,EAAY,SAC5BO,CACP,EAgCI5B,eAAe6B,EACpBC,EACAR,EAII,IAEJ,MAAMS,OACJA,EAAMC,QACNA,EAAU,oCAAmCC,UAC7CA,GACEX,EACEf,EAAkC,CAAA,EAEpCwB,I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AASmB,EAAKpC,MAAM,EAAG,GACvB8B,EAASM,EAAKpC,MAAM,GAG1B,aADoBgB,EAAmBC,EAAQnG,IAClCgH,IAAW,CAE1B,CCaOtI,eAAeoF,EACpBnC,EACA3B,EAwBI,IAEJ,MAAMS,OAAEA,EAAMmB,OAAEA,EAAME,SAAEA,GAAW,EAAIpB,QAAEA,EAAOC,UAAEA,GAAcX,GAEzDkC,EAAUqF,SAAgB1I,QAAQ2I,IAAI,CAC3C9F,EAAgBC,EAAS,CAAElB,SAAQmB,SAAQE,WAAUpB,UAASC,cAE9D,UAAU8G,KAAK9F,GACXS,EAAaT,EAAS,CAAElB,SAAQC,UAASC,cACzC,OAGN,MAAO,CAAEuB,WAAUqF,SACrB,CCjEO7I,eAAegJ,EACpB1H,EAeI,IAIJ,OAAOO,EAFU,uBAEaP,EAChC,CCvEO,MAAM2H,eACXA,GAkBEC,YCnBSC,SAAEA,EAAQC,KAAEA,EAAIC,KAAEA,GAASH,YCE3BI,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,GAAaN,WAC9C,IAAAO,EAAeP,WAAWpJ,MAAM4J,KAAKR","x_google_ignoreList":[8,15,16,17]}
1
+ {"version":3,"file":"hibp.module.js","sources":["../../src/api/fetch-polyfill.ts","../../src/api/haveibeenpwned/responses.ts","../../src/api/haveibeenpwned/fetch-from-api.ts","../../src/breach.ts","../../src/breached-account.ts","../../src/breaches.ts","../../src/data-classes.ts","../../src/paste-account.ts","../../node_modules/jssha/dist/sha1.mjs","../../src/api/pwnedpasswords/responses.ts","../../src/pwned-password-range.ts","../../src/api/pwnedpasswords/fetch-from-api.ts","../../src/pwned-password.ts","../../src/search.ts","../../src/subscription-status.ts"],"sourcesContent":["/* eslint-disable global-require */\n/* eslint-disable @typescript-eslint/no-var-requires */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unnecessary-condition */\n\n// This can probably be removed in favor of Node's native fetch once we drop\n// support for v18. https://x.com/ebey_jacob/status/1709975146939973909?s=20\n\n/* c8 ignore start */\nexport function installUndiciOnNode18() {\n if (\n typeof process !== 'undefined' &&\n process.versions?.node?.startsWith('18.')\n ) {\n const {\n File: UndiciFile,\n fetch: undiciFetch,\n FormData: UndiciFormData,\n Headers: UndiciHeaders,\n Request: UndiciRequest,\n Response: UndiciResponse,\n } = require('undici');\n global.File = UndiciFile as unknown as typeof File;\n global.Headers = UndiciHeaders;\n global.Request = UndiciRequest;\n global.Response = UndiciResponse;\n global.fetch = undiciFetch;\n global.FormData = UndiciFormData;\n }\n}\n/* c8 ignore stop */\n","/**\n * Known potential responses from the remote API.\n *\n * Unfortunately, the API does not send a decent human-readable message back\n * with each response, but they are documented on the website:\n * https://haveibeenpwned.com/api/v3#ResponseCodes\n *\n * These objects simply provide a mapping between the HTTP response status code\n * and the corresponding human-readable message so we can throw a more\n * descriptive error for the consumer. (They are also leveraged in our tests.)\n */\n\nimport type { ResponseBody } from './types.js';\n\n/** @internal */\nexport interface HaveIBeenPwnedApiResponse {\n headers: Map<string, string>;\n status: number;\n statusText?: string;\n body?: ResponseBody;\n}\n\nconst emptyHeaders = new Map<string, string>();\n\n/** @internal */\nexport const BAD_REQUEST: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 400,\n statusText:\n 'Bad request — the account does not comply with an acceptable format.',\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const UNAUTHORIZED: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 401,\n body: {\n statusCode: 401,\n message: 'Access denied due to missing hibp-api-key.',\n },\n};\n\n/** @internal */\nexport const FORBIDDEN: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 403,\n statusText: 'Forbidden - access denied.',\n};\n\n/** @internal */\nexport const BLOCKED: HaveIBeenPwnedApiResponse = {\n headers: new Map([['cf-ray', 'someRayId']]),\n status: 403,\n};\n\n/** @internal */\nexport const NOT_FOUND: HaveIBeenPwnedApiResponse = {\n headers: emptyHeaders,\n status: 404,\n};\n\n/**\n * This response has unique behavior. For some reason, the API includes an\n * object in the response body for this one, containing a human-readable\n * message. Manually populating the message here purely for use in tests.\n *\n * @internal\n */\nexport const TOO_MANY_REQUESTS: HaveIBeenPwnedApiResponse = {\n headers: new Map([['retry-after', '2']]),\n status: 429,\n body: {\n statusCode: 429,\n message: 'Rate limit is exceeded. Try again in 2 seconds.',\n },\n};\n","import { name, version } from '../../../package.json';\nimport { installUndiciOnNode18 } from '../fetch-polyfill.js';\nimport {\n BAD_REQUEST,\n UNAUTHORIZED,\n FORBIDDEN,\n NOT_FOUND,\n TOO_MANY_REQUESTS,\n} from './responses.js';\nimport type { ApiData, ErrorData } from './types.js';\n\ninstallUndiciOnNode18();\n\n/**\n * Custom error thrown when the haveibeenpwned.com API responds with 429 Too\n * Many Requests. See the `retryAfterSeconds` property for the number of seconds\n * to wait before attempting the request again.\n *\n * @see https://haveibeenpwned.com/API/v3#RateLimiting\n */\nexport class RateLimitError extends Error {\n /**\n * The number of seconds to wait before attempting the request again. May be\n * `undefined` if the API does not provide a `retry-after` header, but this\n * should never happen.\n */\n public retryAfterSeconds: number | undefined;\n\n constructor(\n retryAfter: ReturnType<Headers['get']>,\n message: string | undefined,\n options?: ErrorOptions,\n ) {\n super(message, options);\n this.name = this.constructor.name;\n this.retryAfterSeconds =\n typeof retryAfter === 'string'\n ? Number.parseInt(retryAfter, 10) /* c8 ignore start */\n : undefined; /* c8 ignore stop */\n }\n}\n\nfunction blockedWithRayId(rayId: string) {\n return `Request blocked, contact haveibeenpwned.com if this continues (Ray ID: ${rayId})`;\n}\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns an Object (data found).\n * HTTP status code 404 returns null (no data found).\n * HTTP status code 400 throws an Error (bad request).\n * HTTP status code 401 throws an Error (unauthorized).\n * HTTP status code 403 throws an Error (forbidden).\n * HTTP status code 429 throws an Error (too many requests).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<ApiData>} a Promise which resolves to the data resulting\n * from the query (or null for 404 Not Found responses), or rejects with an\n * Error\n */\nexport async function fetchFromApi(\n endpoint: string,\n options: {\n apiKey?: string;\n baseUrl?: string;\n timeoutMs?: number;\n userAgent?: string;\n } = {},\n): Promise<ApiData> {\n const {\n apiKey,\n baseUrl = 'https://haveibeenpwned.com/api/v3',\n timeoutMs,\n userAgent,\n } = options;\n const headers: Record<string, string> = {};\n\n if (apiKey) {\n headers['HIBP-API-Key'] = apiKey;\n }\n\n if (userAgent) {\n headers['User-Agent'] = userAgent;\n }\n\n // Provide a default User-Agent when running outside the browser\n if (!userAgent && typeof navigator === 'undefined') {\n headers['User-Agent'] = `${name} ${version}`;\n }\n\n const config: RequestInit = {\n headers,\n ...(timeoutMs ? { signal: AbortSignal.timeout(timeoutMs) } : {}),\n };\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}`;\n const response = await fetch(url, config);\n\n if (response.ok) return response.json() as Promise<ApiData>;\n\n switch (response.status) {\n case BAD_REQUEST.status: {\n throw new Error(BAD_REQUEST.statusText);\n }\n case UNAUTHORIZED.status: {\n const body = (await response.json()) as unknown as ErrorData;\n throw new Error(body.message);\n }\n case FORBIDDEN.status: {\n const rayId = response.headers.get('cf-ray');\n if (rayId) throw new Error(blockedWithRayId(rayId));\n throw new Error(FORBIDDEN.statusText);\n }\n case NOT_FOUND.status: {\n return null;\n }\n case TOO_MANY_REQUESTS.status: {\n const body = (await response.json()) as unknown as ErrorData;\n const retryAfter = response.headers.get('retry-after');\n throw new RateLimitError(retryAfter, body.message);\n }\n default: {\n throw new Error(response.statusText);\n }\n }\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing a breach.\n *\n * @typedef {object} Breach\n * @property {string} Name\n * @property {string} Title\n * @property {string} Domain\n * @property {string} BreachDate\n * @property {string} AddedDate\n * @property {string} ModifiedDate\n * @property {number} PwnCount\n * @property {string} Description\n * @property {string[]} DataClasses\n * @property {boolean} IsVerified\n * @property {boolean} IsFabricated\n * @property {boolean} IsSensitive\n * @property {boolean} IsRetired\n * @property {boolean} IsSpamList\n * @property {boolean} IsMalware\n * @property {boolean} IsSubscriptionFree\n * @property {string} LogoPath\n */\n\n/**\n * Fetches data for a specific breach event.\n *\n * @param {string} breachName the name of a breach in the system\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach>|Promise<null>)} a Promise which resolves to an\n * object representing a breach (or null if no breach was found), or rejects\n * with an Error\n * @example\n * try {\n * const data = await breach(\"Adobe\");\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breach(\n breachName: string,\n options: {\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach | null> {\n return fetchFromApi(\n `/breach/${encodeURIComponent(breachName)}`,\n options,\n ) as Promise<Breach | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches breach data for a specific account.\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {string} account a username or email address\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {boolean} [options.includeUnverified] include \"unverified\" breaches in\n * the results (default: true)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {boolean} [options.truncate] truncate the results to only include\n * the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Breach[]> | Promise<null>)} a Promise which resolves to an\n * array of breach objects (or null if no breaches were found), or rejects with\n * an Error\n * @example\n * try {\n * const data = await breachedAccount(\"foo\", { apiKey: \"my-api-key\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breachedAccount(\"bar\", {\n * includeUnverified: false,\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breachedAccount(\"baz\", {\n * apiKey: \"my-api-key\",\n * domain: \"adobe.com\",\n * truncate: false,\n * userAgent: \"my-app 1.0\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breachedAccount(\n account: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * include \"unverified\" breaches in the results (default: true)\n */\n includeUnverified?: boolean;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * truncate the results to only include the name of each breach (default:\n * true)\n */\n truncate?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach[] | null> {\n const {\n apiKey,\n domain,\n includeUnverified = true,\n timeoutMs,\n truncate = true,\n baseUrl,\n userAgent,\n } = options;\n const endpoint = `/breachedaccount/${encodeURIComponent(account)}?`;\n const params: string[] = [];\n\n if (domain) {\n params.push(`domain=${encodeURIComponent(domain)}`);\n }\n\n if (!includeUnverified) {\n params.push('includeUnverified=false');\n }\n\n if (!truncate) {\n params.push('truncateResponse=false');\n }\n\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n apiKey,\n baseUrl,\n timeoutMs,\n userAgent,\n }) as Promise<Breach[] | null>;\n}\n","import type { Breach } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches all breach events in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.domain] a domain by which to filter the results\n * (default: all domains)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<Breach[]>} a Promise which resolves to an array of breach\n * objects (an empty array if no breaches were found), or rejects with an Error\n * @example\n * try {\n * const data = await breaches();\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await breaches({ domain: \"adobe.com\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function breaches(\n options: {\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Breach[]> {\n const { domain, baseUrl, timeoutMs, userAgent } = options;\n const endpoint = '/breaches?';\n const params: string[] = [];\n\n if (domain) {\n params.push(`domain=${encodeURIComponent(domain)}`);\n }\n\n return fetchFromApi(`${endpoint}${params.join('&')}`, {\n baseUrl,\n timeoutMs,\n userAgent,\n }) as Promise<Breach[]>;\n}\n","import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * Fetches all data classes in the system.\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<string[]> | Promise<null>)} a Promise which resolves to an\n * array of strings (or null if no data classes were found), or rejects with an\n * Error\n * @example\n * try {\n * const data = await dataClasses();\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function dataClasses(\n options: {\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<string[] | null> {\n return fetchFromApi('/dataclasses', options) as Promise<string[] | null>;\n}\n","import type { Paste } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing a paste.\n *\n * @typedef {object} Paste\n * @property {string} Id\n * @property {string} Source\n * @property {string} Title\n * @property {string} Date\n * @property {number} EmailCount\n */\n\n/**\n * Fetches paste data for a specific account (email address).\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `pasteaccount` endpoint. The\n * `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {string} email the email address to query\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {(Promise<Paste[]> | Promise<null>)} a Promise which resolves to an\n * array of paste objects (or null if no pastes were found), or rejects with an\n * Error\n * @example\n * try {\n * const data = await pasteAccount(\"foo@bar.com\", { apiKey: \"my-api-key\" });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await pasteAccount(\"foo@bar.com\", {\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * if (data) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n */\nexport function pasteAccount(\n email: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<Paste[] | null> {\n return fetchFromApi(\n `/pasteaccount/${encodeURIComponent(email)}`,\n options,\n ) as Promise<Paste[] | null>;\n}\n","/**\n * A JavaScript implementation of the SHA family of hashes - defined in FIPS PUB 180-4, FIPS PUB 202,\n * and SP 800-185 - as well as the corresponding HMAC implementation as defined in FIPS PUB 198-1.\n *\n * Copyright 2008-2023 Brian Turek, 1998-2009 Paul Johnston & Contributors\n * Distributed under the BSD License\n * See http://caligatio.github.com/jsSHA/ for more information\n */\nconst t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",r=\"ARRAYBUFFER not supported by this environment\",n=\"UINT8ARRAY not supported by this environment\";function i(t,r,n,i){let e,s,o;const h=r||[0],u=(n=n||0)>>>3,f=-1===i?3:0;for(e=0;e<t.length;e+=1)o=e+u,s=o>>>2,h.length<=s&&h.push(0),h[s]|=t[e]<<8*(f+i*(o%4));return{value:h,binLen:8*t.length+n}}function e(e,s,o){switch(s){case\"UTF8\":case\"UTF16BE\":case\"UTF16LE\":break;default:throw new Error(\"encoding must be UTF8, UTF16BE, or UTF16LE\")}switch(e){case\"HEX\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;if(0!=t.length%2)throw new Error(\"String of HEX type must be in byte increments\");const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(e=0;e<t.length;e+=2){if(s=parseInt(t.substr(e,2),16),isNaN(s))throw new Error(\"String of HEX type contains invalid characters\");for(h=(e>>>1)+f,o=h>>>2;u.length<=o;)u.push(0);u[o]|=s<<8*(c+i*(h%4))}return{value:u,binLen:4*t.length+n}}(t,r,n,o)};case\"TEXT\":return function(t,r,n){return function(t,r,n,i,e){let s,o,h,u,f,c,a,w,E=0;const l=n||[0],A=(i=i||0)>>>3;if(\"UTF8\"===r)for(a=-1===e?3:0,h=0;h<t.length;h+=1)for(s=t.charCodeAt(h),o=[],128>s?o.push(s):2048>s?(o.push(192|s>>>6),o.push(128|63&s)):55296>s||57344<=s?o.push(224|s>>>12,128|s>>>6&63,128|63&s):(h+=1,s=65536+((1023&s)<<10|1023&t.charCodeAt(h)),o.push(240|s>>>18,128|s>>>12&63,128|s>>>6&63,128|63&s)),u=0;u<o.length;u+=1){for(c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=o[u]<<8*(a+e*(c%4)),E+=1}else for(a=-1===e?2:0,w=\"UTF16LE\"===r&&1!==e||\"UTF16LE\"!==r&&1===e,h=0;h<t.length;h+=1){for(s=t.charCodeAt(h),!0===w&&(u=255&s,s=u<<8|s>>>8),c=E+A,f=c>>>2;l.length<=f;)l.push(0);l[f]|=s<<8*(a+e*(c%4)),E+=2}return{value:l,binLen:8*E+i}}(t,s,r,n,o)};case\"B64\":return function(r,n,i){return function(r,n,i,e){let s,o,h,u,f,c,a,w=0;const E=n||[0],l=(i=i||0)>>>3,A=-1===e?3:0,p=r.indexOf(\"=\");if(-1===r.search(/^[a-zA-Z0-9=+/]+$/))throw new Error(\"Invalid character in base-64 string\");if(r=r.replace(/=/g,\"\"),-1!==p&&p<r.length)throw new Error(\"Invalid '=' found in base-64 string\");for(o=0;o<r.length;o+=4){for(f=r.substr(o,4),u=0,h=0;h<f.length;h+=1)s=t.indexOf(f.charAt(h)),u|=s<<18-6*h;for(h=0;h<f.length-1;h+=1){for(a=w+l,c=a>>>2;E.length<=c;)E.push(0);E[c]|=(u>>>16-8*h&255)<<8*(A+e*(a%4)),w+=1}}return{value:E,binLen:8*w+i}}(r,n,i,o)};case\"BYTES\":return function(t,r,n){return function(t,r,n,i){let e,s,o,h;const u=r||[0],f=(n=n||0)>>>3,c=-1===i?3:0;for(s=0;s<t.length;s+=1)e=t.charCodeAt(s),h=s+f,o=h>>>2,u.length<=o&&u.push(0),u[o]|=e<<8*(c+i*(h%4));return{value:u,binLen:8*t.length+n}}(t,r,n,o)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t,r,n){return function(t,r,n,e){return i(new Uint8Array(t),r,n,e)}(t,r,n,o)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t,r,n){return i(t,r,n,o)};default:throw new Error(\"format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function s(i,e,s,o){switch(i){case\"HEX\":return function(t){return function(t,r,n,i){const e=\"0123456789abcdef\";let s,o,h=\"\";const u=r/8,f=-1===n?3:0;for(s=0;s<u;s+=1)o=t[s>>>2]>>>8*(f+n*(s%4)),h+=e.charAt(o>>>4&15)+e.charAt(15&o);return i.outputUpper?h.toUpperCase():h}(t,e,s,o)};case\"B64\":return function(r){return function(r,n,i,e){let s,o,h,u,f,c=\"\";const a=n/8,w=-1===i?3:0;for(s=0;s<a;s+=3)for(u=s+1<a?r[s+1>>>2]:0,f=s+2<a?r[s+2>>>2]:0,h=(r[s>>>2]>>>8*(w+i*(s%4))&255)<<16|(u>>>8*(w+i*((s+1)%4))&255)<<8|f>>>8*(w+i*((s+2)%4))&255,o=0;o<4;o+=1)c+=8*s+6*o<=n?t.charAt(h>>>6*(3-o)&63):e.b64Pad;return c}(r,e,s,o)};case\"BYTES\":return function(t){return function(t,r,n){let i,e,s=\"\";const o=r/8,h=-1===n?3:0;for(i=0;i<o;i+=1)e=t[i>>>2]>>>8*(h+n*(i%4))&255,s+=String.fromCharCode(e);return s}(t,e,s)};case\"ARRAYBUFFER\":try{new ArrayBuffer(0)}catch(t){throw new Error(r)}return function(t){return function(t,r,n){let i;const e=r/8,s=new ArrayBuffer(e),o=new Uint8Array(s),h=-1===n?3:0;for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(h+n*(i%4))&255;return s}(t,e,s)};case\"UINT8ARRAY\":try{new Uint8Array(0)}catch(t){throw new Error(n)}return function(t){return function(t,r,n){let i;const e=r/8,s=-1===n?3:0,o=new Uint8Array(e);for(i=0;i<e;i+=1)o[i]=t[i>>>2]>>>8*(s+n*(i%4))&255;return o}(t,e,s)};default:throw new Error(\"format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY\")}}function o(t){const r={outputUpper:!1,b64Pad:\"=\",outputLen:-1},n=t||{},i=\"Output length must be a multiple of 8\";if(r.outputUpper=n.outputUpper||!1,n.b64Pad&&(r.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);r.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);r.outputLen=n.shakeLen}if(\"boolean\"!=typeof r.outputUpper)throw new Error(\"Invalid outputUpper formatting option\");if(\"string\"!=typeof r.b64Pad)throw new Error(\"Invalid b64Pad formatting option\");return r}class h{constructor(t,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||\"UTF8\",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error(\"numRounds must a integer >= 1\");this.o=t,this.h=[],this.u=0,this.l=!1,this.A=0,this.p=!1,this.U=[],this.R=[]}update(t){let r,n=0;const i=this.T>>>5,e=this.F(t,this.h,this.u),s=e.binLen,o=e.value,h=s>>>5;for(r=0;r<h;r+=i)n+this.T<=s&&(this.m=this.g(o.slice(r,r+i),this.m),n+=this.T);return this.A+=n,this.h=o.slice(n>>>5),this.u=s%this.T,this.l=!0,this}getHash(t,r){let n,i,e=this.B;const h=o(r);if(this.v){if(-1===h.outputLen)throw new Error(\"Output length must be specified in options\");e=h.outputLen}const u=s(t,e,this.H,h);if(this.p&&this.C)return u(this.C(h));for(i=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),e),n=1;n<this.numRounds;n+=1)this.v&&e%32!=0&&(i[i.length-1]&=16777215>>>24-e%32),i=this.Y(i,e,0,this.L(this.o),e);return u(i)}setHMACKey(t,r,n){if(!this.M)throw new Error(\"Variant does not support HMAC\");if(this.l)throw new Error(\"Cannot set MAC key after calling update\");const i=e(r,(n||{}).encoding||\"UTF8\",this.H);this.N(i(t))}N(t){const r=this.T>>>3,n=r/4-1;let i;if(1!==this.numRounds)throw new Error(\"Cannot set numRounds with MAC\");if(this.p)throw new Error(\"MAC key already set\");for(r<t.binLen/8&&(t.value=this.Y(t.value,t.binLen,0,this.L(this.o),this.B));t.value.length<=n;)t.value.push(0);for(i=0;i<=n;i+=1)this.U[i]=909522486^t.value[i],this.R[i]=1549556828^t.value[i];this.m=this.g(this.U,this.m),this.A=this.T,this.p=!0}getHMAC(t,r){const n=o(r);return s(t,this.B,this.H,n)(this.S())}S(){let t;if(!this.p)throw new Error(\"Cannot call getHMAC without first setting MAC key\");const r=this.Y(this.h.slice(),this.u,this.A,this.I(this.m),this.B);return t=this.g(this.R,this.L(this.o)),t=this.Y(r,this.B,this.T,t,this.B),t}}function u(t,r){return t<<r|t>>>32-r}function f(t,r,n){return t^r^n}function c(t,r,n){return t&r^t&n^r&n}function a(t,r){const n=(65535&t)+(65535&r);return(65535&(t>>>16)+(r>>>16)+(n>>>16))<<16|65535&n}function w(t,r,n,i,e){const s=(65535&t)+(65535&r)+(65535&n)+(65535&i)+(65535&e);return(65535&(t>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(e>>>16)+(s>>>16))<<16|65535&s}function E(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function l(t,r){let n,i,e,s,o,h,E;const l=[];for(n=r[0],i=r[1],e=r[2],s=r[3],o=r[4],E=0;E<80;E+=1)l[E]=E<16?t[E]:u(l[E-3]^l[E-8]^l[E-14]^l[E-16],1),h=E<20?w(u(n,5),(A=i)&e^~A&s,o,1518500249,l[E]):E<40?w(u(n,5),f(i,e,s),o,1859775393,l[E]):E<60?w(u(n,5),c(i,e,s),o,2400959708,l[E]):w(u(n,5),f(i,e,s),o,3395469782,l[E]),o=s,s=e,e=u(i,30),i=n,n=h;var A;return r[0]=a(n,r[0]),r[1]=a(i,r[1]),r[2]=a(e,r[2]),r[3]=a(s,r[3]),r[4]=a(o,r[4]),r}function A(t,r,n,i){let e;const s=15+(r+65>>>9<<4),o=r+n;for(;t.length<=s;)t.push(0);for(t[r>>>5]|=128<<24-r%32,t[s]=4294967295&o,t[s-1]=o/4294967296|0,e=0;e<t.length;e+=16)i=l(t.slice(e,e+16),i);return i}class p extends h{constructor(t,r,n){if(\"SHA-1\"!==t)throw new Error(\"Chosen SHA variant is not supported\");super(t,r,n);const i=n||{};this.M=!0,this.C=this.S,this.H=-1,this.F=e(this.t,this.i,this.H),this.g=l,this.I=function(t){return t.slice()},this.L=E,this.Y=A,this.m=[1732584193,4023233417,2562383102,271733878,3285377520],this.T=512,this.B=160,this.v=!1,i.hmacKey&&this.N(function(t,r,n,i){const s=t+\" must include a value and format\";if(!r){if(!i)throw new Error(s);return i}if(void 0===r.value||!r.format)throw new Error(s);return e(r.format,r.encoding||\"UTF8\",n)(r.value)}(\"hmacKey\",i.hmacKey,this.H))}}export{p as default};\n","/**\n * Known potential responses from the remote API.\n *\n * https://haveibeenpwned.com/api/v3#PwnedPasswords\n *\n */\n\n/** @internal */\nexport interface PwnedPasswordsApiResponse {\n status: number;\n body?: string;\n}\n\n/** @internal */\nexport const BAD_REQUEST: PwnedPasswordsApiResponse = {\n status: 400,\n body: 'The hash prefix was not in a valid format',\n};\n","import { fetchFromApi } from './api/pwnedpasswords/fetch-from-api.js';\n\nexport type PwnedPasswordSuffixes = Record<string, number>;\n\n/**\n * An object mapping an exposed password hash suffix (corresponding to a given\n * hash prefix) to how many times it occurred in the Pwned Passwords repository.\n *\n * @typedef {Object.<string, number>} PwnedPasswordSuffixes\n */\n\n/**\n * Fetches the SHA-1 or NTLM hash suffixes for the given 5-character hash\n * prefix.\n *\n * When a password hash with the same first 5 characters is found in the Pwned\n * Passwords repository, the API will respond with an HTTP 200 and include the\n * suffix of every hash beginning with the specified prefix, followed by a count\n * of how many times it appears in the data set. This function parses the\n * response and returns a more structured format.\n *\n * @param {string} prefix the first 5 characters of a password hash (case\n * insensitive)\n * @param {object} [options] a configuration object\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {'sha1' | 'ntlm'} [options.mode] return SHA-1 or NTLM hashes\n * (default: `sha1`)\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<PwnedPasswordSuffixes>} a Promise which resolves to an\n * object mapping the `suffix` that when matched with the prefix composes the\n * complete hash, to the `count` of how many times it appears in the breached\n * password data set, or rejects with an Error\n *\n * @example\n * try {\n * const results = await pwnedPasswordRange(\"5BAA6\");\n * // results will have the following shape:\n * // {\n * // \"003D68EB55068C33ACE09247EE4C639306B\": 3,\n * // \"012C192B2F16F82EA0EB9EF18D9D539B0DD\": 1,\n * // ...\n * // }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const suffix = \"1E4C9B93F3F0682250B6CF8331B7EE68FD8\";\n * const results = await pwnedPasswordRange(\"5BAA6\");\n * const numPwns = results[suffix] || 0;\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/api/v3#SearchingPwnedPasswordsByRange\n */\nexport async function pwnedPasswordRange(\n prefix: string,\n options: {\n /**\n * ask the remote API to add padding to the response to obscure the password\n * prefix (default: `false`)\n */\n addPadding?: boolean;\n /**\n * return SHA-1 or NTLM hashes (default: `sha1`)\n */\n mode?: 'sha1' | 'ntlm';\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<PwnedPasswordSuffixes> {\n const {\n baseUrl,\n timeoutMs,\n userAgent,\n addPadding = false,\n mode = 'sha1',\n } = options;\n\n const data = await fetchFromApi(`/range/${encodeURIComponent(prefix)}`, {\n baseUrl,\n timeoutMs,\n userAgent,\n addPadding,\n mode,\n });\n\n // create array from lines of text in response body\n const results = data.split('\\n').filter(Boolean);\n\n // convert into an object mapping suffix to count for each line\n return results.reduce<PwnedPasswordSuffixes>((acc, row) => {\n const [suffix, countString] = row.split(':');\n acc[suffix] = Number.parseInt(countString, 10);\n return acc;\n }, {});\n}\n","import { installUndiciOnNode18 } from '../fetch-polyfill.js';\nimport { BAD_REQUEST } from './responses.js';\n\ninstallUndiciOnNode18();\n\n/**\n * Fetches data from the supplied API endpoint.\n *\n * HTTP status code 200 returns plain text (data found).\n * HTTP status code 400 throws an Error (bad request).\n *\n * @internal\n * @private\n * @param {string} endpoint the API endpoint to query\n * @param {object} [options] a configuration object\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {'sha1' | 'ntlm'} [options.mode] return SHA-1 or NTLM hashes\n * (default: `sha1`)\n * @returns {Promise<string>} a Promise which resolves to the data resulting\n * from the query, or rejects with an Error\n */\nexport async function fetchFromApi(\n endpoint: string,\n options: {\n baseUrl?: string;\n timeoutMs?: number;\n userAgent?: string;\n addPadding?: boolean;\n mode?: 'sha1' | 'ntlm';\n } = {},\n): Promise<string> {\n const {\n baseUrl = 'https://api.pwnedpasswords.com',\n timeoutMs,\n userAgent,\n addPadding = false,\n mode = 'sha1',\n } = options;\n\n const config: RequestInit = {\n headers: {\n ...(userAgent ? { 'User-Agent': userAgent } : {}),\n ...(addPadding ? { 'Add-Padding': 'true' } : {}),\n },\n ...(timeoutMs ? { signal: AbortSignal.timeout(timeoutMs) } : {}),\n };\n const url = `${baseUrl.replace(/\\/$/g, '')}${endpoint}?mode=${mode}`;\n const response = await fetch(url, config);\n\n if (response.ok) return response.text();\n\n if (response.status === BAD_REQUEST.status) {\n const text = await response.text();\n throw new Error(text);\n }\n\n throw new Error(response.statusText);\n}\n","import JSSHA from 'jssha/dist/sha1';\nimport { pwnedPasswordRange } from './pwned-password-range.js';\n\n/**\n * Fetches the number of times the the given password has been exposed in a\n * breach (0 indicating no exposure). The password is given in plain text, but\n * only the first 5 characters of its SHA-1 hash will be submitted to the API.\n *\n * @param {string} password a password in plain text\n * @param {object} [options] a configuration object\n * @param {boolean} [options.addPadding] ask the remote API to add padding to\n * the response to obscure the password prefix (default: `false`)\n * @param {string} [options.baseUrl] a custom base URL for the\n * pwnedpasswords.com API endpoints (default: `https://api.pwnedpasswords.com`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<number>} a Promise which resolves to the number of times\n * the password has been exposed in a breach, or rejects with an Error\n * @example\n * try {\n * const numPwns = await pwnedPassword(\"f00b4r\");\n * // truthy check or numeric condition\n * if (numPwns) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/api/v3#PwnedPasswords\n */\nexport async function pwnedPassword(\n password: string,\n options: {\n /**\n * ask the remote API to add padding to the response to obscure the password\n * prefix (default: `false`)\n */\n addPadding?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<number> {\n /* eslint-disable */\n // @ts-expect-error: JSSHA types are busted\n const sha1 = new JSSHA('SHA-1', 'TEXT');\n sha1.update(password);\n const hash = sha1.getHash('HEX', { outputUpper: true });\n const prefix = hash.slice(0, 5);\n const suffix = hash.slice(5);\n\n const range = await pwnedPasswordRange(prefix, options);\n return range[suffix] || 0;\n /* eslint-enable */\n}\n","import type { Breach, Paste } from './api/haveibeenpwned/types.js';\nimport { breachedAccount } from './breached-account.js';\nimport { pasteAccount } from './paste-account.js';\n\nexport interface SearchResults {\n breaches: Breach[] | null;\n pastes: Paste[] | null;\n}\n\n/**\n * An object representing search results.\n *\n * @typedef {object} SearchResults\n * @property {(Breach[] | null)} breaches\n * @property {(Paste[] | null)} pastes\n */\n\n/**\n * Fetches all breaches and all pastes associated with the provided account\n * (email address or username). Note that the remote API does not support\n * querying pastes by username (only email addresses), so in the event the\n * provided account is not a valid email address, only breach data is queried\n * and the \"pastes\" field of the resulting object will always be null. This is\n * exactly how searching via the current web interface behaves, which this\n * convenience method is designed to mimic.\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `breachedaccount` and\n * `pasteaccount` endpoints. The `apiKey` option here is not explicitly\n * required, but direct requests made without it will fail (unless you specify a\n * `baseUrl` to a proxy that inserts a valid API key on your behalf).\n *\n * @param {string} account an email address or username\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.domain] a domain by which to filter the breach\n * results (default: all domains)\n * @param {boolean} [options.truncate] truncate the breach results to only\n * include the name of each breach (default: true)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the\n * User-Agent field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SearchResults>} a Promise which resolves to an object\n * containing a \"breaches\" key (which can be null or an array of breach objects)\n * and a \"pastes\" key (which can be null or an array of paste objects), or\n * rejects with an Error\n * @example\n * try {\n * const data = await search(\"foo\", { apiKey: \"my-api-key\" });\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await search(\"nobody@nowhere.com\", {\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * truncate: false,\n * });\n * if (data.breaches || data.pastes) {\n * // ...\n * } else {\n * // ...\n * }\n * } catch (err) {\n * // ...\n * }\n * @see https://haveibeenpwned.com/\n */\nexport async function search(\n account: string,\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a domain by which to filter the results (default: all domains)\n */\n domain?: string;\n /**\n * truncate the results to only include the name of each breach (default:\n * true)\n */\n truncate?: boolean;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n): Promise<SearchResults> {\n const {\n apiKey,\n domain,\n truncate = true,\n baseUrl,\n timeoutMs,\n userAgent,\n } = options;\n\n const [breaches, pastes] = await Promise.all([\n breachedAccount(account, {\n apiKey,\n domain,\n truncate,\n baseUrl,\n timeoutMs,\n userAgent,\n }),\n // This email regex is garbage but it seems to be what the API uses:\n /^.+@.+$/.test(account)\n ? pasteAccount(account, { apiKey, baseUrl, timeoutMs, userAgent })\n : null,\n ]);\n\n return { breaches, pastes };\n}\n","import type { SubscriptionStatus } from './api/haveibeenpwned/types.js';\nimport { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';\n\n/**\n * An object representing the status of your HIBP subscription.\n *\n * @typedef {object} SubscriptionStatus\n * @property {string} SubscriptionName\n * @property {string} Description\n * @property {string} SubscribedUntil\n * @property {number} Rpm\n * @property {number} DomainSearchMaxBreachedAccounts\n */\n\n/**\n * Fetches the current status of your HIBP subscription (API key).\n *\n * 🔑 `haveibeenpwned.com` requires an API key from\n * https://haveibeenpwned.com/API/Key for the `subscription/status` endpoint.\n * The `apiKey` option here is not explicitly required, but direct requests made\n * without it will fail (unless you specify a `baseUrl` to a proxy that inserts\n * a valid API key on your behalf).\n *\n * @param {object} [options] a configuration object\n * @param {string} [options.apiKey] an API key from\n * https://haveibeenpwned.com/API/Key (default: undefined)\n * @param {string} [options.baseUrl] a custom base URL for the\n * haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n * @param {number} [options.timeoutMs] timeout for the request in milliseconds\n * (default: none)\n * @param {string} [options.userAgent] a custom string to send as the User-Agent\n * field in the request headers (default: `hibp <version>`)\n * @returns {Promise<SubscriptionStatus>} a Promise which resolves to a\n * subscription status object, or rejects with an Error\n * @example\n * try {\n * const data = await subscriptionStatus({ apiKey: \"my-api-key\" });\n * // ...\n * } catch (err) {\n * // ...\n * }\n * @example\n * try {\n * const data = await subscriptionStatus({\n * baseUrl: \"https://my-hibp-proxy:8080\",\n * });\n * // ...\n * } catch (err) {\n * // ...\n * }\n */\nexport async function subscriptionStatus(\n options: {\n /**\n * an API key from https://haveibeenpwned.com/API/Key (default: undefined)\n */\n apiKey?: string;\n /**\n * a custom base URL for the haveibeenpwned.com API endpoints (default:\n * `https://haveibeenpwned.com/api/v3`)\n */\n baseUrl?: string;\n /**\n * timeout for the request in milliseconds (default: none)\n */\n timeoutMs?: number;\n /**\n * a custom string to send as the User-Agent field in the request headers\n * (default: `hibp <version>`)\n */\n userAgent?: string;\n } = {},\n) {\n const endpoint = '/subscription/status';\n\n return fetchFromApi(endpoint, options) as Promise<SubscriptionStatus>;\n}\n"],"names":["installUndiciOnNode18","process","versions","node","startsWith","File","UndiciFile","fetch","undiciFetch","FormData","UndiciFormData","Headers","UndiciHeaders","Request","UndiciRequest","Response","UndiciResponse","require","global","emptyHeaders","Map","BAD_REQUEST","headers","status","statusText","UNAUTHORIZED","body","statusCode","message","FORBIDDEN","NOT_FOUND","TOO_MANY_REQUESTS","RateLimitError","Error","retryAfterSeconds","constructor","retryAfter","options","super","this","name","Number","parseInt","undefined","async","fetchFromApi","endpoint","apiKey","baseUrl","timeoutMs","userAgent","navigator","version","config","signal","AbortSignal","timeout","url","replace","response","ok","json","rayId","get","blockedWithRayId","breach","breachName","encodeURIComponent","breachedAccount","account","domain","includeUnverified","truncate","params","push","join","breaches","dataClasses","pasteAccount","email","t","r","n","i","e","s","o","h","u","f","length","value","binLen","c","substr","isNaN","a","w","E","l","A","charCodeAt","p","indexOf","search","charAt","ArrayBuffer","Uint8Array","outputUpper","toUpperCase","b64Pad","String","fromCharCode","outputLen","shakeLen","encoding","numRounds","U","R","update","T","F","m","g","slice","getHash","B","v","H","C","Y","I","L","setHMACKey","M","N","getHMAC","S","hmacKey","format","pwnedPasswordRange","prefix","addPadding","mode","data","text","split","filter","Boolean","reduce","acc","row","suffix","countString","pwnedPassword","password","sha1","JSSHA","hash","pastes","Promise","all","test","subscriptionStatus"],"mappings":"mCASgBA,IACd,GACqB,oBAAZC,SACPA,QAAQC,UAAUC,MAAMC,WAAW,OACnC,CACA,MACEC,KAAMC,EACNC,MAAOC,EACPC,SAAUC,EACVC,QAASC,EACTC,QAASC,EACTC,SAAUC,GACRC,QAAQ,UACZC,OAAOb,KAAOC,EACdY,OAAOP,QAAUC,EACjBM,OAAOL,QAAUC,EACjBI,OAAOH,SAAWC,EAClBE,OAAOX,MAAQC,EACfU,OAAOT,SAAWC,CACnB,CACH,CCPA,MAAMS,EAAe,IAAIC,IAGZC,EAAyC,CACpDC,QAASH,EACTI,OAAQ,IACRC,WACE,wEAUSC,EAA0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