angular-input-masks
Version:
Personalized input masks for AngularJS
1 lines • 21 kB
JavaScript
!function i(s,u,o){function c(r,e){if(!u[r]){if(!s[r]){var n="function"==typeof require&&require;if(!e&&n)return n(r,!0);if(l)return l(r,!0);var t=new Error("Cannot find module '"+r+"'");throw t.code="MODULE_NOT_FOUND",t}var a=u[r]={exports:{}};s[r][0].call(a.exports,function(e){return c(s[r][1][e]||e)},a,a.exports,i,s,u,o)}return u[r].exports}for(var l="function"==typeof require&&require,e=0;e<o.length;e++)c(o[e]);return c}({1:[function(e,r,n){"use strict";r.exports=angular.module("ui.utils.masks",[e("./global/global-masks"),e("./br/br-masks"),e("./ch/ch-masks"),e("./fr/fr-masks"),e("./us/us-masks")]).name},{"./br/br-masks":3,"./ch/ch-masks":12,"./fr/fr-masks":14,"./global/global-masks":18,"./us/us-masks":29}],2:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("00000.00000 00000.000000 00000.000000 0 00000000000000");r.exports=a({clearValue:function(e){return e.replace(/[^0-9]/g,"").slice(0,47)},format:function(e){return 0===e.length?e:i.apply(e).replace(/[^0-9]$/,"")},validations:{brBoletoBancario:function(e){return 47===e.length}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],3:[function(e,r,n){"use strict";var t=angular.module("ui.utils.masks.br",[]).directive("uiBrBoletoBancarioMask",e("./boleto-bancario/boleto-bancario")).directive("uiBrCarPlateMask",e("./car-plate/car-plate")).directive("uiBrCepMask",e("./cep/cep")).directive("uiBrCnpjMask",e("./cnpj/cnpj")).directive("uiBrCpfMask",e("./cpf/cpf")).directive("uiBrCpfcnpjMask",e("./cpf-cnpj/cpf-cnpj")).directive("uiBrIeMask",e("./inscricao-estadual/ie")).directive("uiNfeAccessKeyMask",e("./nfe/nfe")).directive("uiBrPhoneNumberMask",e("./phone/br-phone"));r.exports=t.name},{"./boleto-bancario/boleto-bancario":2,"./car-plate/car-plate":4,"./cep/cep":5,"./cnpj/cnpj":6,"./cpf-cnpj/cpf-cnpj":7,"./cpf/cpf":8,"./inscricao-estadual/ie":9,"./nfe/nfe":10,"./phone/br-phone":11}],4:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("UUU-0000");r.exports=a({clearValue:function(e){return e.replace(/[^a-zA-Z0-9]/g,"").slice(0,7)},format:function(e){return(i.apply(e)||"").replace(/[^a-zA-Z0-9]$/,"")},validations:{carPlate:function(e){return 7===e.length}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],5:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("00000-000");r.exports=a({clearValue:function(e){return e.toString().replace(/[^0-9]/g,"").slice(0,8)},format:function(e){return(i.apply(e)||"").replace(/[^0-9]$/,"")},validations:{cep:function(e){return 8===e.toString().trim().length}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],6:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("br-validations"),i=e("../../helpers/mask-factory"),s=new t("00.000.000/0000-00");r.exports=i({clearValue:function(e){return e.replace(/[^\d]/g,"").slice(0,14)},format:function(e){return(s.apply(e)||"").trim().replace(/[^0-9]$/,"")},validations:{cnpj:function(e){return a.cnpj.validate(e)}}})},{"../../helpers/mask-factory":24,"br-validations":void 0,"string-mask":void 0}],7:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("br-validations"),i=e("../../helpers/mask-factory"),s=new t("00.000.000/0000-00"),u=new t("000.000.000-00");r.exports=i({clearValue:function(e){return e.replace(/[^\d]/g,"").slice(0,14)},format:function(e){return(11<e.length?s.apply(e):u.apply(e)||"").trim().replace(/[^0-9]$/,"")},validations:{cpf:function(e){return 11<e.length||a.cpf.validate(e)},cnpj:function(e){return e.length<=11||a.cnpj.validate(e)}}})},{"../../helpers/mask-factory":24,"br-validations":void 0,"string-mask":void 0}],8:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("br-validations"),i=e("../../helpers/mask-factory"),s=new t("000.000.000-00");r.exports=i({clearValue:function(e){return e.replace(/[^\d]/g,"").slice(0,11)},format:function(e){return(s.apply(e)||"").trim().replace(/[^0-9]$/,"")},validations:{cpf:function(e){return a.cpf.validate(e)}}})},{"../../helpers/mask-factory":24,"br-validations":void 0,"string-mask":void 0}],9:[function(e,r,n){"use strict";var t=e("string-mask"),c=e("br-validations"),a={AC:[{mask:new t("00.000.000/000-00")}],AL:[{mask:new t("000000000")}],AM:[{mask:new t("00.000.000-0")}],AP:[{mask:new t("000000000")}],BA:[{chars:8,mask:new t("000000-00")},{mask:new t("0000000-00")}],CE:[{mask:new t("00000000-0")}],DF:[{mask:new t("00000000000-00")}],ES:[{mask:new t("00000000-0")}],GO:[{mask:new t("00.000.000-0")}],MA:[{mask:new t("000000000")}],MG:[{mask:new t("000.000.000/0000")}],MS:[{mask:new t("000000000")}],MT:[{mask:new t("0000000000-0")}],PA:[{mask:new t("00-000000-0")}],PB:[{mask:new t("00000000-0")}],PE:[{chars:9,mask:new t("0000000-00")},{mask:new t("00.0.000.0000000-0")}],PI:[{mask:new t("000000000")}],PR:[{mask:new t("000.00000-00")}],RJ:[{mask:new t("00.000.00-0")}],RN:[{chars:9,mask:new t("00.000.000-0")},{mask:new t("00.0.000.000-0")}],RO:[{mask:new t("0000000000000-0")}],RR:[{mask:new t("00000000-0")}],RS:[{mask:new t("000/0000000")}],SC:[{mask:new t("000.000.000")}],SE:[{mask:new t("00000000-0")}],SP:[{mask:new t("000.000.000.000")},{mask:new t("-00000000.0/000")}],TO:[{mask:new t("00000000000")}]};function i(s){function u(e){return e?e.replace(/[^0-9]/g,""):e}function o(e,r){var n=function(e,r){if(e&&a[e]){if("SP"===e&&/^P/i.test(r))return a.SP[1].mask;for(var n=a[e],t=0;n[t].chars&&n[t].chars<u(r).length&&t<n.length-1;)t++;return n[t].mask}}(r,e);if(!n)return e;var t=n.process(u(e)).result||"";return t=t.trim().replace(/[^0-9]$/,""),"SP"===r&&/^p/i.test(e)?"P"+t:t}return{restrict:"A",require:"ngModel",link:function(e,r,n,t){var a=(s(n.uiBrIeMask)(e)||"").toUpperCase();function i(e){if(t.$isEmpty(e))return e;var r=o(e,a),n=u(r);return t.$viewValue!==r&&(t.$setViewValue(r),t.$render()),a&&"SP"===a.toUpperCase()&&/^p/i.test(e)?"P"+n:n}t.$formatters.push(function(e){return t.$isEmpty(e)?e:o(e,a)}),t.$parsers.push(i),t.$validators.ie=function(e){return t.$isEmpty(e)||c.ie(a).validate(e)},e.$watch(n.uiBrIeMask,function(e){a=(e||"").toUpperCase(),i(t.$viewValue),t.$validate()})}}}i.$inject=["$parse"],r.exports=i},{"br-validations":void 0,"string-mask":void 0}],10:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000");r.exports=a({clearValue:function(e){return e.replace(/[^0-9]/g,"").slice(0,44)},format:function(e){return(i.apply(e)||"").replace(/[^0-9]$/,"")},validations:{nfeAccessKey:function(e){return 44===e.length}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],11:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i={countryCode:new t("+00 (00) 0000-0000"),areaCode:new t("(00) 0000-0000"),simple:new t("0000-0000")},s={countryCode:new t("+00 (00) 00000-0000"),areaCode:new t("(00) 00000-0000"),simple:new t("00000-0000")},u={countryCode:null,areaCode:null,simple:new t("0000-000-0000")};r.exports=a({clearValue:function(e){return e.toString().replace(/[^0-9]/g,"").slice(0,13)},format:function(e){return(0===e.indexOf("0800")?u.simple.apply(e):e.length<9?i.simple.apply(e)||"":e.length<10?s.simple.apply(e):e.length<11?i.areaCode.apply(e):e.length<12?s.areaCode.apply(e):e.length<13?i.countryCode.apply(e):s.countryCode.apply(e)).trim().replace(/[^0-9]$/,"")},getModelValue:function(e,r){var n=this.clearValue(e);return"number"===r?parseInt(n):n},validations:{brPhoneNumber:function(e){var r=e&&e.toString().length;return 8<=r&&r<=13}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],12:[function(e,r,n){"use strict";var t=angular.module("ui.utils.masks.ch",[]).directive("uiChPhoneNumberMask",e("./phone/ch-phone"));r.exports=t.name},{"./phone/ch-phone":13}],13:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("+00 00 000 00 00");r.exports=a({clearValue:function(e){return e.toString().replace(/[^0-9]/g,"").slice(0,11)},format:function(e){return(i.apply(e)||"").trim().replace(/[^0-9]$/,"")},validations:{chPhoneNumber:function(e){return 11===(e&&e.toString().length)}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],14:[function(e,r,n){"use strict";var t=angular.module("ui.utils.masks.fr",[]).directive("uiFrPhoneNumberMask",e("./phone/fr-phone"));r.exports=t.name},{"./phone/fr-phone":15}],15:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("00 00 00 00 00");r.exports=a({clearValue:function(e){return e.toString().replace(/[^0-9]/g,"").slice(0,10)},format:function(e){return(i.apply(e)||"").trim().replace(/[^0-9]$/,"")},validations:{frPhoneNumber:function(e){return 10===(e&&e.toString().length)}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],16:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("0000 0000 0000 0000");r.exports=a({clearValue:function(e){return e.toString().replace(/[^0-9]/g,"").slice(0,16)},format:function(e){return(i.apply(e)||"").trim().replace(/[^0-9]$/,"")},validations:{creditCard:function(e){return 16===(e&&e.toString().length)}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],17:[function(e,r,n){"use strict";var u=e("date-fns/format"),o=e("date-fns/parse"),c=e("date-fns/isValid"),l=e("string-mask");var t={"pt-br":"DD/MM/YYYY","es-ar":"DD/MM/YYYY","es-mx":"DD/MM/YYYY",es:"DD/MM/YYYY","en-us":"MM/DD/YYYY",en:"MM/DD/YYYY","fr-fr":"DD/MM/YYYY",fr:"DD/MM/YYYY",ru:"DD.MM.YYYY"};function a(e){var s=t[e.id]||"YYYY-MM-DD";return{restrict:"A",require:"ngModel",link:function(e,r,n,t){n.parse=n.parse||"true",s=n.uiDateMask||s;var a=new l(s.replace(/[YMD]/g,"0"));function i(e){if(t.$isEmpty(e))return null;var r=e;return("object"==typeof e||/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}([-+][0-9]{2}:[0-9]{2}|Z)$/.test(e.toString()))&&(r=u(e,s)),r=r.replace(/[^0-9]/g,""),(a.apply(r)||"").trim().replace(/[^0-9]$/,"")}t.$formatters.push(i),t.$parsers.push(function(e){if(t.$isEmpty(e))return e;var r=i(e);return t.$viewValue!==r&&(t.$setViewValue(r),t.$render()),"false"===n.parse?r:o(r,s,new Date)}),t.$validators.date=function(e,r){return!!t.$isEmpty(e)||c(o(r,s,new Date))&&r.length===s.length}}}}a.$inject=["$locale"],r.exports=a},{"date-fns/format":void 0,"date-fns/isValid":void 0,"date-fns/parse":void 0,"string-mask":void 0}],18:[function(e,r,n){"use strict";var t=angular.module("ui.utils.masks.global",[]).directive("uiCreditCardMask",e("./credit-card/credit-card")).directive("uiDateMask",e("./date/date")).directive("uiMoneyMask",e("./money/money")).directive("uiNumberMask",e("./number/number")).directive("uiPercentageMask",e("./percentage/percentage")).directive("uiScientificNotationMask",e("./scientific-notation/scientific-notation")).directive("uiTimeMask",e("./time/time"));r.exports=t.name},{"./credit-card/credit-card":16,"./date/date":17,"./money/money":19,"./number/number":20,"./percentage/percentage":21,"./scientific-notation/scientific-notation":22,"./time/time":23}],19:[function(e,r,n){"use strict";var k=e("string-mask"),h=e("../../helpers/validators"),$=e("../../helpers/pre-formatters");function t(v,g){return{restrict:"A",require:"ngModel",link:function(e,r,i,s){var t=v.NUMBER_FORMATS.DECIMAL_SEP,a=v.NUMBER_FORMATS.GROUP_SEP,u=v.NUMBER_FORMATS.CURRENCY_SYM,o=" ",c=g(i.uiMoneyMask)(e),l=!1;function n(e){var r=0<e?t+new Array(e+1).join("0"):"",n="#"+a+"##0"+r;return angular.isDefined(i.uiCurrencyAfter)?n+=o:n=o+n,new k(n,{reverse:!0})}r.bind("keydown keypress",function(e){l=8===e.which}),angular.isDefined(i.uiDecimalDelimiter)&&(t=i.uiDecimalDelimiter),angular.isDefined(i.uiThousandsDelimiter)&&(a=i.uiThousandsDelimiter),angular.isDefined(i.uiHideGroupSep)&&(a=""),angular.isDefined(i.uiHideSpace)&&(o=""),angular.isDefined(i.currencySymbol)&&(u=i.currencySymbol,0===i.currencySymbol.length&&(o="")),isNaN(c)&&(c=2);var p,f,m=n(c=parseInt(c));function d(e){if(s.$isEmpty(e))return null;var r,n=e.replace(/[^\d]+/g,"");if(n=(n=n.replace(/^[0]+([1-9])/,"$1"))||"0",l&&angular.isDefined(i.uiCurrencyAfter)&&0!==n&&(n=n.substring(0,n.length-1),l=!1),r=angular.isDefined(i.uiCurrencyAfter)?m.apply(n)+u:u+m.apply(n),angular.isDefined(i.uiNegativeNumber)){var t="-"===e[0];"-"===e.slice(-1)^t&&n&&(n*=-1,r="-"+r)}e!==r&&(s.$setViewValue(r),s.$render());var a=parseInt(r.replace(/[^\d\-]+/g,""));return isNaN(a)?null:(angular.isDefined(i.uiIntegerModel)||(a/=Math.pow(10,c)),a)}(s.$formatters.push(function(e){if(s.$isEmpty(e))return"";angular.isDefined(i.uiIntegerModel)&&(e/=Math.pow(10,c));var r=angular.isDefined(i.uiNegativeNumber)&&e<0?"-":"",n=$.prepareNumberToFormatter(e,c);return angular.isDefined(i.uiCurrencyAfter)?r+m.apply(n)+u:r+u+m.apply(n)}),s.$parsers.push(d),i.uiMoneyMask&&e.$watch(i.uiMoneyMask,function(e){c=isNaN(e)?2:e,c=parseInt(c),m=n(c),d(s.$viewValue)}),i.currency&&e.$watch(i.currency,function(e){u=e,m=n(c),d(s.$viewValue)}),i.min)&&(s.$validators.min=function(e){return h.minNumber(s,e,p)},e.$watch(i.min,function(e){p=e,s.$validate()}));i.max&&(s.$validators.max=function(e){return h.maxNumber(s,e,f)},e.$watch(i.max,function(e){f=e,s.$validate()}))}}}t.$inject=["$locale","$parse"],r.exports=t},{"../../helpers/pre-formatters":26,"../../helpers/validators":27,"string-mask":void 0}],20:[function(e,r,n){"use strict";var d=e("../../helpers/validators"),v=e("../../helpers/number-mask-builder"),g=e("../../helpers/pre-formatters");function t(f,m){return{restrict:"A",require:"ngModel",link:function(e,r,i,s){var n=f.NUMBER_FORMATS.DECIMAL_SEP,t=f.NUMBER_FORMATS.GROUP_SEP,a=m(i.uiNumberMask)(e);angular.isDefined(i.uiHideGroupSep)&&(t=""),isNaN(a)&&(a=2);var u,o,c=v.viewMask(a,n,t),l=v.modelMask(a);function p(e){if(s.$isEmpty(e))return null;var r=g.clearDelimitersAndLeadingZeros(e)||"0",n=c.apply(r),t=parseFloat(l.apply(r));if(angular.isDefined(i.uiNegativeNumber)){var a="-"===e[0];("-"===e.slice(-1)^a||"-"===e)&&(n="-"+(0!==(t*=-1)?n:""))}return s.$viewValue!==n&&(s.$setViewValue(n),s.$render()),t}(r.on("blur",function(){"-"===s.$viewValue&&(s.$setViewValue(""),s.$render())}),s.$formatters.push(function(e){if(s.$isEmpty(e))return e;var r=angular.isDefined(i.uiNegativeNumber)&&e<0?"-":"",n=g.prepareNumberToFormatter(e,a);return r+c.apply(n)}),s.$parsers.push(p),i.uiNumberMask&&e.$watch(i.uiNumberMask,function(e){a=isNaN(e)?2:e,c=v.viewMask(a,n,t),l=v.modelMask(a),p(s.$viewValue)}),i.min)&&(s.$validators.min=function(e){return d.minNumber(s,e,u)},e.$watch(i.min,function(e){u=e,s.$validate()}));i.max&&(s.$validators.max=function(e){return d.maxNumber(s,e,o)},e.$watch(i.max,function(e){o=e,s.$validate()}))}}}t.$inject=["$locale","$parse"],r.exports=t},{"../../helpers/number-mask-builder":25,"../../helpers/pre-formatters":26,"../../helpers/validators":27}],21:[function(e,r,n){"use strict";var h=e("../../helpers/validators"),$=e("../../helpers/number-mask-builder"),y=e("../../helpers/pre-formatters");function t(k){return{restrict:"A",require:"ngModel",link:function(e,r,s,u){var n=k.NUMBER_FORMATS.DECIMAL_SEP,i=!1;r.bind("keydown keypress",function(e){i=8===e.which});var t=k.NUMBER_FORMATS.GROUP_SEP;angular.isDefined(s.uiHideGroupSep)&&(t="");var o=" %";angular.isDefined(s.uiHidePercentageSign)?o="":angular.isDefined(s.uiHideSpace)&&(o="%");var c=parseInt(s.uiPercentageMask);isNaN(c)&&(c=2);var l={multiplier:100,decimalMask:2};angular.isDefined(s.uiPercentageValue)&&(l.multiplier=1,l.decimalMask=0);var a,p,f=c+l.decimalMask,m=$.viewMask(c,n,t),d=$.modelMask(f);function v(e){if(u.$isEmpty(e))return e;var r,n,t,a=angular.isDefined(s.uiNegativeNumber)&&e<0?"-":"",i=(r=e,n=c,t=l.multiplier,y.clearDelimitersAndLeadingZeros((parseFloat(r)*t).toFixed(n)));return a+m.apply(i)+o}function g(e){if(u.$isEmpty(e))return null;var r=y.clearDelimitersAndLeadingZeros(e)||"0";""!==o&&1<e.length&&-1===e.indexOf("%")&&(r=r.slice(0,r.length-1)),i&&1===e.length&&"%"!==e&&(r="0");var n=m.apply(r)+o,t=parseFloat(d.apply(r));if(angular.isDefined(s.uiNegativeNumber)){var a="-"===e[0];("-"===e.slice(-1)^a||"-"===e)&&(n="-"+(0!==(t*=-1)?n:""))}return u.$viewValue!==n&&(u.$setViewValue(n),u.$render()),t}(u.$formatters.push(v),u.$parsers.push(g),s.uiPercentageMask&&e.$watch(s.uiPercentageMask,function(e){c=isNaN(e)?2:e,f=c+l.decimalMask,m=$.viewMask(c,n,t),d=$.modelMask(f),g(v(u.$modelValue))}),s.min)&&(u.$validators.min=function(e){return h.minNumber(u,e,a)},e.$watch(s.min,function(e){a=e,u.$validate()}));s.max&&(u.$validators.max=function(e){return h.maxNumber(u,e,p)},e.$watch(s.max,function(e){p=e,u.$validate()}))}}}t.$inject=["$locale"],r.exports=t},{"../../helpers/number-mask-builder":25,"../../helpers/pre-formatters":26,"../../helpers/validators":27}],22:[function(e,r,n){"use strict";var t=e("string-mask");function a(e,n){var p=e.NUMBER_FORMATS.DECIMAL_SEP;return{restrict:"A",require:"ngModel",link:function(e,r,u,o){var c=n(u.uiScientificNotationMask)(e);isNaN(c)&&(c=2);var l=function(e){var r="0";if(0<e){r+=p;for(var n=0;n<e;n++)r+="0"}return new t(r,{reverse:!0})}(c);function i(e){if(o.$isEmpty(e))return e;var r,n;e="number"==typeof e?e.toExponential(c):e.toString().replace(p,".");var t,a={integerPartOfSignificand:(t=e.toString().match(/(-?[0-9]*)[\.]?([0-9]*)?[Ee]?([\+-]?[0-9]*)?/))[1],decimalPartOfSignificand:t[2],exponent:0|t[3]},i=a.integerPartOfSignificand||0,s=i.toString();return angular.isDefined(a.decimalPartOfSignificand)&&(s+=a.decimalPartOfSignificand),(1<=i||i<=-1)&&(angular.isDefined(a.decimalPartOfSignificand)&&a.decimalPartOfSignificand.length>c||0===c&&2<=s.length)&&(n=s.slice(c+1,s.length),s=s.slice(0,c+1)),r=l.apply(s),0!==a.exponent&&(n=a.exponent),angular.isDefined(n)&&(r+="e"+n),(angular.isDefined(u.uiNegativeNumber)&&"-"===e[0]?"-":"")+r}o.$formatters.push(i),o.$parsers.push(function(e){if(o.$isEmpty(e))return e;var r=/e-/.test(e),n=i(e.replace("e-","e")),t="-"===e.slice(-1);t^r&&(n=n.replace(/(e[-]?)/,"e-")),t&&r&&(n="-"!==n[0]?"-"+n:n.replace(/^(-)/,""));var a=parseFloat(n.replace(p,"."));return o.$viewValue!==n&&(o.$setViewValue(n),o.$render()),a}),o.$validators.max=function(e){return o.$isEmpty(e)||e<Number.MAX_VALUE}}}}a.$inject=["$locale","$parse"],r.exports=a},{"string-mask":void 0}],23:[function(e,r,n){"use strict";var c=e("string-mask");r.exports=function(){return{restrict:"A",require:"ngModel",link:function(e,r,n,i){var t="00:00:00";angular.isDefined(n.uiTimeMask)&&"short"===n.uiTimeMask&&(t="00:00");var s=t.length,a=t.replace(":","").length,u=new c(t);function o(e){if(i.$isEmpty(e))return e;var r=e.replace(/[^0-9]/g,"").slice(0,a)||"";return(u.apply(r)||"").replace(/[^0-9]$/,"")}i.$formatters.push(o),i.$parsers.push(function(e){if(i.$isEmpty(e))return e;var r=o(e),n=r;return i.$viewValue!==r&&(i.$setViewValue(r),i.$render()),n}),i.$validators.time=function(e){if(i.$isEmpty(e))return!0;var r=e.toString().split(/:/).filter(function(e){return!!e}),n=parseInt(r[0]),t=parseInt(r[1]),a=parseInt(r[2]||0);return e.toString().length===s&&n<24&&t<60&&a<60}}}}},{"string-mask":void 0}],24:[function(e,r,n){"use strict";r.exports=function(i){return function(){return{restrict:"A",require:"ngModel",link:function(e,r,n,a){a.$formatters.push(function(e){if(a.$isEmpty(e))return e;var r=i.clearValue(e.toString());return i.format(r)}),a.$parsers.push(function(e){if(a.$isEmpty(e))return e;var r=i.clearValue(e.toString()),n=i.format(r);if(a.$viewValue!==n&&(a.$setViewValue(n),a.$render()),angular.isUndefined(i.getModelValue))return r;var t=typeof a.$modelValue;return i.getModelValue(n,t)}),angular.forEach(i.validations,function(n,e){a.$validators[e]=function(e,r){return a.$isEmpty(e)||n(e,r)}})}}}}},{}],25:[function(e,r,n){"use strict";var i=e("string-mask");r.exports={viewMask:function(e,r,n){var t="#"+n+"##0";if(0<e){t+=r;for(var a=0;a<e;a++)t+="0"}return new i(t,{reverse:!0})},modelMask:function(e){var r="###0";if(0<e){r+=".";for(var n=0;n<e;n++)r+="0"}return new i(r,{reverse:!0})}}},{"string-mask":void 0}],26:[function(e,r,n){"use strict";function t(e){return"0"===e?"0":e.toString().replace(/^-/,"").replace(/^0*/,"").replace(/[^0-9]/g,"")}r.exports={clearDelimitersAndLeadingZeros:t,prepareNumberToFormatter:function(e,r){return t(parseFloat(e).toFixed(r))}}},{}],27:[function(e,r,n){"use strict";r.exports={maxNumber:function(e,r,n){var t=parseFloat(n,10);return e.$isEmpty(r)||isNaN(t)||r<=t},minNumber:function(e,r,n){var t=parseFloat(n,10);return e.$isEmpty(r)||isNaN(t)||t<=r}}},{}],28:[function(e,r,n){"use strict";var t=e("string-mask"),a=e("../../helpers/mask-factory"),i=new t("(000) 000-0000"),s=new t("+00-00-000-000000");r.exports=a({clearValue:function(e){return e.toString().replace(/[^0-9]/g,"")},format:function(e){return(e.length<11?i.apply(e)||"":s.apply(e)).trim().replace(/[^0-9]$/,"")},validations:{usPhoneNumber:function(e){return e&&9<e.toString().length}}})},{"../../helpers/mask-factory":24,"string-mask":void 0}],29:[function(e,r,n){"use strict";var t=angular.module("ui.utils.masks.us",[]).directive("uiUsPhoneNumberMask",e("./phone/us-phone"));r.exports=t.name},{"./phone/us-phone":28}]},{},[1]);