"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),n=require("../../../clients/jsonApi/index.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(e),u=o(r),a=o(t);function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function p(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?i(Object(t),!0).forEach((function(r){c.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}exports.initialDataFetcher=function(e){return function(){var r=u.default(a.default.mark((function r(t,o){var c;return a.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=null,r.prev=1,r.next=4,n.getAppStorage(e.provider,e.collection,t,p(p({},e.params),{},{query:o?"{timestamp#lt#".concat(o,"}"):null,sort:"{timestamp: -1}",limit:1}));case 4:c=r.sent,r.next=10;break;case 7:r.prev=7,r.t0=r.catch(1),console.error(r.t0);case 10:return r.abrupt("return",c);case 11:case"end":return r.stop()}}),r,null,[[1,7]])})));return function(e,t){return r.apply(this,arguments)}}()};
//# sourceMappingURL=initialDataFetcher.js.map
