YUI.add("datasource-local",function(e,s){var t=e.Lang,n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NAME:"dataSourceLocal",ATTRS:{source:{value:null}},_tId:0,transactions:{},issueCallback:function(e,s){var a=e.on||e.callback,t=a&&a.success,n=e.details[0];n.error=e.error||e.response.error,n.error&&(s.fire("error",n),t=a&&a.failure),t&&t(n)}}),e.extend(n,e.Base,{initializer:function(e){this._initEvents()},_initEvents:function(){this.publish("request",{defaultFn:e.bind("_defRequestFn",this),queuable:!0}),this.publish("data",{defaultFn:e.bind("_defDataFn",this),queuable:!0}),this.publish("response",{defaultFn:e.bind("_defResponseFn",this),queuable:!0})},_defRequestFn:function(e){var s=this.get("source"),e=e.details[0];t.isUndefined(s)&&(e.error=new Error("Local source undefined")),e.data=s,this.fire("data",e)},_defDataFn:function(e){var s=e.data,a=e.meta,s={results:t.isArray(s)?s:[s],meta:a||{}},a=e.details[0];a.response=s,this.fire("response",a)},_defResponseFn:function(e){n.issueCallback(e,this)},sendRequest:function(e){var s=n._tId++,a=(e=e||{}).on||e.callback;return this.fire("request",{tId:s,request:e.request,on:a,callback:a,cfg:e.cfg||{}}),s}}),e.namespace("DataSource").Local=n},"patched-v3.18.7",{requires:["base"]});