FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

20
node_modules/@zxcvbn-ts/core/LICENSE.txt generated vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright (c) 2012-2016 Dan Wheeler and Dropbox, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

37
node_modules/@zxcvbn-ts/core/README.md generated vendored Normal file
View File

@@ -0,0 +1,37 @@
# zxcvbn-ts
**zxcvbn** is a password strength estimator inspired by password crackers.
It recognizes and analyzes over 40 thousand common passwords using pattern matching and conservative estimation and
filters out common first names, last names, popular words from Wikipedia and common words in many cultures,
and recognizes common patterns like dates, repetitions (e.g. 'aaa'), sequences (e.g. 'abcd'), keyboard smashes (e.g. 'qwertyuiop'), and l33t speak.
## Installation
#### npm:
`npm install @zxcvbn-ts/core @zxcvbn-ts/language-common --save`
#### yarn:
`yarn add @zxcvbn-ts/core @zxcvbn-ts/language-common`
## Setup
```js
import { zxcvbn, zxcvbnOptions } from '@zxcvbn-ts/core'
import * as zxcvbnCommonPackage from '@zxcvbn-ts/language-common'
import * as zxcvbnEnPackage from '@zxcvbn-ts/language-en'
const password = 'somePassword'
const options = {
dictionary: {
...zxcvbnCommonPackage.dictionary,
...zxcvbnEnPackage.dictionary,
},
graphs: zxcvbnCommonPackage.adjacencyGraphs,
translations: zxcvbnEnPackage.translations,
}
zxcvbnOptions.setOptions(options)
zxcvbn(password)
```

14
node_modules/@zxcvbn-ts/core/dist/Feedback.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { DefaultFeedbackFunction, FeedbackType, MatchEstimated } from './types';
type Matchers = {
[key: string]: DefaultFeedbackFunction;
};
declare class Feedback {
readonly matchers: Matchers;
defaultFeedback: FeedbackType;
constructor();
setDefaultSuggestions(): void;
getFeedback(score: number, sequence: MatchEstimated[]): FeedbackType;
getLongestMatch(sequence: MatchEstimated[]): MatchEstimated;
getMatchFeedback(match: MatchEstimated, isSoleMatch: boolean): FeedbackType | null;
}
export default Feedback;

83
node_modules/@zxcvbn-ts/core/dist/Feedback.esm.js generated vendored Normal file
View File

