import{I as t}from"./p-be8a42cb.js";import{M as r}from"./p-90edb445.js";import{a}from"./p-d6eb762b.js";import"./p-9b3f323d.js";import"./p-f86466b9.js";import"./p-11d0e255.js";import"./p-a96ec623.js";import"./p-112455b1.js";import"./p-1ae2b158.js";class s{constructor(t){this.connection=t}async create(t){return await this.connection.post("merchant",t)}async list(){return this.connection.get("merchant")}async change(r,a){return await this.connection.patch("merchant/"+(t.is(a)?a:""),r)}async load(a){return a?t.is(a)?await this.connection.get("merchant/"+a):(await Promise.all(a.map((t=>this.connection.get("merchant/"+t))))).filter(r.is):await this.connection.get("merchant")}static open(t,r){const e=a.open(t,r);return e&&new s(e)}}export{s as Merchant}