/*
 Input Mask plugin for jquery
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 Version: 2.4.8
*/
(function(c){void 0===c.fn.inputmask&&(c.inputmask={defaults:{placeholder:"_",optionalmarker:{start:"[",end:"]"},quantifiermarker:{start:"{",end:"}"},groupmarker:{start:"(",end:")"},escapeChar:"\\",mask:null,oncomplete:c.noop,onincomplete:c.noop,oncleared:c.noop,repeat:0,greedy:!0,autoUnmask:!1,clearMaskOnLostFocus:!0,insertMode:!0,clearIncomplete:!1,aliases:{},onKeyUp:c.noop,onKeyDown:c.noop,onUnMask:void 0,showMaskOnFocus:!0,showMaskOnHover:!0,onKeyValidation:c.noop,skipOptionalPartCharacter:" ",
showTooltip:!1,numericInput:!1,isNumeric:!1,radixPoint:"",skipRadixDance:!1,rightAlignNumerics:!0,definitions:{9:{validator:"[0-9]",cardinality:1},a:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451]",cardinality:1},"*":{validator:"[A-Za-z\u0410-\u044f\u0401\u04510-9]",cardinality:1}},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,
NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},ignorables:[8,9,13,19,27,33,34,35,36,37,38,39,40,45,46,93,112,113,114,115,116,117,118,119,120,121,122,123],getMaskLength:function(a,c,e,f,b){b=a.length;c||("*"==e?b=f.length+1:1<e&&(b+=a.length*(e-1)));return b}},escapeRegex:function(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)","gim"),"\\$1")}},c.fn.inputmask=function(a,
d){function e(a){var b=document.createElement("input");a="on"+a;var g=a in b;g||(b.setAttribute(a,"return;"),g="function"==typeof b[a]);return g}function f(a,b){var e=g.aliases[a];return e?(e.alias&&f(e.alias),c.extend(!0,g,e),c.extend(!0,g,b),!0):!1}function b(a){g.numericInput&&(a=a.split("").reverse().join(""));var b=!1,e=0,d=g.greedy,f=g.repeat;"*"==f&&(d=!1);1==a.length&&!1==d&&0!=f&&(g.placeholder="");a=c.map(a.split(""),function(a,c){var d=[];if(a==g.escapeChar)b=!0;else if(a!=g.optionalmarker.start&&
a!=g.optionalmarker.end||b){var f=g.definitions[a];if(f&&!b)for(var h=0;h<f.cardinality;h++)d.push(y(e+h));else d.push(a),b=!1;e+=d.length;return d}});for(var h=a.slice(),s=1;s<f&&d;s++)h=h.concat(a.slice());return{mask:h,repeat:f,greedy:d}}function h(a){g.numericInput&&(a=a.split("").reverse().join(""));var b=!1,e=!1,d=!1;return c.map(a.split(""),function(a,c){var f=[];if(a==g.escapeChar)e=!0;else{if(a!=g.optionalmarker.start||e){if(a!=g.optionalmarker.end||e){var h=g.definitions[a];if(h&&!e){for(var L=
h.prevalidator,k=L?L.length:0,p=1;p<h.cardinality;p++){var l=k>=p?L[p-1]:[],m=l.validator,l=l.cardinality;f.push({fn:m?"string"==typeof m?RegExp(m):new function(){this.test=m}:/./,cardinality:l?l:1,optionality:b,newBlockMarker:!0==b?d:!1,offset:0,casing:h.casing,def:h.definitionSymbol||a});!0==b&&(d=!1)}f.push({fn:h.validator?"string"==typeof h.validator?RegExp(h.validator):new function(){this.test=h.validator}:/./,cardinality:h.cardinality,optionality:b,newBlockMarker:d,offset:0,casing:h.casing,
def:h.definitionSymbol||a})}else f.push({fn:null,cardinality:0,optionality:b,newBlockMarker:d,offset:0,casing:null,def:a}),e=!1;d=!1;return f}b=!1}else b=!0;d=!0}})}function k(){function a(b){var e=b.length;for(i=0;i<e&&b.charAt(i)!=g.optionalmarker.start;i++);var d=[b.substring(0,i)];i<e&&d.push(b.substring(i+1,e));return d}function e(k,s,l){var r=0,x=0,p=s.length;for(i=0;i<p&&!(s.charAt(i)==g.optionalmarker.start&&r++,s.charAt(i)==g.optionalmarker.end&&x++,0<r&&r==x);i++);r=[s.substring(0,i)];i<
p&&r.push(s.substring(i+1,p));x=a(r[0]);1<x.length?(s=k+x[0]+(g.optionalmarker.start+x[1]+g.optionalmarker.end)+(1<r.length?r[1]:""),-1==c.inArray(s,f)&&""!=s&&(f.push(s),p=b(s),d.push({mask:s,_buffer:p.mask,buffer:p.mask.slice(),tests:h(s),lastValidPosition:-1,greedy:p.greedy,repeat:p.repeat,metadata:l})),s=k+x[0]+(1<r.length?r[1]:""),-1==c.inArray(s,f)&&""!=s&&(f.push(s),p=b(s),d.push({mask:s,_buffer:p.mask,buffer:p.mask.slice(),tests:h(s),lastValidPosition:-1,greedy:p.greedy,repeat:p.repeat,metadata:l})),
1<a(x[1]).length&&e(k+x[0],x[1]+r[1],l),1<r.length&&1<a(r[1]).length&&(e(k+x[0]+(g.optionalmarker.start+x[1]+g.optionalmarker.end),r[1],l),e(k+x[0],r[1],l))):(s=k+r,-1==c.inArray(s,f)&&""!=s&&(f.push(s),p=b(s),d.push({mask:s,_buffer:p.mask,buffer:p.mask.slice(),tests:h(s),lastValidPosition:-1,greedy:p.greedy,repeat:p.repeat,metadata:l})))}var d=[],f=[],k=[];c.isFunction(g.mask)&&(g.mask=g.mask.call(this,g));c.isArray(g.mask)?c.each(g.mask,function(a,b){void 0!=b.mask?e("",b.mask.toString(),b):e("",
b.toString())}):e("",g.mask.toString());(function(a){function b(){this.matches=[];this.isQuantifier=this.isOptional=this.isGroup=!1}var e=/(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[]()|\\]+|./g,d=new b,c,f=[];for(k=[];c=e.exec(a);)switch(c=c[0],c.charAt(0)){case g.optionalmarker.end:case g.groupmarker.end:c=f.pop();0<f.length?f[f.length-1].matches.push(c):(k.push(c),d=c);break;case g.optionalmarker.start:!d.isGroup&&0<d.matches.length&&k.push(d);d=new b;d.isOptional=!0;f.push(d);break;case g.groupmarker.start:!d.isGroup&&
0<d.matches.length&&k.push(d);d=new b;d.isGroup=!0;f.push(d);break;case g.quantifiermarker.start:var h=new b;h.isQuantifier=!0;h.matches.push(c);0<f.length?f[f.length-1].matches.push(h):d.matches.push(h);break;default:if(0<f.length)f[f.length-1].matches.push(c);else{if(d.isGroup||d.isOptional)d=new b;d.matches.push(c)}}0<d.matches.length&&k.push(d);return k})(g.mask);return g.greedy?d:d.sort(function(a,b){return a.mask.length-b.mask.length})}function y(a){return g.placeholder.charAt(a%g.placeholder.length)}
function n(a,b){function d(){return a[b]}function e(){return d().tests}function f(){return d()._buffer}function h(){return d().buffer}function k(f,e,D){function l(a,d,b,e){for(var f=n(a),h=b?1:0,c="",H=d.buffer,S=d.tests[f].cardinality;S>h;S--)c+=F(H,f-(S-1));b&&(c+=b);return null!=d.tests[f].fn?d.tests[f].fn.test(c,H,a,e,g):b==F(d._buffer,a,!0)||b==g.skipOptionalPartCharacter?{refresh:!0,c:F(d._buffer,a,!0),pos:a}:!1}if(D=!0===D){var m=l(f,d(),e,D);!0===m&&(m={pos:f});return m}var s=[],m=!1,u=b,
v=h().slice(),t=d().lastValidPosition;w(f);var y=[];c.each(a,function(a,g){if("object"==typeof g){b=a;var c=f,k=d().lastValidPosition,n;if(k==t){if(1<c-t)for(k=-1==k?0:k;k<c&&(n=l(k,d(),v[k],!0),!1!==n);k++)G(h(),k,v[k],!0),!0===n&&(n={pos:k}),n=n.pos||k,d().lastValidPosition<n&&(d().lastValidPosition=n);if(!r(c)&&!l(c,d(),e,D)){k=q(c)-c;for(n=0;n<k&&!1===l(++c,d(),e,D);n++);y.push(b)}}(d().lastValidPosition>=t||b==u)&&0<=c&&c<p()&&(m=l(c,d(),e,D),!1!==m&&(!0===m&&(m={pos:c}),n=m.pos||c,d().lastValidPosition<
n&&(d().lastValidPosition=n)),s.push({activeMasksetIndex:a,result:m}))}});b=u;return function(d,b){var h=!1;c.each(b,function(a,b){if(h=-1==c.inArray(b.activeMasksetIndex,d)&&!1!==b.result)return!1});if(h)b=c.map(b,function(b,f){if(-1==c.inArray(b.activeMasksetIndex,d))return b;a[b.activeMasksetIndex].lastValidPosition=t});else{var g=-1,k=-1;c.each(b,function(a,b){-1!=c.inArray(b.activeMasksetIndex,d)&&!1!==b.result&(-1==g||g>b.result.pos)&&(g=b.result.pos,k=b.activeMasksetIndex)});b=c.map(b,function(b,
h){if(-1!=c.inArray(b.activeMasksetIndex,d)){if(b.result.pos==g)return b;if(!1!==b.result){for(var H=f;H<g;H++)if(rsltValid=l(H,a[b.activeMasksetIndex],a[k].buffer[H],!0),!1===rsltValid){a[b.activeMasksetIndex].lastValidPosition=g-1;break}else G(a[b.activeMasksetIndex].buffer,H,a[k].buffer[H],!0),a[b.activeMasksetIndex].lastValidPosition=H;rsltValid=l(g,a[b.activeMasksetIndex],e,!0);!1!==rsltValid&&(G(a[b.activeMasksetIndex].buffer,g,e,!0),a[b.activeMasksetIndex].lastValidPosition=g);return b}}})}return b}(y,
s)}function l(){var f=b,e={activeMasksetIndex:0,lastValidPosition:-1,next:-1};c.each(a,function(a,f){"object"==typeof f&&(b=a,d().lastValidPosition>e.lastValidPosition?(e.activeMasksetIndex=a,e.lastValidPosition=d().lastValidPosition,e.next=q(d().lastValidPosition)):d().lastValidPosition==e.lastValidPosition&&(-1==e.next||e.next>q(d().lastValidPosition))&&(e.activeMasksetIndex=a,e.lastValidPosition=d().lastValidPosition,e.next=q(d().lastValidPosition)))});b=-1!=e.lastValidPosition&&a[f].lastValidPosition==
e.lastValidPosition?f:e.activeMasksetIndex;f!=b&&(U(h(),q(e.lastValidPosition),p()),d().writeOutBuffer=!0);u.data("_inputmask").activeMasksetIndex=b}function r(a){a=n(a);a=e()[a];return void 0!=a?a.fn:!1}function n(a){return a%e().length}function p(){return g.getMaskLength(f(),d().greedy,d().repeat,h(),g)}function q(a){var b=p();if(a>=b)return b;for(;++a<b&&!r(a););return a}function w(a){if(0>=a)return 0;for(;0<--a&&!r(a););return a}function G(a,b,d,f){f&&(b=P(a,b));f=e()[n(b)];var h=d;if(void 0!=
h&&void 0!=f)switch(f.casing){case "upper":h=d.toUpperCase();break;case "lower":h=d.toLowerCase()}a[b]=h}function F(a,b,d){d&&(b=P(a,b));return a[b]}function P(a,b){for(var d;void 0==a[b]&&a.length<p();)for(d=0;void 0!==f()[d];)a.push(f()[d++]);return b}function J(a,b,d){a._valueSet(b.join(""));void 0!=d&&v(a,d)}function U(a,b,d,e){for(var h=p();b<d&&b<h;b++)!0===e?r(b)||G(a,b,""):G(a,b,F(f().slice(),b,!0))}function Q(a,b){var d=n(b);G(a,b,F(f(),d))}function M(e,h,g,k,l){k=void 0!=k?k.slice():V(e._valueGet()).split("");
c.each(a,function(a,b){"object"==typeof b&&(b.buffer=b._buffer.slice(),b.lastValidPosition=-1,b.p=-1)});!0!==g&&(b=0);h&&e._valueSet("");p();c.each(k,function(a,b){if(!0===l){var k=d().p,k=-1==k?k:w(k),n=-1==k?a:q(k);-1==c.inArray(b,f().slice(k+1,n))&&c(e).trigger("_keypress",[!0,b.charCodeAt(0),h,g,a])}else c(e).trigger("_keypress",[!0,b.charCodeAt(0),h,g,a])});!0===g&&-1!=d().p&&(d().lastValidPosition=w(d().p))}function W(a){return c.inputmask.escapeRegex.call(this,a)}function V(a){return a.replace(RegExp("("+
W(f().join(""))+")*$"),"")}function X(a){var b=h(),d=b.slice(),f,g;for(g=d.length-1;0<=g;g--)if(f=n(g),e()[f].optionality)if(r(g)&&k(g,b[g],!0))break;else d.pop();else break;J(a,d)}function fa(a,b){if(!e()||!0!==b&&a.hasClass("hasDatepicker"))return a[0]._valueGet();var d=c.map(h(),function(a,b){return r(b)&&k(b,a,!0)?a:null}),d=(A?d.reverse():d).join("");return void 0!=g.onUnMask?g.onUnMask.call(this,h().join(""),d):d}function C(a){!A||"number"!=typeof a||g.greedy&&""==g.placeholder||(a=h().length-
a);return a}function v(a,b,d){var e=a.jquery&&0<a.length?a[0]:a;if("number"==typeof b)b=C(b),d=C(d),c(a).is(":visible")&&(d="number"==typeof d?d:b,e.scrollLeft=e.scrollWidth,!1==g.insertMode&&b==d&&d++,e.setSelectionRange?(e.selectionStart=b,e.selectionEnd=z?b:d):e.createTextRange&&(a=e.createTextRange(),a.collapse(!0),a.moveEnd("character",d),a.moveStart("character",b),a.select()));else{if(!c(a).is(":visible"))return{begin:0,end:0};e.setSelectionRange?(b=e.selectionStart,d=e.selectionEnd):document.selection&&
document.selection.createRange&&(a=document.selection.createRange(),b=0-a.duplicate().moveStart("character",-1E5),d=b+a.text.length);b=C(b);d=C(d);return{begin:b,end:d}}}function O(d){if("*"!=g.repeat){var e=!1,h=0,k=b;c.each(a,function(a,g){if("object"==typeof g){b=a;var c=w(p());if(g.lastValidPosition>=h&&g.lastValidPosition==c){for(var k=!0,l=0;l<=c;l++){var q=r(l),m=n(l);if(q&&(void 0==d[l]||d[l]==y(l))||!q&&d[l]!=f()[m]){k=!1;break}}if(e=e||k)return!1}h=g.lastValidPosition}});b=k;return e}}var A=
!1,K=h().join(""),u,ga;this.unmaskedvalue=function(a,b){A=a.data("_inputmask").isRTL;return fa(a,b)};this.isComplete=function(a){return O(a)};this.mask=function(z){function P(a){a=c._data(a).events;c.each(a,function(a,b){c.each(b,function(a,b){if("inputmask"==b.namespace&&"setvalue"!=b.type&&"_keypress"!=b.type){var d=b.handler;b.handler=function(a){if(this.readOnly||this.disabled)a.preventDefault;else return d.apply(this,arguments)}}})})}function D(a){var b;Object.getOwnPropertyDescriptor&&(b=Object.getOwnPropertyDescriptor(a,
"value"));if(b&&b.get){if(!a._valueGet){var d=b.get,e=b.set;a._valueGet=function(){return A?d.call(this).split("").reverse().join(""):d.call(this)};a._valueSet=function(a){e.call(this,A?a.split("").reverse().join(""):a)};Object.defineProperty(a,"value",{get:function(){var a=c(this),b=c(this).data("_inputmask"),e=b.masksets,f=b.activeMasksetIndex;return b&&b.opts.autoUnmask?a.inputmask("unmaskedvalue"):d.call(this)!=e[f]._buffer.join("")?d.call(this):""},set:function(a){e.call(this,a);c(this).triggerHandler("setvalue.inputmask")}})}}else if(document.__lookupGetter__&&
a.__lookupGetter__("value"))a._valueGet||(d=a.__lookupGetter__("value"),e=a.__lookupSetter__("value"),a._valueGet=function(){return A?d.call(this).split("").reverse().join(""):d.call(this)},a._valueSet=function(a){e.call(this,A?a.split("").reverse().join(""):a)},a.__defineGetter__("value",function(){var a=c(this),b=c(this).data("_inputmask"),e=b.masksets,f=b.activeMasksetIndex;return b&&b.opts.autoUnmask?a.inputmask("unmaskedvalue"):d.call(this)!=e[f]._buffer.join("")?d.call(this):""}),a.__defineSetter__("value",
function(a){e.call(this,a);c(this).triggerHandler("setvalue.inputmask")}));else if(a._valueGet||(a._valueGet=function(){return A?this.value.split("").reverse().join(""):this.value},a._valueSet=function(a){this.value=A?a.split("").reverse().join(""):a}),void 0==c.valHooks.text||!0!=c.valHooks.text.inputmaskpatch)d=c.valHooks.text&&c.valHooks.text.get?c.valHooks.text.get:function(a){return a.value},e=c.valHooks.text&&c.valHooks.text.set?c.valHooks.text.set:function(a,b){a.value=b;return a},jQuery.extend(c.valHooks,
{text:{get:function(a){var b=c(a);if(b.data("_inputmask")){if(b.data("_inputmask").opts.autoUnmask)return b.inputmask("unmaskedvalue");a=d(a);b=b.data("_inputmask");return a!=b.masksets[b.activeMasksetIndex]._buffer.join("")?a:""}return d(a)},set:function(a,b){var d=c(a),f=e(a,b);d.data("_inputmask")&&d.triggerHandler("setvalue.inputmask");return f},inputmaskpatch:!0}})}function Y(a,b,g,c){var l=h();if(!1!==c)for(;!r(a)&&0<=a-1;)a--;for(c=a;c<b&&c<p();c++)if(r(c)){Q(l,c);var m=q(c),L=F(l,m);if(L!=
y(m))if(m<p()&&!1!==k(c,L,!0)&&e()[n(c)].def==e()[n(m)].def)G(l,c,L,!0);else if(r(c))break}else Q(l,c);void 0!=g&&G(l,w(b),g);if(!1==d().greedy){b=V(l.join("")).split("");l.length=b.length;c=0;for(g=l.length;c<g;c++)l[c]=b[c];0==l.length&&(d().buffer=f().slice())}return a}function ba(a,b,g){var c=h();if(F(c,a,!0)!=y(a))for(var l=w(b);l>a&&0<=l;l--)if(r(l)){var m=w(l),q=F(c,m);if(q!=y(m))if(!1!==k(m,q,!0)&&e()[n(l)].def==e()[n(m)].def)G(c,l,q,!0),Q(c,m);else break}else Q(c,l);void 0!=g&&F(c,a)==y(a)&&
G(c,a,g);a=c.length;if(!1==d().greedy){g=V(c.join("")).split("");c.length=g.length;l=0;for(m=c.length;l<m;l++)c[l]=g[l];0==c.length&&(d().buffer=f().slice())}return b-(a-c.length)}function ca(b,e,c){if(g.numericInput||A){switch(e){case g.keyCode.BACKSPACE:e=g.keyCode.DELETE;break;case g.keyCode.DELETE:e=g.keyCode.BACKSPACE}if(A){var f=c.end;c.end=c.begin;c.begin=f}}f=!0;c.begin==c.end?(f=e==g.keyCode.BACKSPACE?c.begin-1:c.begin,g.isNumeric&&""!=g.radixPoint&&h()[f]==g.radixPoint&&(c.begin=h().length-
1==f?c.begin:e==g.keyCode.BACKSPACE?f:q(f),c.end=c.begin),f=!1,e==g.keyCode.BACKSPACE?c.begin--:e==g.keyCode.DELETE&&c.end++):1!=c.end-c.begin||g.insertMode||(f=!1,e==g.keyCode.BACKSPACE&&c.begin--);U(h(),c.begin,c.end);var k=p();if(!1==g.greedy)Y(c.begin,k,void 0,!A&&e==g.keyCode.BACKSPACE&&!f);else{for(var l=c.begin,m=c.begin;m<c.end;m++)if(r(m)||!f)l=Y(c.begin,k,void 0,!A&&e==g.keyCode.BACKSPACE&&!f);f||(c.begin=l)}e=q(-1);U(h(),c.begin,c.end,!0);M(b,!1,void 0==a[1]||e>=c.end,h());d().lastValidPosition<
e?(d().lastValidPosition=-1,d().p=e):d().p=c.begin}function da(a){T=!1;var b=this,e=c(b),k=a.keyCode,m=v(b);k==g.keyCode.BACKSPACE||k==g.keyCode.DELETE||t&&127==k||a.ctrlKey&&88==k?(a.preventDefault(),88==k&&(K=h().join("")),ca(b,k,m),l(),J(b,h(),d().p),b._valueGet()==f().join("")&&e.trigger("cleared"),g.showTooltip&&e.prop("title",d().mask)):k==g.keyCode.END||k==g.keyCode.PAGE_DOWN?setTimeout(function(){var e=q(d().lastValidPosition);g.insertMode||e!=p()||a.shiftKey||e--;v(b,a.shiftKey?m.begin:e,
e)},0):k==g.keyCode.HOME&&!a.shiftKey||k==g.keyCode.PAGE_UP?v(b,0,a.shiftKey?m.begin:0):k==g.keyCode.ESCAPE||90==k&&a.ctrlKey?(M(b,!0,!1,K.split("")),e.click()):k!=g.keyCode.INSERT||a.shiftKey||a.ctrlKey?!1!=g.insertMode||a.shiftKey||(k==g.keyCode.RIGHT?setTimeout(function(){var a=v(b);v(b,a.begin)},0):k==g.keyCode.LEFT&&setTimeout(function(){var a=v(b);v(b,a.begin-1)},0)):(g.insertMode=!g.insertMode,v(b,g.insertMode||m.begin!=p()?m.begin:m.begin-1));e=v(b);!0===g.onKeyDown.call(this,a,h(),g)&&v(b,
e.begin,e.end);Z=-1!=c.inArray(k,g.ignorables)}function ea(e,f,m,n,r,z){if(void 0==m&&T)return!1;T=!0;var u=c(this);e=e||window.event;m=m||e.which||e.charCode||e.keyCode;if((!e.ctrlKey||!e.altKey)&&(e.ctrlKey||e.metaKey||Z)&&!0!==f)return!0;if(m){!0!==f&&46==m&&!1==e.shiftKey&&","==g.radixPoint&&(m=44);var t,N,x=String.fromCharCode(m);f?(m=r?z:d().lastValidPosition+1,t={begin:m,end:m}):t=v(this);z=A?1<t.begin-t.end||1==t.begin-t.end&&g.insertMode:1<t.end-t.begin||1==t.end-t.begin&&g.insertMode;var D=
b;z&&(b=D,c.each(a,function(a,e){"object"==typeof e&&(b=a,d().undoBuffer=h().join(""))}),ca(this,g.keyCode.DELETE,t),g.insertMode||c.each(a,function(a,e){"object"==typeof e&&(b=a,ba(t.begin,p()),d().lastValidPosition=q(d().lastValidPosition))}),b=D);var C=h().join("").indexOf(g.radixPoint);g.isNumeric&&!0!==f&&-1!=C&&(g.greedy&&t.begin<=C?(t.begin=w(t.begin),t.end=t.begin):x==g.radixPoint&&(t.begin=C,t.end=t.begin));var B=t.begin;m=k(B,x,r);!0===r&&(m=[{activeMasksetIndex:b,result:m}]);var E=-1;c.each(m,
function(a,e){b=e.activeMasksetIndex;d().writeOutBuffer=!0;var c=e.result;if(!1!==c){var f=!1,k=h();!0!==c&&(f=c.refresh,B=void 0!=c.pos?c.pos:B,x=void 0!=c.c?c.c:x);if(!0!==f){if(!0==g.insertMode){c=p();for(k=k.slice();F(k,c,!0)!=y(c)&&c>=B;)c=0==c?-1:w(c);c>=B?(ba(B,p(),x),k=d().lastValidPosition,c=q(k),c!=p()&&k>=B&&F(h(),c,!0)!=y(c)&&(d().lastValidPosition=c)):d().writeOutBuffer=!1}else G(k,B,x,!0);if(-1==E||E>q(B))E=q(B)}else!r&&(k=B<p()?B+1:B,-1==E||E>k)&&(E=k);E>d().p&&(d().p=E)}});!0!==r&&
(b=D,l());if(!1!==n&&(c.each(m,function(a,d){if(d.activeMasksetIndex==b)return N=d,!1}),void 0!=N)){var K=this;setTimeout(function(){g.onKeyValidation.call(K,N.result,g)},0);if(d().writeOutBuffer&&!1!==N.result){var I=h();n=f?void 0:g.numericInput?B>C?w(E):x==g.radixPoint?E-1:w(E-1):E;J(this,I,n);!0!==f&&setTimeout(function(){!0===O(I)&&u.trigger("complete")},0)}else z&&(d().buffer=d().undoBuffer.split(""))}g.showTooltip&&u.prop("title",d().mask);e.preventDefault()}}function W(a){var b=c(this),d=
a.keyCode,e=h();m&&d==g.keyCode.BACKSPACE&&ga==this._valueGet()&&da.call(this,a);g.onKeyUp.call(this,a,e,g);d==g.keyCode.TAB&&g.showMaskOnFocus&&(b.hasClass("focus.inputmask")&&0==this._valueGet().length?(e=f().slice(),J(this,e),v(this,0),K=h().join("")):(J(this,e),e.join("")==f().join("")&&-1!=c.inArray(g.radixPoint,e)?(v(this,C(0)),b.click()):v(this,C(0),C(p()))))}u=c(z);if(u.is(":input")){u.data("_inputmask",{masksets:a,activeMasksetIndex:b,opts:g,isRTL:!1});g.showTooltip&&u.prop("title",d().mask);
d().greedy=d().greedy?d().greedy:0==d().repeat;if(null!=u.attr("maxLength")){var I=u.prop("maxLength");-1<I&&c.each(a,function(a,b){"object"==typeof b&&"*"==b.repeat&&(b.repeat=I)});p()>=I&&-1<I&&(I<f().length&&(f().length=I),!1==d().greedy&&(d().repeat=Math.round(I/f().length)),u.prop("maxLength",2*p()))}D(z);var T=!1,Z=!1;g.numericInput&&(g.isNumeric=g.numericInput);("rtl"==z.dir||g.numericInput&&g.rightAlignNumerics||g.isNumeric&&g.rightAlignNumerics)&&u.css("text-align","right");if("rtl"==z.dir||
g.numericInput){z.dir="ltr";u.removeAttr("dir");var $=u.data("_inputmask");$.isRTL=!0;u.data("_inputmask",$);A=!0}u.unbind(".inputmask");u.removeClass("focus.inputmask");u.closest("form").bind("submit",function(){K!=h().join("")&&u.change()}).bind("reset",function(){setTimeout(function(){u.trigger("setvalue")},0)});u.bind("mouseenter.inputmask",function(){!c(this).hasClass("focus.inputmask")&&g.showMaskOnHover&&this._valueGet()!=h().join("")&&J(this,h())}).bind("blur.inputmask",function(){var d=c(this),
e=this._valueGet(),k=h();d.removeClass("focus.inputmask");K!=h().join("")&&d.change();g.clearMaskOnLostFocus&&""!=e&&(e==f().join("")?this._valueSet(""):X(this));!1===O(k)&&(d.trigger("incomplete"),g.clearIncomplete&&(c.each(a,function(a,b){"object"==typeof b&&(b.buffer=b._buffer.slice(),b.lastValidPosition=-1)}),b=0,g.clearMaskOnLostFocus?this._valueSet(""):(k=f().slice(),J(this,k))))}).bind("focus.inputmask",function(){var a=c(this),b=this._valueGet();g.showMaskOnFocus&&!a.hasClass("focus.inputmask")&&
(!g.showMaskOnHover||g.showMaskOnHover&&""==b)&&this._valueGet()!=h().join("")&&J(this,h(),q(d().lastValidPosition));a.addClass("focus.inputmask");K=h().join("")}).bind("mouseleave.inputmask",function(){var a=c(this);g.clearMaskOnLostFocus&&(a.hasClass("focus.inputmask")||this._valueGet()==a.attr("placeholder")||(this._valueGet()==f().join("")||""==this._valueGet()?this._valueSet(""):X(this)))}).bind("click.inputmask",function(){var a=this;setTimeout(function(){var b=v(a),e=h();if(b.begin==b.end){var b=
g.isRTL?C(b.begin):b.begin,f=d().lastValidPosition,e=g.isNumeric?!1===g.skipRadixDance&&""!=g.radixPoint&&-1!=c.inArray(g.radixPoint,e)?g.numericInput?q(c.inArray(g.radixPoint,e)):c.inArray(g.radixPoint,e):q(f):q(f);b<e?r(b)?v(a,b):v(a,q(b)):v(a,e)}},0)}).bind("dblclick.inputmask",function(){var a=this;setTimeout(function(){v(a,0,q(d().lastValidPosition))},0)}).bind(N+".inputmask dragdrop.inputmask drop.inputmask",function(a){var b=this,d=c(b);if("propertychange"==a.type&&b._valueGet().length<=p())return!0;
setTimeout(function(){M(b,!0,!1,void 0,!0);!0===O(h())&&d.trigger("complete");d.click()},0)}).bind("setvalue.inputmask",function(){M(this,!0);K=h().join("");this._valueGet()==f().join("")&&this._valueSet("")}).bind("_keypress.inputmask",ea).bind("complete.inputmask",g.oncomplete).bind("incomplete.inputmask",g.onincomplete).bind("cleared.inputmask",g.oncleared).bind("keyup.inputmask",W);m?u.bind("input.inputmask",function(a){a=c(this);ga=h().join("");M(this,!1,!1);J(this,h());!0===O(h())&&a.trigger("complete");
a.click()}):u.bind("keydown.inputmask",da).bind("keypress.inputmask",ea);M(z,!0,!1);K=h().join("");var aa;try{aa=document.activeElement}catch(fa){}aa===z?(u.addClass("focus.inputmask"),v(z,q(d().lastValidPosition))):g.clearMaskOnLostFocus?h().join("")==f().join("")?z._valueSet(""):X(z):J(z,h());P(z)}};return this}var g=c.extend(!0,{},c.inputmask.defaults,d),w=null!==navigator.userAgent.match(/msie 10/i),t=null!==navigator.userAgent.match(/iphone/i),z=null!==navigator.userAgent.match(/android.*safari.*/i),
m=null!==navigator.userAgent.match(/android.*chrome.*/i),N=e("paste")&&!w?"paste":e("input")?"input":"propertychange",l,q=0;if("string"===typeof a)switch(a){case "mask":return f(g.alias,d),l=k(),0==l.length?this:this.each(function(){n(c.extend(!0,{},l),0).mask(this)});case "unmaskedvalue":return w=c(this),w.data("_inputmask")?(l=w.data("_inputmask").masksets,q=w.data("_inputmask").activeMasksetIndex,g=w.data("_inputmask").opts,n(l,q).unmaskedvalue(w)):w.val();case "remove":return this.each(function(){var a=
c(this);if(a.data("_inputmask")){l=a.data("_inputmask").masksets;q=a.data("_inputmask").activeMasksetIndex;g=a.data("_inputmask").opts;this._valueSet(n(l,q).unmaskedvalue(a,!0));a.removeData("_inputmask");a.unbind(".inputmask");a.removeClass("focus.inputmask");var b;Object.getOwnPropertyDescriptor&&(b=Object.getOwnPropertyDescriptor(this,"value"));b&&b.get?this._valueGet&&Object.defineProperty(this,"value",{get:this._valueGet,set:this._valueSet}):document.__lookupGetter__&&this.__lookupGetter__("value")&&
this._valueGet&&(this.__defineGetter__("value",this._valueGet),this.__defineSetter__("value",this._valueSet));try{delete this._valueGet,delete this._valueSet}catch(d){this._valueSet=this._valueGet=void 0}}});case "getemptymask":return this.data("_inputmask")?(l=this.data("_inputmask").masksets,q=this.data("_inputmask").activeMasksetIndex,l[q]._buffer.join("")):"";case "hasMaskedValue":return this.data("_inputmask")?!this.data("_inputmask").opts.autoUnmask:!1;case "isComplete":return l=this.data("_inputmask").masksets,
q=this.data("_inputmask").activeMasksetIndex,g=this.data("_inputmask").opts,n(l,q).isComplete(this[0]._valueGet().split(""));case "getmetadata":if(this.data("_inputmask"))return l=this.data("_inputmask").masksets,q=this.data("_inputmask").activeMasksetIndex,l[q].metadata;return;default:return f(a,d)||(g.mask=a),l=k(),0==l.length?this:this.each(function(){n(c.extend(!0,{},l),q).mask(this)})}else{if("object"==typeof a)return g=c.extend(!0,{},c.inputmask.defaults,a),f(g.alias,a),l=k(),0==l.length?this:
this.each(function(){n(c.extend(!0,{},l),q).mask(this)});if(void 0==a)return this.each(function(){var a=c(this).attr("data-inputmask");if(a&&""!=a)try{var a=a.replace(RegExp("'","g"),'"'),b=c.parseJSON("{"+a+"}");c.extend(!0,b,d);g=c.extend(!0,{},c.inputmask.defaults,b);f(g.alias,b);g.alias=void 0;c(this).inputmask(g)}catch(e){}})}return this})})(jQuery);
(function(c){c.extend(c.inputmask.defaults.definitions,{A:{validator:"[A-Za-z]",cardinality:1,casing:"upper"},"#":{validator:"[A-Za-z\u0410-\u044f\u0401\u04510-9]",cardinality:1,casing:"upper"}});c.extend(c.inputmask.defaults.aliases,{url:{mask:"ir",placeholder:"",separator:"",defaultPrefix:"http://",regex:{urlpre1:/[fh]/,urlpre2:/(ft|ht)/,urlpre3:/(ftp|htt)/,urlpre4:/(ftp:|http|ftps)/,urlpre5:/(ftp:\/|ftps:|http:|https)/,urlpre6:/(ftp:\/\/|ftps:\/|http:\/|https:)/,urlpre7:/(ftp:\/\/|ftps:\/\/|http:\/\/|https:\/)/,
urlpre8:/(ftp:\/\/|ftps:\/\/|http:\/\/|https:\/\/)/},definitions:{i:{validator:function(a,d,e,c,b){return!0},cardinality:8,prevalidator:function(){for(var a=[],d=0;8>d;d++)a[d]=function(){var a=d;return{validator:function(d,b,c,k,y){if(y.regex["urlpre"+(a+1)]){var n=d;0<a+1-d.length&&(n=b.join("").substring(0,a+1-d.length)+""+n);d=y.regex["urlpre"+(a+1)].test(n);if(!k&&!d){c-=a;for(k=0;k<y.defaultPrefix.length;k++)b[c]=y.defaultPrefix[k],c++;for(k=0;k<n.length-1;k++)b[c]=n[k],c++;return{pos:c}}return d}return!1},
cardinality:a}}();return a}()},r:{validator:".",cardinality:50}},insertMode:!1,autoUnmask:!1},ip:{mask:["[[x]y]z.[[x]y]z.[[x]y]z.x[yz]","[[x]y]z.[[x]y]z.[[x]y]z.[[x]y][z]"],definitions:{x:{validator:"[012]",cardinality:1,definitionSymbol:"i"},y:{validator:function(a,d,e,c,b){a=-1<e-1&&"."!=d[e-1]?d[e-1]+a:"0"+a;return/2[0-5]|[01][0-9]/.test(a)},cardinality:1,definitionSymbol:"i"},z:{validator:function(a,d,e,c,b){-1<e-1&&"."!=d[e-1]?(a=d[e-1]+a,a=-1<e-2&&"."!=d[e-2]?d[e-2]+a:"0"+a):a="00"+a;return/25[0-5]|2[0-4][0-9]|[01][0-9][0-9]/.test(a)},
cardinality:1,definitionSymbol:"i"}}}})})(jQuery);
(function(c){c.extend(c.inputmask.defaults.definitions,{h:{validator:"[01][0-9]|2[0-3]",cardinality:2,prevalidator:[{validator:"[0-2]",cardinality:1}]},s:{validator:"[0-5][0-9]",cardinality:2,prevalidator:[{validator:"[0-5]",cardinality:1}]},d:{validator:"0[1-9]|[12][0-9]|3[01]",cardinality:2,prevalidator:[{validator:"[0-3]",cardinality:1}]},m:{validator:"0[1-9]|1[012]",cardinality:2,prevalidator:[{validator:"[01]",cardinality:1}]},y:{validator:"(19|20)\\d{2}",cardinality:4,prevalidator:[{validator:"[12]",
cardinality:1},{validator:"(19|20)",cardinality:2},{validator:"(19|20)\\d",cardinality:3}]}});c.extend(c.inputmask.defaults.aliases,{"dd/mm/yyyy":{mask:"1/2/y",placeholder:"dd/mm/yyyy",regex:{val1pre:/[0-3]/,val1:/0[1-9]|[12][0-9]|3[01]/,val2pre:function(a){a=c.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|[12][0-9]|3[01])"+a+"[01])")},val2:function(a){a=c.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|[12][0-9])"+a+"(0[1-9]|1[012]))|(30"+a+"(0[13-9]|1[012]))|(31"+a+"(0[13578]|1[02]))")}},
leapday:"29/02/",separator:"/",yearrange:{minyear:1900,maxyear:2099},isInYearRange:function(a,d,e){var c=parseInt(a.concat(d.toString().slice(a.length)));a=parseInt(a.concat(e.toString().slice(a.length)));return(NaN!=c?d<=c&&c<=e:!1)||(NaN!=a?d<=a&&a<=e:!1)},determinebaseyear:function(a,d,e){var c=(new Date).getFullYear();if(a>c)return a;if(d<c){for(var c=d.toString().slice(0,2),b=d.toString().slice(2,4);d<c+e;)c--;d=c+b;return a>d?a:d}return c},onKeyUp:function(a,d,e){d=c(this);a.ctrlKey&&a.keyCode==
e.keyCode.RIGHT&&(a=new Date,d.val(a.getDate().toString()+(a.getMonth()+1).toString()+a.getFullYear().toString()))},definitions:{1:{validator:function(a,d,c,f,b){var h=b.regex.val1.test(a);return f||h||a.charAt(1)!=b.separator&&-1=="-./".indexOf(a.charAt(1))||!(h=b.regex.val1.test("0"+a.charAt(0)))?h:(d[c-1]="0",{pos:c,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var h=b.regex.val1pre.test(a);return f||h||!(h=b.regex.val1.test("0"+a))?h:(d[c]="0",c++,{pos:c})},cardinality:1}]},
2:{validator:function(a,d,c,f,b){var h=d.join("").substr(0,3),k=b.regex.val2(b.separator).test(h+a);return f||k||a.charAt(1)!=b.separator&&-1=="-./".indexOf(a.charAt(1))||!(k=b.regex.val2(b.separator).test(h+"0"+a.charAt(0)))?k:(d[c-1]="0",{pos:c,c:a.charAt(0)})},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var h=d.join("").substr(0,3),k=b.regex.val2pre(b.separator).test(h+a);return f||k||!(k=b.regex.val2(b.separator).test(h+"0"+a))?k:(d[c]="0",c++,{pos:c})},cardinality:1}]},y:{validator:function(a,
d,c,f,b){if(b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear)){if(d.join("").substr(0,6)!=b.leapday)return!0;a=parseInt(a,10);return 0===a%4?0===a%100?0===a%400?!0:!1:!0:!1}return!1},cardinality:4,prevalidator:[{validator:function(a,d,c,f,b){var h=b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear);if(!f&&!h){f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,a+"0").toString().slice(0,1);if(h=b.isInYearRange(f+a,b.yearrange.minyear,b.yearrange.maxyear))return d[c++]=f[0],
{pos:c};f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,a+"0").toString().slice(0,2);if(h=b.isInYearRange(f+a,b.yearrange.minyear,b.yearrange.maxyear))return d[c++]=f[0],d[c++]=f[1],{pos:c}}return h},cardinality:1},{validator:function(a,d,c,f,b){var h=b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear);if(!f&&!h){f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,a).toString().slice(0,2);if(h=b.isInYearRange(a[0]+f[1]+a[1],b.yearrange.minyear,b.yearrange.maxyear))return d[c++]=
f[1],{pos:c};f=b.determinebaseyear(b.yearrange.minyear,b.yearrange.maxyear,a).toString().slice(0,2);b.isInYearRange(f+a,b.yearrange.minyear,b.yearrange.maxyear)?d.join("").substr(0,6)!=b.leapday?h=!0:(b=parseInt(a,10),h=0===b%4?0===b%100?0===b%400?!0:!1:!0:!1):h=!1;if(h)return d[c-1]=f[0],d[c++]=f[1],d[c++]=a[0],{pos:c}}return h},cardinality:2},{validator:function(a,d,c,f,b){return b.isInYearRange(a,b.yearrange.minyear,b.yearrange.maxyear)},cardinality:3}]}},insertMode:!1,autoUnmask:!1},"mm/dd/yyyy":{placeholder:"mm/dd/yyyy",
alias:"dd/mm/yyyy",regex:{val2pre:function(a){a=c.inputmask.escapeRegex.call(this,a);return RegExp("((0[13-9]|1[012])"+a+"[0-3])|(02"+a+"[0-2])")},val2:function(a){a=c.inputmask.escapeRegex.call(this,a);return RegExp("((0[1-9]|1[012])"+a+"(0[1-9]|[12][0-9]))|((0[13-9]|1[012])"+a+"30)|((0[13578]|1[02])"+a+"31)")},val1pre:/[01]/,val1:/0[1-9]|1[012]/},leapday:"02/29/",onKeyUp:function(a,d,e){d=c(this);a.ctrlKey&&a.keyCode==e.keyCode.RIGHT&&(a=new Date,d.val((a.getMonth()+1).toString()+a.getDate().toString()+
a.getFullYear().toString()))}},"yyyy/mm/dd":{mask:"y/1/2",placeholder:"yyyy/mm/dd",alias:"mm/dd/yyyy",leapday:"/02/29",onKeyUp:function(a,d,e){d=c(this);a.ctrlKey&&a.keyCode==e.keyCode.RIGHT&&(a=new Date,d.val(a.getFullYear().toString()+(a.getMonth()+1).toString()+a.getDate().toString()))},definitions:{2:{validator:function(a,d,c,f,b){var h=d.join("").substr(5,3),k=b.regex.val2(b.separator).test(h+a);if(!(f||k||a.charAt(1)!=b.separator&&-1=="-./".indexOf(a.charAt(1)))&&(k=b.regex.val2(b.separator).test(h+
"0"+a.charAt(0))))return d[c-1]="0",{pos:c,c:a.charAt(0)};if(k){if(d.join("").substr(4,4)+a!=b.leapday)return!0;a=parseInt(d.join("").substr(0,4),10);return 0===a%4?0===a%100?0===a%400?!0:!1:!0:!1}return k},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var h=d.join("").substr(5,3),k=b.regex.val2pre(b.separator).test(h+a);return f||k||!(k=b.regex.val2(b.separator).test(h+"0"+a))?k:(d[c]="0",c++,{pos:c})},cardinality:1}]}}},"dd.mm.yyyy":{mask:"1.2.y",placeholder:"dd.mm.yyyy",leapday:"29.02.",
separator:".",alias:"dd/mm/yyyy"},"dd-mm-yyyy":{mask:"1-2-y",placeholder:"dd-mm-yyyy",leapday:"29-02-",separator:"-",alias:"dd/mm/yyyy"},"mm.dd.yyyy":{mask:"1.2.y",placeholder:"mm.dd.yyyy",leapday:"02.29.",separator:".",alias:"mm/dd/yyyy"},"mm-dd-yyyy":{mask:"1-2-y",placeholder:"mm-dd-yyyy",leapday:"02-29-",separator:"-",alias:"mm/dd/yyyy"},"yyyy.mm.dd":{mask:"y.1.2",placeholder:"yyyy.mm.dd",leapday:".02.29",separator:".",alias:"yyyy/mm/dd"},"yyyy-mm-dd":{mask:"y-1-2",placeholder:"yyyy-mm-dd",leapday:"-02-29",
separator:"-",alias:"yyyy/mm/dd"},datetime:{mask:"1/2/y h:s",placeholder:"dd/mm/yyyy hh:mm",alias:"dd/mm/yyyy",regex:{hrspre:/[012]/,hrs24:/2[0-9]|1[3-9]/,hrs:/[01][0-9]|2[0-3]/,ampm:/^[a|p|A|P][m|M]/},timeseparator:":",hourFormat:"24",definitions:{h:{validator:function(a,d,c,f,b){var h=b.regex.hrs.test(a);return f||h||a.charAt(1)!=b.timeseparator&&-1=="-.:".indexOf(a.charAt(1))||!(h=b.regex.hrs.test("0"+a.charAt(0)))?h&&"24"!==b.hourFormat&&b.regex.hrs24.test(a)?(a=parseInt(a,10),d[c+5]=24==a?"a":
"p",d[c+6]="m",a-=12,10>a?(d[c]=a.toString(),d[c-1]="0"):(d[c]=a.toString().charAt(1),d[c-1]=a.toString().charAt(0)),{pos:c,c:d[c]}):h:(d[c-1]="0",d[c]=a.charAt(0),c++,{pos:c})},cardinality:2,prevalidator:[{validator:function(a,d,c,f,b){var h=b.regex.hrspre.test(a);return f||h||!(h=b.regex.hrs.test("0"+a))?h:(d[c]="0",c++,{pos:c})},cardinality:1}]},t:{validator:function(a,c,e,f,b){return b.regex.ampm.test(a+"m")},casing:"lower",cardinality:1}},insertMode:!1,autoUnmask:!1},datetime12:{mask:"1/2/y h:s t\\m",
placeholder:"dd/mm/yyyy hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"h:s t":{mask:"h:s t\\m",placeholder:"hh:mm xm",alias:"datetime",hourFormat:"12"},"hh:mm:ss":{mask:"h:s:s",autoUnmask:!1},"hh:mm":{mask:"h:s",autoUnmask:!1},date:{alias:"dd/mm/yyyy"},"mm/yyyy":{mask:"1/y",placeholder:"mm/yyyy",leapday:"donotuse",separator:"/",alias:"mm/dd/yyyy"}})})(jQuery);
(function(c){c.extend(c.inputmask.defaults.aliases,{decimal:{mask:"~",placeholder:"",repeat:"*",greedy:!1,numericInput:!1,isNumeric:!0,digits:"*",groupSeparator:"",radixPoint:".",groupSize:3,autoGroup:!1,allowPlus:!0,allowMinus:!0,integerDigits:"*",defaultValue:"",prefix:"",suffix:"",getMaskLength:function(a,d,e,f,b){var h=a.length;d||("*"==e?h=f.length+1:1<e&&(h+=a.length*(e-1)));a=c.inputmask.escapeRegex.call(this,b.groupSeparator);b=c.inputmask.escapeRegex.call(this,b.radixPoint);f=f.join("");
b=f.replace(RegExp(a,"g"),"").replace(RegExp(b),"");return h+(f.length-b.length)},postFormat:function(a,d,e,f){if(""==f.groupSeparator)return d;var b=a.slice();c.inArray(f.radixPoint,a);e||b.splice(d,0,"?");b=b.join("");if(f.autoGroup||e&&-1!=b.indexOf(f.groupSeparator)){for(var h=c.inputmask.escapeRegex.call(this,f.groupSeparator),b=b.replace(RegExp(h,"g"),""),h=b.split(f.radixPoint),b=h[0],k=RegExp("([-+]?[\\d?]+)([\\d?]{"+f.groupSize+"})");k.test(b);)b=b.replace(k,"$1"+f.groupSeparator+"$2"),b=
b.replace(f.groupSeparator+f.groupSeparator,f.groupSeparator);1<h.length&&(b+=f.radixPoint+h[1])}a.length=b.length;f=0;for(h=b.length;f<h;f++)a[f]=b.charAt(f);b=c.inArray("?",a);e||a.splice(b,1);return e?d:b},regex:{number:function(a){var d=c.inputmask.escapeRegex.call(this,a.groupSeparator),e=c.inputmask.escapeRegex.call(this,a.radixPoint),f=isNaN(a.digits)?a.digits:"{0,"+a.digits+"}";return RegExp("^"+("["+(a.allowPlus?"+":"")+(a.allowMinus?"-":"")+"]?")+"(\\d+|\\d{1,"+a.groupSize+"}(("+d+"\\d{"+
a.groupSize+"})?)+)("+e+"\\d"+f+")?$")}},onKeyDown:function(a,d,e){var f=c(this);if(a.keyCode==e.keyCode.TAB){if(a=c.inArray(e.radixPoint,d),-1!=a){for(var b=f.data("_inputmask").masksets,f=f.data("_inputmask").activeMasksetIndex,h=1;h<=e.digits&&h<e.getMaskLength(b[f]._buffer,b[f].greedy,b[f].repeat,d,e);h++)if(void 0==d[a+h]||""==d[a+h])d[a+h]="0";this._valueSet(d.join(""))}}else if(a.keyCode==e.keyCode.DELETE||a.keyCode==e.keyCode.BACKSPACE)return e.postFormat(d,0,!0,e),this._valueSet(d.join("")),
!0},definitions:{"~":{validator:function(a,d,e,f,b){if(""==a)return!1;if(!f&&1>=e&&"0"===d[0]&&/[\d-]/.test(a)&&1==d.length)return d[0]="",{pos:0};var h=f?d.slice(0,e):d.slice();h.splice(e,0,a);var h=h.join(""),k=c.inputmask.escapeRegex.call(this,b.groupSeparator),h=h.replace(RegExp(k,"g"),""),k=b.regex.number(b).test(h);if(!k&&(h+="0",k=b.regex.number(b).test(h),!k)){k=h.lastIndexOf(b.groupSeparator);for(i=h.length-k;3>=i;i++)h+="0";k=b.regex.number(b).test(h);if(!k&&!f&&a==b.radixPoint&&(k=b.regex.number(b).test("0"+
h+"0")))return d[e]="0",e++,{pos:e}}return!1==k||f||a==b.radixPoint?k:{pos:b.postFormat(d,e,!1,b)}},cardinality:1,prevalidator:null}},insertMode:!0,autoUnmask:!1},integer:{regex:{number:function(a){var d=c.inputmask.escapeRegex.call(this,a.groupSeparator);return RegExp("^"+(a.allowPlus||a.allowMinus?"["+(a.allowPlus?"+":"")+(a.allowMinus?"-":"")+"]?":"")+"(\\d+|\\d{1,"+a.groupSize+"}(("+d+"\\d{"+a.groupSize+"})?)+)$")}},alias:"decimal"}})})(jQuery);
(function(c){c.extend(c.inputmask.defaults.aliases,{Regex:{mask:"r",greedy:!1,repeat:"*",regex:null,regexTokens:null,tokenizer:/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,quantifierFilter:/[0-9]+[^,]/,definitions:{r:{validator:function(a,c,e,f,b){function h(){this.matches=[];this.isLiteral=this.isQuantifier=this.isGroup=!1}function k(){var a=
new h,c,d=[];for(b.regexTokens=[];c=b.tokenizer.exec(b.regex);)switch(c=c[0],c.charAt(0)){case "[":case "\\":0<d.length?d[d.length-1].matches.push(c):a.matches.push(c);break;case "(":!a.isGroup&&0<a.matches.length&&b.regexTokens.push(a);a=new h;a.isGroup=!0;d.push(a);break;case ")":c=d.pop();0<d.length?d[d.length-1].matches.push(c):(b.regexTokens.push(c),a=new h);break;case "{":var e=new h;e.isQuantifier=!0;e.matches.push(c);0<d.length?d[d.length-1].matches.push(e):a.matches.push(e);break;default:e=
new h,e.isLiteral=!0,e.matches.push(c),0<d.length?d[d.length-1].matches.push(e):a.matches.push(e)}0<a.matches.length&&b.regexTokens.push(a)}function y(a,c){var d=!1;c&&(n+="(",g++);for(var e=0;e<a.matches.length;e++){var f=a.matches[e];if(!0==f.isGroup)d=y(f,!0);else if(!0==f.isQuantifier){for(var f=f.matches[0],h=b.quantifierFilter.exec(f)[0].replace("}",""),h=n+"{1,"+h+"}",k=0;k<g;k++)h+=")";d=RegExp("^("+h+")$");d=d.test(w);n+=f}else if(!0==f.isLiteral){for(var f=f.matches[0],h=n,R="",k=0;k<g;k++)R+=
")";for(k=0;k<f.length&&!(h=(h+f[k]).replace(/\|$/,""),d=RegExp("^("+h+R+")$"),d=d.test(w));k++);n+=f}else{n+=f;h=n.replace(/\|$/,"");for(k=0;k<g;k++)h+=")";d=RegExp("^("+h+")$");d=d.test(w)}if(d)break}c&&(n+=")",g--);return d}null==b.regexTokens&&k();f=c.slice();var n="";c=!1;var g=0;f.splice(e,0,a);var w=f.join("");for(a=0;a<b.regexTokens.length&&!(h=b.regexTokens[a],c=y(h,h.isGroup));a++);return c},cardinality:1}}}})})(jQuery);
(function(c){c.extend(c.inputmask.defaults.aliases,{phone:{url:"phone-codes/phone-codes.json",mask:function(a){a.definitions={p:{validator:function(){return!1},cardinality:1},"#":{validator:"[0-9]",cardinality:1}};var d=[];c.ajax({url:a.url,async:!1,dataType:"json",success:function(a){d=a}});d.splice(0,0,"+p(ppp)ppp-pppp");return d}}})})(jQuery);