@@ -0,0 +1,83 @@
import { zxcvbnOptions } from './Options.esm.js';
import bruteforceMatcher from './matcher/bruteforce/feedback.esm.js';
import dateMatcher from './matcher/date/feedback.esm.js';
import dictionaryMatcher from './matcher/dictionary/feedback.esm.js';
import regexMatcher from './matcher/regex/feedback.esm.js';
import repeatMatcher from './matcher/repeat/feedback.esm.js';
import sequenceMatcher from './matcher/sequence/feedback.esm.js';
import spatialMatcher from './matcher/spatial/feedback.esm.js';
import separatorMatcher from './matcher/separator/feedback.esm.js';
const defaultFeedback = {
warning: null,
suggestions: []
};
/*
* -------------------------------------------------------------------------------
* Generate feedback ---------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class Feedback {
constructor() {
this.matchers = {
bruteforce: bruteforceMatcher,
date: dateMatcher,
dictionary: dictionaryMatcher,
regex: regexMatcher,
repeat: repeatMatcher,
sequence: sequenceMatcher,
spatial: spatialMatcher,
separator: separatorMatcher
};
this.defaultFeedback = {
warning: null,
suggestions: []
};
this.setDefaultSuggestions();
}
setDefaultSuggestions() {
this.defaultFeedback.suggestions.push(zxcvbnOptions.translations.suggestions.useWords, zxcvbnOptions.translations.suggestions.noNeed);
}
getFeedback(score, sequence) {
if (sequence.length === 0) {
return this.defaultFeedback;
}
if (score > 2) {
return defaultFeedback;
}
const extraFeedback = zxcvbnOptions.translations.suggestions.anotherWord;
const longestMatch = this.getLongestMatch(sequence);
let feedback = this.getMatchFeedback(longestMatch, sequence.length === 1);
if (feedback !== null && feedback !== undefined) {
feedback.suggestions.unshift(extraFeedback);
} else {
feedback = {
warning: null,
suggestions: [extraFeedback]
};
}
return feedback;
}
getLongestMatch(sequence) {
let longestMatch = sequence[0];
const slicedSequence = sequence.slice(1);
slicedSequence.forEach(match => {
if (match.token.length > longestMatch.token.length) {
longestMatch = match;
}
});
return longestMatch;
}
getMatchFeedback(match, isSoleMatch) {
if (this.matchers[match.pattern]) {
return this.matchers[match.pattern](match, isSoleMatch);
}
if (zxcvbnOptions.matchers[match.pattern] && 'feedback' in zxcvbnOptions.matchers[match.pattern]) {
return zxcvbnOptions.matchers[match.pattern].feedback(match, isSoleMatch);
}
return defaultFeedback;
}
}
export { Feedback as default };
//# sourceMappingURL=Feedback.esm.js.map

File diff suppressed because one or more lines are too long

85
node_modules/@zxcvbn-ts/core/dist/Feedback.js generated vendored Normal file
View File

@@ -0,0 +1,85 @@
'use strict';
var Options = require('./Options.js');
var feedback = require('./matcher/bruteforce/feedback.js');
var feedback$1 = require('./matcher/date/feedback.js');
var feedback$2 = require('./matcher/dictionary/feedback.js');
var feedback$3 = require('./matcher/regex/feedback.js');
var feedback$4 = require('./matcher/repeat/feedback.js');
var feedback$5 = require('./matcher/sequence/feedback.js');
var feedback$6 = require('./matcher/spatial/feedback.js');
var feedback$7 = require('./matcher/separator/feedback.js');
const defaultFeedback = {
warning: null,
suggestions: []
};
/*
* -------------------------------------------------------------------------------
* Generate feedback ---------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class Feedback {
constructor() {
this.matchers = {
bruteforce: feedback,
date: feedback$1,
dictionary: feedback$2,
regex: feedback$3,
repeat: feedback$4,
sequence: feedback$5,
spatial: feedback$6,
separator: feedback$7
};
this.defaultFeedback = {
warning: null,
suggestions: []
};
this.setDefaultSuggestions();
}
setDefaultSuggestions() {
this.defaultFeedback.suggestions.push(Options.zxcvbnOptions.translations.suggestions.useWords, Options.zxcvbnOptions.translations.suggestions.noNeed);
}
getFeedback(score, sequence) {
if (sequence.length === 0) {
return this.defaultFeedback;
}
if (score > 2) {
return defaultFeedback;
}
const extraFeedback = Options.zxcvbnOptions.translations.suggestions.anotherWord;
const longestMatch = this.getLongestMatch(sequence);
let feedback = this.getMatchFeedback(longestMatch, sequence.length === 1);
if (feedback !== null && feedback !== undefined) {
feedback.suggestions.unshift(extraFeedback);
} else {
feedback = {
warning: null,
suggestions: [extraFeedback]
};
}
return feedback;
}
getLongestMatch(sequence) {
let longestMatch = sequence[0];
const slicedSequence = sequence.slice(1);
slicedSequence.forEach(match => {
if (match.token.length > longestMatch.token.length) {
longestMatch = match;
}
});
return longestMatch;
}
getMatchFeedback(match, isSoleMatch) {
if (this.matchers[match.pattern]) {
return this.matchers[match.pattern](match, isSoleMatch);
}
if (Options.zxcvbnOptions.matchers[match.pattern] && 'feedback' in Options.zxcvbnOptions.matchers[match.pattern]) {
return Options.zxcvbnOptions.matchers[match.pattern].feedback(match, isSoleMatch);
}
return defaultFeedback;
}
}
module.exports = Feedback;
//# sourceMappingURL=Feedback.js.map

1
node_modules/@zxcvbn-ts/core/dist/Feedback.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

9
node_modules/@zxcvbn-ts/core/dist/Matching.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import { MatchExtended, MatchingType } from './types';
type Matchers = {
[key: string]: MatchingType;
};
declare class Matching {
readonly matchers: Matchers;
match(password: string): MatchExtended[] | Promise<MatchExtended[]>;
}
export default Matching;

61
node_modules/@zxcvbn-ts/core/dist/Matching.esm.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
import { extend, sorted } from './helper.esm.js';
import MatchDate from './matcher/date/matching.esm.js';
import MatchDictionary from './matcher/dictionary/matching.esm.js';
import MatchRegex from './matcher/regex/matching.esm.js';
import MatchRepeat from './matcher/repeat/matching.esm.js';
import MatchSequence from './matcher/sequence/matching.esm.js';
import MatchSpatial from './matcher/spatial/matching.esm.js';
import MatchSeparator from './matcher/separator/matching.esm.js';
import { zxcvbnOptions } from './Options.esm.js';
class Matching {
constructor() {
this.matchers = {
date: MatchDate,
dictionary: MatchDictionary,
regex: MatchRegex,
// @ts-ignore => TODO resolve this type issue. This is because it is possible to be async
repeat: MatchRepeat,
sequence: MatchSequence,
spatial: MatchSpatial,
separator: MatchSeparator
};
}
match(password) {
const matches = [];
const promises = [];
const matchers = [...Object.keys(this.matchers), ...Object.keys(zxcvbnOptions.matchers)];
matchers.forEach(key => {
if (!this.matchers[key] && !zxcvbnOptions.matchers[key]) {
return;
}
const Matcher = this.matchers[key] ? this.matchers[key] : zxcvbnOptions.matchers[key].Matching;
const usedMatcher = new Matcher();
const result = usedMatcher.match({
password,
omniMatch: this
});
if (result instanceof Promise) {
result.then(response => {
extend(matches, response);
});
promises.push(result);
} else {
extend(matches, result);
}
});
if (promises.length > 0) {
return new Promise((resolve, reject) => {
Promise.all(promises).then(() => {
resolve(sorted(matches));
}).catch(error => {
reject(error);
});
});
}
return sorted(matches);
}
}
export { Matching as default };
//# sourceMappingURL=Matching.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Matching.esm.js","sources":["../src/Matching.ts"],"sourcesContent":["import { extend, sorted } from './helper';\nimport dateMatcher from './matcher/date/matching';\nimport dictionaryMatcher from './matcher/dictionary/matching';\nimport regexMatcher from './matcher/regex/matching';\nimport repeatMatcher from './matcher/repeat/matching';\nimport sequenceMatcher from './matcher/sequence/matching';\nimport spatialMatcher from './matcher/spatial/matching';\nimport separatorMatcher from './matcher/separator/matching';\nimport { zxcvbnOptions } from './Options';\nclass Matching {\n constructor() {\n this.matchers = {\n date: dateMatcher,\n dictionary: dictionaryMatcher,\n regex: regexMatcher,\n // @ts-ignore => TODO resolve this type issue. This is because it is possible to be async\n repeat: repeatMatcher,\n sequence: sequenceMatcher,\n spatial: spatialMatcher,\n separator: separatorMatcher,\n };\n }\n match(password) {\n const matches = [];\n const promises = [];\n const matchers = [\n ...Object.keys(this.matchers),\n ...Object.keys(zxcvbnOptions.matchers),\n ];\n matchers.forEach((key) => {\n if (!this.matchers[key] && !zxcvbnOptions.matchers[key]) {\n return;\n }\n const Matcher = this.matchers[key]\n ? this.matchers[key]\n : zxcvbnOptions.matchers[key].Matching;\n const usedMatcher = new Matcher();\n const result = usedMatcher.match({\n password,\n omniMatch: this,\n });\n if (result instanceof Promise) {\n result.then((response) => {\n extend(matches, response);\n });\n promises.push(result);\n }\n else {\n extend(matches, result);\n }\n });\n if (promises.length > 0) {\n return new Promise((resolve, reject) => {\n Promise.all(promises)\n .then(() => {\n resolve(sorted(matches));\n })\n .catch((error) => {\n reject(error);\n });\n });\n }\n return sorted(matches);\n }\n}\nexport default Matching;\n//# sourceMappingURL=Matching.js.map"],"names":["Matching","constructor","matchers","date","dateMatcher","dictionary","dictionaryMatcher","regex","regexMatcher","repeat","repeatMatcher","sequence","sequenceMatcher","spatial","spatialMatcher","separator","separatorMatcher","match","password","matches","promises","Object","keys","zxcvbnOptions","forEach","key","Matcher","usedMatcher","result","omniMatch","Promise","then","response","extend","push","length","resolve","reject","all","sorted","catch","error"],"mappings":";;;;;;;;;;AASA,MAAMA,QAAQ,CAAC;AACXC,EAAAA,WAAWA,GAAG;IACV,IAAI,CAACC,QAAQ,GAAG;AACZC,MAAAA,IAAI,EAAEC,SAAW;AACjBC,MAAAA,UAAU,EAAEC,eAAiB;AAC7BC,MAAAA,KAAK,EAAEC,UAAY;AACnB;AACAC,MAAAA,MAAM,EAAEC,WAAa;AACrBC,MAAAA,QAAQ,EAAEC,aAAe;AACzBC,MAAAA,OAAO,EAAEC,YAAc;AACvBC,MAAAA,SAAS,EAAEC,cAAAA;KACd,CAAA;AACL,GAAA;EACAC,KAAKA,CAACC,QAAQ,EAAE;IACZ,MAAMC,OAAO,GAAG,EAAE,CAAA;IAClB,MAAMC,QAAQ,GAAG,EAAE,CAAA;IACnB,MAAMlB,QAAQ,GAAG,CACb,GAAGmB,MAAM,CAACC,IAAI,CAAC,IAAI,CAACpB,QAAQ,CAAC,EAC7B,GAAGmB,MAAM,CAACC,IAAI,CAACC,aAAa,CAACrB,QAAQ,CAAC,CACzC,CAAA;AACDA,IAAAA,QAAQ,CAACsB,OAAO,CAAEC,GAAG,IAAK;AACtB,MAAA,IAAI,CAAC,IAAI,CAACvB,QAAQ,CAACuB,GAAG,CAAC,IAAI,CAACF,aAAa,CAACrB,QAAQ,CAACuB,GAAG,CAAC,EAAE;AACrD,QAAA,OAAA;AACJ,OAAA;MACA,MAAMC,OAAO,GAAG,IAAI,CAACxB,QAAQ,CAACuB,GAAG,CAAC,GAC5B,IAAI,CAACvB,QAAQ,CAACuB,GAAG,CAAC,GAClBF,aAAa,CAACrB,QAAQ,CAACuB,GAAG,CAAC,CAACzB,QAAQ,CAAA;AAC1C,MAAA,MAAM2B,WAAW,GAAG,IAAID,OAAO,EAAE,CAAA;AACjC,MAAA,MAAME,MAAM,GAAGD,WAAW,CAACV,KAAK,CAAC;QAC7BC,QAAQ;AACRW,QAAAA,SAAS,EAAE,IAAA;AACf,OAAC,CAAC,CAAA;MACF,IAAID,MAAM,YAAYE,OAAO,EAAE;AAC3BF,QAAAA,MAAM,CAACG,IAAI,CAAEC,QAAQ,IAAK;AACtBC,UAAAA,MAAM,CAACd,OAAO,EAAEa,QAAQ,CAAC,CAAA;AAC7B,SAAC,CAAC,CAAA;AACFZ,QAAAA,QAAQ,CAACc,IAAI,CAACN,MAAM,CAAC,CAAA;AACzB,OAAC,MACI;AACDK,QAAAA,MAAM,CAACd,OAAO,EAAES,MAAM,CAAC,CAAA;AAC3B,OAAA;AACJ,KAAC,CAAC,CAAA;AACF,IAAA,IAAIR,QAAQ,CAACe,MAAM,GAAG,CAAC,EAAE;AACrB,MAAA,OAAO,IAAIL,OAAO,CAAC,CAACM,OAAO,EAAEC,MAAM,KAAK;QACpCP,OAAO,CAACQ,GAAG,CAAClB,QAAQ,CAAC,CAChBW,IAAI,CAAC,MAAM;AACZK,UAAAA,OAAO,CAACG,MAAM,CAACpB,OAAO,CAAC,CAAC,CAAA;AAC5B,SAAC,CAAC,CACGqB,KAAK,CAAEC,KAAK,IAAK;UAClBJ,MAAM,CAACI,KAAK,CAAC,CAAA;AACjB,SAAC,CAAC,CAAA;AACN,OAAC,CAAC,CAAA;AACN,KAAA;IACA,OAAOF,MAAM,CAACpB,OAAO,CAAC,CAAA;AAC1B,GAAA;AACJ;;;;"}

63
node_modules/@zxcvbn-ts/core/dist/Matching.js generated vendored Normal file
View File

@@ -0,0 +1,63 @@
'use strict';
var helper = require('./helper.js');
var matching = require('./matcher/date/matching.js');
var matching$1 = require('./matcher/dictionary/matching.js');
var matching$2 = require('./matcher/regex/matching.js');
var matching$3 = require('./matcher/repeat/matching.js');
var matching$4 = require('./matcher/sequence/matching.js');
var matching$5 = require('./matcher/spatial/matching.js');
var matching$6 = require('./matcher/separator/matching.js');
var Options = require('./Options.js');
class Matching {
constructor() {
this.matchers = {
date: matching,
dictionary: matching$1,
regex: matching$2,
// @ts-ignore => TODO resolve this type issue. This is because it is possible to be async
repeat: matching$3,
sequence: matching$4,
spatial: matching$5,
separator: matching$6
};
}
match(password) {
const matches = [];
const promises = [];
const matchers = [...Object.keys(this.matchers), ...Object.keys(Options.zxcvbnOptions.matchers)];
matchers.forEach(key => {
if (!this.matchers[key] && !Options.zxcvbnOptions.matchers[key]) {
return;
}
const Matcher = this.matchers[key] ? this.matchers[key] : Options.zxcvbnOptions.matchers[key].Matching;
const usedMatcher = new Matcher();
const result = usedMatcher.match({
password,
omniMatch: this
});
if (result instanceof Promise) {
result.then(response => {
helper.extend(matches, response);
});
promises.push(result);
} else {
helper.extend(matches, result);
}
});
if (promises.length > 0) {
return new Promise((resolve, reject) => {
Promise.all(promises).then(() => {
resolve(helper.sorted(matches));
}).catch(error => {
reject(error);
});
});
}
return helper.sorted(matches);
}
}
module.exports = Matching;
//# sourceMappingURL=Matching.js.map

1
node_modules/@zxcvbn-ts/core/dist/Matching.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Matching.js","sources":["../src/Matching.ts"],"sourcesContent":["import { extend, sorted } from './helper';\nimport dateMatcher from './matcher/date/matching';\nimport dictionaryMatcher from './matcher/dictionary/matching';\nimport regexMatcher from './matcher/regex/matching';\nimport repeatMatcher from './matcher/repeat/matching';\nimport sequenceMatcher from './matcher/sequence/matching';\nimport spatialMatcher from './matcher/spatial/matching';\nimport separatorMatcher from './matcher/separator/matching';\nimport { zxcvbnOptions } from './Options';\nclass Matching {\n constructor() {\n this.matchers = {\n date: dateMatcher,\n dictionary: dictionaryMatcher,\n regex: regexMatcher,\n // @ts-ignore => TODO resolve this type issue. This is because it is possible to be async\n repeat: repeatMatcher,\n sequence: sequenceMatcher,\n spatial: spatialMatcher,\n separator: separatorMatcher,\n };\n }\n match(password) {\n const matches = [];\n const promises = [];\n const matchers = [\n ...Object.keys(this.matchers),\n ...Object.keys(zxcvbnOptions.matchers),\n ];\n matchers.forEach((key) => {\n if (!this.matchers[key] && !zxcvbnOptions.matchers[key]) {\n return;\n }\n const Matcher = this.matchers[key]\n ? this.matchers[key]\n : zxcvbnOptions.matchers[key].Matching;\n const usedMatcher = new Matcher();\n const result = usedMatcher.match({\n password,\n omniMatch: this,\n });\n if (result instanceof Promise) {\n result.then((response) => {\n extend(matches, response);\n });\n promises.push(result);\n }\n else {\n extend(matches, result);\n }\n });\n if (promises.length > 0) {\n return new Promise((resolve, reject) => {\n Promise.all(promises)\n .then(() => {\n resolve(sorted(matches));\n })\n .catch((error) => {\n reject(error);\n });\n });\n }\n return sorted(matches);\n }\n}\nexport default Matching;\n//# sourceMappingURL=Matching.js.map"],"names":["Matching","constructor","matchers","date","dateMatcher","dictionary","dictionaryMatcher","regex","regexMatcher","repeat","repeatMatcher","sequence","sequenceMatcher","spatial","spatialMatcher","separator","separatorMatcher","match","password","matches","promises","Object","keys","zxcvbnOptions","forEach","key","Matcher","usedMatcher","result","omniMatch","Promise","then","response","extend","push","length","resolve","reject","all","sorted","catch","error"],"mappings":";;;;;;;;;;;;AASA,MAAMA,QAAQ,CAAC;AACXC,EAAAA,WAAWA,GAAG;IACV,IAAI,CAACC,QAAQ,GAAG;AACZC,MAAAA,IAAI,EAAEC,QAAW;AACjBC,MAAAA,UAAU,EAAEC,UAAiB;AAC7BC,MAAAA,KAAK,EAAEC,UAAY;AACnB;AACAC,MAAAA,MAAM,EAAEC,UAAa;AACrBC,MAAAA,QAAQ,EAAEC,UAAe;AACzBC,MAAAA,OAAO,EAAEC,UAAc;AACvBC,MAAAA,SAAS,EAAEC,UAAAA;KACd,CAAA;AACL,GAAA;EACAC,KAAKA,CAACC,QAAQ,EAAE;IACZ,MAAMC,OAAO,GAAG,EAAE,CAAA;IAClB,MAAMC,QAAQ,GAAG,EAAE,CAAA;IACnB,MAAMlB,QAAQ,GAAG,CACb,GAAGmB,MAAM,CAACC,IAAI,CAAC,IAAI,CAACpB,QAAQ,CAAC,EAC7B,GAAGmB,MAAM,CAACC,IAAI,CAACC,qBAAa,CAACrB,QAAQ,CAAC,CACzC,CAAA;AACDA,IAAAA,QAAQ,CAACsB,OAAO,CAAEC,GAAG,IAAK;AACtB,MAAA,IAAI,CAAC,IAAI,CAACvB,QAAQ,CAACuB,GAAG,CAAC,IAAI,CAACF,qBAAa,CAACrB,QAAQ,CAACuB,GAAG,CAAC,EAAE;AACrD,QAAA,OAAA;AACJ,OAAA;MACA,MAAMC,OAAO,GAAG,IAAI,CAACxB,QAAQ,CAACuB,GAAG,CAAC,GAC5B,IAAI,CAACvB,QAAQ,CAACuB,GAAG,CAAC,GAClBF,qBAAa,CAACrB,QAAQ,CAACuB,GAAG,CAAC,CAACzB,QAAQ,CAAA;AAC1C,MAAA,MAAM2B,WAAW,GAAG,IAAID,OAAO,EAAE,CAAA;AACjC,MAAA,MAAME,MAAM,GAAGD,WAAW,CAACV,KAAK,CAAC;QAC7BC,QAAQ;AACRW,QAAAA,SAAS,EAAE,IAAA;AACf,OAAC,CAAC,CAAA;MACF,IAAID,MAAM,YAAYE,OAAO,EAAE;AAC3BF,QAAAA,MAAM,CAACG,IAAI,CAAEC,QAAQ,IAAK;AACtBC,UAAAA,aAAM,CAACd,OAAO,EAAEa,QAAQ,CAAC,CAAA;AAC7B,SAAC,CAAC,CAAA;AACFZ,QAAAA,QAAQ,CAACc,IAAI,CAACN,MAAM,CAAC,CAAA;AACzB,OAAC,MACI;AACDK,QAAAA,aAAM,CAACd,OAAO,EAAES,MAAM,CAAC,CAAA;AAC3B,OAAA;AACJ,KAAC,CAAC,CAAA;AACF,IAAA,IAAIR,QAAQ,CAACe,MAAM,GAAG,CAAC,EAAE;AACrB,MAAA,OAAO,IAAIL,OAAO,CAAC,CAACM,OAAO,EAAEC,MAAM,KAAK;QACpCP,OAAO,CAACQ,GAAG,CAAClB,QAAQ,CAAC,CAChBW,IAAI,CAAC,MAAM;AACZK,UAAAA,OAAO,CAACG,aAAM,CAACpB,OAAO,CAAC,CAAC,CAAA;AAC5B,SAAC,CAAC,CACGqB,KAAK,CAAEC,KAAK,IAAK;UAClBJ,MAAM,CAACI,KAAK,CAAC,CAAA;AACjB,SAAC,CAAC,CAAA;AACN,OAAC,CAAC,CAAA;AACN,KAAA;IACA,OAAOF,aAAM,CAACpB,OAAO,CAAC,CAAA;AAC1B,GAAA;AACJ;;;;"}

26
node_modules/@zxcvbn-ts/core/dist/Options.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import { TranslationKeys, OptionsType, OptionsDictionary, OptionsL33tTable, OptionsGraph, RankedDictionaries, Matchers, Matcher } from './types';
import TrieNode from './matcher/dictionary/variants/matching/unmunger/TrieNode';
export declare class Options {
matchers: Matchers;
l33tTable: OptionsL33tTable;
trieNodeRoot: TrieNode;
dictionary: OptionsDictionary;
rankedDictionaries: RankedDictionaries;
rankedDictionariesMaxWordSize: Record<string, number>;
translations: TranslationKeys;
graphs: OptionsGraph;
useLevenshteinDistance: boolean;
levenshteinThreshold: number;
l33tMaxSubstitutions: number;
maxLength: number;
constructor();
setOptions(options?: OptionsType): void;
setTranslations(translations: TranslationKeys): void;
checkCustomTranslations(translations: TranslationKeys): boolean;
setRankedDictionaries(): void;
getRankedDictionariesMaxWordSize(list: (string | number)[]): number;
buildSanitizedRankedDictionary(list: (string | number)[]): import("./types").LooseObject;
extendUserInputsDictionary(dictionary: (string | number)[]): void;
addMatcher(name: string, matcher: Matcher): void;
}
export declare const zxcvbnOptions: Options;

129
node_modules/@zxcvbn-ts/core/dist/Options.esm.js generated vendored Normal file
View File

@@ -0,0 +1,129 @@
import { buildRankedDictionary } from './helper.esm.js';
import l33tTable from './data/l33tTable.esm.js';
import translationKeys from './data/translationKeys.esm.js';
import TrieNode from './matcher/dictionary/variants/matching/unmunger/TrieNode.esm.js';
import l33tTableToTrieNode from './matcher/dictionary/variants/matching/unmunger/l33tTableToTrieNode.esm.js';
class Options {
constructor() {
this.matchers = {};
this.l33tTable = l33tTable;
this.trieNodeRoot = l33tTableToTrieNode(l33tTable, new TrieNode());
this.dictionary = {
userInputs: []
};
this.rankedDictionaries = {};
this.rankedDictionariesMaxWordSize = {};
this.translations = translationKeys;
this.graphs = {};
this.useLevenshteinDistance = false;
this.levenshteinThreshold = 2;
this.l33tMaxSubstitutions = 100;
this.maxLength = 256;
this.setRankedDictionaries();
}
// eslint-disable-next-line max-statements,complexity
setOptions(options = {}) {
if (options.l33tTable) {
this.l33tTable = options.l33tTable;
this.trieNodeRoot = l33tTableToTrieNode(options.l33tTable, new TrieNode());
}
if (options.dictionary) {
this.dictionary = options.dictionary;
this.setRankedDictionaries();
}
if (options.translations) {
this.setTranslations(options.translations);
}
if (options.graphs) {
this.graphs = options.graphs;
}
if (options.useLevenshteinDistance !== undefined) {
this.useLevenshteinDistance = options.useLevenshteinDistance;
}
if (options.levenshteinThreshold !== undefined) {
this.levenshteinThreshold = options.levenshteinThreshold;
}
if (options.l33tMaxSubstitutions !== undefined) {
this.l33tMaxSubstitutions = options.l33tMaxSubstitutions;
}
if (options.maxLength !== undefined) {
this.maxLength = options.maxLength;
}
}
setTranslations(translations) {
if (this.checkCustomTranslations(translations)) {
this.translations = translations;
} else {
throw new Error('Invalid translations object fallback to keys');
}
}
checkCustomTranslations(translations) {
let valid = true;
Object.keys(translationKeys).forEach(type => {
if (type in translations) {
const translationType = type;
Object.keys(translationKeys[translationType]).forEach(key => {
if (!(key in translations[translationType])) {
valid = false;
}
});
} else {
valid = false;
}
});
return valid;
}
setRankedDictionaries() {
const rankedDictionaries = {};
const rankedDictionariesMaxWorkSize = {};
Object.keys(this.dictionary).forEach(name => {
rankedDictionaries[name] = buildRankedDictionary(this.dictionary[name]);
rankedDictionariesMaxWorkSize[name] = this.getRankedDictionariesMaxWordSize(this.dictionary[name]);
});
this.rankedDictionaries = rankedDictionaries;
this.rankedDictionariesMaxWordSize = rankedDictionariesMaxWorkSize;
}
getRankedDictionariesMaxWordSize(list) {
const data = list.map(el => {
if (typeof el !== 'string') {
return el.toString().length;
}
return el.length;
});
// do not use Math.max(...data) because it can result in max stack size error because every entry will be used as an argument
if (data.length === 0) {
return 0;
}
return data.reduce((a, b) => Math.max(a, b), -Infinity);
}
buildSanitizedRankedDictionary(list) {
const sanitizedInputs = [];
list.forEach(input => {
const inputType = typeof input;
if (inputType === 'string' || inputType === 'number' || inputType === 'boolean') {
sanitizedInputs.push(input.toString().toLowerCase());
}
});
return buildRankedDictionary(sanitizedInputs);
}
extendUserInputsDictionary(dictionary) {
if (!this.dictionary.userInputs) {
this.dictionary.userInputs = [];
}
const newList = [...this.dictionary.userInputs, ...dictionary];
this.rankedDictionaries.userInputs = this.buildSanitizedRankedDictionary(newList);
this.rankedDictionariesMaxWordSize.userInputs = this.getRankedDictionariesMaxWordSize(newList);
}
addMatcher(name, matcher) {
if (this.matchers[name]) {
console.info(`Matcher ${name} already exists`);
} else {
this.matchers[name] = matcher;
}
}
}
const zxcvbnOptions = new Options();
export { Options, zxcvbnOptions };
//# sourceMappingURL=Options.esm.js.map

1
node_modules/@zxcvbn-ts/core/dist/Options.esm.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

132
node_modules/@zxcvbn-ts/core/dist/Options.js generated vendored Normal file
View File

@@ -0,0 +1,132 @@
'use strict';
var helper = require('./helper.js');
var l33tTable = require('./data/l33tTable.js');
var translationKeys = require('./data/translationKeys.js');
var TrieNode = require('./matcher/dictionary/variants/matching/unmunger/TrieNode.js');
var l33tTableToTrieNode = require('./matcher/dictionary/variants/matching/unmunger/l33tTableToTrieNode.js');
class Options {
constructor() {
this.matchers = {};
this.l33tTable = l33tTable;
this.trieNodeRoot = l33tTableToTrieNode(l33tTable, new TrieNode());
this.dictionary = {
userInputs: []
};
this.rankedDictionaries = {};
this.rankedDictionariesMaxWordSize = {};
this.translations = translationKeys;
this.graphs = {};
this.useLevenshteinDistance = false;
this.levenshteinThreshold = 2;
this.l33tMaxSubstitutions = 100;
this.maxLength = 256;
this.setRankedDictionaries();
}
// eslint-disable-next-line max-statements,complexity
setOptions(options = {}) {
if (options.l33tTable) {
this.l33tTable = options.l33tTable;
this.trieNodeRoot = l33tTableToTrieNode(options.l33tTable, new TrieNode());
}
if (options.dictionary) {
this.dictionary = options.dictionary;
this.setRankedDictionaries();
}
if (options.translations) {
this.setTranslations(options.translations);
}
if (options.graphs) {
this.graphs = options.graphs;
}
if (options.useLevenshteinDistance !== undefined) {
this.useLevenshteinDistance = options.useLevenshteinDistance;
}
if (options.levenshteinThreshold !== undefined) {
this.levenshteinThreshold = options.levenshteinThreshold;
}
if (options.l33tMaxSubstitutions !== undefined) {
this.l33tMaxSubstitutions = options.l33tMaxSubstitutions;
}
if (options.maxLength !== undefined) {
this.maxLength = options.maxLength;
}
}
setTranslations(translations) {
if (this.checkCustomTranslations(translations)) {
this.translations = translations;
} else {
throw new Error('Invalid translations object fallback to keys');
}
}
checkCustomTranslations(translations) {
let valid = true;
Object.keys(translationKeys).forEach(type => {
if (type in translations) {
const translationType = type;
Object.keys(translationKeys[translationType]).forEach(key => {
if (!(key in translations[translationType])) {
valid = false;
}
});
} else {
valid = false;
}
});
return valid;
}
setRankedDictionaries() {
const rankedDictionaries = {};
const rankedDictionariesMaxWorkSize = {};
Object.keys(this.dictionary).forEach(name => {
rankedDictionaries[name] = helper.buildRankedDictionary(this.dictionary[name]);
rankedDictionariesMaxWorkSize[name] = this.getRankedDictionariesMaxWordSize(this.dictionary[name]);
});
this.rankedDictionaries = rankedDictionaries;
this.rankedDictionariesMaxWordSize = rankedDictionariesMaxWorkSize;
}
getRankedDictionariesMaxWordSize(list) {
const data = list.map(el => {
if (typeof el !== 'string') {
return el.toString().length;
}
return el.length;
});
// do not use Math.max(...data) because it can result in max stack size error because every entry will be used as an argument
if (data.length === 0) {
return 0;
}
return data.reduce((a, b) => Math.max(a, b), -Infinity);
}
buildSanitizedRankedDictionary(list) {
const sanitizedInputs = [];
list.forEach(input => {
const inputType = typeof input;
if (inputType === 'string' || inputType === 'number' || inputType === 'boolean') {
sanitizedInputs.push(input.toString().toLowerCase());
}
});
return helper.buildRankedDictionary(sanitizedInputs);
}
extendUserInputsDictionary(dictionary) {
if (!this.dictionary.userInputs) {
this.dictionary.userInputs = [];
}
const newList = [...this.dictionary.userInputs, ...dictionary];
this.rankedDictionaries.userInputs = this.buildSanitizedRankedDictionary(newList);
this.rankedDictionariesMaxWordSize.userInputs = this.getRankedDictionariesMaxWordSize(newList);
}
addMatcher(name, matcher) {
if (this.matchers[name]) {
console.info(`Matcher ${name} already exists`);
} else {
this.matchers[name] = matcher;
}
}
}
const zxcvbnOptions = new Options();
exports.Options = Options;
exports.zxcvbnOptions = zxcvbnOptions;
//# sourceMappingURL=Options.js.map

1
node_modules/@zxcvbn-ts/core/dist/Options.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

12
node_modules/@zxcvbn-ts/core/dist/TimeEstimates.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { CrackTimesDisplay, CrackTimesSeconds, Score } from './types';
declare class TimeEstimates {
translate(displayStr: string, value: number | undefined): string;
estimateAttackTimes(guesses: number): {
crackTimesSeconds: CrackTimesSeconds;
crackTimesDisplay: CrackTimesDisplay;
score: Score;
};
guessesToScore(guesses: number): Score;
displayTime(seconds: number): string;
}
export default TimeEstimates;

98
node_modules/@zxcvbn-ts/core/dist/TimeEstimates.esm.js generated vendored Normal file
View File

@@ -0,0 +1,98 @@
import { zxcvbnOptions } from './Options.esm.js';
const SECOND = 1;
const MINUTE = SECOND * 60;
const HOUR = MINUTE * 60;
const DAY = HOUR * 24;
const MONTH = DAY * 31;
const YEAR = MONTH * 12;
const CENTURY = YEAR * 100;
const times = {
second: SECOND,
minute: MINUTE,
hour: HOUR,
day: DAY,
month: MONTH,
year: YEAR,
century: CENTURY
};
/*
* -------------------------------------------------------------------------------
* Estimates time for an attacker ---------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class TimeEstimates {
translate(displayStr, value) {
let key = displayStr;
if (value !== undefined && value !== 1) {
key += 's';
}
const {
timeEstimation
} = zxcvbnOptions.translations;
return timeEstimation[key].replace('{base}', `${value}`);
}
estimateAttackTimes(guesses) {
const crackTimesSeconds = {
onlineThrottling100PerHour: guesses / (100 / 3600),
onlineNoThrottling10PerSecond: guesses / 10,
offlineSlowHashing1e4PerSecond: guesses / 1e4,
offlineFastHashing1e10PerSecond: guesses / 1e10
};
const crackTimesDisplay = {
onlineThrottling100PerHour: '',
onlineNoThrottling10PerSecond: '',
offlineSlowHashing1e4PerSecond: '',
offlineFastHashing1e10PerSecond: ''
};
Object.keys(crackTimesSeconds).forEach(scenario => {
const seconds = crackTimesSeconds[scenario];
crackTimesDisplay[scenario] = this.displayTime(seconds);
});
return {
crackTimesSeconds,
crackTimesDisplay,
score: this.guessesToScore(guesses)
};
}
guessesToScore(guesses) {
const DELTA = 5;
if (guesses < 1e3 + DELTA) {
// risky password: "too guessable"
return 0;
}
if (guesses < 1e6 + DELTA) {
// modest protection from throttled online attacks: "very guessable"
return 1;
}
if (guesses < 1e8 + DELTA) {
// modest protection from unthrottled online attacks: "somewhat guessable"
return 2;
}
if (guesses < 1e10 + DELTA) {
// modest protection from offline attacks: "safely unguessable"
// assuming a salted, slow hash function like bcrypt, scrypt, PBKDF2, argon, etc
return 3;
}
// strong protection from offline attacks under same scenario: "very unguessable"
return 4;
}
displayTime(seconds) {
let displayStr = 'centuries';
let base;
const timeKeys = Object.keys(times);
const foundIndex = timeKeys.findIndex(time => seconds < times[time]);
if (foundIndex > -1) {
displayStr = timeKeys[foundIndex - 1];
if (foundIndex !== 0) {
base = Math.round(seconds / times[displayStr]);
} else {
displayStr = 'ltSecond';
}
}
return this.translate(displayStr, base);
}
}
export { TimeEstimates as default };
//# sourceMappingURL=TimeEstimates.esm.js.map

File diff suppressed because one or more lines are too long

100
node_modules/@zxcvbn-ts/core/dist/TimeEstimates.js generated vendored Normal file
View File

@@ -0,0 +1,100 @@
'use strict';
var Options = require('./Options.js');
const SECOND = 1;
const MINUTE = SECOND * 60;
const HOUR = MINUTE * 60;
const DAY = HOUR * 24;
const MONTH = DAY * 31;
const YEAR = MONTH * 12;
const CENTURY = YEAR * 100;
const times = {
second: SECOND,
minute: MINUTE,
hour: HOUR,
day: DAY,
month: MONTH,
year: YEAR,
century: CENTURY
};
/*
* -------------------------------------------------------------------------------
* Estimates time for an attacker ---------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class TimeEstimates {
translate(displayStr, value) {
let key = displayStr;
if (value !== undefined && value !== 1) {
key += 's';
}
const {
timeEstimation
} = Options.zxcvbnOptions.translations;
return timeEstimation[key].replace('{base}', `${value}`);
}
estimateAttackTimes(guesses) {
const crackTimesSeconds = {
onlineThrottling100PerHour: guesses / (100 / 3600),
onlineNoThrottling10PerSecond: guesses / 10,
offlineSlowHashing1e4PerSecond: guesses / 1e4,
offlineFastHashing1e10PerSecond: guesses / 1e10
};
const crackTimesDisplay = {
onlineThrottling100PerHour: '',
onlineNoThrottling10PerSecond: '',
offlineSlowHashing1e4PerSecond: '',
offlineFastHashing1e10PerSecond: ''
};
Object.keys(crackTimesSeconds).forEach(scenario => {
const seconds = crackTimesSeconds[scenario];
crackTimesDisplay[scenario] = this.displayTime(seconds);
});
return {
crackTimesSeconds,
crackTimesDisplay,
score: this.guessesToScore(guesses)
};
}
guessesToScore(guesses) {
const DELTA = 5;
if (guesses < 1e3 + DELTA) {
// risky password: "too guessable"
return 0;
}
if (guesses < 1e6 + DELTA) {
// modest protection from throttled online attacks: "very guessable"
return 1;
}
if (guesses < 1e8 + DELTA) {
// modest protection from unthrottled online attacks: "somewhat guessable"
return 2;
}
if (guesses < 1e10 + DELTA) {
// modest protection from offline attacks: "safely unguessable"
// assuming a salted, slow hash function like bcrypt, scrypt, PBKDF2, argon, etc
return 3;
}
// strong protection from offline attacks under same scenario: "very unguessable"
return 4;
}
displayTime(seconds) {
let displayStr = 'centuries';
let base;
const timeKeys = Object.keys(times);
const foundIndex = timeKeys.findIndex(time => seconds < times[time]);
if (foundIndex > -1) {
displayStr = timeKeys[foundIndex - 1];
if (foundIndex !== 0) {
base = Math.round(seconds / times[displayStr]);
} else {
displayStr = 'ltSecond';
}
}
return this.translate(displayStr, base);
}
}
module.exports = TimeEstimates;
//# sourceMappingURL=TimeEstimates.js.map

File diff suppressed because one or more lines are too long

30
node_modules/@zxcvbn-ts/core/dist/data/const.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
export declare const DATE_MAX_YEAR = 2050;
export declare const DATE_MIN_YEAR = 1000;
export declare const DATE_SPLITS: {
4: number[][];
5: number[][];
6: number[][];
7: number[][];
8: number[][];
};
export declare const BRUTEFORCE_CARDINALITY = 10;
export declare const MIN_GUESSES_BEFORE_GROWING_SEQUENCE = 10000;
export declare const MIN_SUBMATCH_GUESSES_SINGLE_CHAR = 10;
export declare const MIN_SUBMATCH_GUESSES_MULTI_CHAR = 50;
export declare const MIN_YEAR_SPACE = 20;
export declare const START_UPPER: RegExp;
export declare const END_UPPER: RegExp;
export declare const ALL_UPPER: RegExp;
export declare const ALL_UPPER_INVERTED: RegExp;
export declare const ALL_LOWER: RegExp;
export declare const ALL_LOWER_INVERTED: RegExp;
export declare const ONE_LOWER: RegExp;
export declare const ONE_UPPER: RegExp;
export declare const ALPHA_INVERTED: RegExp;
export declare const ALL_DIGIT: RegExp;
export declare const REFERENCE_YEAR: number;
export declare const REGEXEN: {
recentYear: RegExp;
};
export declare const SEPERATOR_CHARS: string[];
export declare const SEPERATOR_CHAR_COUNT: number;

32
node_modules/@zxcvbn-ts/core/dist/data/const.esm.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import dateSplits from './dateSplits.esm.js';
const DATE_MAX_YEAR = 2050;
const DATE_MIN_YEAR = 1000;
const DATE_SPLITS = dateSplits;
const BRUTEFORCE_CARDINALITY = 10;
const MIN_GUESSES_BEFORE_GROWING_SEQUENCE = 10000;
const MIN_SUBMATCH_GUESSES_SINGLE_CHAR = 10;
const MIN_SUBMATCH_GUESSES_MULTI_CHAR = 50;
const MIN_YEAR_SPACE = 20;
// \xbf-\xdf is a range for almost all special uppercase letter like Ä and so on
const START_UPPER = /^[A-Z\xbf-\xdf][^A-Z\xbf-\xdf]+$/;
const END_UPPER = /^[^A-Z\xbf-\xdf]+[A-Z\xbf-\xdf]$/;
// \xdf-\xff is a range for almost all special lowercase letter like ä and so on
const ALL_UPPER = /^[A-Z\xbf-\xdf]+$/;
const ALL_UPPER_INVERTED = /^[^a-z\xdf-\xff]+$/;
const ALL_LOWER = /^[a-z\xdf-\xff]+$/;
const ALL_LOWER_INVERTED = /^[^A-Z\xbf-\xdf]+$/;
const ONE_LOWER = /[a-z\xdf-\xff]/;
const ONE_UPPER = /[A-Z\xbf-\xdf]/;
const ALPHA_INVERTED = /[^A-Za-z\xbf-\xdf]/gi;
const ALL_DIGIT = /^\d+$/;
const REFERENCE_YEAR = new Date().getFullYear();
const REGEXEN = {
recentYear: /19\d\d|200\d|201\d|202\d/g
};
/* Separators */
const SEPERATOR_CHARS = [' ', ',', ';', ':', '|', '/', '\\', '_', '.', '-'];
const SEPERATOR_CHAR_COUNT = SEPERATOR_CHARS.length;
export { ALL_DIGIT, ALL_LOWER, ALL_LOWER_INVERTED, ALL_UPPER, ALL_UPPER_INVERTED, ALPHA_INVERTED, BRUTEFORCE_CARDINALITY, DATE_MAX_YEAR, DATE_MIN_YEAR, DATE_SPLITS, END_UPPER, MIN_GUESSES_BEFORE_GROWING_SEQUENCE, MIN_SUBMATCH_GUESSES_MULTI_CHAR, MIN_SUBMATCH_GUESSES_SINGLE_CHAR, MIN_YEAR_SPACE, ONE_LOWER, ONE_UPPER, REFERENCE_YEAR, REGEXEN, SEPERATOR_CHARS, SEPERATOR_CHAR_COUNT, START_UPPER };
//# sourceMappingURL=const.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"const.esm.js","sources":["../../src/data/const.ts"],"sourcesContent":["import dateSplits from './dateSplits';\nexport const DATE_MAX_YEAR = 2050;\nexport const DATE_MIN_YEAR = 1000;\nexport const DATE_SPLITS = dateSplits;\nexport const BRUTEFORCE_CARDINALITY = 10;\nexport const MIN_GUESSES_BEFORE_GROWING_SEQUENCE = 10000;\nexport const MIN_SUBMATCH_GUESSES_SINGLE_CHAR = 10;\nexport const MIN_SUBMATCH_GUESSES_MULTI_CHAR = 50;\nexport const MIN_YEAR_SPACE = 20;\n// \\xbf-\\xdf is a range for almost all special uppercase letter like Ä and so on\nexport const START_UPPER = /^[A-Z\\xbf-\\xdf][^A-Z\\xbf-\\xdf]+$/;\nexport const END_UPPER = /^[^A-Z\\xbf-\\xdf]+[A-Z\\xbf-\\xdf]$/;\n// \\xdf-\\xff is a range for almost all special lowercase letter like ä and so on\nexport const ALL_UPPER = /^[A-Z\\xbf-\\xdf]+$/;\nexport const ALL_UPPER_INVERTED = /^[^a-z\\xdf-\\xff]+$/;\nexport const ALL_LOWER = /^[a-z\\xdf-\\xff]+$/;\nexport const ALL_LOWER_INVERTED = /^[^A-Z\\xbf-\\xdf]+$/;\nexport const ONE_LOWER = /[a-z\\xdf-\\xff]/;\nexport const ONE_UPPER = /[A-Z\\xbf-\\xdf]/;\nexport const ALPHA_INVERTED = /[^A-Za-z\\xbf-\\xdf]/gi;\nexport const ALL_DIGIT = /^\\d+$/;\nexport const REFERENCE_YEAR = new Date().getFullYear();\nexport const REGEXEN = { recentYear: /19\\d\\d|200\\d|201\\d|202\\d/g };\n/* Separators */\nexport const SEPERATOR_CHARS = [\n ' ',\n ',',\n ';',\n ':',\n '|',\n '/',\n '\\\\',\n '_',\n '.',\n '-',\n];\nexport const SEPERATOR_CHAR_COUNT = SEPERATOR_CHARS.length;\n//# sourceMappingURL=const.js.map"],"names":["DATE_MAX_YEAR","DATE_MIN_YEAR","DATE_SPLITS","dateSplits","BRUTEFORCE_CARDINALITY","MIN_GUESSES_BEFORE_GROWING_SEQUENCE","MIN_SUBMATCH_GUESSES_SINGLE_CHAR","MIN_SUBMATCH_GUESSES_MULTI_CHAR","MIN_YEAR_SPACE","START_UPPER","END_UPPER","ALL_UPPER","ALL_UPPER_INVERTED","ALL_LOWER","ALL_LOWER_INVERTED","ONE_LOWER","ONE_UPPER","ALPHA_INVERTED","ALL_DIGIT","REFERENCE_YEAR","Date","getFullYear","REGEXEN","recentYear","SEPERATOR_CHARS","SEPERATOR_CHAR_COUNT","length"],"mappings":";;AACO,MAAMA,aAAa,GAAG,KAAI;AAC1B,MAAMC,aAAa,GAAG,KAAI;AAC1B,MAAMC,WAAW,GAAGC,WAAU;AAC9B,MAAMC,sBAAsB,GAAG,GAAE;AACjC,MAAMC,mCAAmC,GAAG,MAAK;AACjD,MAAMC,gCAAgC,GAAG,GAAE;AAC3C,MAAMC,+BAA+B,GAAG,GAAE;AAC1C,MAAMC,cAAc,GAAG,GAAE;AAChC;AACO,MAAMC,WAAW,GAAG,mCAAkC;AACtD,MAAMC,SAAS,GAAG,mCAAkC;AAC3D;AACO,MAAMC,SAAS,GAAG,oBAAmB;AACrC,MAAMC,kBAAkB,GAAG,qBAAoB;AAC/C,MAAMC,SAAS,GAAG,oBAAmB;AACrC,MAAMC,kBAAkB,GAAG,qBAAoB;AAC/C,MAAMC,SAAS,GAAG,iBAAgB;AAClC,MAAMC,SAAS,GAAG,iBAAgB;AAClC,MAAMC,cAAc,GAAG,uBAAsB;AAC7C,MAAMC,SAAS,GAAG,QAAO;AACzB,MAAMC,cAAc,GAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,GAAE;AAC/C,MAAMC,OAAO,GAAG;AAAEC,EAAAA,UAAU,EAAE,2BAAA;AAA4B,EAAC;AAClE;AACO,MAAMC,eAAe,GAAG,CAC3B,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,GAAG,EACH,GAAG,EACN;AACYC,MAAAA,oBAAoB,GAAGD,eAAe,CAACE;;;;"}

