//>>built
define("dojox/wire/ml/Action",["dojo","dijit","dojox","dojo/require!dijit/_Widget,dijit/_Container,dojox/wire/Wire,dojox/wire/ml/util"],function(a,f,e){a.provide("dojox.wire.ml.Action");a.require("dijit._Widget");a.require("dijit._Container");a.require("dojox.wire.Wire");a.require("dojox.wire.ml.util");a.declare("dojox.wire.ml.Action",[f._Widget,f._Container],{trigger:"",triggerEvent:"",triggerTopic:"",postCreate:function(){this._connect()},_connect:function(){if(this.triggerEvent)if(this.trigger){var c=
e.wire.ml._getValue(this.trigger);c&&(c[this.triggerEvent]||(c[this.triggerEvent]=function(){}),this._triggerHandle=a.connect(c,this.triggerEvent,this,"run"))}else{if("onload"==this.triggerEvent.toLowerCase()){var b=this;a.addOnLoad(function(){b._run.apply(b,arguments)})}}else this.triggerTopic&&(this._triggerHandle=a.subscribe(this.triggerTopic,this,"run"))},_disconnect:function(){this._triggerHandle&&(this.triggerTopic?a.unsubscribe(this.triggerTopic,this._triggerHandle):a.disconnect(this._triggerHandle))},
run:function(){var c=this.getChildren(),b;for(b in c){var a=c[b];if(a instanceof e.wire.ml.ActionFilter&&!a.filter.apply(a,arguments))return}this._run.apply(this,arguments)},_run:function(){var a=this.getChildren(),b;for(b in a){var d=a[b];d instanceof e.wire.ml.Action&&d.run.apply(d,arguments)}},uninitialize:function(){this._disconnect();return!0}});a.declare("dojox.wire.ml.ActionFilter",f._Widget,{required:"",requiredValue:"",type:"",message:"",error:"",filter:function(){if(""===this.required)return!0;
var a=e.wire.ml._getValue(this.required,arguments);if(""===this.requiredValue){if(a)return!0}else{var b=this.requiredValue;if(""!==this.type){var d=this.type.toLowerCase();"boolean"===d?b="false"===b.toLowerCase()?!1:!0:"number"===d&&(b=parseInt(b,10))}if(a===b)return!0}this.message&&(this.error?e.wire.ml._setValue(this.error,this.message):alert(this.message));return!1}})});