import React3 from 'react';
import { View, Text, Button, ScrollView, Image, Input, Textarea } from '@tarojs/components';

// src/showmasterpiece/ui/miniapp/components/PageHeader.tsx
var PageHeader = ({ title, subtitle, actions, cta }) => {
  return /* @__PURE__ */ React3.createElement(View, { className: "bg-white/95 px-4 py-4 border-b border-prussian-blue-200/30" }, /* @__PURE__ */ React3.createElement(View, { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ React3.createElement(View, { className: "flex-1" }, /* @__PURE__ */ React3.createElement(Text, { className: "text-lg font-bold text-rich-black" }, title), subtitle && /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-prussian-blue-600" }, subtitle)), actions && actions.length > 0 && /* @__PURE__ */ React3.createElement(View, { className: "flex items-center gap-2" }, actions.map((action) => /* @__PURE__ */ React3.createElement(
    Button,
    {
      key: action.label,
      className: action.variant === "ghost" ? "h-8 rounded-full border border-prussian-blue-200 bg-white px-3 text-xs font-semibold text-prussian-blue-700" : "h-8 rounded-full bg-gradient-to-r from-moonstone to-cerulean px-3 text-xs font-semibold text-white shadow-lg",
      onClick: action.onClick
    },
    action.label
  )))), cta && /* @__PURE__ */ React3.createElement(
    Button,
    {
      className: "mt-3 h-9 rounded-full bg-gradient-to-r from-moonstone to-cerulean px-4 text-xs font-semibold text-white shadow-lg",
      onClick: cta.onClick
    },
    cta.label
  ));
};
var PageHeader_default = PageHeader;
function CategoryTabs({
  items,
  activeValue,
  onChange
}) {
  return /* @__PURE__ */ React3.createElement(ScrollView, { scrollX: true, className: "mt-4", showScrollbar: false }, /* @__PURE__ */ React3.createElement(View, { className: "flex gap-2 rounded-2xl bg-moonstone-900/10 p-1" }, items.map((item) => {
    const isActive = activeValue === item.value;
    return /* @__PURE__ */ React3.createElement(
      View,
      {
        key: item.value,
        className: `flex flex-col items-center justify-center rounded-xl px-4 py-2 text-xs font-semibold transition-all ${isActive ? "bg-gradient-to-r from-moonstone to-cerulean text-white shadow-lg" : "text-prussian-blue-700"}`,
        onClick: () => onChange(item.value)
      },
      /* @__PURE__ */ React3.createElement(Text, null, item.label),
      typeof item.count === "number" && /* @__PURE__ */ React3.createElement(
        Text,
        {
          className: `mt-1 rounded-full px-2 py-0.5 text-[10px] ${isActive ? "bg-white/20 text-white" : "bg-moonstone-900/10 text-cerulean"}`
        },
        item.count
      )
    );
  })));
}
var CategoryTabs_default = CategoryTabs;