55
node_modules/@zxcvbn-ts/core/dist/data/const.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
'use strict';
var dateSplits = require('./dateSplits.js');
const DATE_MAX_YEAR = 2050;
const DATE_MIN_YEAR = 1000;
const DATE_SPLITS = dateSplits;
const BRUTEFORCE_CARDINALITY = 10;
const MIN_GUESSES_BEFORE_GROWING_SEQUENCE = 10000;
const MIN_SUBMATCH_GUESSES_SINGLE_CHAR = 10;
const MIN_SUBMATCH_GUESSES_MULTI_CHAR = 50;
const MIN_YEAR_SPACE = 20;
// \xbf-\xdf is a range for almost all special uppercase letter like Ä and so on
const START_UPPER = /^[A-Z\xbf-\xdf][^A-Z\xbf-\xdf]+$/;
const END_UPPER = /^[^A-Z\xbf-\xdf]+[A-Z\xbf-\xdf]$/;
// \xdf-\xff is a range for almost all special lowercase letter like ä and so on
const ALL_UPPER = /^[A-Z\xbf-\xdf]+$/;
const ALL_UPPER_INVERTED = /^[^a-z\xdf-\xff]+$/;
const ALL_LOWER = /^[a-z\xdf-\xff]+$/;
const ALL_LOWER_INVERTED = /^[^A-Z\xbf-\xdf]+$/;
const ONE_LOWER = /[a-z\xdf-\xff]/;
const ONE_UPPER = /[A-Z\xbf-\xdf]/;
const ALPHA_INVERTED = /[^A-Za-z\xbf-\xdf]/gi;
const ALL_DIGIT = /^\d+$/;
const REFERENCE_YEAR = new Date().getFullYear();
const REGEXEN = {
recentYear: /19\d\d|200\d|201\d|202\d/g
};
/* Separators */
const SEPERATOR_CHARS = [' ', ',', ';', ':', '|', '/', '\\', '_', '.', '-'];
const SEPERATOR_CHAR_COUNT = SEPERATOR_CHARS.length;
exports.ALL_DIGIT = ALL_DIGIT;
exports.ALL_LOWER = ALL_LOWER;
exports.ALL_LOWER_INVERTED = ALL_LOWER_INVERTED;
exports.ALL_UPPER = ALL_UPPER;
exports.ALL_UPPER_INVERTED = ALL_UPPER_INVERTED;
exports.ALPHA_INVERTED = ALPHA_INVERTED;
exports.BRUTEFORCE_CARDINALITY = BRUTEFORCE_CARDINALITY;
exports.DATE_MAX_YEAR = DATE_MAX_YEAR;
exports.DATE_MIN_YEAR = DATE_MIN_YEAR;
exports.DATE_SPLITS = DATE_SPLITS;
exports.END_UPPER = END_UPPER;
exports.MIN_GUESSES_BEFORE_GROWING_SEQUENCE = MIN_GUESSES_BEFORE_GROWING_SEQUENCE;
exports.MIN_SUBMATCH_GUESSES_MULTI_CHAR = MIN_SUBMATCH_GUESSES_MULTI_CHAR;
exports.MIN_SUBMATCH_GUESSES_SINGLE_CHAR = MIN_SUBMATCH_GUESSES_SINGLE_CHAR;
exports.MIN_YEAR_SPACE = MIN_YEAR_SPACE;
exports.ONE_LOWER = ONE_LOWER;
exports.ONE_UPPER = ONE_UPPER;
exports.REFERENCE_YEAR = REFERENCE_YEAR;
exports.REGEXEN = REGEXEN;
exports.SEPERATOR_CHARS = SEPERATOR_CHARS;
exports.SEPERATOR_CHAR_COUNT = SEPERATOR_CHAR_COUNT;
exports.START_UPPER = START_UPPER;
//# sourceMappingURL=const.js.map

1
node_modules/@zxcvbn-ts/core/dist/data/const.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"const.js","sources":["../../src/data/const.ts"],"sourcesContent":["import dateSplits from './dateSplits';\nexport const DATE_MAX_YEAR = 2050;\nexport const DATE_MIN_YEAR = 1000;\nexport const DATE_SPLITS = dateSplits;\nexport const BRUTEFORCE_CARDINALITY = 10;\nexport const MIN_GUESSES_BEFORE_GROWING_SEQUENCE = 10000;\nexport const MIN_SUBMATCH_GUESSES_SINGLE_CHAR = 10;\nexport const MIN_SUBMATCH_GUESSES_MULTI_CHAR = 50;\nexport const MIN_YEAR_SPACE = 20;\n// \\xbf-\\xdf is a range for almost all special uppercase letter like Ä and so on\nexport const START_UPPER = /^[A-Z\\xbf-\\xdf][^A-Z\\xbf-\\xdf]+$/;\nexport const END_UPPER = /^[^A-Z\\xbf-\\xdf]+[A-Z\\xbf-\\xdf]$/;\n// \\xdf-\\xff is a range for almost all special lowercase letter like ä and so on\nexport const ALL_UPPER = /^[A-Z\\xbf-\\xdf]+$/;\nexport const ALL_UPPER_INVERTED = /^[^a-z\\xdf-\\xff]+$/;\nexport const ALL_LOWER = /^[a-z\\xdf-\\xff]+$/;\nexport const ALL_LOWER_INVERTED = /^[^A-Z\\xbf-\\xdf]+$/;\nexport const ONE_LOWER = /[a-z\\xdf-\\xff]/;\nexport const ONE_UPPER = /[A-Z\\xbf-\\xdf]/;\nexport const ALPHA_INVERTED = /[^A-Za-z\\xbf-\\xdf]/gi;\nexport const ALL_DIGIT = /^\\d+$/;\nexport const REFERENCE_YEAR = new Date().getFullYear();\nexport const REGEXEN = { recentYear: /19\\d\\d|200\\d|201\\d|202\\d/g };\n/* Separators */\nexport const SEPERATOR_CHARS = [\n ' ',\n ',',\n ';',\n ':',\n '|',\n '/',\n '\\\\',\n '_',\n '.',\n '-',\n];\nexport const SEPERATOR_CHAR_COUNT = SEPERATOR_CHARS.length;\n//# sourceMappingURL=const.js.map"],"names":["DATE_MAX_YEAR","DATE_MIN_YEAR","DATE_SPLITS","dateSplits","BRUTEFORCE_CARDINALITY","MIN_GUESSES_BEFORE_GROWING_SEQUENCE","MIN_SUBMATCH_GUESSES_SINGLE_CHAR","MIN_SUBMATCH_GUESSES_MULTI_CHAR","MIN_YEAR_SPACE","START_UPPER","END_UPPER","ALL_UPPER","ALL_UPPER_INVERTED","ALL_LOWER","ALL_LOWER_INVERTED","ONE_LOWER","ONE_UPPER","ALPHA_INVERTED","ALL_DIGIT","REFERENCE_YEAR","Date","getFullYear","REGEXEN","recentYear","SEPERATOR_CHARS","SEPERATOR_CHAR_COUNT","length"],"mappings":";;;;AACO,MAAMA,aAAa,GAAG,KAAI;AAC1B,MAAMC,aAAa,GAAG,KAAI;AAC1B,MAAMC,WAAW,GAAGC,WAAU;AAC9B,MAAMC,sBAAsB,GAAG,GAAE;AACjC,MAAMC,mCAAmC,GAAG,MAAK;AACjD,MAAMC,gCAAgC,GAAG,GAAE;AAC3C,MAAMC,+BAA+B,GAAG,GAAE;AAC1C,MAAMC,cAAc,GAAG,GAAE;AAChC;AACO,MAAMC,WAAW,GAAG,mCAAkC;AACtD,MAAMC,SAAS,GAAG,mCAAkC;AAC3D;AACO,MAAMC,SAAS,GAAG,oBAAmB;AACrC,MAAMC,kBAAkB,GAAG,qBAAoB;AAC/C,MAAMC,SAAS,GAAG,oBAAmB;AACrC,MAAMC,kBAAkB,GAAG,qBAAoB;AAC/C,MAAMC,SAAS,GAAG,iBAAgB;AAClC,MAAMC,SAAS,GAAG,iBAAgB;AAClC,MAAMC,cAAc,GAAG,uBAAsB;AAC7C,MAAMC,SAAS,GAAG,QAAO;AACzB,MAAMC,cAAc,GAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,GAAE;AAC/C,MAAMC,OAAO,GAAG;AAAEC,EAAAA,UAAU,EAAE,2BAAA;AAA4B,EAAC;AAClE;AACO,MAAMC,eAAe,GAAG,CAC3B,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG,EACH,GAAG,EACH,GAAG,EACN;AACYC,MAAAA,oBAAoB,GAAGD,eAAe,CAACE;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,8 @@
declare const _default: {
4: number[][];
5: number[][];
6: number[][];
7: number[][];
8: number[][];
};
export default _default;

View File

@@ -0,0 +1,24 @@
var dateSplits = {
4: [
// for length-4 strings, eg 1191 or 9111, two ways to split:
[1, 2], [2, 3] // 91 1 1
],
5: [[1, 3], [2, 3],
// [2, 3], // 91 1 11 <- duplicate previous one
[2, 4] // 91 11 1 <- New and must be added as bug fix
],
6: [[1, 2], [2, 4], [4, 5] // 1991 1 1
],
// 1111991
7: [[1, 3], [2, 3], [4, 5], [4, 6] // 1991 11 1
],
8: [[2, 4], [4, 6] // 1991 11 11
]
};
export { dateSplits as default };
//# sourceMappingURL=dateSplits.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dateSplits.esm.js","sources":["../../src/data/dateSplits.ts"],"sourcesContent":["export default {\n 4: [\n // for length-4 strings, eg 1191 or 9111, two ways to split:\n [1, 2],\n [2, 3], // 91 1 1\n ],\n 5: [\n [1, 3],\n [2, 3],\n // [2, 3], // 91 1 11 <- duplicate previous one\n [2, 4], // 91 11 1 <- New and must be added as bug fix\n ],\n 6: [\n [1, 2],\n [2, 4],\n [4, 5], // 1991 1 1\n ],\n // 1111991\n 7: [\n [1, 3],\n [2, 3],\n [4, 5],\n [4, 6], // 1991 11 1\n ],\n 8: [\n [2, 4],\n [4, 6], // 1991 11 11\n ],\n};\n//# sourceMappingURL=dateSplits.js.map"],"names":[],"mappings":"AAAA,iBAAe;AACX,EAAA,CAAC,EAAE;AACC;EACA,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD,EAAA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACN;AACA,EAAA,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD,EAAA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD;EACA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD,EAAA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;AAAE,GAAA;AAEhB,CAAC;;;;"}

26
node_modules/@zxcvbn-ts/core/dist/data/dateSplits.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict';
var dateSplits = {
4: [
// for length-4 strings, eg 1191 or 9111, two ways to split:
[1, 2], [2, 3] // 91 1 1
],
5: [[1, 3], [2, 3],
// [2, 3], // 91 1 11 <- duplicate previous one
[2, 4] // 91 11 1 <- New and must be added as bug fix
],
6: [[1, 2], [2, 4], [4, 5] // 1991 1 1
],
// 1111991
7: [[1, 3], [2, 3], [4, 5], [4, 6] // 1991 11 1
],
8: [[2, 4], [4, 6] // 1991 11 11
]
};
module.exports = dateSplits;
//# sourceMappingURL=dateSplits.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dateSplits.js","sources":["../../src/data/dateSplits.ts"],"sourcesContent":["export default {\n 4: [\n // for length-4 strings, eg 1191 or 9111, two ways to split:\n [1, 2],\n [2, 3], // 91 1 1\n ],\n 5: [\n [1, 3],\n [2, 3],\n // [2, 3], // 91 1 11 <- duplicate previous one\n [2, 4], // 91 11 1 <- New and must be added as bug fix\n ],\n 6: [\n [1, 2],\n [2, 4],\n [4, 5], // 1991 1 1\n ],\n // 1111991\n 7: [\n [1, 3],\n [2, 3],\n [4, 5],\n [4, 6], // 1991 11 1\n ],\n 8: [\n [2, 4],\n [4, 6], // 1991 11 11\n ],\n};\n//# sourceMappingURL=dateSplits.js.map"],"names":[],"mappings":";;AAAA,iBAAe;AACX,EAAA,CAAC,EAAE;AACC;EACA,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD,EAAA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACN;AACA,EAAA,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD,EAAA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD;EACA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;GACT;;AACD,EAAA,CAAC,EAAE,CACC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAE,CAAC,CAAC;AAAE,GAAA;AAEhB,CAAC;;;;"}

