@webless/agent 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed.cjs CHANGED
@@ -4369,7 +4369,23 @@ function calendarCells(year, month) {
4369
4369
  function BookingCardLoader() {
4370
4370
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("section", { className: "booking-card", "aria-label": "Book a meeting", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "booking-card__loading", role: "status", children: "Finding available times\u2026" }) });
4371
4371
  }
4372
- function BookingCard({
4372
+ function BookingCard(props) {
4373
+ if (!props.readOnly) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(InteractiveBookingCard, { ...props });
4374
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "booking-card", "aria-label": "Recorded available times", children: [
4375
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "booking-card__title", children: "Available times offered" }),
4376
+ props.offer.slots.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { children: props.offer.slots.map((slot, index) => {
4377
+ const eventType = props.offer.eventTypes.find(
4378
+ (item) => item.uri === slot.eventTypeUri
4379
+ );
4380
+ const label = Number.isFinite(Date.parse(slot.startTime)) ? formatSlotLabel(slot.startTime) : "Time unavailable";
4381
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { children: [
4382
+ eventType ? `${eventType.name} \xB7 ` : "",
4383
+ label
4384
+ ] }, `${slot.eventTypeUri ?? ""}:${slot.startTime}:${index}`);
4385
+ }) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "No available times were recorded." })
4386
+ ] });
4387
+ }
4388
+ function InteractiveBookingCard({
4373
4389
  disabled = false,
4374
4390
  offer,
4375
4391
  onBook
@@ -4735,6 +4751,7 @@ function MessageBubble({
4735
4751
  message,
4736
4752
  brandLogoUrl,
4737
4753
  bookingDisabled = false,
4754
+ bookingReadOnly = false,
4738
4755
  offer,
4739
4756
  onBook
4740
4757
  }) {
@@ -4801,6 +4818,7 @@ function MessageBubble({
4801
4818
  BookingCard,
4802
4819
  {
4803
4820
  disabled: bookingDisabled,
4821
+ readOnly: bookingReadOnly,
4804
4822
  offer: nextOffer,
4805
4823
  onBook
4806
4824
  },