!function(r,e){e.errorStateClassName="error",e.showErrors=function(t,a,s){var i=null!=a?a:r("ul.error_messages");if(i=r(i[0]),0==r("ul.error_messages").length){var n=r("div#header");if(0==n.length)return null;r("").insertAfter(n),i=r(".error_messages")}var l=i.children("li");if(l.hide(),t.length>0){var o=(s=r(s)).children("input, select, label"),f=s.find("input, select, label");o.each((function(){e.hideErrorState(this)})),f.removeClass("error"),f.removeAttr("aria-invalid")}for(var d=0,u=t.length;d0?v.show():((v=r("
  • ")).html(h.text),i.append(v)),h.displayMode&&"message"===h.displayMode&&v.addClass("message"),h.tags&&r.isArray(h.tags))for(var p=/^field\.(\w+)$/,w=0,y=h.tags.length;w0){e.showErrorState(S[0]);var b=r("label[for="+S[0].id+"]",s);e.showErrorState(b[0]),g&&S.attr("aria-invalid",!0)}}}}i.show(),i.addClass("error_messages_display")},e.showErrorState=function(t){if(!t||!e.isElement(t))return null;r(t).addClass(e.errorStateClassName),r(t).attr("aria-invalid",!0)},e.hideErrorState=function(t){if(!t||!e.isElement(t))return null;r(t).removeClass(e.errorStateClassName)},e.errorOrder=function(t,a,s,i){var n=new Array,l=new Array;for(var o in t)t.hasOwnProperty(o)&&s.indexOf(t[o].key)>=0?n[s.indexOf(t[o].key)]=t[o]:t.hasOwnProperty(o)&&l.push(t[o]);n=r.grep(n.concat(l),(function(r){return r})),e.showErrors(n,a,i)},e.focusErrors=function(r,e){var t=r.children().filter(":visible");r.addClass("outline-none"),t.length>0&&(r.attr("tabindex",-1).focus(),r.focusout((function(){var r=e.find(".error, .checkedEmpty").filter(":visible:input");r.length>0?r.first().focus():e.find(":input").filter(":visible:first").focus()})))}}(jQuery,window.generic||{}); //# sourceMappingURL=error.min.js.map