PageSourceSearch

https://us.pferd.com/assets/61809bf09a7ff2a073cf011c4945cc89d2ed0e…/js/pferd.password-complexity-indicator.js

js pferd.com collected 2026-09-24 22:31:28 UTC 8,132 bytes, 1 lines download raw bytes

1(globalThis.webpackJsonp_pferd=globalThis.webpackJsonp_pferd||[]).push([[133],{99018:(t,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>h});var i,a=s(57142),n=s(23549),r=s(36326),o=s.n(r);!function(t){t[t.lowercase=10]="lowercase",t[t.digits=15]="digits",t[t.uppercase=20]="uppercase",t[t.symbols=30]="symbols",t[t.min=25]="min"}(i||(i={}));class h extends a.A{constructor(){super(...arguments),this.availableProperties=["min","lowercase","uppercase","digits","symbols"],this.complexityGradation=new Map([["weak",0],["medium",25],["strong",50],["very-strong",75]]),this.currentComplexity="",this.maxPasswordComplexity=0,this.factor=100,this.inputElement=void 0,this.notificationElement=void 0,this.indicatorListElement=void 0,this.schema=void 0}readyCallback(){}init(){this.inputElement=document.getElementsByClassName(this.inputClassName)[0],this.indicatorListElement=this.getElementsByClassName(this.indicatorListClassName)[0],this.notificationElement=this.getElementsByClassName(this.additionalMessageClassName)[0],this.schema=new(o()),this.initValidator(),this.mapEvents()}mapEvents(){this.mapInputElementKeyUpEvent()}mapInputElementKeyUpEvent(){this.inputElement.addEventListener("keyup",(0,n.A)((()=>this.onInputKeyUp()),this.debounceDelay))}initValidator(){this.availableProperties.forEach((t=>{this.setValidation(t),this.increaseMaxPasswordComplexity(t)}))}increaseMaxPasswordComplexity(t){this.maxPasswordComplexity+=i[t]}setValidation(t){var e=this[t];"min"!==t?this.setHasValidationType(t,e):this.setIsValidationType(t,e)}setHasValidationType(t,e){this.schema.has()[t](e)}setIsValidationType(t,e){this.schema.is()[t](e)}onInputKeyUp(){var t=this.inputElement.value,e=this.schema.validate(t,{list:!0}),s=this.maxPasswordComplexity;e.forEach((t=>{s-=i[t]})),this.validatePassword(s)}validatePassword(t){var e=t/this.maxPasswordComplexity*this.factor;this.complexityGradation.forEach(((t,s)=>{e>=t&&this.updateValidation(s)}))}updateValidation(t){this.updateModifier(this.indicatorListElement,this.indicatorListClassName,t),this.updateModifier(this.notificationElement,this.additionalMessageClassName,t),this.currentComplexity=t}updateModifier(t,e,s){var i=t.classList;i.remove(e+"--"+this.currentComplexity),i.add(e+"--"+s)}get inputClassName(){return this.getAttribute("input-class-name")}get indicatorListClassName(){return this.name+"__indicator-list"}get additionalMessageClassName(){return this.name+"__additional-message"}get debounceDelay(){return Number(this.getAttribute("debounce-delay"))}get min(){return Number(this.getAttribute("min"))}get lowercase(){return Number(this.getAttribute("lowercase"))}get uppercase(){return Number(this.getAttribute("uppercase"))}get digits(){return Number(this.getAttribute("digits"))}get symbols(){return Number(this.getAttribute("symbols"))}}},76855:t=>{t.exports={error:{length:"Length should be a valid positive number",password:"Password should be a valid string",invalidPlugin:"Plugin should be a valid function"},regex:{digits:"(\\d.*)",letters:"([a-zA-Z].*)",symbols:"([`~\\!@#\\$%\\^\\&\\*\\(\\)\\-_\\=\\+\\[\\{\\}\\]\\\\|;:\\'\",<.>\\/\\?€£¥₹§±].*)",spaces:"([\\s].*)"}}},36326:(t,e,s)=>{var i=s(72513),a=s(76855).error,n=s(35923);function r(t){const e=Number(t);if(isNaN(e)||!Number.isInteger(e)||e<1)throw new Error(a.length)}function o(t){return i[t.method].apply(this,t.arguments)}function h(t,e,s){return this.properties.push({method:t,arguments:e,description:s}),this}t.exports=class{constructor(){this.properties=[]}validate(t,e){return this.list=Boolean(e&&e.list),this.details=Boolean(e&&e.details),this.password=String(t),this.positive=!0,this.list||this.details?this.properties.reduce(((t,e)=>{if(!o.call(this,e)){var s=e.method;if(this.details){s={validation:e.method},e.arguments&&e.arguments[0]&&(s.arguments=e.arguments[0]),this.positive||"not"===e.method||(s.inverted=!0);var i=e.arguments&&e.arguments[1]||n(e.method,s.arguments,s.inverted);s.message=i}return t.concat(s)}return t}),[]):this.properties.every(o.bind(this))}letters(t,e){return t&&r(t),h.call(this,"letters",arguments)}digits(t,e){return t&&r(t),h.call(this,"digits",arguments)}symbols(t,e){return t&&r(t),h.call(this,"symbols",arguments)}min(t,e){return r(t),h.call(this,"min",arguments)}max(t,e){return r(t),h.call(this,"max",arguments)}lowercase(t,e){return t&&r(t),h.call(this,"lowercase",arguments)}uppercase(t,e){return t&&r(t),h.call(this,"uppercase",arguments)}spaces(t,e){return t&&r(t),h.call(this,"spaces",arguments)}has(t,e){return h.call(this,"has",arguments)}not(t,e){return h.call(this,"not",arguments)}is(){return h.call(this,"is",arguments)}oneOf(t,e){return h.call(this,"oneOf",arguments)}usingPlugin(t,e){if("function"!=typeof t)throw new Error(a.invalidPlugin);return h.call(this,"usingPlugin",arguments)}}},72513:(t,e,s)=>{var i=s(76855).regex;function a(t,e){if(e&&e>1){const s=parseInt(e,10);return new RegExp(t+"{"+s+",}").test(this.password)===this.positive}return new RegExp(t).test(this.password)===this.positive}t.exports={not:function(t){return this.positive=!1,!t||a.call(this,t)},has:function(t){return this.positive=!0,!t||a.call(this,t)},is:function(){return this.positive=!0,!0},min:function(t){return this.password.length>=t},max:function(t){return this.password.length<=t},digits:function(t){return a.call(this,i.digits,t)},letters:function(t){return a.call(this,i.letters,t)},uppercase:function(t){if(t&&t>1){let e=0,s=0;for(;s<t&&e<this.password.length;){const t=this.password.charAt(e);t!==t.toLowerCase()&&s++,e++}return s===t===this.positive}return this.password!==this.password.toLowerCase()===this.positive},lowercase:function(t){if(t&&t>1){let e=0,s=0;for(;s<t&&e<this.password.length;){const t=this.password.charAt(e);t!==t.toUpperCase()&&s++,e++}return s===t===this.positive}return this.password!==this.password.toUpperCase()===this.positive},symbols:function(t){return a.call(this,i.symbols,t)},spaces:function(t){return a.call(this,i.spaces,t)},oneOf:function(t){return t.indexOf(this.password)>=0===this.positive},usingPlugin:function(t){try{const e=t.call({},this.password);return Boolean(e)===this.positive}catch(t){return!1}}}},35923:t=>{t.exports=function(t,i,a){const n=a?s:e;return n[t]&&n[t](i)};const e={min:t=>`The string should have a minimum length of ${t} character${i(t)}`,max:t=>`The string should have a maximum length of ${t} character${i(t)}`,letters:(t=1)=>`The string should have a minimum of ${t} letter${i(t)}`,digits:(t=1)=>`The string should have a minimum of ${t} digit${i(t)}`,uppercase:(t=1)=>`The string should have a minimum of ${t} uppercase letter${i(t)}`,lowercase:(t=1)=>`The string should have a minimum of ${t} lowercase letter${i(t)}`,symbols:(t=1)=>`The string should have a minimum of ${t} symbol${i(t)}`,spaces:(t=1)=>`The string should have a minimum of ${t} space${i(t)}`,oneOf:t=>`The string should be ${t.length>1?`one of ${t.slice(0,-1).join(", ")} and `:""}${t[t.length-1]}`,has:t=>`The string should have pattern '${t}'`,not:t=>`The string should not have pattern '${t}'`,usingPlugin:t=>`The string should not violate ${t.name||"plugin"}`},s={min:t=>`The string should have a maximum length of ${t} character${i(t)}`,max:t=>`The string should have a minimum length of ${t} character${i(t)}`,letters:(t=0)=>`The string should ${0===t?"not have":`have a maximum of ${t}`} letter${i(t)}`,digits:(t=0)=>`The string should ${0===t?"not have":`have a maximum of ${t}`} digit${i(t)}`,uppercase:(t=0)=>`The string should ${0===t?"not have":`have a maximum of ${t}`} uppercase letter${i(t)}`,lowercase:(t=0)=>`The string should ${0===t?"not have":`have a maximum of ${t}`} lowercase letter${i(t)}`,symbols:(t=0)=>`The string should ${0===t?"not have":`have a maximum of ${t}`} symbol${i(t)}`,spaces:(t=0)=>`The string should ${0===t?"not have":`have a maximum of ${t}`} space${i(t)}`,oneOf:t=>`The string should not be ${t.length>1?`one of ${t.slice(0,-1).join(", ")} and `:""}${t[t.length-1]}`,has:t=>`The string should not have pattern '${t}'`,not:t=>`The string should have pattern '${t}'`,usingPlugin:t=>`The string should violate ${t.name||"plugin"}`};function i(t){return 1===t?"":"s"}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.