PageSourceSearch

https://0hh.ru/assets/js/intltelinput.js?

js 0hh.ru collected 2026-10-09 04:34:46 UTC 2,700 bytes, 1 lines download raw bytes

1angular.module("YepCom").directive("intlTelInput",function($ocLazyLoad,$timeout){return{restrict:"EA",require:"?ngModel",link:function(scope,element,attrs,ngModel){function destroyMask(){scope.iMask&&(scope.iMask.destroy(),scope.iMask=null)}function onMaskAccept(){var maskedValue;ngModel&&scope.iMask&&(maskedValue=scope.iMask.value||"",ngModel.$viewValue!==maskedValue)&&ngModel.$setViewValue(maskedValue)}function updateMaskState(value){input&&(value=null!=value?value:input.value,(fitsRuMask(value)?applyMaskValue:setRawValue)(value))}function handlePaste(event){event.preventDefault();var pastedText=(event.clipboardData||window.clipboardData).getData("text")||"";scope.$apply(function(){updateMaskState(pastedText)})}function handleInput(){scope.iMask||$timeout(function(){updateMaskState(input.value)})}var input,iti,rusNumberMask="+{7} (000) 000-00-00",ruPhonePattern=/^\+7 \(\d{3}\) \d{3}-\d{2}-\d{2}$/,getRuDigits=function(value){value=String(value||"").replace(/\D/g,"");return value?("8"===value.charAt(0)?value="7"+value.slice(1):"7"!==value.charAt(0)&&(value="7"+value),value):""},fitsRuMask=function(value){return!value||!!ruPhonePattern.test(value)||getRuDigits(value).length<=11},createMask=function(){!scope.iMask&&input&&(scope.iMask=IMask(input,{mask:rusNumberMask}),scope.iMask.on("accept",onMaskAccept))},setRawValue=function(value){destroyMask(),input.value=value||"",ngModel&&ngModel.$setViewValue(value||"")},applyMaskValue=function(value){createMask(),scope.iMask.value=value||"",ngModel&&ngModel.$setViewValue(scope.iMask.value||"")};$ocLazyLoad.load({files:["/assets/intlTelInput.css?min","/assets/intlTelInput.js?min","/assets/js/imask.js"],series:!0}).then(function(){(input=element[0]).addEventListener("paste",handlePaste),input.addEventListener("input",handleInput),iti=window.intlTelInput(input,{allowDropdown:!0,preferredCountries:["ru"],autoPlaceholder:"polite",placeholderNumberType:"MOBILE",utilsScript:"/assets/utils.js",customPlaceholder:function(selectedCountryPlaceholder,selectedCountryData){return attrs.placeholder||("ru"==selectedCountryData.iso2?"+7 (912) 345-67-89":selectedCountryPlaceholder)}}),$timeout(function(){updateMaskState(ngModel&&ngModel.$viewValue)},500),input.addEventListener("countrychange",function(){var inputMask;setRawValue(""),scope.countryData="+"+iti.getSelectedCountryData().dialCode,inputMask="ru"==iti.getSelectedCountryData().iso2?rusNumberMask:input.placeholder.replace(/[0-9]/g,"0"),createMask(),scope.iMask&&(scope.iMask.mask=inputMask,scope.iMask.updateValue())})}),scope.$on("$destroy",function(){destroyMask(),input&&(input.removeEventListener("paste",handlePaste),input.removeEventListener("input",handleInput))})}}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.