// src/showmasterpiece/types/index.ts
var categories = {
  ["collection" /* COLLECTION */]: {
    value: "collection" /* COLLECTION */,
    displayName: "\u753B\u96C6",
    description: "\u7528\u4E8E\u5C55\u793A\u827A\u672F\u4F5C\u54C1"
  },
  ["acrylic" /* ACRYLIC */]: {
    value: "acrylic" /* ACRYLIC */,
    displayName: "\u7ACB\u724C",
    description: "\u7ACB\u724C\u5236\u54C1"
  },
  ["badge" /* BADGE */]: {
    value: "badge" /* BADGE */,
    displayName: "\u5427\u5527",
    description: "\u5FBD\u7AE0\u7C7B\u5546\u54C1"
  },
  ["color_paper" /* COLOR_PAPER */]: {
    value: "color_paper" /* COLOR_PAPER */,
    displayName: "\u8272\u7EB8",
    description: "\u5F69\u8272\u7EB8\u5F20\u5236\u54C1"
  },
  ["transparent_card" /* TRANSPARENT_CARD */]: {
    value: "transparent_card" /* TRANSPARENT_CARD */,
    displayName: "\u900F\u5361",
    description: "\u900F\u660E\u5361\u7247\u5236\u54C1"
  },
  ["postcard" /* POSTCARD */]: {
    value: "postcard" /* POSTCARD */,
    displayName: "\u660E\u4FE1\u7247",
    description: "\u660E\u4FE1\u7247\u7C7B\u5546\u54C1"
  },
  ["laser_ticket" /* LASER_TICKET */]: {
    value: "laser_ticket" /* LASER_TICKET */,
    displayName: "\u956D\u5C04\u7968",
    description: "\u956D\u5C04\u7968\u7C7B\u5546\u54C1"
  },
  ["canvas_bag" /* CANVAS_BAG */]: {
    value: "canvas_bag" /* CANVAS_BAG */,
    displayName: "\u5E06\u5E03\u5305",
    description: "\u5E06\u5E03\u5305\u7C7B\u5546\u54C1"
  },
  ["spiral_notebook" /* SPIRAL_NOTEBOOK */]: {
    value: "spiral_notebook" /* SPIRAL_NOTEBOOK */,
    displayName: "\u7EBF\u5708\u7B14\u8BB0\u672C",
    description: "\u7EBF\u5708\u88C5\u8BA2\u7B14\u8BB0\u672C"
  },
  ["mouse_pad" /* MOUSE_PAD */]: {
    value: "mouse_pad" /* MOUSE_PAD */,
    displayName: "\u9F20\u6807\u57AB",
    description: "\u9F20\u6807\u57AB\u7C7B\u5546\u54C1"
  },
  ["support_stick" /* SUPPORT_STICK */]: {
    value: "support_stick" /* SUPPORT_STICK */,
    displayName: "\u5E94\u63F4\u68D2",
    description: "\u5E94\u63F4\u68D2\u7C7B\u5546\u54C1"
  },
  ["keychain" /* KEYCHAIN */]: {
    value: "keychain" /* KEYCHAIN */,
    displayName: "\u6302\u4EF6/\u94A5\u5319\u6263",
    description: "\u6302\u4EF6/\u94A5\u5319\u6263\u7C7B\u5546\u54C1"
  },
  ["other" /* OTHER */]: {
    value: "other" /* OTHER */,
    displayName: "\u5176\u5B83",
    description: "\u5176\u4ED6\u7C7B\u578B\u5546\u54C1"
  }
};
function getCategoryDisplayName(category) {
  return categories[category]?.displayName || category;
}
function getCategoryInfo(category) {
  return categories[category] || {
    value: category,
    displayName: category,
    description: ""
  };
}
if (!Object.getOwnPropertyDescriptor(String.prototype, "displayName")) {
  Object.defineProperty(String.prototype, "displayName", {
    get() {
      return getCategoryDisplayName(this);
    }
  });
}
if (!Object.getOwnPropertyDescriptor(String.prototype, "categoryInfo")) {
  Object.defineProperty(String.prototype, "categoryInfo", {
    get() {
      return getCategoryInfo(this);
    }
  });
}

// src/showmasterpiece/logic/shared/format.ts
var formatPrice = (price) => {
  if (!price) return "\u4EF7\u683C\u5F85\u5B9A";
  return `\xA5${price}`;
};

// src/showmasterpiece/logic/shared/category.ts
var CATEGORY_LABELS = {
  collection: "\u753B\u96C6",
  acrylic: "\u7ACB\u724C",
  badge: "\u5427\u5527",
  color_paper: "\u8272\u7EB8",
  transparent_card: "\u900F\u5361",
  postcard: "\u660E\u4FE1\u7247",
  laser_ticket: "\u956D\u5C04\u7968",
  canvas_bag: "\u5E06\u5E03\u5305",
  spiral_notebook: "\u7EBF\u5708\u672C",
  mouse_pad: "\u9F20\u6807\u57AB",
  support_stick: "\u5E94\u63F4\u68D2",
  keychain: "\u6302\u4EF6/\u94A5\u5319\u6263",
  other: "\u5176\u5B83"
};
var getCategoryLabel = (category) => {
  if (!category) return "\u672A\u5206\u7C7B";
  return CATEGORY_LABELS[String(category)] ?? String(category);
};

