inputmask.dependencyLib.min.js 4.8 KB

12345678
  1. /*!
  2. * dependencyLibs/inputmask.dependencyLib.min.js
  3. * https://github.com/RobinHerbots/jquery.inputmask
  4. * Copyright (c) 2010 - 2017 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 3.3.5-213
  7. */
  8. !function(a){"function"==typeof define&&define.amd?define(["../global/window","../global/document"],a):"object"==typeof exports?module.exports=a(require("../global/window"),require("../global/document")):window.dependencyLib=a(window,document)}(function(a,b){function c(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function d(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[i.toString.call(a)]||"object":typeof a}function e(a){return null!=a&&a===a.window}function f(a){var b="length"in a&&a.length,c=d(a);return"function"!==c&&!e(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function g(a){return a instanceof Element}function h(c){return c instanceof h?c:this instanceof h?void(void 0!==c&&null!==c&&c!==a&&(this[0]=c.nodeName?c:void 0!==c[0]&&c[0].nodeName?c[0]:b.querySelector(c),void 0!==this[0]&&null!==this[0]&&(this[0].eventRegistry=this[0].eventRegistry||{}))):new h(c)}for(var i={},j="Boolean Number String Function Array Date RegExp Object Error".split(" "),k=0;k<j.length;k++)i["[object "+j[k]+"]"]=j[k].toLowerCase();return h.prototype={on:function(a,b){function c(a,c){e.addEventListener?e.addEventListener(a,b,!1):e.attachEvent&&e.attachEvent("on"+a,b),d[a]=d[a]||{},d[a][c]=d[a][c]||[],d[a][c].push(b)}if(g(this[0]))for(var d=this[0].eventRegistry,e=this[0],f=a.split(" "),h=0;h<f.length;h++){var i=f[h].split("."),j=i[0],k=i[1]||"global";c(j,k)}return this},off:function(a,b){function c(a,b,c){if(a in e==!0)if(f.removeEventListener?f.removeEventListener(a,c,!1):f.detachEvent&&f.detachEvent("on"+a,c),"global"===b)for(var d in e[a])e[a][d].splice(e[a][d].indexOf(c),1);else e[a][b].splice(e[a][b].indexOf(c),1)}function d(a,c){var d,f,g=[];if(a.length>0)if(void 0===b)for(d=0,f=e[a][c].length;d<f;d++)g.push({ev:a,namespace:c&&c.length>0?c:"global",handler:e[a][c][d]});else g.push({ev:a,namespace:c&&c.length>0?c:"global",handler:b});else if(c.length>0)for(var h in e)for(var i in e[h])if(i===c)if(void 0===b)for(d=0,f=e[h][i].length;d<f;d++)g.push({ev:h,namespace:i,handler:e[h][i][d]});else g.push({ev:h,namespace:i,handler:b});return g}if(g(this[0]))for(var e=this[0].eventRegistry,f=this[0],h=a.split(" "),i=0;i<h.length;i++)for(var j=h[i].split("."),k=d(j[0],j[1]),l=0,m=k.length;l<m;l++)c(k[l].ev,k[l].namespace,k[l].handler);return this},trigger:function(a){if(g(this[0]))for(var c=this[0].eventRegistry,d=this[0],e="string"==typeof a?a.split(" "):[a.type],f=0;f<e.length;f++){var i=e[f].split("."),j=i[0],k=i[1]||"global";if(void 0!==b&&"global"===k){var l,m,n={bubbles:!1,cancelable:!0,detail:Array.prototype.slice.call(arguments,1)};if(b.createEvent){try{l=new CustomEvent(j,n)}catch(o){l=b.createEvent("CustomEvent"),l.initCustomEvent(j,n.bubbles,n.cancelable,n.detail)}a.type&&h.extend(l,a),d.dispatchEvent(l)}else l=b.createEventObject(),l.eventType=j,a.type&&h.extend(l,a),d.fireEvent("on"+l.eventType,l)}else if(void 0!==c[j])if(arguments[0]=arguments[0].type?arguments[0]:h.Event(arguments[0]),"global"===k)for(var p in c[j])for(m=0;m<c[j][p].length;m++)c[j][p][m].apply(d,arguments);else for(m=0;m<c[j][k].length;m++)c[j][k][m].apply(d,arguments)}return this},position:function(){if(g(this[0]))return{top:this[0].offsetTop,left:this[0].offsetLeft}}},h.isFunction=function(a){return"function"===d(a)},h.noop=function(){},h.isArray=Array.isArray,h.inArray=function(a,b,d){return null==b?-1:c(b,a,d)},h.valHooks=void 0,h.isPlainObject=function(a){return"object"===d(a)&&!a.nodeType&&!e(a)&&!(a.constructor&&!i.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf"))},h.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof g&&(k=g,g=arguments[i]||{},i++),"object"==typeof g||h.isFunction(g)||(g={}),i===j&&(g=this,i--);i<j;i++)if(null!=(a=arguments[i]))for(b in a)c=g[b],d=a[b],g!==d&&(k&&d&&(h.isPlainObject(d)||(e=h.isArray(d)))?(e?(e=!1,f=c&&h.isArray(c)?c:[]):f=c&&h.isPlainObject(c)?c:{},g[b]=h.extend(k,f,d)):void 0!==d&&(g[b]=d));return g},h.each=function(a,b){var c,d=0;if(f(a))for(var e=a.length;d<e&&(c=b.call(a[d],d,a[d]),c!==!1);d++);else for(d in a)if(c=b.call(a[d],d,a[d]),c===!1)break;return a},h.map=function(a,b){var c,d=0,e=a.length,g=f(a),h=[];if(g)for(;d<e;d++)c=b(a[d],d),null!=c&&h.push(c);else for(d in a)c=b(a[d],d),null!=c&&h.push(c);return[].concat(h)},h.data=function(a,b,c){return void 0===c?a.__data?a.__data[b]:null:(a.__data=a.__data||{},void(a.__data[b]=c))},h.Event=function(a,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var d=b.createEvent("CustomEvent");return d.initCustomEvent(a,c.bubbles,c.cancelable,c.detail),d},h.Event.prototype=a.Event.prototype,h});