25
node_modules/@zxcvbn-ts/core/dist/data/l33tTable.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
declare const _default: {
a: string[];
b: string[];
c: string[];
d: string[];
e: string[];
f: string[];
g: string[];
h: string[];
i: string[];
k: string[];
l: string[];
m: string[];
n: string[];
o: string[];
q: string[];
u: string[];
s: string[];
t: string[];
v: string[];
w: string[];
x: string[];
z: string[];
};
export default _default;

View File

@@ -0,0 +1,27 @@
var l33tTable = {
a: ['4', '@'],
b: ['8'],
c: ['(', '{', '[', '<'],
d: ['6', '|)'],
e: ['3'],
f: ['#'],
g: ['6', '9', '&'],
h: ['#', '|-|'],
i: ['1', '!', '|'],
k: ['<', '|<'],
l: ['!', '1', '|', '7'],
m: ['^^', 'nn', '2n', '/\\\\/\\\\'],
n: ['//'],
o: ['0', '()'],
q: ['9'],
u: ['|_|'],
s: ['$', '5'],
t: ['+', '7'],
v: ['<', '>', '/'],
w: ['^/', 'uu', 'vv', '2u', '2v', '\\\\/\\\\/'],
x: ['%', '><'],
z: ['2']
};
export { l33tTable as default };
//# sourceMappingURL=l33tTable.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"l33tTable.esm.js","sources":["../../src/data/l33tTable.ts"],"sourcesContent":["export default {\n a: ['4', '@'],\n b: ['8'],\n c: ['(', '{', '[', '<'],\n d: ['6', '|)'],\n e: ['3'],\n f: ['#'],\n g: ['6', '9', '&'],\n h: ['#', '|-|'],\n i: ['1', '!', '|'],\n k: ['<', '|<'],\n l: ['!', '1', '|', '7'],\n m: ['^^', 'nn', '2n', '/\\\\\\\\/\\\\\\\\'],\n n: ['//'],\n o: ['0', '()'],\n q: ['9'],\n u: ['|_|'],\n s: ['$', '5'],\n t: ['+', '7'],\n v: ['<', '>', '/'],\n w: ['^/', 'uu', 'vv', '2u', '2v', '\\\\\\\\/\\\\\\\\/'],\n x: ['%', '><'],\n z: ['2'],\n};\n//# sourceMappingURL=l33tTable.js.map"],"names":["a","b","c","d","e","f","g","h","i","k","l","m","n","o","q","u","s","t","v","w","x","z"],"mappings":"AAAA,gBAAe;AACXA,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;EACbC,CAAC,EAAE,CAAC,GAAG,CAAC;EACRC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AACvBC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,CAAC;EACRC,CAAC,EAAE,CAAC,GAAG,CAAC;AACRC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAClBC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC;AACfC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAClBC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EACvBC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;EACnCC,CAAC,EAAE,CAAC,IAAI,CAAC;AACTC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,CAAC;EACRC,CAAC,EAAE,CAAC,KAAK,CAAC;AACVC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;AACbC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;AACbC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAClBC,EAAAA,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;AAC/CC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,CAAA;AACX,CAAC;;;;"}

29
node_modules/@zxcvbn-ts/core/dist/data/l33tTable.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
'use strict';
var l33tTable = {
a: ['4', '@'],
b: ['8'],
c: ['(', '{', '[', '<'],
d: ['6', '|)'],
e: ['3'],
f: ['#'],
g: ['6', '9', '&'],
h: ['#', '|-|'],
i: ['1', '!', '|'],
k: ['<', '|<'],
l: ['!', '1', '|', '7'],
m: ['^^', 'nn', '2n', '/\\\\/\\\\'],
n: ['//'],
o: ['0', '()'],
q: ['9'],
u: ['|_|'],
s: ['$', '5'],
t: ['+', '7'],
v: ['<', '>', '/'],
w: ['^/', 'uu', 'vv', '2u', '2v', '\\\\/\\\\/'],
x: ['%', '><'],
z: ['2']
};
module.exports = l33tTable;
//# sourceMappingURL=l33tTable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"l33tTable.js","sources":["../../src/data/l33tTable.ts"],"sourcesContent":["export default {\n a: ['4', '@'],\n b: ['8'],\n c: ['(', '{', '[', '<'],\n d: ['6', '|)'],\n e: ['3'],\n f: ['#'],\n g: ['6', '9', '&'],\n h: ['#', '|-|'],\n i: ['1', '!', '|'],\n k: ['<', '|<'],\n l: ['!', '1', '|', '7'],\n m: ['^^', 'nn', '2n', '/\\\\\\\\/\\\\\\\\'],\n n: ['//'],\n o: ['0', '()'],\n q: ['9'],\n u: ['|_|'],\n s: ['$', '5'],\n t: ['+', '7'],\n v: ['<', '>', '/'],\n w: ['^/', 'uu', 'vv', '2u', '2v', '\\\\\\\\/\\\\\\\\/'],\n x: ['%', '><'],\n z: ['2'],\n};\n//# sourceMappingURL=l33tTable.js.map"],"names":["a","b","c","d","e","f","g","h","i","k","l","m","n","o","q","u","s","t","v","w","x","z"],"mappings":";;AAAA,gBAAe;AACXA,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;EACbC,CAAC,EAAE,CAAC,GAAG,CAAC;EACRC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AACvBC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,CAAC;EACRC,CAAC,EAAE,CAAC,GAAG,CAAC;AACRC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAClBC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC;AACfC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAClBC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EACvBC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;EACnCC,CAAC,EAAE,CAAC,IAAI,CAAC;AACTC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,CAAC;EACRC,CAAC,EAAE,CAAC,KAAK,CAAC;AACVC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;AACbC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;AACbC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAClBC,EAAAA,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC;AAC/CC,EAAAA,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;EACdC,CAAC,EAAE,CAAC,GAAG,CAAA;AACX,CAAC;;;;"}

View File

@@ -0,0 +1,53 @@
declare const _default: {
warnings: {
straightRow: string;
keyPattern: string;
simpleRepeat: string;
extendedRepeat: string;
sequences: string;
recentYears: string;
dates: string;
topTen: string;
topHundred: string;
common: string;
similarToCommon: string;
wordByItself: string;
namesByThemselves: string;
commonNames: string;
userInputs: string;
pwned: string;
};
suggestions: {
l33t: string;
reverseWords: string;
allUppercase: string;
capitalization: string;
dates: string;
recentYears: string;
associatedYears: string;
sequences: string;
repeated: string;
longerKeyboardPattern: string;
anotherWord: string;
useWords: string;
noNeed: string;
pwned: string;
};
timeEstimation: {
ltSecond: string;
second: string;
seconds: string;
minute: string;
minutes: string;
hour: string;
hours: string;
day: string;
days: string;
month: string;
months: string;
year: string;
years: string;
centuries: string;
};
};
export default _default;

View File

@@ -0,0 +1,55 @@
var translationKeys = {
warnings: {
straightRow: 'straightRow',
keyPattern: 'keyPattern',
simpleRepeat: 'simpleRepeat',
extendedRepeat: 'extendedRepeat',
sequences: 'sequences',
recentYears: 'recentYears',
dates: 'dates',
topTen: 'topTen',
topHundred: 'topHundred',
common: 'common',
similarToCommon: 'similarToCommon',
wordByItself: 'wordByItself',
namesByThemselves: 'namesByThemselves',
commonNames: 'commonNames',
userInputs: 'userInputs',
pwned: 'pwned'
},
suggestions: {
l33t: 'l33t',
reverseWords: 'reverseWords',
allUppercase: 'allUppercase',
capitalization: 'capitalization',
dates: 'dates',
recentYears: 'recentYears',
associatedYears: 'associatedYears',
sequences: 'sequences',
repeated: 'repeated',
longerKeyboardPattern: 'longerKeyboardPattern',
anotherWord: 'anotherWord',
useWords: 'useWords',
noNeed: 'noNeed',
pwned: 'pwned'
},
timeEstimation: {
ltSecond: 'ltSecond',
second: 'second',
seconds: 'seconds',
minute: 'minute',
minutes: 'minutes',
hour: 'hour',
hours: 'hours',
day: 'day',
days: 'days',
month: 'month',
months: 'months',
year: 'year',
years: 'years',
centuries: 'centuries'
}
};
export { translationKeys as default };
//# sourceMappingURL=translationKeys.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"translationKeys.esm.js","sources":["../../src/data/translationKeys.ts"],"sourcesContent":["export default {\n warnings: {\n straightRow: 'straightRow',\n keyPattern: 'keyPattern',\n simpleRepeat: 'simpleRepeat',\n extendedRepeat: 'extendedRepeat',\n sequences: 'sequences',\n recentYears: 'recentYears',\n dates: 'dates',\n topTen: 'topTen',\n topHundred: 'topHundred',\n common: 'common',\n similarToCommon: 'similarToCommon',\n wordByItself: 'wordByItself',\n namesByThemselves: 'namesByThemselves',\n commonNames: 'commonNames',\n userInputs: 'userInputs',\n pwned: 'pwned',\n },\n suggestions: {\n l33t: 'l33t',\n reverseWords: 'reverseWords',\n allUppercase: 'allUppercase',\n capitalization: 'capitalization',\n dates: 'dates',\n recentYears: 'recentYears',\n associatedYears: 'associatedYears',\n sequences: 'sequences',\n repeated: 'repeated',\n longerKeyboardPattern: 'longerKeyboardPattern',\n anotherWord: 'anotherWord',\n useWords: 'useWords',\n noNeed: 'noNeed',\n pwned: 'pwned',\n },\n timeEstimation: {\n ltSecond: 'ltSecond',\n second: 'second',\n seconds: 'seconds',\n minute: 'minute',\n minutes: 'minutes',\n hour: 'hour',\n hours: 'hours',\n day: 'day',\n days: 'days',\n month: 'month',\n months: 'months',\n year: 'year',\n years: 'years',\n centuries: 'centuries',\n },\n};\n//# sourceMappingURL=translationKeys.js.map"],"names":["warnings","straightRow","keyPattern","simpleRepeat","extendedRepeat","sequences","recentYears","dates","topTen","topHundred","common","similarToCommon","wordByItself","namesByThemselves","commonNames","userInputs","pwned","suggestions","l33t","reverseWords","allUppercase","capitalization","associatedYears","repeated","longerKeyboardPattern","anotherWord","useWords","noNeed","timeEstimation","ltSecond","second","seconds","minute","minutes","hour","hours","day","days","month","months","year","years","centuries"],"mappings":"AAAA,sBAAe;AACXA,EAAAA,QAAQ,EAAE;AACNC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,UAAU,EAAE,YAAY;AACxBC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,cAAc,EAAE,gBAAgB;AAChCC,IAAAA,SAAS,EAAE,WAAW;AACtBC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,UAAU,EAAE,YAAY;AACxBC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,eAAe,EAAE,iBAAiB;AAClCC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,UAAU,EAAE,YAAY;AACxBC,IAAAA,KAAK,EAAE,OAAA;GACV;AACDC,EAAAA,WAAW,EAAE;AACTC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,cAAc,EAAE,gBAAgB;AAChCd,IAAAA,KAAK,EAAE,OAAO;AACdD,IAAAA,WAAW,EAAE,aAAa;AAC1BgB,IAAAA,eAAe,EAAE,iBAAiB;AAClCjB,IAAAA,SAAS,EAAE,WAAW;AACtBkB,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,qBAAqB,EAAE,uBAAuB;AAC9CC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,MAAM,EAAE,QAAQ;AAChBX,IAAAA,KAAK,EAAE,OAAA;GACV;AACDY,EAAAA,cAAc,EAAE;AACZC,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,OAAO,EAAE,SAAS;AAClBC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,OAAO,EAAE,SAAS;AAClBC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,GAAG,EAAE,KAAK;AACVC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,SAAS,EAAE,WAAA;AACf,GAAA;AACJ,CAAC;;;;"}

View File

@@ -0,0 +1,57 @@
'use strict';
var translationKeys = {
warnings: {
straightRow: 'straightRow',
keyPattern: 'keyPattern',
simpleRepeat: 'simpleRepeat',
extendedRepeat: 'extendedRepeat',
sequences: 'sequences',
recentYears: 'recentYears',
dates: 'dates',
topTen: 'topTen',
topHundred: 'topHundred',
common: 'common',
similarToCommon: 'similarToCommon',
wordByItself: 'wordByItself',
namesByThemselves: 'namesByThemselves',
commonNames: 'commonNames',
userInputs: 'userInputs',
pwned: 'pwned'
},
suggestions: {
l33t: 'l33t',
reverseWords: 'reverseWords',
allUppercase: 'allUppercase',
capitalization: 'capitalization',
dates: 'dates',
recentYears: 'recentYears',
associatedYears: 'associatedYears',
sequences: 'sequences',
repeated: 'repeated',
longerKeyboardPattern: 'longerKeyboardPattern',
anotherWord: 'anotherWord',
useWords: 'useWords',
noNeed: 'noNeed',
pwned: 'pwned'
},
timeEstimation: {
ltSecond: 'ltSecond',
second: 'second',
seconds: 'seconds',
minute: 'minute',
minutes: 'minutes',
hour: 'hour',
hours: 'hours',
day: 'day',
days: 'days',
month: 'month',
months: 'months',
year: 'year',
years: 'years',
centuries: 'centuries'
}
};
module.exports = translationKeys;
//# sourceMappingURL=translationKeys.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"translationKeys.js","sources":["../../src/data/translationKeys.ts"],"sourcesContent":["export default {\n warnings: {\n straightRow: 'straightRow',\n keyPattern: 'keyPattern',\n simpleRepeat: 'simpleRepeat',\n extendedRepeat: 'extendedRepeat',\n sequences: 'sequences',\n recentYears: 'recentYears',\n dates: 'dates',\n topTen: 'topTen',\n topHundred: 'topHundred',\n common: 'common',\n similarToCommon: 'similarToCommon',\n wordByItself: 'wordByItself',\n namesByThemselves: 'namesByThemselves',\n commonNames: 'commonNames',\n userInputs: 'userInputs',\n pwned: 'pwned',\n },\n suggestions: {\n l33t: 'l33t',\n reverseWords: 'reverseWords',\n allUppercase: 'allUppercase',\n capitalization: 'capitalization',\n dates: 'dates',\n recentYears: 'recentYears',\n associatedYears: 'associatedYears',\n sequences: 'sequences',\n repeated: 'repeated',\n longerKeyboardPattern: 'longerKeyboardPattern',\n anotherWord: 'anotherWord',\n useWords: 'useWords',\n noNeed: 'noNeed',\n pwned: 'pwned',\n },\n timeEstimation: {\n ltSecond: 'ltSecond',\n second: 'second',\n seconds: 'seconds',\n minute: 'minute',\n minutes: 'minutes',\n hour: 'hour',\n hours: 'hours',\n day: 'day',\n days: 'days',\n month: 'month',\n months: 'months',\n year: 'year',\n years: 'years',\n centuries: 'centuries',\n },\n};\n//# sourceMappingURL=translationKeys.js.map"],"names":["warnings","straightRow","keyPattern","simpleRepeat","extendedRepeat","sequences","recentYears","dates","topTen","topHundred","common","similarToCommon","wordByItself","namesByThemselves","commonNames","userInputs","pwned","suggestions","l33t","reverseWords","allUppercase","capitalization","associatedYears","repeated","longerKeyboardPattern","anotherWord","useWords","noNeed","timeEstimation","ltSecond","second","seconds","minute","minutes","hour","hours","day","days","month","months","year","years","centuries"],"mappings":";;AAAA,sBAAe;AACXA,EAAAA,QAAQ,EAAE;AACNC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,UAAU,EAAE,YAAY;AACxBC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,cAAc,EAAE,gBAAgB;AAChCC,IAAAA,SAAS,EAAE,WAAW;AACtBC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,UAAU,EAAE,YAAY;AACxBC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,eAAe,EAAE,iBAAiB;AAClCC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,UAAU,EAAE,YAAY;AACxBC,IAAAA,KAAK,EAAE,OAAA;GACV;AACDC,EAAAA,WAAW,EAAE;AACTC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,YAAY,EAAE,cAAc;AAC5BC,IAAAA,cAAc,EAAE,gBAAgB;AAChCd,IAAAA,KAAK,EAAE,OAAO;AACdD,IAAAA,WAAW,EAAE,aAAa;AAC1BgB,IAAAA,eAAe,EAAE,iBAAiB;AAClCjB,IAAAA,SAAS,EAAE,WAAW;AACtBkB,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,qBAAqB,EAAE,uBAAuB;AAC9CC,IAAAA,WAAW,EAAE,aAAa;AAC1BC,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,MAAM,EAAE,QAAQ;AAChBX,IAAAA,KAAK,EAAE,OAAA;GACV;AACDY,EAAAA,cAAc,EAAE;AACZC,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,OAAO,EAAE,SAAS;AAClBC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,OAAO,EAAE,SAAS;AAClBC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,GAAG,EAAE,KAAK;AACVC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,IAAI,EAAE,MAAM;AACZC,IAAAA,KAAK,EAAE,OAAO;AACdC,IAAAA,SAAS,EAAE,WAAA;AACf,GAAA;AACJ,CAAC;;;;"}

9
node_modules/@zxcvbn-ts/core/dist/debounce.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export type Procedure = (...args: any[]) => void;
/**
* @link https://davidwalsh.name/javascript-debounce-function
* @param func needs to implement a function which is debounced
* @param wait how long do you want to wait till the previous declared function is executed
* @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.
*/
declare const _default: <F extends Procedure>(func: F, wait: number, isImmediate?: boolean) => (this: ThisParameterType<F>, ...args: Parameters<F>) => void;
export default _default;

30
node_modules/@zxcvbn-ts/core/dist/debounce.esm.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
/**
* @link https://davidwalsh.name/javascript-debounce-function
* @param func needs to implement a function which is debounced
* @param wait how long do you want to wait till the previous declared function is executed
* @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.
*/
var debounce = ((func, wait, isImmediate) => {
let timeout;
return function debounce(...args) {
const context = this;
const later = () => {
timeout = undefined;
if (!isImmediate) {
func.apply(context, args);
}
};
const shouldCallNow = isImmediate && !timeout;
if (timeout !== undefined) {
clearTimeout(timeout);
}
timeout = setTimeout(later, wait);
if (shouldCallNow) {
return func.apply(context, args);
}
return undefined;
};
});
export { debounce as default };
//# sourceMappingURL=debounce.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"debounce.esm.js","sources":["../src/debounce.ts"],"sourcesContent":["/**\n * @link https://davidwalsh.name/javascript-debounce-function\n * @param func needs to implement a function which is debounced\n * @param wait how long do you want to wait till the previous declared function is executed\n * @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.\n */\nexport default (func, wait, isImmediate) => {\n let timeout;\n return function debounce(...args) {\n const context = this;\n const later = () => {\n timeout = undefined;\n if (!isImmediate) {\n func.apply(context, args);\n }\n };\n const shouldCallNow = isImmediate && !timeout;\n if (timeout !== undefined) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(later, wait);\n if (shouldCallNow) {\n return func.apply(context, args);\n }\n return undefined;\n };\n};\n//# sourceMappingURL=debounce.js.map"],"names":["func","wait","isImmediate","timeout","debounce","args","context","later","undefined","apply","shouldCallNow","clearTimeout","setTimeout"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,CAAe,CAACA,IAAI,EAAEC,IAAI,EAAEC,WAAW,KAAK;AACxC,EAAA,IAAIC,OAAO,CAAA;AACX,EAAA,OAAO,SAASC,QAAQA,CAAC,GAAGC,IAAI,EAAE;IAC9B,MAAMC,OAAO,GAAG,IAAI,CAAA;IACpB,MAAMC,KAAK,GAAGA,MAAM;AAChBJ,MAAAA,OAAO,GAAGK,SAAS,CAAA;MACnB,IAAI,CAACN,WAAW,EAAE;AACdF,QAAAA,IAAI,CAACS,KAAK,CAACH,OAAO,EAAED,IAAI,CAAC,CAAA;AAC7B,OAAA;KACH,CAAA;AACD,IAAA,MAAMK,aAAa,GAAGR,WAAW,IAAI,CAACC,OAAO,CAAA;IAC7C,IAAIA,OAAO,KAAKK,SAAS,EAAE;MACvBG,YAAY,CAACR,OAAO,CAAC,CAAA;AACzB,KAAA;AACAA,IAAAA,OAAO,GAAGS,UAAU,CAACL,KAAK,EAAEN,IAAI,CAAC,CAAA;AACjC,IAAA,IAAIS,aAAa,EAAE;AACf,MAAA,OAAOV,IAAI,CAACS,KAAK,CAACH,OAAO,EAAED,IAAI,CAAC,CAAA;AACpC,KAAA;AACA,IAAA,OAAOG,SAAS,CAAA;GACnB,CAAA;AACL,CAAC;;;;"}