// src/showmasterpiece/ui/miniapp/components/CollectionCard.tsx
var CollectionCard = ({
  collection,
  actions,
  showCategory = true,
  showDescription = true,
  variant = "default"
}) => {
  const isCompact = variant === "compact";
  const pageCount = collection.pages?.length ?? 0;
  const isCollection = collection.category === "collection" /* COLLECTION */;
  const badgeText = isCollection ? pageCount > 0 ? `${pageCount} \u9875` : "\u753B\u96C6" : "\u5546\u54C1";
  return /* @__PURE__ */ React3.createElement(
    View,
    {
      className: isCompact ? "flex gap-3 rounded-2xl border border-prussian-blue-200/30 bg-white/95 p-3 shadow-sm" : "overflow-hidden rounded-2xl border border-prussian-blue-200/30 bg-gradient-to-br from-white to-prussian-blue-900/5 shadow-lg"
    },
    /* @__PURE__ */ React3.createElement(
      View,
      {
        className: isCompact ? "relative h-20 w-16 flex-shrink-0 overflow-hidden rounded-xl bg-gradient-to-br from-prussian-blue-900/5 to-oxford-blue-100/10" : "relative w-full overflow-hidden bg-gradient-to-br from-prussian-blue-900/5 to-oxford-blue-100/10 aspect-[1/1.414]"
      },
      collection.coverImage ? /* @__PURE__ */ React3.createElement(
        Image,
        {
          src: collection.coverImage,
          mode: "aspectFill",
          className: isCompact ? "h-full w-full" : "h-full w-full"
        }
      ) : /* @__PURE__ */ React3.createElement(View, { className: "flex h-full w-full items-center justify-center text-xs text-prussian-blue-500" }, "\u6682\u65E0\u56FE\u7247"),
      !isCompact && /* @__PURE__ */ React3.createElement(View, { className: "absolute bottom-3 left-3 rounded-full bg-moonstone/90 px-3 py-1 text-[10px] font-semibold text-white shadow-lg" }, /* @__PURE__ */ React3.createElement(Text, null, badgeText))
    ),
    /* @__PURE__ */ React3.createElement(View, { className: isCompact ? "flex-1" : "p-4" }, /* @__PURE__ */ React3.createElement(Text, { className: isCompact ? "text-sm font-semibold text-rich-black" : "text-base font-bold text-rich-black" }, collection.title), /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-prussian-blue-600" }, "\u7F16\u53F7\uFF1A", collection.number), showCategory && collection.category && /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-prussian-blue-600" }, "\u5206\u7C7B\uFF1A", getCategoryLabel(collection.category)), /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs font-medium text-prussian-blue-700" }, "\u4EF7\u683C\uFF1A", formatPrice(collection.price)), showDescription && collection.description && !isCompact && /* @__PURE__ */ React3.createElement(Text, { className: "mt-2 block text-xs text-prussian-blue-500" }, collection.description), actions && actions.length > 0 && /* @__PURE__ */ React3.createElement(View, { className: isCompact ? "mt-3 flex gap-2" : "mt-4 flex gap-2" }, actions.map((action) => /* @__PURE__ */ React3.createElement(
      Button,
      {
        key: action.label,
        className: action.variant === "ghost" ? "h-8 rounded-full border border-prussian-blue-200 bg-white px-4 text-xs font-semibold text-prussian-blue-700" : "h-8 rounded-full bg-gradient-to-r from-moonstone to-cerulean px-4 text-xs font-semibold text-white shadow-lg",
        onClick: action.onClick
      },
      action.label
    ))))
  );
};
var CollectionCard_default = CollectionCard;
var BookingSteps = ({ step }) => {
  return /* @__PURE__ */ React3.createElement(View, { className: "mx-4 mt-4 flex items-center justify-center" }, /* @__PURE__ */ React3.createElement(View, { className: "flex items-center" }, /* @__PURE__ */ React3.createElement(
    View,
    {
      className: `h-8 w-8 rounded-full flex items-center justify-center text-xs font-semibold ${step === "select" ? "bg-blue-600 text-white" : "bg-green-500 text-white"}`
    },
    /* @__PURE__ */ React3.createElement(Text, null, step === "select" ? "1" : "\u2713")
  ), /* @__PURE__ */ React3.createElement(Text, { className: `ml-2 text-sm ${step === "select" ? "text-blue-600" : "text-green-600"}` }, "\u9009\u62E9\u753B\u96C6")), /* @__PURE__ */ React3.createElement(View, { className: "mx-4 h-px w-10 bg-slate-300" }), /* @__PURE__ */ React3.createElement(View, { className: "flex items-center" }, /* @__PURE__ */ React3.createElement(
    View,
    {
      className: `h-8 w-8 rounded-full flex items-center justify-center text-xs font-semibold ${step === "form" ? "bg-blue-600 text-white" : "bg-slate-300 text-slate-600"}`
    },
    /* @__PURE__ */ React3.createElement(Text, null, "2")
  ), /* @__PURE__ */ React3.createElement(Text, { className: `ml-2 text-sm ${step === "form" ? "text-blue-600" : "text-slate-500"}` }, "\u586B\u5199\u4FE1\u606F")));
};
var BookingSteps_default = BookingSteps;
var FormInput = ({
  label,
  value,
  placeholder,
  disabled,
  error,
  type = "text",
  onChange
}) => {
  return /* @__PURE__ */ React3.createElement(View, { className: "mt-4" }, /* @__PURE__ */ React3.createElement(Text, { className: "text-sm font-medium text-slate-700" }, label), /* @__PURE__ */ React3.createElement(
    Input,
    {
      value,
      placeholder,
      onInput: (event) => onChange(event.detail.value),
      className: `mt-2 h-11 w-full rounded-lg border bg-white px-3 text-sm ${error ? "border-rose-300" : "border-slate-300"}`,
      disabled,
      type
    }
  ), error && /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-rose-600" }, error));
};
var FormTextarea = ({
  label,
  value,
  placeholder,
  disabled,
  error,
  onChange
}) => {
  return /* @__PURE__ */ React3.createElement(View, { className: "mt-4" }, /* @__PURE__ */ React3.createElement(Text, { className: "text-sm font-medium text-slate-700" }, label), /* @__PURE__ */ React3.createElement(
    Textarea,
    {
      value,
      placeholder,
      onInput: (event) => onChange(event.detail.value),
      className: `mt-2 min-h-24 w-full rounded-lg border bg-white px-3 py-2 text-sm ${error ? "border-rose-300" : "border-slate-300"}`,
      disabled
    }
  ), error && /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-rose-600" }, error));
};
var CartItemCard = ({ item, onIncrease, onDecrease, onRemove }) => {
  return /* @__PURE__ */ React3.createElement(View, { className: "flex gap-3 rounded-lg border border-slate-200 bg-white p-3" }, item.collection.coverImage ? /* @__PURE__ */ React3.createElement(
    Image,
    {
      src: item.collection.coverImage,
      mode: "aspectFill",
      className: "h-16 w-16 rounded-lg"
    }
  ) : /* @__PURE__ */ React3.createElement(View, { className: "flex h-16 w-16 items-center justify-center rounded-lg bg-slate-100 text-xs text-slate-500" }, "\u6682\u65E0\u56FE\u7247"), /* @__PURE__ */ React3.createElement(View, { className: "flex-1" }, /* @__PURE__ */ React3.createElement(Text, { className: "text-sm font-semibold text-slate-900" }, item.collection.title), /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-slate-600" }, "\u7F16\u53F7\uFF1A", item.collection.number), /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-slate-600" }, "\u4EF7\u683C\uFF1A", formatPrice(item.collection.price)), /* @__PURE__ */ React3.createElement(View, { className: "mt-3 flex items-center gap-2" }, /* @__PURE__ */ React3.createElement(
    Button,
    {
      className: "h-9 w-9 rounded-full border border-slate-300 bg-white text-base text-slate-700",
      onClick: onDecrease
    },
    "-"
  ), /* @__PURE__ */ React3.createElement(Text, { className: "text-sm font-semibold" }, item.quantity), /* @__PURE__ */ React3.createElement(
    Button,
    {
      className: "h-9 w-9 rounded-full border border-slate-300 bg-white text-base text-slate-700",
      onClick: onIncrease
    },
    "+"
  ), /* @__PURE__ */ React3.createElement(
    Button,
    {
      className: "ml-auto h-9 rounded-md border border-rose-200 bg-rose-50 px-3 text-xs font-medium text-rose-600",
      onClick: onRemove
    },
    "\u79FB\u9664"
  ))));
};
var CartItemCard_default = CartItemCard;
var statusLabelMap = {
  pending: "\u5F85\u786E\u8BA4",
  confirmed: "\u5DF2\u786E\u8BA4",
  completed: "\u5DF2\u5B8C\u6210",
  cancelled: "\u5DF2\u53D6\u6D88"
};
var statusStyleMap = {
  pending: "bg-yellow-100 text-yellow-800",
  confirmed: "bg-blue-100 text-blue-800",
  completed: "bg-green-100 text-green-800",
  cancelled: "bg-red-100 text-red-800"
};
var HistoryRecordCard = ({ record }) => {
  const statusText = statusLabelMap[record.status] || record.status;
  const statusStyle = statusStyleMap[record.status] || "bg-slate-100 text-slate-600";
  return /* @__PURE__ */ React3.createElement(View, { className: "flex gap-3 rounded-lg border border-slate-200 bg-white p-4" }, record.collection?.coverImage ? /* @__PURE__ */ React3.createElement(
    Image,
    {
      src: record.collection.coverImage,
      mode: "aspectFill",
      className: "h-16 w-16 rounded-lg"
    }
  ) : /* @__PURE__ */ React3.createElement(View, { className: "flex h-16 w-16 items-center justify-center rounded-lg bg-slate-100 text-xs text-slate-500" }, "\u6682\u65E0\u56FE\u7247"), /* @__PURE__ */ React3.createElement(View, { className: "flex-1" }, /* @__PURE__ */ React3.createElement(Text, { className: "text-sm font-semibold text-slate-900" }, record.collection?.title || "\u753B\u96C6"), /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-slate-600" }, "\u6570\u91CF\uFF1A", record.quantity), /* @__PURE__ */ React3.createElement(Text, { className: "mt-1 block text-xs text-slate-600" }, "\u4EF7\u683C\uFF1A", formatPrice(record.collection?.price)), /* @__PURE__ */ React3.createElement(View, { className: "mt-2 flex items-center justify-between" }, /* @__PURE__ */ React3.createElement(View, { className: `rounded-full px-2 py-0.5 text-[10px] font-medium ${statusStyle}` }, /* @__PURE__ */ React3.createElement(Text, null, statusText)), /* @__PURE__ */ React3.createElement(Text, { className: "text-xs text-slate-400" }, record.createdAt?.slice(0, 10)))));
};
var HistoryRecordCard_default = HistoryRecordCard;

export { BookingSteps_default as BookingSteps, CartItemCard_default as CartItemCard, CategoryTabs_default as CategoryTabs, FormInput, FormTextarea, HistoryRecordCard_default as HistoryRecordCard, CollectionCard_default as MiniappCollectionCard, PageHeader_default as PageHeader };
//# sourceMappingURL=index.mjs.map
//# sourceMappingURL=index.mjs.map