mirror of https://github.com/itflow-org/itflow
11 lines
22 KiB
JavaScript
11 lines
22 KiB
JavaScript
/**
|
|
* bootstrap-show-password - Show/hide password plugin for twitter bootstrap.
|
|
*
|
|
* @version v1.2.1
|
|
* @homepage https://github.com/wenzhixin/bootstrap-show-password
|
|
* @author zhixin wen <wenzhixin2010@gmail.com>
|
|
* @license MIT
|
|
*/
|
|
|
|
var toString={}.toString,classofRaw=function(a){return toString.call(a).slice(8,-1)},isArray=Array.isArray||function(a){return"Array"==classofRaw(a)},isObject=function(a){return"object"==typeof a?null!==a:"function"==typeof a},requireObjectCoercible=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a},toObject=function(a){return Object(requireObjectCoercible(a))},ceil=Math.ceil,floor=Math.floor,toInteger=function(a){return isNaN(a=+a)?0:(0<a?floor:ceil)(a)},min=Math.min,toLength=function(a){return 0<a?min(toInteger(a),9007199254740991):0},toPrimitive=function(a,b){if(!isObject(a))return a;var c,d;if(b&&"function"==typeof(c=a.toString)&&!isObject(d=c.call(a)))return d;if("function"==typeof(c=a.valueOf)&&!isObject(d=c.call(a)))return d;if(!b&&"function"==typeof(c=a.toString)&&!isObject(d=c.call(a)))return d;throw TypeError("Can't convert object to primitive value")},fails=function(a){try{return!!a()}catch(a){return!0}},descriptors=!fails(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),global="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")(),document=global.document,exist=isObject(document)&&isObject(document.createElement),documentCreateElement=function(a){return exist?document.createElement(a):{}},ie8DomDefine=!descriptors&&!fails(function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a}),anObject=function(a){if(!isObject(a))throw TypeError(a+" is not an object");return a},nativeDefineProperty=Object.defineProperty,f=descriptors?nativeDefineProperty:function(a,b,c){if(anObject(a),b=toPrimitive(b,!0),anObject(c),ie8DomDefine)try{return nativeDefineProperty(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported");return"value"in c&&(a[b]=c.value),a},objectDefineProperty={f:f},createPropertyDescriptor=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},createProperty=function(a,b,c){var d=toPrimitive(b);d in a?objectDefineProperty.f(a,d,createPropertyDescriptor(0,c)):a[d]=c};function createCommonjsModule(a,b){return b={exports:{}},a(b,b.exports),b.exports}var set,get,has$1,hide=descriptors?function(a,b,c){return objectDefineProperty.f(a,b,createPropertyDescriptor(1,c))}:function(a,b,c){return a[b]=c,a},setGlobal=function(a,b){try{hide(global,a,b)}catch(c){global[a]=b}return b},shared=createCommonjsModule(function(a){var b=global["__core-js_shared__"]||setGlobal("__core-js_shared__",{});(a.exports=function(a,c){return b[a]||(b[a]=c===void 0?{}:c)})("versions",[]).push({version:"3.0.1",mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),id=0,postfix=Math.random(),uid=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++id+postfix).toString(36))},nativeSymbol=!fails(function(){return!(Symbol()+"")}),store=shared("wks"),Symbol$1=global.Symbol,wellKnownSymbol=function(a){return store[a]||(store[a]=nativeSymbol&&Symbol$1[a]||(nativeSymbol?Symbol$1:uid)("Symbol."+a))},SPECIES=wellKnownSymbol("species"),arraySpeciesCreate=function(a,b){var c;return isArray(a)&&(c=a.constructor,"function"==typeof c&&(c===Array||isArray(c.prototype))?c=void 0:isObject(c)&&(c=c[SPECIES],null===c&&(c=void 0))),new(void 0===c?Array:c)(0===b?0:b)},SPECIES$1=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(a){return!fails(function(){var b=[],c=b.constructor={};return c[SPECIES$1]=function(){return{foo:1}},1!==b[a](Boolean).foo})},nativePropertyIsEnumerable={}.propertyIsEnumerable,nativeGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,NASHORN_BUG=nativeGetOwnPropertyDescriptor&&!nativePropertyIsEnumerable.call({1:2},1),f$1=NASHORN_BUG?function(a){var b=nativeGetOwnPropertyDescriptor(this,a);return!!b&&b.enumerable}:nativePropertyIsEnumerable,objectPropertyIsEnumerable={f:f$1},split="".split,indexedObject=fails(function(){return!Object("z").propertyIsEnumerable(0)})?function(a){return"String"==classofRaw(a)?split.call(a,""):Object(a)}:Object,toIndexedObject=function(a){return indexedObject(requireObjectCoercible(a))},hasOwnProperty={}.hasOwnProperty,has=function(a,b){return hasOwnProperty.call(a,b)},nativeGetOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,f$2=descriptors?nativeGetOwnPropertyDescriptor$1:function(a,b){if(a=toIndexedObject(a),b=toPrimitive(b,!0),ie8DomDefine)try{return nativeGetOwnPropertyDescriptor$1(a,b)}catch(a){}return has(a,b)?createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(a,b),a[b]):void 0},objectGetOwnPropertyDescriptor={f:f$2},functionToString=shared("native-function-to-string",Function.toString),WeakMap=global.WeakMap,nativeWeakMap="function"==typeof WeakMap&&/native code/.test(functionToString.call(WeakMap)),shared$1=shared("keys"),sharedKey=function(a){return shared$1[a]||(shared$1[a]=uid(a))},hiddenKeys={},WeakMap$1=global.WeakMap,enforce=function(a){return has$1(a)?get(a):set(a,{})},getterFor=function(a){return function(b){var c;if(!isObject(b)||(c=get(b)).type!==a)throw TypeError("Incompatible receiver, "+a+" required");return c}};if(nativeWeakMap){var store$1=new WeakMap$1,wmget=store$1.get,wmhas=store$1.has,wmset=store$1.set;set=function(a,b){return wmset.call(store$1,a,b),b},get=function(a){return wmget.call(store$1,a)||{}},has$1=function(a){return wmhas.call(store$1,a)}}else{var STATE=sharedKey("state");hiddenKeys[STATE]=!0,set=function(a,b){return hide(a,STATE,b),b},get=function(a){return has(a,STATE)?a[STATE]:{}},has$1=function(a){return has(a,STATE)}}var internalState={set:set,get:get,has:has$1,enforce:enforce,getterFor:getterFor},redefine=createCommonjsModule(function(a){var b=internalState.get,c=internalState.enforce,d=(functionToString+"").split("toString");shared("inspectSource",function(a){return functionToString.call(a)}),(a.exports=function(a,b,e,f){var g=!!f&&!!f.unsafe,h=!!f&&!!f.enumerable,i=!!f&&!!f.noTargetGet;return("function"==typeof e&&("string"==typeof b&&!has(e,"name")&&hide(e,"name",b),c(e).source=d.join("string"==typeof b?b:"")),a===global)?void(h?a[b]=e:setGlobal(b,e)):void(g?!i&&a[b]&&(h=!0):delete a[b],h?a[b]=e:hide(a,b,e))})(Function.prototype,"toString",function(){return"function"==typeof this&&b(this).source||functionToString.call(this)})}),max=Math.max,min$1=Math.min,toAbsoluteIndex=function(a,b){var c=toInteger(a);return 0>c?max(c+b,0):min$1(c,b)},arrayIncludes=function(a){return function(b,c,d){var e,f=toIndexedObject(b),g=toLength(f.length),h=toAbsoluteIndex(d,g);if(a&&c!=c){for(;g>h;)if(e=f[h++],e!=e)return!0;}else for(;g>h;h++)if((a||h in f)&&f[h]===c)return a||h||0;return!a&&-1}},arrayIndexOf=arrayIncludes(!1),objectKeysInternal=function(a,b){var c,d=toIndexedObject(a),e=0,f=[];for(c in d)!has(hiddenKeys,c)&&has(d,c)&&f.push(c);for(;b.length>e;)has(d,c=b[e++])&&(~arrayIndexOf(f,c)||f.push(c));return f},enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hiddenKeys$1=enumBugKeys.concat("length","prototype"),f$3=Object.getOwnPropertyNames||function(a){return objectKeysInternal(a,hiddenKeys$1)},objectGetOwnPropertyNames={f:f$3},f$4=Object.getOwnPropertySymbols,objectGetOwnPropertySymbols={f:f$4},Reflect=global.Reflect,ownKeys=Reflect&&Reflect.ownKeys||function(a){var b=objectGetOwnPropertyNames.f(anObject(a)),c=objectGetOwnPropertySymbols.f;return c?b.concat(c(a)):b},copyConstructorProperties=function(a,b){for(var c,d=ownKeys(b),e=objectDefineProperty.f,f=objectGetOwnPropertyDescriptor.f,g=0;g<d.length;g++)c=d[g],has(a,c)||e(a,c,f(b,c))},replacement=/#|\.prototype\./,isForced=function(a,b){var c=data[normalize(a)];return!(c!=POLYFILL)||c!=NATIVE&&("function"==typeof b?fails(b):!!b)},normalize=isForced.normalize=function(a){return(a+"").replace(replacement,".").toLowerCase()},data=isForced.data={},NATIVE=isForced.NATIVE="N",POLYFILL=isForced.POLYFILL="P",isForced_1=isForced,getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,_export=function(a,b){var c,d,e,f,g,h,i=a.target,j=a.global,k=a.stat;if(d=j?global:k?global[i]||setGlobal(i,{}):(global[i]||{}).prototype,d)for(e in b){if(g=b[e],a.noTargetGet?(h=getOwnPropertyDescriptor(d,e),f=h&&h.value):f=d[e],c=isForced_1(j?e:i+(k?".":"#")+e,a.forced),!c&&void 0!==f){if(typeof g==typeof f)continue;copyConstructorProperties(g,f)}(a.sham||f&&f.sham)&&hide(g,"sham",!0),redefine(d,e,g,a)}},IS_CONCAT_SPREADABLE=wellKnownSymbol("isConcatSpreadable"),MAX_SAFE_INTEGER=9007199254740991,MAXIMUM_ALLOWED_INDEX_EXCEEDED="Maximum allowed index exceeded",IS_CONCAT_SPREADABLE_SUPPORT=!fails(function(){var a=[];return a[IS_CONCAT_SPREADABLE]=!1,a.concat()[0]!==a}),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(a){if(!isObject(a))return!1;var b=a[IS_CONCAT_SPREADABLE];return b===void 0?isArray(a):!!b},FORCED=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;_export({target:"Array",proto:!0,forced:FORCED},{concat:function(){var a,b,c,d,e,f=toObject(this),g=arraySpeciesCreate(f,0),h=0;for(a=-1,c=arguments.length;a<c;a++)if(e=-1===a?f:arguments[a],isConcatSpreadable(e)){if(d=toLength(e.length),h+d>MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);for(b=0;b<d;b++,h++)b in e&&createProperty(g,h,e[b])}else{if(h>=MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);createProperty(g,h++,e)}return g.length=h,g}});var aFunction=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function");return a},bindContext=function(d,e,f){return(aFunction(d),void 0===e)?d:0===f?function(){return d.call(e)}:1===f?function(b){return d.call(e,b)}:2===f?function(c,a){return d.call(e,c,a)}:3===f?function(f,a,b){return d.call(e,f,a,b)}:function(){return d.apply(e,arguments)}},arrayMethods=function(a,b){var c=1==a,d=4==a,e=6==a,f=b||arraySpeciesCreate;return function(b,g,h){for(var i,j,k=toObject(b),l=indexedObject(k),m=bindContext(g,h,3),n=toLength(l.length),o=0,p=c?f(b,n):2==a?f(b,0):void 0;n>o;o++)if((5==a||e||o in l)&&(i=l[o],j=m(i,o,k),a))if(c)p[o]=j;else if(j)switch(a){case 3:return!0;case 5:return i;case 6:return o;case 2:p.push(i);}else if(d)return!1;return e?-1:3==a||d?d:p}},objectKeys=Object.keys||function(a){return objectKeysInternal(a,enumBugKeys)},objectDefineProperties=descriptors?Object.defineProperties:function(a,b){anObject(a);for(var c,d=objectKeys(b),e=d.length,f=0;e>f;)objectDefineProperty.f(a,c=d[f++],b[c]);return a},document$1=global.document,html=document$1&&document$1.documentElement,IE_PROTO=sharedKey("IE_PROTO"),PROTOTYPE="prototype",Empty=function(){},createDict=function(){var a,b=documentCreateElement("iframe"),c=enumBugKeys.length,d="<",e="script",f=">";for(b.style.display="none",html.appendChild(b),b.src="java"+e+":"+"",a=b.contentWindow.document,a.open(),a.write(d+e+f+"document.F=Object"+d+"/"+e+f),a.close(),createDict=a.F;c--;)delete createDict[PROTOTYPE][enumBugKeys[c]];return createDict()},objectCreate=Object.create||function(a,b){var c;return null===a?c=createDict():(Empty[PROTOTYPE]=anObject(a),c=new Empty,Empty[PROTOTYPE]=null,c[IE_PROTO]=a),void 0===b?c:objectDefineProperties(c,b)};hiddenKeys[IE_PROTO]=!0;var UNSCOPABLES=wellKnownSymbol("unscopables"),ArrayPrototype=Array.prototype;ArrayPrototype[UNSCOPABLES]==null&&hide(ArrayPrototype,UNSCOPABLES,objectCreate(null));var addToUnscopables=function(a){ArrayPrototype[UNSCOPABLES][a]=!0},internalFind=arrayMethods(5),FIND="find",SKIPS_HOLES=!0;FIND in[]&&[,][FIND](function(){SKIPS_HOLES=!1}),_export({target:"Array",proto:!0,forced:SKIPS_HOLES},{find:function(a){return internalFind(this,a,1<arguments.length?arguments[1]:void 0)}}),addToUnscopables(FIND);var sloppyArrayMethod=function(a,b){var c=[][a];return!c||!fails(function(){c.call(null,b||function(){throw 1},1)})},nativeJoin=[].join,ES3_STRINGS=indexedObject!=Object,SLOPPY_METHOD=sloppyArrayMethod("join",",");_export({target:"Array",proto:!0,forced:ES3_STRINGS||SLOPPY_METHOD},{join:function(a){return nativeJoin.call(toIndexedObject(this),a===void 0?",":a)}});var whitespaces="\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF",whitespace="[\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),stringTrim=function(a,b){return a=requireObjectCoercible(a)+"",1&b&&(a=a.replace(ltrim,"")),2&b&&(a=a.replace(rtrim,"")),a},nativeParseInt=global.parseInt,hex=/^[-+]?0[xX]/,FORCED$1=8!==nativeParseInt("\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF08")||22!==nativeParseInt("\t\n\x0B\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF0x16"),_parseInt=FORCED$1?function(a,b){var c=stringTrim(a+"",3);return nativeParseInt(c,b>>>0||(hex.test(c)?16:10))}:nativeParseInt;_export({global:!0,forced:parseInt!=_parseInt},{parseInt:_parseInt});var regexpFlags=function(){var a=anObject(this),b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),a.unicode&&(b+="u"),a.sticky&&(b+="y"),b},nativeExec=RegExp.prototype.exec,nativeReplace=String.prototype.replace,patchedExec=nativeExec,UPDATES_LAST_INDEX_WRONG=function(){var a=/a/,b=/b*/g;return nativeExec.call(a,"a"),nativeExec.call(b,"a"),0!==a.lastIndex||0!==b.lastIndex}(),NPCG_INCLUDED=/()??/.exec("")[1]!==void 0,PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED;PATCH&&(patchedExec=function(a){var b,c,d,e,f=this;return NPCG_INCLUDED&&(c=new RegExp("^"+f.source+"$(?!\\s)",regexpFlags.call(f))),UPDATES_LAST_INDEX_WRONG&&(b=f.lastIndex),d=nativeExec.call(f,a),UPDATES_LAST_INDEX_WRONG&&d&&(f.lastIndex=f.global?d.index+d[0].length:b),NPCG_INCLUDED&&d&&1<d.length&&nativeReplace.call(d[0],c,function(){for(e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(d[e]=void 0)}),d});var regexpExec=patchedExec;_export({target:"RegExp",proto:!0,forced:/./.exec!==regexpExec},{exec:regexpExec});var stringAt=function(a,b,c){var d,e,f=requireObjectCoercible(a)+"",g=toInteger(b),h=f.length;return 0>g||g>=h?c?"":void 0:(d=f.charCodeAt(g),55296>d||56319<d||g+1===h||56320>(e=f.charCodeAt(g+1))||57343<e?c?f.charAt(g):d:c?f.slice(g,g+2):(d-55296<<10)+(e-56320)+65536)},advanceStringIndex=function(a,b,c){return b+(c?stringAt(a,b,!0).length:1)},regexpExecAbstract=function(a,b){var c=a.exec;if("function"==typeof c){var d=c.call(a,b);if("object"!=typeof d)throw TypeError("RegExp exec method returned something other than an Object or null");return d}if("RegExp"!==classofRaw(a))throw TypeError("RegExp#exec called on incompatible receiver");return regexpExec.call(a,b)},SPECIES$2=wellKnownSymbol("species"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails(function(){var a=/./;return a.exec=function(){var a=[];return a.groups={a:"7"},a},"7"!=="".replace(a,"$<a>")}),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails(function(){var a=/(?:)/,b=a.exec;a.exec=function(){return b.apply(this,arguments)};var c="ab".split(a);return 2!==c.length||"a"!==c[0]||"b"!==c[1]}),fixRegexpWellKnownSymbolLogic=function(a,b,c,d){var e=wellKnownSymbol(a),f=!fails(function(){var b={};return b[e]=function(){return 7},7!=""[a](b)}),g=f&&!fails(function(){var b=!1,c=/a/;return c.exec=function(){return b=!0,null},"split"===a&&(c.constructor={},c.constructor[SPECIES$2]=function(){return c}),c[e](""),!b});if(!f||!g||"replace"===a&&!REPLACE_SUPPORTS_NAMED_GROUPS||"split"===a&&!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC){var h=/./[e],i=c(e,""[a],function(a,b,c,d,e){return b.exec===regexpExec?f&&!e?{done:!0,value:h.call(b,c,d)}:{done:!0,value:a.call(c,b,d)}:{done:!1}}),j=i[0],k=i[1];redefine(String.prototype,a,j),redefine(RegExp.prototype,e,2==b?function(a,b){return k.call(a,this,b)}:function(a){return k.call(a,this)}),d&&hide(RegExp.prototype[e],"sham",!0)}},max$1=Math.max,min$2=Math.min,floor$1=Math.floor,SUBSTITUTION_SYMBOLS=/\$([$&`']|\d\d?|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&`']|\d\d?)/g,maybeToString=function(a){return a===void 0?a:a+""};fixRegexpWellKnownSymbolLogic("replace",2,function(a,b,c){function d(a,c,d,e,g,h){var i=d+a.length,j=e.length,f=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==g&&(g=toObject(g),f=SUBSTITUTION_SYMBOLS),b.call(h,f,function(b,h){var k;switch(h.charAt(0)){case"$":return"$";case"&":return a;case"`":return c.slice(0,d);case"'":return c.slice(i);case"<":k=g[h.slice(1,-1)];break;default:var l=+h;if(0==l)return b;if(l>j){var m=floor$1(l/10);return 0===m?b:m<=j?void 0===e[m-1]?h.charAt(1):e[m-1]+h.charAt(1):b}k=e[l-1];}return void 0===k?"":k})}return[function(c,d){var e=requireObjectCoercible(this),f=c==null?void 0:c[a];return f===void 0?b.call(e+"",c,d):f.call(c,e,d)},function(a,e){var f=c(b,a,this,e);if(f.done)return f.value;var g=anObject(a),h=this+"",k="function"==typeof e;k||(e=e+"");var l=g.global;if(l){var m=g.unicode;g.lastIndex=0}for(var n,o=[];(n=regexpExecAbstract(g,h),null!==n)&&!(o.push(n),!l);){var p=n[0]+"";""==p&&(g.lastIndex=advanceStringIndex(h,toLength(g.lastIndex),m))}for(var q="",r=0,s=0;s<o.length;s++){n=o[s];for(var t=n[0]+"",u=max$1(min$2(toInteger(n.index),h.length),0),v=[],w=1;w<n.length;w++)v.push(maybeToString(n[w]));var x=n.groups;if(k){var y=[t].concat(v,u,h);x!==void 0&&y.push(x);var z=e.apply(void 0,y)+""}else z=d(t,h,u,v,x,e);u>=r&&(q+=h.slice(r,u)+z,r=u+t.length)}return q+h.slice(r)}]});function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}var bootstrapVersion=4;try{var rawVersion=$.fn.dropdown.Constructor.VERSION;rawVersion!==void 0&&(bootstrapVersion=parseInt(rawVersion,10))}catch(a){}var Constants={html:{inputGroups:{3:["<span tabindex=\"100\" class=\"add-on input-group-addon %s\" title=\"%s\">","</span>"],4:["<div class=\"%s\"><button tabindex=\"100\" title=\"%s\" class=\"btn btn-outline-secondary\" type=\"button\">","</button></div>"]}[bootstrapVersion]}},sprintf=function(a){var b=arguments,c=!0,d=1;return a=a.replace(/%s/g,function(){var a=b[d++];return"undefined"==typeof a?(c=!1,""):a}),c?a:""},Password=function(){function a(b,c){_classCallCheck(this,a),this.options=c,this.$element=$(b),this.isShown=!1,this.init()}return _createClass(a,[{key:"init",value:function(){var a,b;"before"===this.options.placement?(a="insertBefore",b="input-group-prepend"):(this.options.placement="after",a="insertAfter",b="input-group-append"),this.$element.wrap("<div class=\"input-group".concat(sprintf(" input-group-%s",this.options.size),"\" />")),this.$text=$("<input type=\"text\" />")[a](this.$element).attr("class",this.$element.attr("class")).attr("style",this.$element.attr("style")).attr("placeholder",this.$element.attr("placeholder")).attr("maxlength",this.$element.attr("maxlength")).attr("disabled",this.$element.attr("disabled")).css("display",this.$element.css("display")).val(this.$element.val()).hide(),this.$element.prop("readonly")&&this.$text.prop("readonly",!0),this.$icon=$(["".concat(sprintf(Constants.html.inputGroups[0],b,this.options.message),"\n <i class=\"icon-eye-open ").concat(this.options.eyeClass," ").concat(this.options.eyeClassPositionInside?"":this.options.eyeOpenClass,"\">\n ").concat(this.options.eyeClassPositionInside?this.options.eyeOpenClass:"","\n </i>"),Constants.html.inputGroups[1]].join(""))[a](this.$text).css("cursor","pointer"),this.$text.off("keyup").on("keyup",$.proxy(function(){this.isShown&&this.$element.val(this.$text.val()).trigger("change")},this)),this.$icon.off("click").on("click",$.proxy(function(){this.$text.val(this.$element.val()).trigger("change"),this.toggle()},this))}},{key:"toggle",value:function(a){this[this.isShown?"hide":"show"](a)}},{key:"show",value:function(a){var b=$.Event("show.bs.password",{relatedTarget:a});this.$element.trigger(b),this.isShown=!0,this.$element.hide(),this.$text.show(),this.options.eyeClassPositionInside?this.$icon.find("i,svg").removeClass("icon-eye-open").addClass("icon-eye-close").html(this.options.eyeCloseClass):this.$icon.find("i,svg").removeClass("icon-eye-open ".concat(this.options.eyeOpenClass)).addClass("icon-eye-close ".concat(this.options.eyeCloseClass)),this.$text[this.options.placement](this.$element)}},{key:"hide",value:function(a){var b=$.Event("hide.bs.password",{relatedTarget:a});this.$element.trigger(b),this.isShown=!1,this.$element.show(),this.$text.hide(),this.options.eyeClassPositionInside?this.$icon.find("i,svg").removeClass("icon-eye-close").addClass("icon-eye-open").html(this.options.eyeOpenClass):this.$icon.find("i,svg").removeClass("icon-eye-close ".concat(this.options.eyeCloseClass)).addClass("icon-eye-open ".concat(this.options.eyeOpenClass)),this.$element[this.options.placement](this.$text)}},{key:"val",value:function(a){return"undefined"==typeof a?this.$element.val():void(this.$element.val(a).trigger("change"),this.$text.val(a))}},{key:"focus",value:function(){this.$element.focus()}}]),a}();Password.DEFAULTS={placement:"after",message:"Click here to show/hide password",size:void 0,eyeClass:"fa",eyeOpenClass:"fa-eye",eyeCloseClass:"fa-eye-slash",eyeClassPositionInside:!1};var old=$.fn.password;$.fn.password=function(){var a,b=arguments[0],c=arguments,d=["show","hide","toggle","val","focus"];return this.each(function(){var e=$(this),f=e.data("bs.password"),g=$.extend({},Password.DEFAULTS,e.data(),"object"===_typeof(b)&&b);if("string"==typeof b){if(0>$.inArray(b,d))throw new Error("Unknown method: ".concat(b));a=f[b](c[1])}else f?f.init(g):(f=new Password(e,g),e.data("bs.password",f))}),a?a:this},$.fn.password.Constructor=Password,$.fn.password.noConflict=function(){return $.fn.password=old,this},$(function(){$("[data-toggle=\"password\"]").password()});
|