32
node_modules/@zxcvbn-ts/core/dist/debounce.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
'use strict';
/**
* @link https://davidwalsh.name/javascript-debounce-function
* @param func needs to implement a function which is debounced
* @param wait how long do you want to wait till the previous declared function is executed
* @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.
*/
var debounce = ((func, wait, isImmediate) => {
let timeout;
return function debounce(...args) {
const context = this;
const later = () => {
timeout = undefined;
if (!isImmediate) {
func.apply(context, args);
}
};
const shouldCallNow = isImmediate && !timeout;
if (timeout !== undefined) {
clearTimeout(timeout);
}
timeout = setTimeout(later, wait);
if (shouldCallNow) {
return func.apply(context, args);
}
return undefined;
};
});
module.exports = debounce;
//# sourceMappingURL=debounce.js.map

1
node_modules/@zxcvbn-ts/core/dist/debounce.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"debounce.js","sources":["../src/debounce.ts"],"sourcesContent":["/**\n * @link https://davidwalsh.name/javascript-debounce-function\n * @param func needs to implement a function which is debounced\n * @param wait how long do you want to wait till the previous declared function is executed\n * @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.\n */\nexport default (func, wait, isImmediate) => {\n let timeout;\n return function debounce(...args) {\n const context = this;\n const later = () => {\n timeout = undefined;\n if (!isImmediate) {\n func.apply(context, args);\n }\n };\n const shouldCallNow = isImmediate && !timeout;\n if (timeout !== undefined) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(later, wait);\n if (shouldCallNow) {\n return func.apply(context, args);\n }\n return undefined;\n };\n};\n//# sourceMappingURL=debounce.js.map"],"names":["func","wait","isImmediate","timeout","debounce","args","context","later","undefined","apply","shouldCallNow","clearTimeout","setTimeout"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,CAAe,CAACA,IAAI,EAAEC,IAAI,EAAEC,WAAW,KAAK;AACxC,EAAA,IAAIC,OAAO,CAAA;AACX,EAAA,OAAO,SAASC,QAAQA,CAAC,GAAGC,IAAI,EAAE;IAC9B,MAAMC,OAAO,GAAG,IAAI,CAAA;IACpB,MAAMC,KAAK,GAAGA,MAAM;AAChBJ,MAAAA,OAAO,GAAGK,SAAS,CAAA;MACnB,IAAI,CAACN,WAAW,EAAE;AACdF,QAAAA,IAAI,CAACS,KAAK,CAACH,OAAO,EAAED,IAAI,CAAC,CAAA;AAC7B,OAAA;KACH,CAAA;AACD,IAAA,MAAMK,aAAa,GAAGR,WAAW,IAAI,CAACC,OAAO,CAAA;IAC7C,IAAIA,OAAO,KAAKK,SAAS,EAAE;MACvBG,YAAY,CAACR,OAAO,CAAC,CAAA;AACzB,KAAA;AACAA,IAAAA,OAAO,GAAGS,UAAU,CAACL,KAAK,EAAEN,IAAI,CAAC,CAAA;AACjC,IAAA,IAAIS,aAAa,EAAE;AACf,MAAA,OAAOV,IAAI,CAACS,KAAK,CAACH,OAAO,EAAED,IAAI,CAAC,CAAA;AACpC,KAAA;AACA,IAAA,OAAOG,SAAS,CAAA;GACnB,CAAA;AACL,CAAC;;;;"}

7
node_modules/@zxcvbn-ts/core/dist/helper.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import { LooseObject, MatchExtended } from './types';
export declare const empty: (obj: LooseObject) => boolean;
export declare const extend: (listToExtend: any[], list: any[]) => number;
export declare const translate: (string: string, chrMap: LooseObject) => string;
export declare const mod: (n: number, m: number) => number;
export declare const sorted: (matches: MatchExtended[]) => MatchExtended[];
export declare const buildRankedDictionary: (orderedList: any[]) => LooseObject;

17
node_modules/@zxcvbn-ts/core/dist/helper.esm.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
const extend = (listToExtend, list) =>
// eslint-disable-next-line prefer-spread
listToExtend.push.apply(listToExtend, list);
// sort on i primary, j secondary
const sorted = matches => matches.sort((m1, m2) => m1.i - m2.i || m1.j - m2.j);
const buildRankedDictionary = orderedList => {
const result = {};
let counter = 1; // rank starts at 1, not 0
orderedList.forEach(word => {
result[word] = counter;
counter += 1;
});
return result;
};
export { buildRankedDictionary, extend, sorted };
//# sourceMappingURL=helper.esm.js.map

1
node_modules/@zxcvbn-ts/core/dist/helper.esm.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"helper.esm.js","sources":["../src/helper.ts"],"sourcesContent":["export const empty = (obj) => Object.keys(obj).length === 0;\nexport const extend = (listToExtend, list) => \n// eslint-disable-next-line prefer-spread\nlistToExtend.push.apply(listToExtend, list);\nexport const translate = (string, chrMap) => {\n let newString = string;\n Object.entries(chrMap).forEach(([key, value]) => {\n const escapedKey = key.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regex = new RegExp(escapedKey, 'g');\n newString = newString.replace(regex, value);\n });\n return newString;\n};\n// mod implementation that works for negative numbers\nexport const mod = (n, m) => ((n % m) + m) % m;\n// sort on i primary, j secondary\nexport const sorted = (matches) => matches.sort((m1, m2) => m1.i - m2.i || m1.j - m2.j);\nexport const buildRankedDictionary = (orderedList) => {\n const result = {};\n let counter = 1; // rank starts at 1, not 0\n orderedList.forEach((word) => {\n result[word] = counter;\n counter += 1;\n });\n return result;\n};\n//# sourceMappingURL=helper.js.map"],"names":["extend","listToExtend","list","push","apply","sorted","matches","sort","m1","m2","i","j","buildRankedDictionary","orderedList","result","counter","forEach","word"],"mappings":"MACaA,MAAM,GAAGA,CAACC,YAAY,EAAEC,IAAI;AACzC;AACAD,YAAY,CAACE,IAAI,CAACC,KAAK,CAACH,YAAY,EAAEC,IAAI,EAAC;AAY3C;AACaG,MAAAA,MAAM,GAAIC,OAAO,IAAKA,OAAO,CAACC,IAAI,CAAC,CAACC,EAAE,EAAEC,EAAE,KAAKD,EAAE,CAACE,CAAC,GAAGD,EAAE,CAACC,CAAC,IAAIF,EAAE,CAACG,CAAC,GAAGF,EAAE,CAACE,CAAC,EAAC;AAC1EC,MAAAA,qBAAqB,GAAIC,WAAW,IAAK;EAClD,MAAMC,MAAM,GAAG,EAAE,CAAA;AACjB,EAAA,IAAIC,OAAO,GAAG,CAAC,CAAC;AAChBF,EAAAA,WAAW,CAACG,OAAO,CAAEC,IAAI,IAAK;AAC1BH,IAAAA,MAAM,CAACG,IAAI,CAAC,GAAGF,OAAO,CAAA;AACtBA,IAAAA,OAAO,IAAI,CAAC,CAAA;AAChB,GAAC,CAAC,CAAA;AACF,EAAA,OAAOD,MAAM,CAAA;AACjB;;;;"}

21
node_modules/@zxcvbn-ts/core/dist/helper.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
const extend = (listToExtend, list) =>
// eslint-disable-next-line prefer-spread
listToExtend.push.apply(listToExtend, list);
// sort on i primary, j secondary
const sorted = matches => matches.sort((m1, m2) => m1.i - m2.i || m1.j - m2.j);
const buildRankedDictionary = orderedList => {
const result = {};
let counter = 1; // rank starts at 1, not 0
orderedList.forEach(word => {
result[word] = counter;
counter += 1;
});
return result;
};
exports.buildRankedDictionary = buildRankedDictionary;
exports.extend = extend;
exports.sorted = sorted;
//# sourceMappingURL=helper.js.map

1
node_modules/@zxcvbn-ts/core/dist/helper.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"helper.js","sources":["../src/helper.ts"],"sourcesContent":["export const empty = (obj) => Object.keys(obj).length === 0;\nexport const extend = (listToExtend, list) => \n// eslint-disable-next-line prefer-spread\nlistToExtend.push.apply(listToExtend, list);\nexport const translate = (string, chrMap) => {\n let newString = string;\n Object.entries(chrMap).forEach(([key, value]) => {\n const escapedKey = key.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const regex = new RegExp(escapedKey, 'g');\n newString = newString.replace(regex, value);\n });\n return newString;\n};\n// mod implementation that works for negative numbers\nexport const mod = (n, m) => ((n % m) + m) % m;\n// sort on i primary, j secondary\nexport const sorted = (matches) => matches.sort((m1, m2) => m1.i - m2.i || m1.j - m2.j);\nexport const buildRankedDictionary = (orderedList) => {\n const result = {};\n let counter = 1; // rank starts at 1, not 0\n orderedList.forEach((word) => {\n result[word] = counter;\n counter += 1;\n });\n return result;\n};\n//# sourceMappingURL=helper.js.map"],"names":["extend","listToExtend","list","push","apply","sorted","matches","sort","m1","m2","i","j","buildRankedDictionary","orderedList","result","counter","forEach","word"],"mappings":";;MACaA,MAAM,GAAGA,CAACC,YAAY,EAAEC,IAAI;AACzC;AACAD,YAAY,CAACE,IAAI,CAACC,KAAK,CAACH,YAAY,EAAEC,IAAI,EAAC;AAY3C;AACaG,MAAAA,MAAM,GAAIC,OAAO,IAAKA,OAAO,CAACC,IAAI,CAAC,CAACC,EAAE,EAAEC,EAAE,KAAKD,EAAE,CAACE,CAAC,GAAGD,EAAE,CAACC,CAAC,IAAIF,EAAE,CAACG,CAAC,GAAGF,EAAE,CAACE,CAAC,EAAC;AAC1EC,MAAAA,qBAAqB,GAAIC,WAAW,IAAK;EAClD,MAAMC,MAAM,GAAG,EAAE,CAAA;AACjB,EAAA,IAAIC,OAAO,GAAG,CAAC,CAAC;AAChBF,EAAAA,WAAW,CAACG,OAAO,CAAEC,IAAI,IAAK;AAC1BH,IAAAA,MAAM,CAACG,IAAI,CAAC,GAAGF,OAAO,CAAA;AACtBA,IAAAA,OAAO,IAAI,CAAC,CAAA;AAChB,GAAC,CAAC,CAAA;AACF,EAAA,OAAOD,MAAM,CAAA;AACjB;;;;;;"}

7
node_modules/@zxcvbn-ts/core/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import { zxcvbnOptions, Options } from './Options';
import debounce from './debounce';
import { ZxcvbnResult } from './types';
export declare const zxcvbn: (password: string, userInputs?: (string | number)[]) => ZxcvbnResult;
export declare const zxcvbnAsync: (password: string, userInputs?: (string | number)[]) => Promise<ZxcvbnResult>;
export * from './types';
export { zxcvbnOptions, Options, debounce };

46
node_modules/@zxcvbn-ts/core/dist/index.esm.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
import Matching from './Matching.esm.js';
import scoring from './scoring/index.esm.js';
import TimeEstimates from './TimeEstimates.esm.js';
import Feedback from './Feedback.esm.js';
import { zxcvbnOptions } from './Options.esm.js';
export { Options } from './Options.esm.js';
export { default as debounce } from './debounce.esm.js';
const time = () => new Date().getTime();
const createReturnValue = (resolvedMatches, password, start) => {
const feedback = new Feedback();
const timeEstimates = new TimeEstimates();
const matchSequence = scoring.mostGuessableMatchSequence(password, resolvedMatches);
const calcTime = time() - start;
const attackTimes = timeEstimates.estimateAttackTimes(matchSequence.guesses);
return {
calcTime,
...matchSequence,
...attackTimes,
feedback: feedback.getFeedback(attackTimes.score, matchSequence.sequence)
};
};
const main = (password, userInputs) => {
if (userInputs) {
zxcvbnOptions.extendUserInputsDictionary(userInputs);
}
const matching = new Matching();
return matching.match(password);
};
const zxcvbn = (password, userInputs) => {
const start = time();
const matches = main(password, userInputs);
if (matches instanceof Promise) {
throw new Error('You are using a Promised matcher, please use `zxcvbnAsync` for it.');
}
return createReturnValue(matches, password, start);
};
const zxcvbnAsync = async (password, userInputs) => {
const usedPassword = password.substring(0, zxcvbnOptions.maxLength);
const start = time();
const matches = await main(usedPassword, userInputs);
return createReturnValue(matches, usedPassword, start);
};
export { zxcvbn, zxcvbnAsync, zxcvbnOptions };
//# sourceMappingURL=index.esm.js.map

1
node_modules/@zxcvbn-ts/core/dist/index.esm.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["import Matching from './Matching';\nimport scoring from './scoring';\nimport TimeEstimates from './TimeEstimates';\nimport Feedback from './Feedback';\nimport { zxcvbnOptions, Options } from './Options';\nimport debounce from './debounce';\nconst time = () => new Date().getTime();\nconst createReturnValue = (resolvedMatches, password, start) => {\n const feedback = new Feedback();\n const timeEstimates = new TimeEstimates();\n const matchSequence = scoring.mostGuessableMatchSequence(password, resolvedMatches);\n const calcTime = time() - start;\n const attackTimes = timeEstimates.estimateAttackTimes(matchSequence.guesses);\n return {\n calcTime,\n ...matchSequence,\n ...attackTimes,\n feedback: feedback.getFeedback(attackTimes.score, matchSequence.sequence),\n };\n};\nconst main = (password, userInputs) => {\n if (userInputs) {\n zxcvbnOptions.extendUserInputsDictionary(userInputs);\n }\n const matching = new Matching();\n return matching.match(password);\n};\nexport const zxcvbn = (password, userInputs) => {\n const start = time();\n const matches = main(password, userInputs);\n if (matches instanceof Promise) {\n throw new Error('You are using a Promised matcher, please use `zxcvbnAsync` for it.');\n }\n return createReturnValue(matches, password, start);\n};\nexport const zxcvbnAsync = async (password, userInputs) => {\n const usedPassword = password.substring(0, zxcvbnOptions.maxLength);\n const start = time();\n const matches = await main(usedPassword, userInputs);\n return createReturnValue(matches, usedPassword, start);\n};\nexport * from './types';\nexport { zxcvbnOptions, Options, debounce };\n//# sourceMappingURL=index.js.map"],"names":["time","Date","getTime","createReturnValue","resolvedMatches","password","start","feedback","Feedback","timeEstimates","TimeEstimates","matchSequence","scoring","mostGuessableMatchSequence","calcTime","attackTimes","estimateAttackTimes","guesses","getFeedback","score","sequence","main","userInputs","zxcvbnOptions","extendUserInputsDictionary","matching","Matching","match","zxcvbn","matches","Promise","Error","zxcvbnAsync","usedPassword","substring","maxLength"],"mappings":";;;;;;;;AAMA,MAAMA,IAAI,GAAGA,MAAM,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE,CAAA;AACvC,MAAMC,iBAAiB,GAAGA,CAACC,eAAe,EAAEC,QAAQ,EAAEC,KAAK,KAAK;AAC5D,EAAA,MAAMC,QAAQ,GAAG,IAAIC,QAAQ,EAAE,CAAA;AAC/B,EAAA,MAAMC,aAAa,GAAG,IAAIC,aAAa,EAAE,CAAA;EACzC,MAAMC,aAAa,GAAGC,OAAO,CAACC,0BAA0B,CAACR,QAAQ,EAAED,eAAe,CAAC,CAAA;AACnF,EAAA,MAAMU,QAAQ,GAAGd,IAAI,EAAE,GAAGM,KAAK,CAAA;EAC/B,MAAMS,WAAW,GAAGN,aAAa,CAACO,mBAAmB,CAACL,aAAa,CAACM,OAAO,CAAC,CAAA;EAC5E,OAAO;IACHH,QAAQ;AACR,IAAA,GAAGH,aAAa;AAChB,IAAA,GAAGI,WAAW;IACdR,QAAQ,EAAEA,QAAQ,CAACW,WAAW,CAACH,WAAW,CAACI,KAAK,EAAER,aAAa,CAACS,QAAQ,CAAA;GAC3E,CAAA;AACL,CAAC,CAAA;AACD,MAAMC,IAAI,GAAGA,CAAChB,QAAQ,EAAEiB,UAAU,KAAK;AACnC,EAAA,IAAIA,UAAU,EAAE;AACZC,IAAAA,aAAa,CAACC,0BAA0B,CAACF,UAAU,CAAC,CAAA;AACxD,GAAA;AACA,EAAA,MAAMG,QAAQ,GAAG,IAAIC,QAAQ,EAAE,CAAA;AAC/B,EAAA,OAAOD,QAAQ,CAACE,KAAK,CAACtB,QAAQ,CAAC,CAAA;AACnC,CAAC,CAAA;MACYuB,MAAM,GAAGA,CAACvB,QAAQ,EAAEiB,UAAU,KAAK;AAC5C,EAAA,MAAMhB,KAAK,GAAGN,IAAI,EAAE,CAAA;AACpB,EAAA,MAAM6B,OAAO,GAAGR,IAAI,CAAChB,QAAQ,EAAEiB,UAAU,CAAC,CAAA;EAC1C,IAAIO,OAAO,YAAYC,OAAO,EAAE;AAC5B,IAAA,MAAM,IAAIC,KAAK,CAAC,oEAAoE,CAAC,CAAA;AACzF,GAAA;AACA,EAAA,OAAO5B,iBAAiB,CAAC0B,OAAO,EAAExB,QAAQ,EAAEC,KAAK,CAAC,CAAA;AACtD,EAAC;AACM,MAAM0B,WAAW,GAAG,OAAO3B,QAAQ,EAAEiB,UAAU,KAAK;EACvD,MAAMW,YAAY,GAAG5B,QAAQ,CAAC6B,SAAS,CAAC,CAAC,EAAEX,aAAa,CAACY,SAAS,CAAC,CAAA;AACnE,EAAA,MAAM7B,KAAK,GAAGN,IAAI,EAAE,CAAA;EACpB,MAAM6B,OAAO,GAAG,MAAMR,IAAI,CAACY,YAAY,EAAEX,UAAU,CAAC,CAAA;AACpD,EAAA,OAAOnB,iBAAiB,CAAC0B,OAAO,EAAEI,YAAY,EAAE3B,KAAK,CAAC,CAAA;AAC1D;;;;"}

51
node_modules/@zxcvbn-ts/core/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
'use strict';
var Matching = require('./Matching.js');
var index = require('./scoring/index.js');
var TimeEstimates = require('./TimeEstimates.js');
var Feedback = require('./Feedback.js');
var Options = require('./Options.js');
var debounce = require('./debounce.js');
const time = () => new Date().getTime();
const createReturnValue = (resolvedMatches, password, start) => {
const feedback = new Feedback();
const timeEstimates = new TimeEstimates();
const matchSequence = index.mostGuessableMatchSequence(password, resolvedMatches);
const calcTime = time() - start;
const attackTimes = timeEstimates.estimateAttackTimes(matchSequence.guesses);
return {
calcTime,
...matchSequence,
...attackTimes,
feedback: feedback.getFeedback(attackTimes.score, matchSequence.sequence)
};
};
const main = (password, userInputs) => {
if (userInputs) {
Options.zxcvbnOptions.extendUserInputsDictionary(userInputs);
}
const matching = new Matching();
return matching.match(password);
};
const zxcvbn = (password, userInputs) => {
const start = time();
const matches = main(password, userInputs);
if (matches instanceof Promise) {
throw new Error('You are using a Promised matcher, please use `zxcvbnAsync` for it.');
}
return createReturnValue(matches, password, start);
};
const zxcvbnAsync = async (password, userInputs) => {
const usedPassword = password.substring(0, Options.zxcvbnOptions.maxLength);
const start = time();
const matches = await main(usedPassword, userInputs);
return createReturnValue(matches, usedPassword, start);
};
exports.Options = Options.Options;
exports.zxcvbnOptions = Options.zxcvbnOptions;
exports.debounce = debounce;
exports.zxcvbn = zxcvbn;
exports.zxcvbnAsync = zxcvbnAsync;
//# sourceMappingURL=index.js.map

