const { SearchBox, SearchBoxComposer, OfferListComponent, dummyCoffeeApi, util } = ourCoffeeSdk; class CustomOfferList extends OfferListComponent { constructor(context, container, offerList, options) { super(context, container, offerList, options); this.onClickListener = (e) => { const { target, value: action } = util.findDataField( e.target, "action" ); if (target === null || action === null) { return; } const { target: container, value: offerId } = util.findDataField(target, "offerId"); if (container === null || offerId === null) { return; } switch (action) { case "expand": this.expand(container); break; case "collapse": this.collapse(container); break; case "createOrder": this.context.createOrder(offerId); break; } }; } expand(item) { item.classList.add("expanded"); } collapse(item) { item.classList.remove("expanded"); } generateOfferHtml(offer) { return util.html`