var __spreadArray=this&&this.__spreadArray||function(t,e){for(var r=0,i=e.length,s=t.length;r<i;r++,s++)t[s]=e[r];return t};System.register(["./p-fa32c614.system.js","./p-23628d1c.system.js","./p-da593370.system.js","./p-cc2dfee2.system.js"],(function(t){"use strict";var e,r,i,s,a;return{setters:[function(t){e=t.T},function(t){r=t.D},function(t){i=t.C},function(t){s=t.r;a=t.c}],execute:function(){var n=function(){function t(t,e,r,i,s,a){this.apiData=t;this.callback=a;this.params=e;this.table=r;this.fields=s;this.query=i}t.prototype.fetchData=function(t){var n=this;var c;if(t.isPending){return}this.callback(t.beforeFetch());var f=this.table.name;var u=((c=this.query)===null||c===void 0?void 0:c.filter)?s(a(this.query.filter),this.params):{comparison:i.Eq,id:"_id",value:this.params.itemId};this.apiData.query(f,{fields:__spreadArray(__spreadArray([],this.fields),[new e("_id","ID")]),filter:u,limit:1,skip:0}).then((function(e){n.callback(t.afterFetch(e.results.length>0?e.results[0]:new r))}),(function(e){n.callback(t.afterFetchError(e))}))};return t}();t("I",n)}}}));