define("dojo/rpc/RpcService",["../_base/array","../_base/declare","../_base/Deferred","../_base/kernel","../_base/lang","../_base/url","../_base/xhr"],function(_1,_2,_3,_4,_5,_6,_7){return_2("dojo.rpc.RpcService",null,{constructor:function(_8){if(_8){if((_5.isString(_8))||(_8instanceof_6)){if(_8instanceof_6){var_9=_8+"";}else{_9=_8;}var_a=_7.get({url:_9,handleAs:"json-comment-optional",sync:true});_a.addCallback(this,"processSmd");_a.addErrback(function(){thrownewError("Unable to load SMD from "+_8);});}else{if(_8.smdStr){this.processSmd(_4.eval("("+_8.smdStr+")"));}else{if(_8.serviceUrl){this.serviceUrl=_8.serviceUrl;}this.timeout=_8.timeout||3000;if("strictArgChecks"in_8){this.strictArgChecks=_8.strictArgChecks;}this.processSmd(_8);}}}},strictArgChecks:true,serviceUrl:"",parseResults:function(_b){return_b;},errorCallback:function(_c){returnfunction(_d){_c.errback(_d.message);};},resultCallback:function(_e){return_5.hitch(this,function(_f){if(_f.error!=null){varerr;if(typeof_f.error=="object"){err=newError(_f.error.message);err.code=_f.error.code;err.error=_f.error.error;}else{err=newError(_f.error);}err.id=_f.id;err.errorObject=_f;_e.errback(err);}else{_e.callback(this.parseResults(_f));}});},generateMethod:function(_10,_11,url){return_5.hitch(this,function(){var_12=new_3();if((this.strictArgChecks)&&(_11!=null)&&(arguments.length!=_11.length)){thrownewError("Invalid number of parameters for remote method.");}else{this.bind(_10,_5._toArray(arguments),_12,url);}return_12;});},processSmd:function(_13){if(_13.methods){_1.forEach(_13.methods,function(m){if(m&&m.name){this[m.name]=this.generateMethod(m.name,m.parameters,m.url||m.serviceUrl||m.serviceURL);if(!_5.isFunction(this[m.name])){thrownewError("RpcService: Failed to create"+m.name+"()");}}},this);}this.serviceUrl=_13.serviceUrl||_13.serviceURL;this.required=_13.required;this.smd=_13;}});});