//>>built
define("dojox/validate/check",["dojo/_base/kernel","dojo/_base/lang","./_base"],function(o,j,l){o.experimental("dojox.validate.check");l.check=function(g,b){var f=[],i=[],m={isSuccessful:function(){return!this.hasInvalid()&&!this.hasMissing()},hasMissing:function(){return 0<f.length},getMissing:function(){return f},isMissing:function(a){for(var b=0;b<f.length;b++)if(a==f[b])return!0;return!1},hasInvalid:function(){return 0<i.length},getInvalid:function(){return i},isInvalid:function(a){for(var b=
0;b<i.length;b++)if(a==i[b])return!0;return!1}},h=function(a,b){return"undefined"==typeof b[a]};if(b.trim instanceof Array)for(var c=0;c<b.trim.length;c++){var a=g[b.trim[c]];if(!(h("type",a)||"text"!=a.type&&"textarea"!=a.type&&"password"!=a.type))a.value=a.value.replace(/(^\s*|\s*$)/g,"")}if(b.uppercase instanceof Array)for(c=0;c<b.uppercase.length;c++)if(a=g[b.uppercase[c]],!(h("type",a)||"text"!=a.type&&"textarea"!=a.type&&"password"!=a.type))a.value=a.value.toUpperCase();if(b.lowercase instanceof
Array)for(c=0;c<b.lowercase.length;c++)if(a=g[b.lowercase[c]],!(h("type",a)||"text"!=a.type&&"textarea"!=a.type&&"password"!=a.type))a.value=a.value.toLowerCase();if(b.ucfirst instanceof Array)for(c=0;c<b.ucfirst.length;c++)if(a=g[b.ucfirst[c]],!(h("type",a)||"text"!=a.type&&"textarea"!=a.type&&"password"!=a.type))a.value=a.value.replace(/\b\w+\b/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1).toLowerCase()});if(b.digit instanceof Array)for(c=0;c<b.digit.length;c++)if(a=g[b.digit[c]],
!(h("type",a)||"text"!=a.type&&"textarea"!=a.type&&"password"!=a.type))a.value=a.value.replace(/\D/g,"");if(b.required instanceof Array)for(c=0;c<b.required.length;c++)if(j.isString(b.required[c]))if(a=g[b.required[c]],!h("type",a)&&("text"==a.type||"textarea"==a.type||"password"==a.type||"file"==a.type)&&/^\s*$/.test(a.value))f[f.length]=a.name;else if(!h("type",a)&&("select-one"==a.type||"select-multiple"==a.type)&&(-1==a.selectedIndex||/^\s*$/.test(a.options[a.selectedIndex].value)))f[f.length]=
a.name;else if(a instanceof Array){for(var k=!1,e=0;e<a.length;e++)a[e].checked&&(k=!0);if(!k)f[f.length]=a[0].name}if(b.required instanceof Array)for(c=0;c<b.required.length;c++)if(j.isObject(b.required[c])){var n,d;for(d in b.required[c])a=g[d],n=b.required[c][d];if(a instanceof Array){for(e=k=0;e<a.length;e++)a[e].checked&&k++;if(k<n)f[f.length]=a[0].name}else if(!h("type",a)&&"select-multiple"==a.type){for(e=k=0;e<a.options.length;e++)a.options[e].selected&&!/^\s*$/.test(a.options[e].value)&&
k++;if(k<n)f[f.length]=a.name}}if(j.isObject(b.dependencies))for(d in b.dependencies)if(a=g[d],!h("type",a)&&!("text"!=a.type&&"textarea"!=a.type&&"password"!=a.type)&&!/\S+/.test(a.value)&&!m.isMissing(a.name)&&(c=g[b.dependencies[d]],!("text"!=c.type&&"textarea"!=c.type&&"password"!=c.type)&&!/^\s*$/.test(c.value)))f[f.length]=a.name;if(j.isObject(b.constraints))for(d in b.constraints)if((a=g[d])&&(h("tagName",a)||!(0<=a.tagName.toLowerCase().indexOf("input")||0<=a.tagName.toLowerCase().indexOf("textarea"))||
!/^\s*$/.test(a.value))){e=!0;if(j.isFunction(b.constraints[d]))e=b.constraints[d](a.value);else if(j.isArray(b.constraints[d]))if(j.isArray(b.constraints[d][0]))for(c=0;c<b.constraints[d].length&&!(e=l.evaluateConstraint(b,b.constraints[d][c],d,a),!e);c++);else e=l.evaluateConstraint(b,b.constraints[d],d,a);if(!e)i[i.length]=a.name}if(j.isObject(b.confirm))for(d in b.confirm)if(a=g[d],c=g[b.confirm[d]],!h("type",a)&&!h("type",c)&&!("text"!=a.type&&"textarea"!=a.type&&"password"!=a.type||c.type!=
a.type||c.value==a.value||m.isInvalid(a.name)||/^\s*$/.test(c.value)))i[i.length]=a.name;return m};l.evaluateConstraint=function(g,b,f,i){g=b[0];b=b.slice(1);b.unshift(i.value);return"undefined"!=typeof g?g.apply(null,b):!1};return l.check});