text: /*! netteForms.js | (c) 2004, 2015 David Grudl (http://davidgrudl.com) */
  (function(g,d){"function"===typeof define&&define.amd?define(function(){return d(g)}):"object"===typeof module&&"object"===typeof module.exports?module.exports=d(g):(g.Nette=d(g),g.Nette.initOnLoad())})("undefined"!==typeof window?window:this,function(g){var d={addEvent:function(a,b,c){var d=a["on"+b];a["on"+b]=function(){return"function"===typeof d&&!1===d.apply(a,arguments)?!1:c.apply(a,arguments)}},getValue:function(a){var b;if(a){if(a.tagName){if("radio"===a.type){var c=a.form.elements;for(b=
  0;b<c.length;b++)if(c[b].name===a.name&&c[b].checked)return c[b].value;return null}if("file"===a.type)return a.files||a.value;if("select"===a.tagName.toLowerCase()){b=a.selectedIndex;var c=a.options,e=[];if("select-one"===a.type)return 0>b?null:c[b].value;for(b=0;b<c.length;b++)c[b].selected&&e.push(c[b].value);return e}if(a.name&&a.name.match(/\[\]$/)){c=a.form.elements[a.name].tagName?[a]:a.form.elements[a.name];e=[];for(b=0;b<c.length;b++)("checkbox"!==c[b].type||c[b].checked)&&e.push(c[b].value);
  return e}return"checkbox"===a.type?a.checked:"textarea"===a.tagName.toLowerCase()?a.value.replace("\r",""):a.value.replace("\r","").replace(/^\s+|\s+$/g,"")}return a[0]?d.getValue(a[0]):null}return null},getEffectiveValue:function(a){var b=d.getValue(a);a.getAttribute&&b===a.getAttribute("data-nette-empty-value")&&(b="");return b},validateControl:function(a,b,c,e){a=a.tagName?a:a[0];b=b||d.parseJSON(a.getAttribute("data-nette-rules"));e=void 0===e?{value:d.getEffectiveValue(a)}:e;for(var f=0,g=b.length;f<
  g;f++){var k=b[f],n=k.op.match(/(~)?([^?]+)/),h=k.control?a.form.elements.namedItem(k.control):a;if(h&&(k.neg=n[1],k.op=n[2],k.condition=!!k.rules,h=h.tagName?h:h[0],n=a===h?e:{value:d.getEffectiveValue(h)},n=d.validateRule(h,k.op,k.arg,n),null!==n))if(k.neg&&(n=!n),k.condition&&n){if(!d.validateControl(a,k.rules,c,e))return!1}else if(!k.condition&&!n&&!d.isDisabled(h)){if(!c){var q=d.isArray(k.arg)?k.arg:[k.arg];b=k.msg.replace(/%(value|\d+)/g,function(b,c){return d.getValue("value"===c?h:a.form.elements.namedItem(q[c].control))});
  d.addError(h,b)}return!1}}return!0},validateForm:function(a){a=a.form||a;var b=!1;if(a["nette-submittedBy"]&&null!==a["nette-submittedBy"].getAttribute("formnovalidate"))if(b=d.parseJSON(a["nette-submittedBy"].getAttribute("data-nette-validation-scope")),b.length)b=new RegExp("^("+b.join("-|")+"-)");else return!0;var c={},e,f;for(e=0;e<a.elements.length;e++)if(f=a.elements[e],!f.tagName||f.tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}){if("radio"===f.type){if(c[f.name])continue;c[f.name]=
  !0}if(!(b&&!f.name.replace(/]\[|\[|]|$/g,"-").match(b)||d.isDisabled(f)||d.validateControl(f)))return!1}return!0},isDisabled:function(a){if("radio"===a.type){for(var b=0,c=a.form.elements;b<c.length;b++)if(c[b].name===a.name&&!c[b].disabled)return!1;return!0}return a.disabled},addError:function(a,b){b&&alert(b);a.focus&&a.focus()},expandRuleArgument:function(a,b){b&&b.control&&(b=d.getEffectiveValue(a.elements.namedItem(b.control)));return b},validateRule:function(a,b,c,e){e=void 0===e?{value:d.getEffectiveValue(a)}:
  e;":"===b.charAt(0)&&(b=b.substr(1));b=b.replace("::","_");b=b.replace(/\\/g,"");for(var f=d.isArray(c)?c.slice(0):[c],g=0,k=f.length;g<k;g++)f[g]=d.expandRuleArgument(a.form,f[g]);return d.validators[b]?d.validators[b](a,d.isArray(c)?f:f[0],e.value,e):null},validators:{filled:function(a,b,c){return""!==c&&!1!==c&&null!==c&&(!d.isArray(c)||!!c.length)&&(!g.FileList||!(c instanceof g.FileList)||c.length)},blank:function(a,b,c){return!d.validators.filled(a,b,c)},valid:function(a,b,c){return d.validateControl(a,
  null,!0)},equal:function(a,b,c){if(void 0===b)return null;c=d.isArray(c)?c:[c];b=d.isArray(b)?b:[b];a=0;var e=c.length;a:for(;a<e;a++){for(var f=0,g=b.length;f<g;f++)if(c[a]==b[f])continue a;return!1}return!0},notEqual:function(a,b,c){return void 0===b?null:!d.validators.equal(a,b,c)},minLength:function(a,b,c){return c.length>=b},maxLength:function(a,b,c){return c.length<=b},length:function(a,b,c){b=d.isArray(b)?b:[b,b];return(null===b[0]||c.length>=b[0])&&(null===b[1]||c.length<=b[1])},email:function(a,
  b,c){return/^("([ !#-[\]-~]*|\\[ -~])+"|[-a-z0-9!#$%&'*+\/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+\/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(c)},url:function(a,b,c,d){/^[a-z\d+.-]+:/.test(c)||(c="http://"+c);return/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(c)?
  (d.value=c,!0):!1},regexp:function(a,b,c){a="string"===typeof b?b.match(/^\/(.*)\/([imu]*)$/):!1;try{return a&&(new RegExp(a[1],a[2].replace("u",""))).test(c)}catch(d){}},pattern:function(a,b,c){try{return"string"===typeof b?(new RegExp("^("+b+")$")).test(c):null}catch(d){}},integer:function(a,b,c){return/^-?[0-9]+$/.test(c)},"float":function(a,b,c,d){c=c.replace(" ","").replace(",",".");return/^-?[0-9]*[.,]?[0-9]+$/.test(c)?(d.value=c,!0):!1},min:function(a,b,c){return d.validators.range(a,[b,null],
  c)},max:function(a,b,c){return d.validators.range(a,[null,b],c)},range:function(a,b,c){return d.isArray(b)?(null===b[0]||parseFloat(c)>=b[0])&&(null===b[1]||parseFloat(c)<=b[1]):null},submitted:function(a,b,c){return a.form["nette-submittedBy"]===a},fileSize:function(a,b,c){if(g.FileList)for(a=0;a<c.length;a++)if(c[a].size>b)return!1;return!0},image:function(a,b,c){if(g.FileList&&c instanceof g.FileList)for(a=0;a<c.length;a++)if((b=c[a].type)&&"image/gif"!==b&&"image/png"!==b&&"image/jpeg"!==b)return!1;
  return!0}},toggleForm:function(a,b){var c;d.toggles={};for(c=0;c<a.elements.length;c++)a.elements[c].tagName.toLowerCase()in{input:1,select:1,textarea:1,button:1}&&d.toggleControl(a.elements[c],null,null,!b);for(c in d.toggles)d.toggle(c,d.toggles[c],b)},toggleControl:function(a,b,c,e,f){b=b||d.parseJSON(a.getAttribute("data-nette-rules"));f=void 0===f?{value:d.getEffectiveValue(a)}:f;for(var g=!1,k=[],n=function(){d.toggleForm(a.form,a)},h,q=0,u=b.length;q<u;q++){var m=b[q],r=m.op.match(/(~)?([^?]+)/),
  l=m.control?a.form.elements.namedItem(m.control):a;if(l){h=c;if(!1!==c){m.neg=r[1];m.op=r[2];h=a===l?f:{value:d.getEffectiveValue(l)};h=d.validateRule(l,m.op,m.arg,h);if(null===h)continue;else m.neg&&(h=!h);m.rules||(c=h)}if(m.rules&&d.toggleControl(a,m.rules,h,e,f)||m.toggle){g=!0;if(e)for(var r=!document.addEventListener,v=l.tagName?l.name:l[0].name,l=l.tagName?l.form.elements:l,p=0;p<l.length;p++)l[p].name!==v||d.inArray(k,l[p])||(d.addEvent(l[p],r&&l[p].type in{checkbox:1,radio:1}?"click":"change",
  n),k.push(l[p]));for(var t in m.toggle||[])Object.prototype.hasOwnProperty.call(m.toggle,t)&&(d.toggles[t]=d.toggles[t]||(m.toggle[t]?h:!h))}}}return g},parseJSON:function(a){a=a||"[]";return"{op"===a.substr(0,3)?eval("["+a+"]"):g.JSON&&g.JSON.parse?JSON.parse(a):eval(a)},toggle:function(a,b,c){if(a=document.getElementById(a))a.style.display=b?"":"none"},initForm:function(a){a.noValidate="novalidate";d.addEvent(a,"submit",function(b){if(!d.validateForm(a))return b&&b.stopPropagation?b.stopPropagation():
  g.event&&(event.cancelBubble=!0),!1});d.addEvent(a,"click",function(b){b=b||event;b=b.target||b.srcElement;a["nette-submittedBy"]=b.type in{submit:1,image:1}?b:null});d.toggleForm(a)},initOnLoad:function(){d.addEvent(g,"load",function(){for(var a=0;a<document.forms.length;a++)for(var b=document.forms[a],c=0;c<b.elements.length;c++)if(b.elements[c].getAttribute("data-nette-rules")){d.initForm(b);break}})},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},inArray:function(a,
  b){if([].indexOf)return-1<a.indexOf(b);for(var c=0;c<a.length;c++)if(a[c]===b)return!0;return!1},webalize:function(a){a=a.toLowerCase();var b="",c,e;for(c=0;c<a.length;c++)e=d.webalizeTable[a.charAt(c)],b+=e?e:a.charAt(c);return b.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")},webalizeTable:{"\u00e1":"a","\u00e4":"a","\u010d":"c","\u010f":"d","\u00e9":"e","\u011b":"e","\u00ed":"i","\u013e":"l","\u0148":"n","\u00f3":"o","\u00f4":"o","\u0159":"r","\u0161":"s","\u0165":"t","\u00fa":"u","\u016f":"u",
  "\u00fd":"y","\u017e":"z"}};return d});
  