/*! * passwordIntensity v1.0 * author JerryZst * qq 1309579432 * Date: 2021/01/20 0007 */layui.define(["jquery","element"],function(c){var h=layui.jquery,d=layui.element,u="passwordIntensity",r=function(t){this.version="passwordIntensity-1.0",this.tmpId=new Date().getTime(),this.tmpId=t.uniqueId?t.uniqueId:this.tmpId+Math.round(Math.random()*1e3+9999),this.passwordLevel=["low","middle","midhigh","high"],this._level=null,this.options=h.extend(!0,{data:t.data||"",chang:t.chang||8,on:t.on||null},t),this.init(),this.bindEvents()};r.prototype.getComponents=function(){var t=this,e=h(t.options.elem),s=e.attr("lay-filter");return s||(s=t.options.elem.substring(1),e.attr("lay-filter",s)),{$elem:e,filter:s}},r.prototype.init=function(){for(var t=this.getComponents(),e="",s=0;s
'+a+""}if(e='
'+e+"
",t.$elem.parent("div").append(e),this.options.data){t.$elem.val(this.options.data);var o=this,y=p(this.options.data,this.options.chang);switch(y){case 0:o.setLevel("low","100%");break;case 1:o.setLevel("low","100%");break;case 2:o.setLevel("middle","100%");break;case 3:o.setLevel("midhigh","100%");break;default:o.setLevel("high","100%");break}}return e},r.prototype.bindEvents=function(){var t=this.getComponents(),e=this;t.$elem.off("input propertychange").on("input propertychange",function(){var s=h(this).val();if(s==""||s==null)e.setLevel(""),e._level=null;else{var l=p(s,e.options.chang);switch(e._level=l,l){case 0:e.setLevel("low","100%");break;case 1:e.setLevel("low","100%");break;case 2:e.setLevel("middle","100%");break;case 3:e.setLevel("midhigh","100%");break;default:e.setLevel("high","100%");break}}}),t.$elem.off("blur").on("blur",function(){var s=h(this).val();if(s==""||s==null)e.setLevel(""),e._level=null;else{var l=p(s,e.options.chang);switch(e._level=l,l){case 0:e.setLevel("low","100%");break;case 1:e.setLevel("low","100%");break;case 2:e.setLevel("middle","100%");break;case 3:e.setLevel("midhigh","100%");break;default:e.setLevel("high","100%");break}}})},r.prototype.setLevel=function(t,e){e=e||"100%";for(var s=0;s=48&&t<=57?1:t>=65&&t<=90?2:t>=97&&t<=122?4:8}function g(t){for(modes=0,i=0;i<4;i++)t&1&&modes++,t>>>=1;return modes}function p(t,e){if(t.length<=6||t.length