1
node_modules/@zxcvbn-ts/core/dist/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import Matching from './Matching';\nimport scoring from './scoring';\nimport TimeEstimates from './TimeEstimates';\nimport Feedback from './Feedback';\nimport { zxcvbnOptions, Options } from './Options';\nimport debounce from './debounce';\nconst time = () => new Date().getTime();\nconst createReturnValue = (resolvedMatches, password, start) => {\n const feedback = new Feedback();\n const timeEstimates = new TimeEstimates();\n const matchSequence = scoring.mostGuessableMatchSequence(password, resolvedMatches);\n const calcTime = time() - start;\n const attackTimes = timeEstimates.estimateAttackTimes(matchSequence.guesses);\n return {\n calcTime,\n ...matchSequence,\n ...attackTimes,\n feedback: feedback.getFeedback(attackTimes.score, matchSequence.sequence),\n };\n};\nconst main = (password, userInputs) => {\n if (userInputs) {\n zxcvbnOptions.extendUserInputsDictionary(userInputs);\n }\n const matching = new Matching();\n return matching.match(password);\n};\nexport const zxcvbn = (password, userInputs) => {\n const start = time();\n const matches = main(password, userInputs);\n if (matches instanceof Promise) {\n throw new Error('You are using a Promised matcher, please use `zxcvbnAsync` for it.');\n }\n return createReturnValue(matches, password, start);\n};\nexport const zxcvbnAsync = async (password, userInputs) => {\n const usedPassword = password.substring(0, zxcvbnOptions.maxLength);\n const start = time();\n const matches = await main(usedPassword, userInputs);\n return createReturnValue(matches, usedPassword, start);\n};\nexport * from './types';\nexport { zxcvbnOptions, Options, debounce };\n//# sourceMappingURL=index.js.map"],"names":["time","Date","getTime","createReturnValue","resolvedMatches","password","start","feedback","Feedback","timeEstimates","TimeEstimates","matchSequence","scoring","mostGuessableMatchSequence","calcTime","attackTimes","estimateAttackTimes","guesses","getFeedback","score","sequence","main","userInputs","zxcvbnOptions","extendUserInputsDictionary","matching","Matching","match","zxcvbn","matches","Promise","Error","zxcvbnAsync","usedPassword","substring","maxLength"],"mappings":";;;;;;;;;AAMA,MAAMA,IAAI,GAAGA,MAAM,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE,CAAA;AACvC,MAAMC,iBAAiB,GAAGA,CAACC,eAAe,EAAEC,QAAQ,EAAEC,KAAK,KAAK;AAC5D,EAAA,MAAMC,QAAQ,GAAG,IAAIC,QAAQ,EAAE,CAAA;AAC/B,EAAA,MAAMC,aAAa,GAAG,IAAIC,aAAa,EAAE,CAAA;EACzC,MAAMC,aAAa,GAAGC,KAAO,CAACC,0BAA0B,CAACR,QAAQ,EAAED,eAAe,CAAC,CAAA;AACnF,EAAA,MAAMU,QAAQ,GAAGd,IAAI,EAAE,GAAGM,KAAK,CAAA;EAC/B,MAAMS,WAAW,GAAGN,aAAa,CAACO,mBAAmB,CAACL,aAAa,CAACM,OAAO,CAAC,CAAA;EAC5E,OAAO;IACHH,QAAQ;AACR,IAAA,GAAGH,aAAa;AAChB,IAAA,GAAGI,WAAW;IACdR,QAAQ,EAAEA,QAAQ,CAACW,WAAW,CAACH,WAAW,CAACI,KAAK,EAAER,aAAa,CAACS,QAAQ,CAAA;GAC3E,CAAA;AACL,CAAC,CAAA;AACD,MAAMC,IAAI,GAAGA,CAAChB,QAAQ,EAAEiB,UAAU,KAAK;AACnC,EAAA,IAAIA,UAAU,EAAE;AACZC,IAAAA,qBAAa,CAACC,0BAA0B,CAACF,UAAU,CAAC,CAAA;AACxD,GAAA;AACA,EAAA,MAAMG,QAAQ,GAAG,IAAIC,QAAQ,EAAE,CAAA;AAC/B,EAAA,OAAOD,QAAQ,CAACE,KAAK,CAACtB,QAAQ,CAAC,CAAA;AACnC,CAAC,CAAA;MACYuB,MAAM,GAAGA,CAACvB,QAAQ,EAAEiB,UAAU,KAAK;AAC5C,EAAA,MAAMhB,KAAK,GAAGN,IAAI,EAAE,CAAA;AACpB,EAAA,MAAM6B,OAAO,GAAGR,IAAI,CAAChB,QAAQ,EAAEiB,UAAU,CAAC,CAAA;EAC1C,IAAIO,OAAO,YAAYC,OAAO,EAAE;AAC5B,IAAA,MAAM,IAAIC,KAAK,CAAC,oEAAoE,CAAC,CAAA;AACzF,GAAA;AACA,EAAA,OAAO5B,iBAAiB,CAAC0B,OAAO,EAAExB,QAAQ,EAAEC,KAAK,CAAC,CAAA;AACtD,EAAC;AACM,MAAM0B,WAAW,GAAG,OAAO3B,QAAQ,EAAEiB,UAAU,KAAK;EACvD,MAAMW,YAAY,GAAG5B,QAAQ,CAAC6B,SAAS,CAAC,CAAC,EAAEX,qBAAa,CAACY,SAAS,CAAC,CAAA;AACnE,EAAA,MAAM7B,KAAK,GAAGN,IAAI,EAAE,CAAA;EACpB,MAAM6B,OAAO,GAAG,MAAMR,IAAI,CAACY,YAAY,EAAEX,UAAU,CAAC,CAAA;AACpD,EAAA,OAAOnB,iBAAiB,CAAC0B,OAAO,EAAEI,YAAY,EAAE3B,KAAK,CAAC,CAAA;AAC1D;;;;;;;;"}

7
node_modules/@zxcvbn-ts/core/dist/levenshtein.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import { LooseObject } from './types';
export interface FindLevenshteinDistanceResult {
levenshteinDistance: number;
levenshteinDistanceEntry: string;
}
declare const findLevenshteinDistance: (password: string, rankedDictionary: LooseObject, threshold: number) => Partial<FindLevenshteinDistanceResult>;
export default findLevenshteinDistance;

34
node_modules/@zxcvbn-ts/core/dist/levenshtein.esm.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import { distance } from 'fastest-levenshtein';
const getUsedThreshold = (password, entry, threshold) => {
const isPasswordToShort = password.length <= entry.length;
const isThresholdLongerThanPassword = password.length <= threshold;
const shouldUsePasswordLength = isPasswordToShort || isThresholdLongerThanPassword;
// if password is too small use the password length divided by 4 while the threshold needs to be at least 1
return shouldUsePasswordLength ? Math.ceil(password.length / 4) : threshold;
};
const findLevenshteinDistance = (password, rankedDictionary, threshold) => {
let foundDistance = 0;
const found = Object.keys(rankedDictionary).find(entry => {
const usedThreshold = getUsedThreshold(password, entry, threshold);
if (Math.abs(password.length - entry.length) > usedThreshold) {
return false;
}
const foundEntryDistance = distance(password, entry);
const isInThreshold = foundEntryDistance <= usedThreshold;
if (isInThreshold) {
foundDistance = foundEntryDistance;
}
return isInThreshold;
});
if (found) {
return {
levenshteinDistance: foundDistance,
levenshteinDistanceEntry: found
};
}
return {};
};
export { findLevenshteinDistance as default };
//# sourceMappingURL=levenshtein.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"levenshtein.esm.js","sources":["../src/levenshtein.ts"],"sourcesContent":["import { distance } from 'fastest-levenshtein';\nconst getUsedThreshold = (password, entry, threshold) => {\n const isPasswordToShort = password.length <= entry.length;\n const isThresholdLongerThanPassword = password.length <= threshold;\n const shouldUsePasswordLength = isPasswordToShort || isThresholdLongerThanPassword;\n // if password is too small use the password length divided by 4 while the threshold needs to be at least 1\n return shouldUsePasswordLength ? Math.ceil(password.length / 4) : threshold;\n};\nconst findLevenshteinDistance = (password, rankedDictionary, threshold) => {\n let foundDistance = 0;\n const found = Object.keys(rankedDictionary).find((entry) => {\n const usedThreshold = getUsedThreshold(password, entry, threshold);\n if (Math.abs(password.length - entry.length) > usedThreshold) {\n return false;\n }\n const foundEntryDistance = distance(password, entry);\n const isInThreshold = foundEntryDistance <= usedThreshold;\n if (isInThreshold) {\n foundDistance = foundEntryDistance;\n }\n return isInThreshold;\n });\n if (found) {\n return {\n levenshteinDistance: foundDistance,\n levenshteinDistanceEntry: found,\n };\n }\n return {};\n};\nexport default findLevenshteinDistance;\n//# sourceMappingURL=levenshtein.js.map"],"names":["getUsedThreshold","password","entry","threshold","isPasswordToShort","length","isThresholdLongerThanPassword","shouldUsePasswordLength","Math","ceil","findLevenshteinDistance","rankedDictionary","foundDistance","found","Object","keys","find","usedThreshold","abs","foundEntryDistance","distance","isInThreshold","levenshteinDistance","levenshteinDistanceEntry"],"mappings":";;AACA,MAAMA,gBAAgB,GAAGA,CAACC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,KAAK;EACrD,MAAMC,iBAAiB,GAAGH,QAAQ,CAACI,MAAM,IAAIH,KAAK,CAACG,MAAM,CAAA;AACzD,EAAA,MAAMC,6BAA6B,GAAGL,QAAQ,CAACI,MAAM,IAAIF,SAAS,CAAA;AAClE,EAAA,MAAMI,uBAAuB,GAAGH,iBAAiB,IAAIE,6BAA6B,CAAA;AAClF;AACA,EAAA,OAAOC,uBAAuB,GAAGC,IAAI,CAACC,IAAI,CAACR,QAAQ,CAACI,MAAM,GAAG,CAAC,CAAC,GAAGF,SAAS,CAAA;AAC/E,CAAC,CAAA;AACKO,MAAAA,uBAAuB,GAAGA,CAACT,QAAQ,EAAEU,gBAAgB,EAAER,SAAS,KAAK;EACvE,IAAIS,aAAa,GAAG,CAAC,CAAA;AACrB,EAAA,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,IAAI,CAAEd,KAAK,IAAK;IACxD,MAAMe,aAAa,GAAGjB,gBAAgB,CAACC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,CAAC,CAAA;AAClE,IAAA,IAAIK,IAAI,CAACU,GAAG,CAACjB,QAAQ,CAACI,MAAM,GAAGH,KAAK,CAACG,MAAM,CAAC,GAAGY,aAAa,EAAE;AAC1D,MAAA,OAAO,KAAK,CAAA;AAChB,KAAA;AACA,IAAA,MAAME,kBAAkB,GAAGC,QAAQ,CAACnB,QAAQ,EAAEC,KAAK,CAAC,CAAA;AACpD,IAAA,MAAMmB,aAAa,GAAGF,kBAAkB,IAAIF,aAAa,CAAA;AACzD,IAAA,IAAII,aAAa,EAAE;AACfT,MAAAA,aAAa,GAAGO,kBAAkB,CAAA;AACtC,KAAA;AACA,IAAA,OAAOE,aAAa,CAAA;AACxB,GAAC,CAAC,CAAA;AACF,EAAA,IAAIR,KAAK,EAAE;IACP,OAAO;AACHS,MAAAA,mBAAmB,EAAEV,aAAa;AAClCW,MAAAA,wBAAwB,EAAEV,KAAAA;KAC7B,CAAA;AACL,GAAA;AACA,EAAA,OAAO,EAAE,CAAA;AACb;;;;"}

36
node_modules/@zxcvbn-ts/core/dist/levenshtein.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
'use strict';
var fastestLevenshtein = require('fastest-levenshtein');
const getUsedThreshold = (password, entry, threshold) => {
const isPasswordToShort = password.length <= entry.length;
const isThresholdLongerThanPassword = password.length <= threshold;
const shouldUsePasswordLength = isPasswordToShort || isThresholdLongerThanPassword;
// if password is too small use the password length divided by 4 while the threshold needs to be at least 1
return shouldUsePasswordLength ? Math.ceil(password.length / 4) : threshold;
};
const findLevenshteinDistance = (password, rankedDictionary, threshold) => {
let foundDistance = 0;
const found = Object.keys(rankedDictionary).find(entry => {
const usedThreshold = getUsedThreshold(password, entry, threshold);
if (Math.abs(password.length - entry.length) > usedThreshold) {
return false;
}
const foundEntryDistance = fastestLevenshtein.distance(password, entry);
const isInThreshold = foundEntryDistance <= usedThreshold;
if (isInThreshold) {
foundDistance = foundEntryDistance;
}
return isInThreshold;
});
if (found) {
return {
levenshteinDistance: foundDistance,
levenshteinDistanceEntry: found
};
}
return {};
};
module.exports = findLevenshteinDistance;
//# sourceMappingURL=levenshtein.js.map

1
node_modules/@zxcvbn-ts/core/dist/levenshtein.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"levenshtein.js","sources":["../src/levenshtein.ts"],"sourcesContent":["import { distance } from 'fastest-levenshtein';\nconst getUsedThreshold = (password, entry, threshold) => {\n const isPasswordToShort = password.length <= entry.length;\n const isThresholdLongerThanPassword = password.length <= threshold;\n const shouldUsePasswordLength = isPasswordToShort || isThresholdLongerThanPassword;\n // if password is too small use the password length divided by 4 while the threshold needs to be at least 1\n return shouldUsePasswordLength ? Math.ceil(password.length / 4) : threshold;\n};\nconst findLevenshteinDistance = (password, rankedDictionary, threshold) => {\n let foundDistance = 0;\n const found = Object.keys(rankedDictionary).find((entry) => {\n const usedThreshold = getUsedThreshold(password, entry, threshold);\n if (Math.abs(password.length - entry.length) > usedThreshold) {\n return false;\n }\n const foundEntryDistance = distance(password, entry);\n const isInThreshold = foundEntryDistance <= usedThreshold;\n if (isInThreshold) {\n foundDistance = foundEntryDistance;\n }\n return isInThreshold;\n });\n if (found) {\n return {\n levenshteinDistance: foundDistance,\n levenshteinDistanceEntry: found,\n };\n }\n return {};\n};\nexport default findLevenshteinDistance;\n//# sourceMappingURL=levenshtein.js.map"],"names":["getUsedThreshold","password","entry","threshold","isPasswordToShort","length","isThresholdLongerThanPassword","shouldUsePasswordLength","Math","ceil","findLevenshteinDistance","rankedDictionary","foundDistance","found","Object","keys","find","usedThreshold","abs","foundEntryDistance","distance","isInThreshold","levenshteinDistance","levenshteinDistanceEntry"],"mappings":";;;;AACA,MAAMA,gBAAgB,GAAGA,CAACC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,KAAK;EACrD,MAAMC,iBAAiB,GAAGH,QAAQ,CAACI,MAAM,IAAIH,KAAK,CAACG,MAAM,CAAA;AACzD,EAAA,MAAMC,6BAA6B,GAAGL,QAAQ,CAACI,MAAM,IAAIF,SAAS,CAAA;AAClE,EAAA,MAAMI,uBAAuB,GAAGH,iBAAiB,IAAIE,6BAA6B,CAAA;AAClF;AACA,EAAA,OAAOC,uBAAuB,GAAGC,IAAI,CAACC,IAAI,CAACR,QAAQ,CAACI,MAAM,GAAG,CAAC,CAAC,GAAGF,SAAS,CAAA;AAC/E,CAAC,CAAA;AACKO,MAAAA,uBAAuB,GAAGA,CAACT,QAAQ,EAAEU,gBAAgB,EAAER,SAAS,KAAK;EACvE,IAAIS,aAAa,GAAG,CAAC,CAAA;AACrB,EAAA,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,IAAI,CAAEd,KAAK,IAAK;IACxD,MAAMe,aAAa,GAAGjB,gBAAgB,CAACC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,CAAC,CAAA;AAClE,IAAA,IAAIK,IAAI,CAACU,GAAG,CAACjB,QAAQ,CAACI,MAAM,GAAGH,KAAK,CAACG,MAAM,CAAC,GAAGY,aAAa,EAAE;AAC1D,MAAA,OAAO,KAAK,CAAA;AAChB,KAAA;AACA,IAAA,MAAME,kBAAkB,GAAGC,2BAAQ,CAACnB,QAAQ,EAAEC,KAAK,CAAC,CAAA;AACpD,IAAA,MAAMmB,aAAa,GAAGF,kBAAkB,IAAIF,aAAa,CAAA;AACzD,IAAA,IAAII,aAAa,EAAE;AACfT,MAAAA,aAAa,GAAGO,kBAAkB,CAAA;AACtC,KAAA;AACA,IAAA,OAAOE,aAAa,CAAA;AACxB,GAAC,CAAC,CAAA;AACF,EAAA,IAAIR,KAAK,EAAE;IACP,OAAO;AACHS,MAAAA,mBAAmB,EAAEV,aAAa;AAClCW,MAAAA,wBAAwB,EAAEV,KAAAA;KAC7B,CAAA;AACL,GAAA;AACA,EAAA,OAAO,EAAE,CAAA;AACb;;;;"}

View File

@@ -0,0 +1,2 @@
declare const _default: () => null;
export default _default;

View File

@@ -0,0 +1,6 @@
var bruteforceMatcher = (() => {
return null;
});
export { bruteforceMatcher as default };
//# sourceMappingURL=feedback.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"feedback.esm.js","sources":["../../../src/matcher/bruteforce/feedback.ts"],"sourcesContent":["export default () => {\n return null;\n};\n//# sourceMappingURL=feedback.js.map"],"names":[],"mappings":"AAAA,wBAAA,CAAe,MAAM;AACjB,EAAA,OAAO,IAAI,CAAA;AACf,CAAC;;;;"}

View File

@@ -0,0 +1,8 @@
'use strict';
var bruteforceMatcher = (() => {
return null;
});
module.exports = bruteforceMatcher;
//# sourceMappingURL=feedback.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"feedback.js","sources":["../../../src/matcher/bruteforce/feedback.ts"],"sourcesContent":["export default () => {\n return null;\n};\n//# sourceMappingURL=feedback.js.map"],"names":[],"mappings":";;AAAA,wBAAA,CAAe,MAAM;AACjB,EAAA,OAAO,IAAI,CAAA;AACf,CAAC;;;;"}

View File

@@ -0,0 +1,3 @@
import { MatchEstimated, MatchExtended } from '../../types';
declare const _default: ({ token }: MatchExtended | MatchEstimated) => number;
export default _default;

View File

@@ -0,0 +1,22 @@
import { BRUTEFORCE_CARDINALITY, MIN_SUBMATCH_GUESSES_SINGLE_CHAR, MIN_SUBMATCH_GUESSES_MULTI_CHAR } from '../../data/const.esm.js';
var bruteforceMatcher = (({
token
}) => {
let guesses = BRUTEFORCE_CARDINALITY ** token.length;
if (guesses === Number.POSITIVE_INFINITY) {
guesses = Number.MAX_VALUE;
}
let minGuesses;
// small detail: make bruteforce matches at minimum one guess bigger than smallest allowed
// submatch guesses, such that non-bruteforce submatches over the same [i..j] take precedence.
if (token.length === 1) {
minGuesses = MIN_SUBMATCH_GUESSES_SINGLE_CHAR + 1;
} else {
minGuesses = MIN_SUBMATCH_GUESSES_MULTI_CHAR + 1;
}
return Math.max(guesses, minGuesses);
});
export { bruteforceMatcher as default };
//# sourceMappingURL=scoring.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scoring.esm.js","sources":["../../../src/matcher/bruteforce/scoring.ts"],"sourcesContent":["import { BRUTEFORCE_CARDINALITY, MIN_SUBMATCH_GUESSES_SINGLE_CHAR, MIN_SUBMATCH_GUESSES_MULTI_CHAR, } from '../../data/const';\nexport default ({ token }) => {\n let guesses = BRUTEFORCE_CARDINALITY ** token.length;\n if (guesses === Number.POSITIVE_INFINITY) {\n guesses = Number.MAX_VALUE;\n }\n let minGuesses;\n // small detail: make bruteforce matches at minimum one guess bigger than smallest allowed\n // submatch guesses, such that non-bruteforce submatches over the same [i..j] take precedence.\n if (token.length === 1) {\n minGuesses = MIN_SUBMATCH_GUESSES_SINGLE_CHAR + 1;\n }\n else {\n minGuesses = MIN_SUBMATCH_GUESSES_MULTI_CHAR + 1;\n }\n return Math.max(guesses, minGuesses);\n};\n//# sourceMappingURL=scoring.js.map"],"names":["token","guesses","BRUTEFORCE_CARDINALITY","length","Number","POSITIVE_INFINITY","MAX_VALUE","minGuesses","MIN_SUBMATCH_GUESSES_SINGLE_CHAR","MIN_SUBMATCH_GUESSES_MULTI_CHAR","Math","max"],"mappings":";;AACA,wBAAA,CAAe,CAAC;AAAEA,EAAAA,KAAAA;AAAM,CAAC,KAAK;AAC1B,EAAA,IAAIC,OAAO,GAAGC,sBAAsB,IAAIF,KAAK,CAACG,MAAM,CAAA;AACpD,EAAA,IAAIF,OAAO,KAAKG,MAAM,CAACC,iBAAiB,EAAE;IACtCJ,OAAO,GAAGG,MAAM,CAACE,SAAS,CAAA;AAC9B,GAAA;AACA,EAAA,IAAIC,UAAU,CAAA;AACd;AACA;AACA,EAAA,IAAIP,KAAK,CAACG,MAAM,KAAK,CAAC,EAAE;IACpBI,UAAU,GAAGC,gCAAgC,GAAG,CAAC,CAAA;AACrD,GAAC,MACI;IACDD,UAAU,GAAGE,+BAA+B,GAAG,CAAC,CAAA;AACpD,GAAA;AACA,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACV,OAAO,EAAEM,UAAU,CAAC,CAAA;AACxC,CAAC;;;;"}

