element-web-synapse01pim.gr.jp

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

9175.js.map (7250B)


      1 {"version":3,"file":"bundles/12c8185ea2689492c07b/9175.js","mappings":"80CAmBO,MAAMA,EAAc,CACvBC,WAAUC,EAAAA,EAAAA,EAAA,GACHC,EAAAA,GACAC,EAAAA,GAA0B,IAC7BC,WAAY,CAAC,OAAQ,SAAU,UAAWC,EAAAA,EAAUC,MAAMC,SAE9DC,OAAQN,EAAAA,EACRO,wBAAwB,GAsDrB,SAASC,EACZC,EACAC,EACAR,EAAuB,IAEvB,GAAwB,IAApBQ,EAASC,OAAc,OAAO,KAGlC,MAAMC,EAAS,IAAIV,GAEnB,GAAIO,EAAc,CACdG,EAAOC,KAAKJ,EAAaK,sBAEzB,IACI,MAAMC,EAASN,EAAaO,YAC5BJ,EAAOC,KAAKE,EAChB,CAAE,MACE,CAER,CAEA,MAAME,EAAS,IAAIC,EAAAA,GAAanB,EAAAA,EAAA,GACzBF,GAAW,IACdsB,aAzEG,CACHC,SAAU,CACNC,aAAaC,EAAAA,EAAAA,IAAG,+BAChBC,YAAYD,EAAAA,EAAAA,IAAG,8BACfE,cAAcF,EAAAA,EAAAA,IAAG,gCACjBG,gBAAgBH,EAAAA,EAAAA,IAAG,kCACnBI,WAAWJ,EAAAA,EAAAA,IAAG,6BACdK,aAAaL,EAAAA,EAAAA,IAAG,+BAChBM,OAAON,EAAAA,EAAAA,IAAG,yBACVO,QAAQP,EAAAA,EAAAA,IAAG,0BACXQ,YAAYR,EAAAA,EAAAA,IAAG,8BACfS,QAAQT,EAAAA,EAAAA,IAAG,0BACXU,iBAAiBV,EAAAA,EAAAA,IAAG,mCACpBW,cAAcX,EAAAA,EAAAA,IAAG,gCACjBY,mBAAmBZ,EAAAA,EAAAA,IAAG,qCACtBa,aAAab,EAAAA,EAAAA,IAAG,+BAChBpB,YAAYoB,EAAAA,EAAAA,IAAG,8BACfc,OAAOd,EAAAA,EAAAA,IAAG,0BAEde,YAAa,CACTC,MAAMhB,EAAAA,EAAAA,IAAG,2BACTiB,cAAcjB,EAAAA,EAAAA,IAAG,mCACjBkB,cAAclB,EAAAA,EAAAA,IAAG,mCACjBmB,gBAAgBnB,EAAAA,EAAAA,IAAG,qCACnBM,OAAON,EAAAA,EAAAA,IAAG,4BACVK,aAAaL,EAAAA,EAAAA,IAAG,kCAChBoB,iBAAiBpB,EAAAA,EAAAA,IAAG,sCACpBI,WAAWJ,EAAAA,EAAAA,IAAG,gCACdqB,UAAUrB,EAAAA,EAAAA,IAAG,+BACbsB,uBAAuBtB,EAAAA,EAAAA,IAAG,4CAC1BuB,aAAavB,EAAAA,EAAAA,IAAG,kCAChBwB,UAAUxB,EAAAA,EAAAA,IAAG,+BACbyB,QAAQzB,EAAAA,EAAAA,IAAG,6BACXc,OAAOd,EAAAA,EAAAA,IAAG,6BAGd0B,eAAgB/C,EAAAA,EAA6B+C,mBAwCjD,IAAIC,EAAehC,EAAOiC,MAAMxC,EAAUE,GAE1C,GAAIF,EAASyC,SAAS,KAAM,CACxB,MAAMC,EAAiBnC,EAAOiC,MAAMxC,EAAS2C,QAAQ,KAAM,IAAKzC,GAC5DwC,EAAeE,MAAQL,EAAaK,QAAOL,EAAeG,EAClE,CAEA,OAAOH,CACX","sources":["webpack://element-web/./src/utils/PasswordScorer.ts"],"sourcesContent":["/*\nCopyright 2018-2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport { ZxcvbnFactory, type ZxcvbnResult, type TranslationKeys } from \"@zxcvbn-ts/core\";\nimport * as zxcvbnCommonPackage from \"@zxcvbn-ts/language-common\";\nimport * as zxcvbnEnPackage from \"@zxcvbn-ts/language-en\";\nimport { type MatrixClient } from \"matrix-js-sdk/src/matrix\";\n\nimport { _t } from \"../languageHandler\";\nimport SdkConfig from \"../SdkConfig\";\n\n/**\n * Base zxcvbn options\n * @knipignore - exported for tests\n */\nexport const baseOptions = {\n    dictionary: {\n        ...zxcvbnCommonPackage.dictionary,\n        ...zxcvbnEnPackage.dictionary,\n        userInputs: [\"riot\", \"matrix\", \"element\", SdkConfig.get().brand],\n    },\n    graphs: zxcvbnCommonPackage.adjacencyGraphs,\n    useLevenshteinDistance: true,\n};\n\nfunction getTranslations(): TranslationKeys {\n    return {\n        warnings: {\n            straightRow: _t(\"zxcvbn|warnings|straightRow\"),\n            keyPattern: _t(\"zxcvbn|warnings|keyPattern\"),\n            simpleRepeat: _t(\"zxcvbn|warnings|simpleRepeat\"),\n            extendedRepeat: _t(\"zxcvbn|warnings|extendedRepeat\"),\n            sequences: _t(\"zxcvbn|warnings|sequences\"),\n            recentYears: _t(\"zxcvbn|warnings|recentYears\"),\n            dates: _t(\"zxcvbn|warnings|dates\"),\n            topTen: _t(\"zxcvbn|warnings|topTen\"),\n            topHundred: _t(\"zxcvbn|warnings|topHundred\"),\n            common: _t(\"zxcvbn|warnings|common\"),\n            similarToCommon: _t(\"zxcvbn|warnings|similarToCommon\"),\n            wordByItself: _t(\"zxcvbn|warnings|wordByItself\"),\n            namesByThemselves: _t(\"zxcvbn|warnings|namesByThemselves\"),\n            commonNames: _t(\"zxcvbn|warnings|commonNames\"),\n            userInputs: _t(\"zxcvbn|warnings|userInputs\"),\n            pwned: _t(\"zxcvbn|warnings|pwned\"),\n        },\n        suggestions: {\n            l33t: _t(\"zxcvbn|suggestions|l33t\"),\n            reverseWords: _t(\"zxcvbn|suggestions|reverseWords\"),\n            allUppercase: _t(\"zxcvbn|suggestions|allUppercase\"),\n            capitalization: _t(\"zxcvbn|suggestions|capitalization\"),\n            dates: _t(\"zxcvbn|suggestions|dates\"),\n            recentYears: _t(\"zxcvbn|suggestions|recentYears\"),\n            associatedYears: _t(\"zxcvbn|suggestions|associatedYears\"),\n            sequences: _t(\"zxcvbn|suggestions|sequences\"),\n            repeated: _t(\"zxcvbn|suggestions|repeated\"),\n            longerKeyboardPattern: _t(\"zxcvbn|suggestions|longerKeyboardPattern\"),\n            anotherWord: _t(\"zxcvbn|suggestions|anotherWord\"),\n            useWords: _t(\"zxcvbn|suggestions|useWords\"),\n            noNeed: _t(\"zxcvbn|suggestions|noNeed\"),\n            pwned: _t(\"zxcvbn|suggestions|pwned\"),\n        },\n        // We don't utilise the time estimation at this time so just pass through the English translations here\n        timeEstimation: zxcvbnEnPackage.translations.timeEstimation,\n    };\n}\n\n/**\n * Wrapper around zxcvbn password strength estimation\n * Include this only from async components: it pulls in zxcvbn\n * (obviously) which is large.\n *\n * @param {string} password Password to score\n * @param matrixClient the client of the logged-in user, if any\n * @param userInputs additional strings such as the user's name which should be considered a bad password component\n * @returns {object} Score result with `score` and `feedback` properties\n */\nexport function scorePassword(\n    matrixClient: MatrixClient | null,\n    password: string,\n    userInputs: string[] = [],\n): ZxcvbnResult | null {\n    if (password.length === 0) return null;\n\n    // copy the supplied array before modifying it\n    const inputs = [...userInputs];\n\n    if (matrixClient) {\n        inputs.push(matrixClient.getUserIdLocalpart()!);\n\n        try {\n            const domain = matrixClient.getDomain()!;\n            inputs.push(domain);\n        } catch {\n            // This is fine\n        }\n    }\n\n    const zxcvbn = new ZxcvbnFactory({\n        ...baseOptions,\n        translations: getTranslations(),\n    });\n\n    let zxcvbnResult = zxcvbn.check(password, inputs);\n    // Work around https://github.com/dropbox/zxcvbn/issues/216\n    if (password.includes(\" \")) {\n        const resultNoSpaces = zxcvbn.check(password.replace(/ /g, \"\"), inputs);\n        if (resultNoSpaces.score < zxcvbnResult.score) zxcvbnResult = resultNoSpaces;\n    }\n\n    return zxcvbnResult;\n}\n"],"names":["baseOptions","dictionary","_objectSpread","zxcvbnCommonPackage","zxcvbnEnPackage","userInputs","SdkConfig","get","brand","graphs","useLevenshteinDistance","scorePassword","matrixClient","password","length","inputs","push","getUserIdLocalpart","domain","getDomain","zxcvbn","ZxcvbnFactory","translations","warnings","straightRow","_t","keyPattern","simpleRepeat","extendedRepeat","sequences","recentYears","dates","topTen","topHundred","common","similarToCommon","wordByItself","namesByThemselves","commonNames","pwned","suggestions","l33t","reverseWords","allUppercase","capitalization","associatedYears","repeated","longerKeyboardPattern","anotherWord","useWords","noNeed","timeEstimation","zxcvbnResult","check","includes","resultNoSpaces","replace","score"],"sourceRoot":""}