var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{s(r.next(t))}catch(t){i(t)}}function c(t){try{s(r["throw"](t))}catch(t){i(t)}}function s(t){t.done?n(t.value):o(t.value).then(a,c)}s((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(e){return s([t,e])}}function s(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;o=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(t){a=[6,t];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{I as Identifier}from"./Token-ba2c5d5c.js";import"./index-c2c33860.js";import{a as Connection}from"./Item-f4cbd6f4.js";import{S as Settlement$1}from"./index-8e333ab5.js";import"./ok-c9833bf3.js";import"./index-714bb39b.js";import"./index-063af7ee.js";import"./TextDecoder-357ac2ce.js";import"./_commonjsHelpers-9943807e.js";import"./index-1f953d81.js";var Settlement=function(){function t(t){this.connection=t}t.prototype.list=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this.connection.get("settlement"+(t&&e?"?date="+t+"&days="+e:t?"?date="+t:e?"?days="+e:""))];case 1:return[2,n.sent()]}}))}))};t.prototype.report=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.connection.post("settlement/report?language="+e,t)]}))}))};t.prototype.load=function(t){return __awaiter(this,void 0,void 0,(function(){var e;var n=this;return __generator(this,(function(r){switch(r.label){case 0:if(!Identifier.is(t))return[3,2];return[4,this.connection.get("settlement/"+t)];case 1:e=r.sent();return[3,4];case 2:return[4,Promise.all(t.map((function(t){return n.connection.get("settlement/"+t)})))];case 3:e=r.sent().filter(Settlement$1.is);r.label=4;case 4:return[2,e]}}))}))};t.open=function(e,n){var r=Connection.open(e,n);return r&&new t(r)};return t}();export{Settlement};