View File

@@ -0,0 +1,24 @@
'use strict';
var _const = require('../../data/const.js');
var bruteforceMatcher = (({
token
}) => {
let guesses = _const.BRUTEFORCE_CARDINALITY ** token.length;
if (guesses === Number.POSITIVE_INFINITY) {
guesses = Number.MAX_VALUE;
}
let minGuesses;
// small detail: make bruteforce matches at minimum one guess bigger than smallest allowed
// submatch guesses, such that non-bruteforce submatches over the same [i..j] take precedence.
if (token.length === 1) {
minGuesses = _const.MIN_SUBMATCH_GUESSES_SINGLE_CHAR + 1;
} else {
minGuesses = _const.MIN_SUBMATCH_GUESSES_MULTI_CHAR + 1;
}
return Math.max(guesses, minGuesses);
});
module.exports = bruteforceMatcher;
//# sourceMappingURL=scoring.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scoring.js","sources":["../../../src/matcher/bruteforce/scoring.ts"],"sourcesContent":["import { BRUTEFORCE_CARDINALITY, MIN_SUBMATCH_GUESSES_SINGLE_CHAR, MIN_SUBMATCH_GUESSES_MULTI_CHAR, } from '../../data/const';\nexport default ({ token }) => {\n let guesses = BRUTEFORCE_CARDINALITY ** token.length;\n if (guesses === Number.POSITIVE_INFINITY) {\n guesses = Number.MAX_VALUE;\n }\n let minGuesses;\n // small detail: make bruteforce matches at minimum one guess bigger than smallest allowed\n // submatch guesses, such that non-bruteforce submatches over the same [i..j] take precedence.\n if (token.length === 1) {\n minGuesses = MIN_SUBMATCH_GUESSES_SINGLE_CHAR + 1;\n }\n else {\n minGuesses = MIN_SUBMATCH_GUESSES_MULTI_CHAR + 1;\n }\n return Math.max(guesses, minGuesses);\n};\n//# sourceMappingURL=scoring.js.map"],"names":["token","guesses","BRUTEFORCE_CARDINALITY","length","Number","POSITIVE_INFINITY","MAX_VALUE","minGuesses","MIN_SUBMATCH_GUESSES_SINGLE_CHAR","MIN_SUBMATCH_GUESSES_MULTI_CHAR","Math","max"],"mappings":";;;;AACA,wBAAA,CAAe,CAAC;AAAEA,EAAAA,KAAAA;AAAM,CAAC,KAAK;AAC1B,EAAA,IAAIC,OAAO,GAAGC,6BAAsB,IAAIF,KAAK,CAACG,MAAM,CAAA;AACpD,EAAA,IAAIF,OAAO,KAAKG,MAAM,CAACC,iBAAiB,EAAE;IACtCJ,OAAO,GAAGG,MAAM,CAACE,SAAS,CAAA;AAC9B,GAAA;AACA,EAAA,IAAIC,UAAU,CAAA;AACd;AACA;AACA,EAAA,IAAIP,KAAK,CAACG,MAAM,KAAK,CAAC,EAAE;IACpBI,UAAU,GAAGC,uCAAgC,GAAG,CAAC,CAAA;AACrD,GAAC,MACI;IACDD,UAAU,GAAGE,sCAA+B,GAAG,CAAC,CAAA;AACpD,GAAA;AACA,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACV,OAAO,EAAEM,UAAU,CAAC,CAAA;AACxC,CAAC;;;;"}

View File

@@ -0,0 +1,5 @@
declare const _default: () => {
warning: string;
suggestions: string[];
};
export default _default;

View File

@@ -0,0 +1,11 @@
import { zxcvbnOptions } from '../../Options.esm.js';
var dateMatcher = (() => {
return {
warning: zxcvbnOptions.translations.warnings.dates,
suggestions: [zxcvbnOptions.translations.suggestions.dates]
};
});
export { dateMatcher as default };
//# sourceMappingURL=feedback.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"feedback.esm.js","sources":["../../../src/matcher/date/feedback.ts"],"sourcesContent":["import { zxcvbnOptions } from '../../Options';\nexport default () => {\n return {\n warning: zxcvbnOptions.translations.warnings.dates,\n suggestions: [zxcvbnOptions.translations.suggestions.dates],\n };\n};\n//# sourceMappingURL=feedback.js.map"],"names":["warning","zxcvbnOptions","translations","warnings","dates","suggestions"],"mappings":";;AACA,kBAAA,CAAe,MAAM;EACjB,OAAO;AACHA,IAAAA,OAAO,EAAEC,aAAa,CAACC,YAAY,CAACC,QAAQ,CAACC,KAAK;IAClDC,WAAW,EAAE,CAACJ,aAAa,CAACC,YAAY,CAACG,WAAW,CAACD,KAAK,CAAA;GAC7D,CAAA;AACL,CAAC;;;;"}

View File

@@ -0,0 +1,13 @@
'use strict';
var Options = require('../../Options.js');
var dateMatcher = (() => {
return {
warning: Options.zxcvbnOptions.translations.warnings.dates,
suggestions: [Options.zxcvbnOptions.translations.suggestions.dates]
};
});
module.exports = dateMatcher;
//# sourceMappingURL=feedback.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"feedback.js","sources":["../../../src/matcher/date/feedback.ts"],"sourcesContent":["import { zxcvbnOptions } from '../../Options';\nexport default () => {\n return {\n warning: zxcvbnOptions.translations.warnings.dates,\n suggestions: [zxcvbnOptions.translations.suggestions.dates],\n };\n};\n//# sourceMappingURL=feedback.js.map"],"names":["warning","zxcvbnOptions","translations","warnings","dates","suggestions"],"mappings":";;;;AACA,kBAAA,CAAe,MAAM;EACjB,OAAO;AACHA,IAAAA,OAAO,EAAEC,qBAAa,CAACC,YAAY,CAACC,QAAQ,CAACC,KAAK;IAClDC,WAAW,EAAE,CAACJ,qBAAa,CAACC,YAAY,CAACG,WAAW,CAACD,KAAK,CAAA;GAC7D,CAAA;AACL,CAAC;;;;"}

View File

@@ -0,0 +1,26 @@
import { DateMatch } from '../../types';
interface DateMatchOptions {
password: string;
}
declare class MatchDate {
match({ password }: DateMatchOptions): import("../../types").MatchExtended[];
getMatchesWithSeparator(password: string): DateMatch[];
getMatchesWithoutSeparator(password: string): DateMatch[];
filterNoise(matches: DateMatch[]): DateMatch[];
mapIntegersToDayMonthYear(integers: number[]): {
year: number;
month: number;
day: number;
} | null;
getDayMonth(integers: number[]): {
year: number;
month: number;
day: number;
} | null;
mapIntegersToDayMonth(integers: number[]): {
day: number;
month: number;
} | null;
twoToFourDigitYear(year: number): number;
}
export default MatchDate;

View File

@@ -0,0 +1,257 @@
import { DATE_MIN_YEAR, DATE_MAX_YEAR, REFERENCE_YEAR, DATE_SPLITS } from '../../data/const.esm.js';
import { sorted } from '../../helper.esm.js';
/*
* -------------------------------------------------------------------------------
* date matching ----------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class MatchDate {
/*
* a "date" is recognized as:
* any 3-tuple that starts or ends with a 2- or 4-digit year,
* with 2 or 0 separator chars (1.1.91 or 1191),
* maybe zero-padded (01-01-91 vs 1-1-91),
* a month between 1 and 12,
* a day between 1 and 31.
*
* note: this isn't true date parsing in that "feb 31st" is allowed,
* this doesn't check for leap years, etc.
*
* recipe:
* start with regex to find maybe-dates, then attempt to map the integers
* onto month-day-year to filter the maybe-dates into dates.
* finally, remove matches that are substrings of other matches to reduce noise.
*
* note: instead of using a lazy or greedy regex to find many dates over the full string,
* this uses a ^...$ regex against every substring of the password -- less performant but leads
* to every possible date match.
*/
match({
password
}) {
const matches = [...this.getMatchesWithoutSeparator(password), ...this.getMatchesWithSeparator(password)];
const filteredMatches = this.filterNoise(matches);
return sorted(filteredMatches);
}
getMatchesWithSeparator(password) {
const matches = [];
const maybeDateWithSeparator = /^(\d{1,4})([\s/\\_.-])(\d{1,2})\2(\d{1,4})$/;
// # dates with separators are between length 6 '1/1/91' and 10 '11/11/1991'
for (let i = 0; i <= Math.abs(password.length - 6); i += 1) {
for (let j = i + 5; j <= i + 9; j += 1) {
if (j >= password.length) {
break;
}
const token = password.slice(i, +j + 1 || 9e9);
const regexMatch = maybeDateWithSeparator.exec(token);
if (regexMatch != null) {
const dmy = this.mapIntegersToDayMonthYear([parseInt(regexMatch[1], 10), parseInt(regexMatch[3], 10), parseInt(regexMatch[4], 10)]);
if (dmy != null) {
matches.push({
pattern: 'date',
token,
i,
j,
separator: regexMatch[2],
year: dmy.year,
month: dmy.month,
day: dmy.day
});
}
}
}
}
return matches;
}
// eslint-disable-next-line max-statements
getMatchesWithoutSeparator(password) {
const matches = [];
const maybeDateNoSeparator = /^\d{4,8}$/;
const metric = candidate => Math.abs(candidate.year - REFERENCE_YEAR);
// # dates without separators are between length 4 '1191' and 8 '11111991'
for (let i = 0; i <= Math.abs(password.length - 4); i += 1) {
for (let j = i + 3; j <= i + 7; j += 1) {
if (j >= password.length) {
break;
}
const token = password.slice(i, +j + 1 || 9e9);
if (maybeDateNoSeparator.exec(token)) {
const candidates = [];
const index = token.length;
const splittedDates = DATE_SPLITS[index];
splittedDates.forEach(([k, l]) => {
const dmy = this.mapIntegersToDayMonthYear([parseInt(token.slice(0, k), 10), parseInt(token.slice(k, l), 10), parseInt(token.slice(l), 10)]);
if (dmy != null) {
candidates.push(dmy);
}
});
if (candidates.length > 0) {
/*
* at this point: different possible dmy mappings for the same i,j substring.
* match the candidate date that likely takes the fewest guesses: a year closest
* to 2000.
* (scoring.REFERENCE_YEAR).
*
* ie, considering '111504', prefer 11-15-04 to 1-1-1504
* (interpreting '04' as 2004)
*/
let bestCandidate = candidates[0];
let minDistance = metric(candidates[0]);
candidates.slice(1).forEach(candidate => {
const distance = metric(candidate);
if (distance < minDistance) {
bestCandidate = candidate;
minDistance = distance;
}
});
matches.push({
pattern: 'date',
token,
i,
j,
separator: '',
year: bestCandidate.year,
month: bestCandidate.month,
day: bestCandidate.day
});
}
}
}
}
return matches;
}
/*
* matches now contains all valid date strings in a way that is tricky to capture
* with regexes only. while thorough, it will contain some unintuitive noise:
*
* '2015_06_04', in addition to matching 2015_06_04, will also contain
* 5(!) other date matches: 15_06_04, 5_06_04, ..., even 2015 (matched as 5/1/2020)
*
* to reduce noise, remove date matches that are strict substrings of others
*/
filterNoise(matches) {
return matches.filter(match => {
let isSubmatch = false;
const matchesLength = matches.length;
for (let o = 0; o < matchesLength; o += 1) {
const otherMatch = matches[o];
if (match !== otherMatch) {
if (otherMatch.i <= match.i && otherMatch.j >= match.j) {
isSubmatch = true;
break;
}
}
}
return !isSubmatch;
});
}
/*
* given a 3-tuple, discard if:
* middle int is over 31 (for all dmy formats, years are never allowed in the middle)
* middle int is zero
* any int is over the max allowable year
* any int is over two digits but under the min allowable year
* 2 integers are over 31, the max allowable day
* 2 integers are zero
* all integers are over 12, the max allowable month
*/
// eslint-disable-next-line complexity, max-statements
mapIntegersToDayMonthYear(integers) {
if (integers[1] > 31 || integers[1] <= 0) {
return null;
}
let over12 = 0;
let over31 = 0;
let under1 = 0;
for (let o = 0, len1 = integers.length; o < len1; o += 1) {
const int = integers[o];
if (int > 99 && int < DATE_MIN_YEAR || int > DATE_MAX_YEAR) {
return null;
}
if (int > 31) {
over31 += 1;
}
if (int > 12) {
over12 += 1;
}
if (int <= 0) {
under1 += 1;
}
}
if (over31 >= 2 || over12 === 3 || under1 >= 2) {
return null;
}
return this.getDayMonth(integers);
}
// eslint-disable-next-line max-statements
getDayMonth(integers) {
// first look for a four digit year: yyyy + daymonth or daymonth + yyyy
const possibleYearSplits = [[integers[2], integers.slice(0, 2)], [integers[0], integers.slice(1, 3)] // year first
];
const possibleYearSplitsLength = possibleYearSplits.length;
for (let j = 0; j < possibleYearSplitsLength; j += 1) {
const [y, rest] = possibleYearSplits[j];
if (DATE_MIN_YEAR <= y && y <= DATE_MAX_YEAR) {
const dm = this.mapIntegersToDayMonth(rest);
if (dm != null) {
return {
year: y,
month: dm.month,
day: dm.day
};
}
/*
* for a candidate that includes a four-digit year,
* when the remaining integers don't match to a day and month,
* it is not a date.
*/
return null;
}
}
// given no four-digit year, two digit years are the most flexible int to match, so
// try to parse a day-month out of integers[0..1] or integers[1..0]
for (let k = 0; k < possibleYearSplitsLength; k += 1) {
const [y, rest] = possibleYearSplits[k];
const dm = this.mapIntegersToDayMonth(rest);
if (dm != null) {
return {
year: this.twoToFourDigitYear(y),
month: dm.month,
day: dm.day
};
}
}
return null;
}
mapIntegersToDayMonth(integers) {
const temp = [integers, integers.slice().reverse()];
for (let i = 0; i < temp.length; i += 1) {
const data = temp[i];
const day = data[0];
const month = data[1];
if (day >= 1 && day <= 31 && month >= 1 && month <= 12) {
return {
day,
month
};
}
}
return null;
}
twoToFourDigitYear(year) {
if (year > 99) {
return year;
}
if (year > 50) {
// 87 -> 1987
return year + 1900;
}
// 15 -> 2015
return year + 2000;
}
}
export { MatchDate as default };
//# sourceMappingURL=matching.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,259 @@
'use strict';
var _const = require('../../data/const.js');
var helper = require('../../helper.js');
/*
* -------------------------------------------------------------------------------
* date matching ----------------------------------------------------------------
* -------------------------------------------------------------------------------
*/
class MatchDate {
/*
* a "date" is recognized as:
* any 3-tuple that starts or ends with a 2- or 4-digit year,
* with 2 or 0 separator chars (1.1.91 or 1191),
* maybe zero-padded (01-01-91 vs 1-1-91),
* a month between 1 and 12,
* a day between 1 and 31.
*
* note: this isn't true date parsing in that "feb 31st" is allowed,
* this doesn't check for leap years, etc.
*
* recipe:
* start with regex to find maybe-dates, then attempt to map the integers
* onto month-day-year to filter the maybe-dates into dates.
* finally, remove matches that are substrings of other matches to reduce noise.
*
* note: instead of using a lazy or greedy regex to find many dates over the full string,
* this uses a ^...$ regex against every substring of the password -- less performant but leads
* to every possible date match.
*/
match({
password
}) {
const matches = [...this.getMatchesWithoutSeparator(password), ...this.getMatchesWithSeparator(password)];
const filteredMatches = this.filterNoise(matches);
return helper.sorted(filteredMatches);
}
getMatchesWithSeparator(password) {
const matches = [];
const maybeDateWithSeparator = /^(\d{1,4})([\s/\\_.-])(\d{1,2})\2(\d{1,4})$/;
// # dates with separators are between length 6 '1/1/91' and 10 '11/11/1991'
for (let i = 0; i <= Math.abs(password.length - 6); i += 1) {
for (let j = i + 5; j <= i + 9; j += 1) {
if (j >= password.length) {
break;
}
const token = password.slice(i, +j + 1 || 9e9);
const regexMatch = maybeDateWithSeparator.exec(token);
if (regexMatch != null) {
const dmy = this.mapIntegersToDayMonthYear([parseInt(regexMatch[1], 10), parseInt(regexMatch[3], 10), parseInt(regexMatch[4], 10)]);
if (dmy != null) {
matches.push({
pattern: 'date',
token,
i,
j,
separator: regexMatch[2],
year: dmy.year,
month: dmy.month,
day: dmy.day
});
}
}
}
}
return matches;
}
// eslint-disable-next-line max-statements
getMatchesWithoutSeparator(password) {
const matches = [];
const maybeDateNoSeparator = /^\d{4,8}$/;
const metric = candidate => Math.abs(candidate.year - _const.REFERENCE_YEAR);
// # dates without separators are between length 4 '1191' and 8 '11111991'
for (let i = 0; i <= Math.abs(password.length - 4); i += 1) {
for (let j = i + 3; j <= i + 7; j += 1) {
if (j >= password.length) {
break;
}
const token = password.slice(i, +j + 1 || 9e9);
if (maybeDateNoSeparator.exec(token)) {
const candidates = [];
const index = token.length;
const splittedDates = _const.DATE_SPLITS[index];
splittedDates.forEach(([k, l]) => {
const dmy = this.mapIntegersToDayMonthYear([parseInt(token.slice(0, k), 10), parseInt(token.slice(k, l), 10), parseInt(token.slice(l), 10)]);
if (dmy != null) {
candidates.push(dmy);
}
});
if (candidates.length > 0) {
/*
* at this point: different possible dmy mappings for the same i,j substring.
* match the candidate date that likely takes the fewest guesses: a year closest
* to 2000.
* (scoring.REFERENCE_YEAR).
*
* ie, considering '111504', prefer 11-15-04 to 1-1-1504
* (interpreting '04' as 2004)
*/
let bestCandidate = candidates[0];
let minDistance = metric(candidates[0]);
candidates.slice(1).forEach(candidate => {
const distance = metric(candidate);
if (distance < minDistance) {
bestCandidate = candidate;
minDistance = distance;
}
});
matches.push({
pattern: 'date',
token,
i,
j,
separator: '',
year: bestCandidate.year,
month: bestCandidate.month,
day: bestCandidate.day
});
}
}
}
}
return matches;
}
/*
* matches now contains all valid date strings in a way that is tricky to capture
* with regexes only. while thorough, it will contain some unintuitive noise:
*
* '2015_06_04', in addition to matching 2015_06_04, will also contain
* 5(!) other date matches: 15_06_04, 5_06_04, ..., even 2015 (matched as 5/1/2020)
*
* to reduce noise, remove date matches that are strict substrings of others
*/
filterNoise(matches) {
return matches.filter(match => {
let isSubmatch = false;
const matchesLength = matches.length;
for (let o = 0; o < matchesLength; o += 1) {
const otherMatch = matches[o];
if (match !== otherMatch) {
if (otherMatch.i <= match.i && otherMatch.j >= match.j) {
isSubmatch = true;
break;
}
}
}
return !isSubmatch;
});
}
/*
* given a 3-tuple, discard if:
* middle int is over 31 (for all dmy formats, years are never allowed in the middle)
* middle int is zero
* any int is over the max allowable year
* any int is over two digits but under the min allowable year
* 2 integers are over 31, the max allowable day
* 2 integers are zero
* all integers are over 12, the max allowable month
*/
// eslint-disable-next-line complexity, max-statements
mapIntegersToDayMonthYear(integers) {
if (integers[1] > 31 || integers[1] <= 0) {
return null;
}
let over12 = 0;
let over31 = 0;
let under1 = 0;
for (let o = 0, len1 = integers.length; o < len1; o += 1) {
const int = integers[o];
if (int > 99 && int < _const.DATE_MIN_YEAR || int > _const.DATE_MAX_YEAR) {
return null;
}
if (int > 31) {
over31 += 1;
}
if (int > 12) {
over12 += 1;
}
if (int <= 0) {
under1 += 1;
}
}
if (over31 >= 2 || over12 === 3 || under1 >= 2) {
return null;
}
return this.getDayMonth(integers);
}
// eslint-disable-next-line max-statements
getDayMonth(integers) {
// first look for a four digit year: yyyy + daymonth or daymonth + yyyy
const possibleYearSplits = [[integers[2], integers.slice(0, 2)], [integers[0], integers.slice(1, 3)] // year first
];
const possibleYearSplitsLength = possibleYearSplits.length;
for (let j = 0; j < possibleYearSplitsLength; j += 1) {
const [y, rest] = possibleYearSplits[j];
if (_const.DATE_MIN_YEAR <= y && y <= _const.DATE_MAX_YEAR) {
const dm = this.mapIntegersToDayMonth(rest);
if (dm != null) {
return {
year: y,
month: dm.month,
day: dm.day
};
}
/*
* for a candidate that includes a four-digit year,
* when the remaining integers don't match to a day and month,
* it is not a date.
*/
return null;
}
}
// given no four-digit year, two digit years are the most flexible int to match, so
// try to parse a day-month out of integers[0..1] or integers[1..0]
for (let k = 0; k < possibleYearSplitsLength; k += 1) {
const [y, rest] = possibleYearSplits[k];
const dm = this.mapIntegersToDayMonth(rest);
if (dm != null) {
return {
year: this.twoToFourDigitYear(y),
month: dm.month,
day: dm.day
};
}
}
return null;
}
mapIntegersToDayMonth(integers) {
const temp = [integers, integers.slice().reverse()];
for (let i = 0; i < temp.length; i += 1) {
const data = temp[i];
const day = data[0];
const month = data[1];
if (day >= 1 && day <= 31 && month >= 1 && month <= 12) {
return {
day,
month
};
}
}
return null;
}
twoToFourDigitYear(year) {
if (year > 99) {
return year;
}
if (year > 50) {
// 87 -> 1987
return year + 1900;
}
// 15 -> 2015
return year + 2000;
}
}
module.exports = MatchDate;
//# sourceMappingURL=matching.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import { MatchEstimated, MatchExtended } from '../../types';
declare const _default: ({ year, separator }: MatchExtended | MatchEstimated) => number;
export default _default;

