// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/declare dojo/Deferred dojo/_base/lang dojo/_base/array jimu/LayerInfos/LayerInfos dijit/form/Select esri/tasks/query esri/tasks/QueryTask dijit/_TemplatedMixin ../BaseEditor".split(" "),function(f,g,h,k,l,m,n,p,q,r){return f([r,q],{templateString:'\x3cdiv\x3e\x3cdiv class\x3d"recordset-editor" data-dojo-attach-point\x3d"tableChooseNode"\x3e\x3c/div\x3e\x3c/div\x3e',editorName:"SelectRecordSetFromTable",postCreate:function(){this.inherited(arguments);var b=l.getInstanceSync().getTableInfoArray(),
c=[{label:this.nls.chooseATable,value:"",selected:!0}];k.forEach(b,function(a){c.push({label:a.title||a.name,value:a})});this.selectDijit=new m({name:"tableSelctor","class":"table-select",options:c});this.selectDijit.placeAt(this.tableChooseNode).startup()},getGPValue:function(){var b=new g,c=this.selectDijit.get("value");c?c.getLayerObject().then(h.hitch(this,function(a){if(a)if(a.featureCollectionData)b.resolve(a.featureCollectionData);else if(a.url){a=new p(a.url);var d=new n;d.where="1\x3d1";
d.outFields=["*"];a.execute(d,function(e){b.resolve(e)},function(e){b.reject(e)})}else b.resolve(null);else b.resolve(null)})):b.resolve(null);return b}})});