1(function(){'use strict';var postCodeValidator={validatedPostCodeExample:[],validate:function(postCode,countryId,postCodesPatterns){var self=this,result,patterns=postCodesPatterns?postCodesPatterns[countryId]:window.checkoutConfig.postCodes[countryId];this.validatedPostCodeExample=[];if(!postCode||!patterns){return true;} 2result=_.find(patterns,function(item){var regex=new RegExp(item.pattern);self.validatedPostCodeExample.push(item.example);return regex.test(postCode);});return result!==undefined;}};$.widget('addressValidation',{component:'addressValidation',options:{selectors:{button:'[data-action=save-address]',zip:'#zip',country:'select[name="country_id"]'}},create:function(){this.zipInput=this.element.find(this.options.selectors.zip);this.countrySelect=this.element.find(this.options.selectors.country);this._addPostCodeValidation();},_addPostCodeValidation:function(){var self=this;this.zipInput.on('keyup',_.debounce(function(event){var valid=self._validatePostCode(event.target.value);self._renderValidationResult(valid);},500));this.countrySelect.on('change',function(){var valid=self._validatePostCode(self.zipInput.val());self._renderValidationResult(valid);});}
2,_validatePostCode:function(postCode){var countryId=this.countrySelect.val();if(postCode===null){return true;} 3return postCodeValidator.validate(postCode,countryId,this.options.postCodes);},_renderValidationResult:function(valid){var warnMessage,alertDiv=this.zipInput.next();if(!valid){warnMessage=$t('Provided Zip/Postal Code seems to be invalid.');if(postCodeValidator.validatedPostCodeExample.length){warnMessage+=$t(' Example: ')+postCodeValidator.validatedPostCodeExample.join('; ')+'. ';} 4warnMessage+=$t('If you believe it is the right one you can ignore this notice.');} 5alertDiv.children().first().text(warnMessage);if(valid){alertDiv.hide();}else{alertDiv.show();}}});})();
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.