View File

@@ -0,0 +1,18 @@
import { REFERENCE_YEAR, MIN_YEAR_SPACE } from '../../data/const.esm.js';
var dateMatcher = (({
year,
separator
}) => {
// base guesses: (year distance from REFERENCE_YEAR) * num_days * num_years
const yearSpace = Math.max(Math.abs(year - REFERENCE_YEAR), MIN_YEAR_SPACE);
let guesses = yearSpace * 365;
// add factor of 4 for separator selection (one of ~4 choices)
if (separator) {
guesses *= 4;
}
return guesses;
});
export { dateMatcher as default };
//# sourceMappingURL=scoring.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scoring.esm.js","sources":["../../../src/matcher/date/scoring.ts"],"sourcesContent":["import { MIN_YEAR_SPACE, REFERENCE_YEAR } from '../../data/const';\nexport default ({ year, separator }) => {\n // base guesses: (year distance from REFERENCE_YEAR) * num_days * num_years\n const yearSpace = Math.max(Math.abs(year - REFERENCE_YEAR), MIN_YEAR_SPACE);\n let guesses = yearSpace * 365;\n // add factor of 4 for separator selection (one of ~4 choices)\n if (separator) {\n guesses *= 4;\n }\n return guesses;\n};\n//# sourceMappingURL=scoring.js.map"],"names":["year","separator","yearSpace","Math","max","abs","REFERENCE_YEAR","MIN_YEAR_SPACE","guesses"],"mappings":";;AACA,kBAAA,CAAe,CAAC;EAAEA,IAAI;AAAEC,EAAAA,SAAAA;AAAU,CAAC,KAAK;AACpC;AACA,EAAA,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACL,IAAI,GAAGM,cAAc,CAAC,EAAEC,cAAc,CAAC,CAAA;AAC3E,EAAA,IAAIC,OAAO,GAAGN,SAAS,GAAG,GAAG,CAAA;AAC7B;AACA,EAAA,IAAID,SAAS,EAAE;AACXO,IAAAA,OAAO,IAAI,CAAC,CAAA;AAChB,GAAA;AACA,EAAA,OAAOA,OAAO,CAAA;AAClB,CAAC;;;;"}

View File

@@ -0,0 +1,20 @@
'use strict';
var _const = require('../../data/const.js');
var dateMatcher = (({
year,
separator
}) => {
// base guesses: (year distance from REFERENCE_YEAR) * num_days * num_years
const yearSpace = Math.max(Math.abs(year - _const.REFERENCE_YEAR), _const.MIN_YEAR_SPACE);
let guesses = yearSpace * 365;
// add factor of 4 for separator selection (one of ~4 choices)
if (separator) {
guesses *= 4;
}
return guesses;
});
module.exports = dateMatcher;
//# sourceMappingURL=scoring.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scoring.js","sources":["../../../src/matcher/date/scoring.ts"],"sourcesContent":["import { MIN_YEAR_SPACE, REFERENCE_YEAR } from '../../data/const';\nexport default ({ year, separator }) => {\n // base guesses: (year distance from REFERENCE_YEAR) * num_days * num_years\n const yearSpace = Math.max(Math.abs(year - REFERENCE_YEAR), MIN_YEAR_SPACE);\n let guesses = yearSpace * 365;\n // add factor of 4 for separator selection (one of ~4 choices)\n if (separator) {\n guesses *= 4;\n }\n return guesses;\n};\n//# sourceMappingURL=scoring.js.map"],"names":["year","separator","yearSpace","Math","max","abs","REFERENCE_YEAR","MIN_YEAR_SPACE","guesses"],"mappings":";;;;AACA,kBAAA,CAAe,CAAC;EAAEA,IAAI;AAAEC,EAAAA,SAAAA;AAAU,CAAC,KAAK;AACpC;AACA,EAAA,MAAMC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACL,IAAI,GAAGM,qBAAc,CAAC,EAAEC,qBAAc,CAAC,CAAA;AAC3E,EAAA,IAAIC,OAAO,GAAGN,SAAS,GAAG,GAAG,CAAA;AAC7B;AACA,EAAA,IAAID,SAAS,EAAE;AACXO,IAAAA,OAAO,IAAI,CAAC,CAAA;AAChB,GAAA;AACA,EAAA,OAAOA,OAAO,CAAA;AAClB,CAAC;;;;"}

View File

@@ -0,0 +1,6 @@
import { MatchEstimated } from '../../types';
declare const _default: (match: MatchEstimated, isSoleMatch?: boolean) => {
warning: string | null;
suggestions: string[];
};
export default _default;

View File

@@ -0,0 +1,69 @@
import { zxcvbnOptions } from '../../Options.esm.js';
import { START_UPPER, ALL_UPPER_INVERTED } from '../../data/const.esm.js';
const getDictionaryWarningPassword = (match, isSoleMatch) => {
let warning = null;
if (isSoleMatch && !match.l33t && !match.reversed) {
if (match.rank <= 10) {
warning = zxcvbnOptions.translations.warnings.topTen;
} else if (match.rank <= 100) {
warning = zxcvbnOptions.translations.warnings.topHundred;
} else {
warning = zxcvbnOptions.translations.warnings.common;
}
} else if (match.guessesLog10 <= 4) {
warning = zxcvbnOptions.translations.warnings.similarToCommon;
}
return warning;
};
const getDictionaryWarningWikipedia = (match, isSoleMatch) => {
let warning = null;
if (isSoleMatch) {
warning = zxcvbnOptions.translations.warnings.wordByItself;
}
return warning;
};
const getDictionaryWarningNames = (match, isSoleMatch) => {
if (isSoleMatch) {
return zxcvbnOptions.translations.warnings.namesByThemselves;
}
return zxcvbnOptions.translations.warnings.commonNames;
};
const getDictionaryWarning = (match, isSoleMatch) => {
let warning = null;
const dictName = match.dictionaryName;
const isAName = dictName === 'lastnames' || dictName.toLowerCase().includes('firstnames');
if (dictName === 'passwords') {
warning = getDictionaryWarningPassword(match, isSoleMatch);
} else if (dictName.includes('wikipedia')) {
warning = getDictionaryWarningWikipedia(match, isSoleMatch);
} else if (isAName) {
warning = getDictionaryWarningNames(match, isSoleMatch);
} else if (dictName === 'userInputs') {
warning = zxcvbnOptions.translations.warnings.userInputs;
}
return warning;
};
var dictionaryMatcher = ((match, isSoleMatch) => {
const warning = getDictionaryWarning(match, isSoleMatch);
const suggestions = [];
const word = match.token;
if (word.match(START_UPPER)) {
suggestions.push(zxcvbnOptions.translations.suggestions.capitalization);
} else if (word.match(ALL_UPPER_INVERTED) && word.toLowerCase() !== word) {
suggestions.push(zxcvbnOptions.translations.suggestions.allUppercase);
}
if (match.reversed && match.token.length >= 4) {
suggestions.push(zxcvbnOptions.translations.suggestions.reverseWords);
}
if (match.l33t) {
suggestions.push(zxcvbnOptions.translations.suggestions.l33t);
}
return {
warning,
suggestions
};
});
export { dictionaryMatcher as default };
//# sourceMappingURL=feedback.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,71 @@
'use strict';
var Options = require('../../Options.js');
var _const = require('../../data/const.js');
const getDictionaryWarningPassword = (match, isSoleMatch) => {
let warning = null;
if (isSoleMatch && !match.l33t && !match.reversed) {
if (match.rank <= 10) {
warning = Options.zxcvbnOptions.translations.warnings.topTen;
} else if (match.rank <= 100) {
warning = Options.zxcvbnOptions.translations.warnings.topHundred;
} else {
warning = Options.zxcvbnOptions.translations.warnings.common;
}
} else if (match.guessesLog10 <= 4) {
warning = Options.zxcvbnOptions.translations.warnings.similarToCommon;
}
return warning;
};
const getDictionaryWarningWikipedia = (match, isSoleMatch) => {
let warning = null;
if (isSoleMatch) {
warning = Options.zxcvbnOptions.translations.warnings.wordByItself;
}
return warning;
};
const getDictionaryWarningNames = (match, isSoleMatch) => {
if (isSoleMatch) {
return Options.zxcvbnOptions.translations.warnings.namesByThemselves;
}
return Options.zxcvbnOptions.translations.warnings.commonNames;
};
const getDictionaryWarning = (match, isSoleMatch) => {
let warning = null;
const dictName = match.dictionaryName;
const isAName = dictName === 'lastnames' || dictName.toLowerCase().includes('firstnames');
if (dictName === 'passwords') {
warning = getDictionaryWarningPassword(match, isSoleMatch);
} else if (dictName.includes('wikipedia')) {
warning = getDictionaryWarningWikipedia(match, isSoleMatch);
} else if (isAName) {
warning = getDictionaryWarningNames(match, isSoleMatch);
} else if (dictName === 'userInputs') {
warning = Options.zxcvbnOptions.translations.warnings.userInputs;
}
return warning;
};
var dictionaryMatcher = ((match, isSoleMatch) => {
const warning = getDictionaryWarning(match, isSoleMatch);
const suggestions = [];
const word = match.token;
if (word.match(_const.START_UPPER)) {
suggestions.push(Options.zxcvbnOptions.translations.suggestions.capitalization);
} else if (word.match(_const.ALL_UPPER_INVERTED) && word.toLowerCase() !== word) {
suggestions.push(Options.zxcvbnOptions.translations.suggestions.allUppercase);
}
if (match.reversed && match.token.length >= 4) {
suggestions.push(Options.zxcvbnOptions.translations.suggestions.reverseWords);
}
if (match.l33t) {
suggestions.push(Options.zxcvbnOptions.translations.suggestions.l33t);
}
return {
warning,
suggestions
};
});
module.exports = dictionaryMatcher;
//# sourceMappingURL=feedback.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
import { DictionaryMatch } from '../../types';
import Reverse from './variants/matching/reverse';
import L33t from './variants/matching/l33t';
import { DictionaryMatchOptions } from './types';
declare class MatchDictionary {
l33t: L33t;
reverse: Reverse;
constructor();
match({ password }: DictionaryMatchOptions): import("../../types").MatchExtended[];
defaultMatch({ password, useLevenshtein }: DictionaryMatchOptions): DictionaryMatch[];
}
export default MatchDictionary;

View File

@@ -0,0 +1,73 @@
import findLevenshteinDistance from '../../levenshtein.esm.js';
import { sorted } from '../../helper.esm.js';
import { zxcvbnOptions } from '../../Options.esm.js';
import MatchReverse from './variants/matching/reverse.esm.js';
import MatchL33t from './variants/matching/l33t.esm.js';
class MatchDictionary {
constructor() {
this.l33t = new MatchL33t(this.defaultMatch);
this.reverse = new MatchReverse(this.defaultMatch);
}
match({
password
}) {
const matches = [...this.defaultMatch({
password
}), ...this.reverse.match({
password
}), ...this.l33t.match({
password
})];
return sorted(matches);
}
defaultMatch({
password,
useLevenshtein = true
}) {
const matches = [];
const passwordLength = password.length;
const passwordLower = password.toLowerCase();
// eslint-disable-next-line complexity,max-statements
Object.keys(zxcvbnOptions.rankedDictionaries).forEach(dictionaryName => {
const rankedDict = zxcvbnOptions.rankedDictionaries[dictionaryName];
const longestDictionaryWordSize = zxcvbnOptions.rankedDictionariesMaxWordSize[dictionaryName];
const searchWidth = Math.min(longestDictionaryWordSize, passwordLength);
for (let i = 0; i < passwordLength; i += 1) {
const searchEnd = Math.min(i + searchWidth, passwordLength);
for (let j = i; j < searchEnd; j += 1) {
const usedPassword = passwordLower.slice(i, +j + 1 || 9e9);
const isInDictionary = (usedPassword in rankedDict);
let foundLevenshteinDistance = {};
// only use levenshtein distance on full password to minimize the performance drop
// and because otherwise there would be to many false positives
const isFullPassword = i === 0 && j === passwordLength - 1;
if (zxcvbnOptions.useLevenshteinDistance && isFullPassword && !isInDictionary && useLevenshtein) {
foundLevenshteinDistance = findLevenshteinDistance(usedPassword, rankedDict, zxcvbnOptions.levenshteinThreshold);
}
const isLevenshteinMatch = Object.keys(foundLevenshteinDistance).length !== 0;
if (isInDictionary || isLevenshteinMatch) {
const usedRankPassword = isLevenshteinMatch ? foundLevenshteinDistance.levenshteinDistanceEntry : usedPassword;
const rank = rankedDict[usedRankPassword];
matches.push({
pattern: 'dictionary',
i,
j,
token: password.slice(i, +j + 1 || 9e9),
matchedWord: usedPassword,
rank,
dictionaryName: dictionaryName,
reversed: false,
l33t: false,
...foundLevenshteinDistance
});
}
}
}
});
return matches;
}
}
export { MatchDictionary as default };
//# sourceMappingURL=matching.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,75 @@
'use strict';
var levenshtein = require('../../levenshtein.js');
var helper = require('../../helper.js');
var Options = require('../../Options.js');
var reverse = require('./variants/matching/reverse.js');
var l33t = require('./variants/matching/l33t.js');
class MatchDictionary {
constructor() {
this.l33t = new l33t(this.defaultMatch);
this.reverse = new reverse(this.defaultMatch);
}
match({
password
}) {
const matches = [...this.defaultMatch({
password
}), ...this.reverse.match({
password
}), ...this.l33t.match({
password
})];
return helper.sorted(matches);
}
defaultMatch({
password,
useLevenshtein = true
}) {
const matches = [];
const passwordLength = password.length;
const passwordLower = password.toLowerCase();
// eslint-disable-next-line complexity,max-statements
Object.keys(Options.zxcvbnOptions.rankedDictionaries).forEach(dictionaryName => {
const rankedDict = Options.zxcvbnOptions.rankedDictionaries[dictionaryName];
const longestDictionaryWordSize = Options.zxcvbnOptions.rankedDictionariesMaxWordSize[dictionaryName];
const searchWidth = Math.min(longestDictionaryWordSize, passwordLength);
for (let i = 0; i < passwordLength; i += 1) {
const searchEnd = Math.min(i + searchWidth, passwordLength);
for (let j = i; j < searchEnd; j += 1) {
const usedPassword = passwordLower.slice(i, +j + 1 || 9e9);
const isInDictionary = (usedPassword in rankedDict);
let foundLevenshteinDistance = {};
// only use levenshtein distance on full password to minimize the performance drop
// and because otherwise there would be to many false positives
const isFullPassword = i === 0 && j === passwordLength - 1;
if (Options.zxcvbnOptions.useLevenshteinDistance && isFullPassword && !isInDictionary && useLevenshtein) {
foundLevenshteinDistance = levenshtein(usedPassword, rankedDict, Options.zxcvbnOptions.levenshteinThreshold);
}
const isLevenshteinMatch = Object.keys(foundLevenshteinDistance).length !== 0;
if (isInDictionary || isLevenshteinMatch) {
const usedRankPassword = isLevenshteinMatch ? foundLevenshteinDistance.levenshteinDistanceEntry : usedPassword;
const rank = rankedDict[usedRankPassword];
matches.push({
pattern: 'dictionary',
i,
j,
token: password.slice(i, +j + 1 || 9e9),
matchedWord: usedPassword,
rank,
dictionaryName: dictionaryName,
reversed: false,
l33t: false,
...foundLevenshteinDistance
});
}
}
}
});
return matches;
}
}
module.exports = MatchDictionary;
//# sourceMappingURL=matching.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
import { MatchEstimated, MatchExtended } from '../../types';
export interface DictionaryReturn {
baseGuesses: number;
uppercaseVariations: number;
l33tVariations: number;
calculation: number;
}
declare const _default: ({ rank, reversed, l33t, subs, token, dictionaryName, }: MatchExtended | MatchEstimated) => DictionaryReturn;
export default _default;

View File

@@ -0,0 +1,37 @@
import uppercaseVariant from './variants/scoring/uppercase.esm.js';
import l33tVariant from './variants/scoring/l33t.esm.js';
var dictionaryMatcher = (({
rank,
reversed,
l33t,
subs,
token,
dictionaryName
}) => {
const baseGuesses = rank; // keep these as properties for display purposes
const uppercaseVariations = uppercaseVariant(token);
const l33tVariations = l33tVariant({
l33t,
subs,
token
});
const reversedVariations = reversed && 2 || 1;
let calculation;
if (dictionaryName === 'diceware') {
// diceware dictionaries are special, so we get a simple scoring of 1/2 of 6^5 (6 digits on 5 dice)
// to get fix entropy of ~12.9 bits for every entry https://en.wikipedia.org/wiki/Diceware#:~:text=The%20level%20of,bits
calculation = 6 ** 5 / 2;
} else {
calculation = baseGuesses * uppercaseVariations * l33tVariations * reversedVariations;
}
return {
baseGuesses,
uppercaseVariations,
l33tVariations,
calculation
};
});
export { dictionaryMatcher as default };
//# sourceMappingURL=scoring.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scoring.esm.js","sources":["../../../src/matcher/dictionary/scoring.ts"],"sourcesContent":["import uppercaseVariant from './variants/scoring/uppercase';\nimport l33tVariant from './variants/scoring/l33t';\nexport default ({ rank, reversed, l33t, subs, token, dictionaryName, }) => {\n const baseGuesses = rank; // keep these as properties for display purposes\n const uppercaseVariations = uppercaseVariant(token);\n const l33tVariations = l33tVariant({ l33t, subs, token });\n const reversedVariations = (reversed && 2) || 1;\n let calculation;\n if (dictionaryName === 'diceware') {\n // diceware dictionaries are special, so we get a simple scoring of 1/2 of 6^5 (6 digits on 5 dice)\n // to get fix entropy of ~12.9 bits for every entry https://en.wikipedia.org/wiki/Diceware#:~:text=The%20level%20of,bits\n calculation = 6 ** 5 / 2;\n }\n else {\n calculation =\n baseGuesses * uppercaseVariations * l33tVariations * reversedVariations;\n }\n return {\n baseGuesses,\n uppercaseVariations,\n l33tVariations,\n calculation,\n };\n};\n//# sourceMappingURL=scoring.js.map"],"names":["rank","reversed","l33t","subs","token","dictionaryName","baseGuesses","uppercaseVariations","uppercaseVariant","l33tVariations","l33tVariant","reversedVariations","calculation"],"mappings":";;;AAEA,wBAAA,CAAe,CAAC;EAAEA,IAAI;EAAEC,QAAQ;EAAEC,IAAI;EAAEC,IAAI;EAAEC,KAAK;AAAEC,EAAAA,cAAAA;AAAgB,CAAC,KAAK;AACvE,EAAA,MAAMC,WAAW,GAAGN,IAAI,CAAC;AACzB,EAAA,MAAMO,mBAAmB,GAAGC,gBAAgB,CAACJ,KAAK,CAAC,CAAA;EACnD,MAAMK,cAAc,GAAGC,WAAW,CAAC;IAAER,IAAI;IAAEC,IAAI;AAAEC,IAAAA,KAAAA;AAAM,GAAC,CAAC,CAAA;AACzD,EAAA,MAAMO,kBAAkB,GAAIV,QAAQ,IAAI,CAAC,IAAK,CAAC,CAAA;AAC/C,EAAA,IAAIW,WAAW,CAAA;EACf,IAAIP,cAAc,KAAK,UAAU,EAAE;AAC/B;AACA;AACAO,IAAAA,WAAW,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC5B,GAAC,MACI;AACDA,IAAAA,WAAW,GACPN,WAAW,GAAGC,mBAAmB,GAAGE,cAAc,GAAGE,kBAAkB,CAAA;AAC/E,GAAA;EACA,OAAO;IACHL,WAAW;IACXC,mBAAmB;IACnBE,cAAc;AACdG,IAAAA,WAAAA;GACH,CAAA;AACL,CAAC;;;;"}

Some files were not shown because too many files have changed in this diff Show More