inputmask.dependencyLib.min.js 4.5 KB

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