@cedros/pay-react 1.1.25 → 1.1.26

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.
Files changed (94) hide show
  1. package/dist/{AISettingsSection-Dg1kazTI.mjs → AISettingsSection-BlIv3CzS.mjs} +2 -2
  2. package/dist/{AISettingsSection-BvSSiK2G.js → AISettingsSection-DELur7D2.js} +1 -1
  3. package/dist/{AutosaveIndicator-BHfkV59p.mjs → AutosaveIndicator-Bed0-ekg.mjs} +1 -1
  4. package/dist/{AutosaveIndicator-D2l7U8R1.js → AutosaveIndicator-Dn_qA2hK.js} +1 -1
  5. package/dist/ChatLogsSection-BH5tLA4T.js +1 -0
  6. package/dist/ChatLogsSection-v4zwzCTC.mjs +201 -0
  7. package/dist/{ComplianceSection-BSE2f3Wo.mjs → ComplianceSection-CemgfDrL.mjs} +282 -166
  8. package/dist/ComplianceSection-DP2a9-S0.js +1 -0
  9. package/dist/CustomersSection-CBwy_waO.js +1 -0
  10. package/dist/CustomersSection-D_j7OrfS.mjs +207 -0
  11. package/dist/DisputesSection-BLjIk60n.js +1 -0
  12. package/dist/DisputesSection-BcAbXp3K.mjs +230 -0
  13. package/dist/{FAQSection-uZG5V3pJ.mjs → FAQSection-Dn38OhB_.mjs} +1 -1
  14. package/dist/{FAQSection-6nGI0FK9.js → FAQSection-wNeH0i6Q.js} +1 -1
  15. package/dist/ImagesSection-0ZzKlzMJ.js +1 -0
  16. package/dist/ImagesSection-Ctw9Icym.mjs +216 -0
  17. package/dist/InventorySection-DmhjUlRZ.mjs +150 -0
  18. package/dist/InventorySection-zV6lTmue.js +1 -0
  19. package/dist/{MessagingSection-M0lj5yo4.mjs → MessagingSection-B1FaGxkp.mjs} +2 -2
  20. package/dist/{MessagingSection-DrXb578q.js → MessagingSection-B_wdFR0j.js} +1 -1
  21. package/dist/{OrdersSection-DteItv_O.mjs → OrdersSection-Bj8bPdg8.mjs} +1 -1
  22. package/dist/{OrdersSection-_-rIw6XW.js → OrdersSection-Dw2FX-1d.js} +1 -1
  23. package/dist/{PaymentSettingsSection-enTbUI95.js → PaymentSettingsSection-BYF4D-GR.js} +1 -1
  24. package/dist/{PaymentSettingsSection-CdtdLFTg.mjs → PaymentSettingsSection-EnMxeWjv.mjs} +1 -1
  25. package/dist/ReturnsSection-BC0L8r2e.mjs +267 -0
  26. package/dist/ReturnsSection-D_pJVxuG.js +1 -0
  27. package/dist/{SettingsSection-mcT4LEhO.mjs → SettingsSection-KYdEizq_.mjs} +1 -1
  28. package/dist/{SettingsSection-DUTEd6uV.js → SettingsSection-vdYFSNxB.js} +1 -1
  29. package/dist/ShippingSection-1DRSTu49.js +1 -0
  30. package/dist/ShippingSection-BOgto6_9.mjs +434 -0
  31. package/dist/{SingleCategorySettings-D2LVM5mn.js → SingleCategorySettings-DwCnBdRf.js} +1 -1
  32. package/dist/{SingleCategorySettings-BvHBVfSe.mjs → SingleCategorySettings-suJ8z9d8.mjs} +2 -2
  33. package/dist/{StorefrontSection-BqQ36JIS.mjs → StorefrontSection-BRvIGBEJ.mjs} +2 -2
  34. package/dist/{StorefrontSection-Du7hV2Gc.js → StorefrontSection-RumGkb3C.js} +1 -1
  35. package/dist/{SubscriptionsSection-C4BRN1dP.js → SubscriptionsSection-C2aLLn7L.js} +1 -1
  36. package/dist/{SubscriptionsSection-BYiCBwKZ.mjs → SubscriptionsSection-D60qrX9a.mjs} +1 -1
  37. package/dist/TaxSection-C7-pv-Rl.mjs +294 -0
  38. package/dist/TaxSection-Dt1DnM51.js +1 -0
  39. package/dist/{Token22Section-BHvOhz5d.mjs → Token22Section-CrHLQ0EB.mjs} +1 -1
  40. package/dist/{Token22Section-0c22NM5G.js → Token22Section-DY3mUwTY.js} +1 -1
  41. package/dist/WebhooksSection-CKeiJ7Py.js +1 -0
  42. package/dist/WebhooksSection-COPW4Ec0.mjs +223 -0
  43. package/dist/crypto-only.js +1 -1
  44. package/dist/crypto-only.mjs +1 -1
  45. package/dist/index-C0g-JxJk.js +84 -0
  46. package/dist/{index-BkDimQDF.mjs → index-DXnuQp5x.mjs} +7068 -6768
  47. package/dist/index.js +1 -1
  48. package/dist/index.mjs +1 -1
  49. package/dist/{sections-By4H1baL.mjs → sections-C1NpK7hk.mjs} +2 -2
  50. package/dist/{sections-5jO2aHAo.js → sections-DVVSZBhW.js} +1 -1
  51. package/dist/src/components/ComplianceGatePage.d.ts +3 -1
  52. package/dist/src/components/ComplianceGatePage.d.ts.map +1 -1
  53. package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts +1 -1
  54. package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -1
  55. package/dist/src/components/admin/ChatLogsSection.d.ts +3 -0
  56. package/dist/src/components/admin/ChatLogsSection.d.ts.map +1 -0
  57. package/dist/src/components/admin/ComplianceKycTab.d.ts +3 -0
  58. package/dist/src/components/admin/ComplianceKycTab.d.ts.map +1 -0
  59. package/dist/src/components/admin/ComplianceRequirementsEditor.d.ts +8 -0
  60. package/dist/src/components/admin/ComplianceRequirementsEditor.d.ts.map +1 -0
  61. package/dist/src/components/admin/ComplianceSection.d.ts.map +1 -1
  62. package/dist/src/components/admin/CustomersSection.d.ts +3 -0
  63. package/dist/src/components/admin/CustomersSection.d.ts.map +1 -0
  64. package/dist/src/components/admin/DisputesSection.d.ts +3 -0
  65. package/dist/src/components/admin/DisputesSection.d.ts.map +1 -0
  66. package/dist/src/components/admin/ImagesSection.d.ts +3 -0
  67. package/dist/src/components/admin/ImagesSection.d.ts.map +1 -0
  68. package/dist/src/components/admin/InventorySection.d.ts +3 -0
  69. package/dist/src/components/admin/InventorySection.d.ts.map +1 -0
  70. package/dist/src/components/admin/NftMetadataPreview.d.ts +20 -0
  71. package/dist/src/components/admin/NftMetadataPreview.d.ts.map +1 -0
  72. package/dist/src/components/admin/ProductsSection.d.ts.map +1 -1
  73. package/dist/src/components/admin/ReturnsSection.d.ts +3 -0
  74. package/dist/src/components/admin/ReturnsSection.d.ts.map +1 -0
  75. package/dist/src/components/admin/ShippingSection.d.ts +3 -0
  76. package/dist/src/components/admin/ShippingSection.d.ts.map +1 -0
  77. package/dist/src/components/admin/TaxSection.d.ts +3 -0
  78. package/dist/src/components/admin/TaxSection.d.ts.map +1 -0
  79. package/dist/src/components/admin/WebhooksSection.d.ts +3 -0
  80. package/dist/src/components/admin/WebhooksSection.d.ts.map +1 -0
  81. package/dist/src/components/admin/complianceTypes.d.ts +15 -1
  82. package/dist/src/components/admin/complianceTypes.d.ts.map +1 -1
  83. package/dist/src/ecommerce/adapters/CommerceAdapter.d.ts +36 -0
  84. package/dist/src/ecommerce/adapters/CommerceAdapter.d.ts.map +1 -1
  85. package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
  86. package/dist/src/ecommerce/components/chat/ShopChatPanel.d.ts +8 -5
  87. package/dist/src/ecommerce/components/chat/ShopChatPanel.d.ts.map +1 -1
  88. package/dist/src/ecommerce/index.d.ts +2 -2
  89. package/dist/src/ecommerce/index.d.ts.map +1 -1
  90. package/dist/src/hooks/useComplianceCheck.d.ts +1 -1
  91. package/dist/src/hooks/useComplianceCheck.d.ts.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/ComplianceSection-D6ETKG6b.js +0 -1
  94. package/dist/index-C7MWL6O8.js +0 -84
@@ -1,7 +1,7 @@
1
1
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
2
  import { useState as u, useRef as S, useCallback as A, useEffect as T, useMemo as q } from "react";
3
- import { I as w, E as J, F as Y } from "./index-BkDimQDF.mjs";
4
- import { A as X } from "./AutosaveIndicator-BHfkV59p.mjs";
3
+ import { I as w, E as J, F as Y } from "./index-DXnuQp5x.mjs";
4
+ import { A as X } from "./AutosaveIndicator-Bed0-ekg.mjs";
5
5
  const C = [
6
6
  { id: "not_set", label: "Disabled", provider: null },
7
7
  { id: "gemini-2.5-flash", label: "Gemini 2.5 Flash", provider: "gemini" },
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),b=require("./index-C7MWL6O8.js"),z=require("./AutosaveIndicator-D2l7U8R1.js"),w=[{id:"not_set",label:"Disabled",provider:null},{id:"gemini-2.5-flash",label:"Gemini 2.5 Flash",provider:"gemini"},{id:"gemini-2.5-pro",label:"Gemini 2.5 Pro",provider:"gemini"},{id:"openai-4o",label:"OpenAI 4o",provider:"openai"},{id:"openai-5.1",label:"OpenAI 5.1",provider:"openai"},{id:"openai-5.2",label:"OpenAI 5.2",provider:"openai"}],P=[{task:"site_chat",label:"Site Chat",description:"The conversational model that crafts responses to customer messages",defaultPrompt:`You are a friendly and helpful shopping assistant for our store. Your role is to:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),b=require("./index-C0g-JxJk.js"),z=require("./AutosaveIndicator-Dn_qA2hK.js"),w=[{id:"not_set",label:"Disabled",provider:null},{id:"gemini-2.5-flash",label:"Gemini 2.5 Flash",provider:"gemini"},{id:"gemini-2.5-pro",label:"Gemini 2.5 Pro",provider:"gemini"},{id:"openai-4o",label:"OpenAI 4o",provider:"openai"},{id:"openai-5.1",label:"OpenAI 5.1",provider:"openai"},{id:"openai-5.2",label:"OpenAI 5.2",provider:"openai"}],P=[{task:"site_chat",label:"Site Chat",description:"The conversational model that crafts responses to customer messages",defaultPrompt:`You are a friendly and helpful shopping assistant for our store. Your role is to:
2
2
 
3
3
  - Help customers find products that match their needs
4
4
  - Answer questions about products, shipping, returns, and store policies
@@ -1,5 +1,5 @@
1
1
  import { jsxs as n, jsx as r, Fragment as i } from "react/jsx-runtime";
2
- import { I as d } from "./index-BkDimQDF.mjs";
2
+ import { I as d } from "./index-DXnuQp5x.mjs";
3
3
  function l({ status: e, error: a }) {
4
4
  return e === "idle" ? null : /* @__PURE__ */ n(
5
5
  "span",
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),i=require("./index-C7MWL6O8.js");function a({status:n,error:r}){return n==="idle"?null:e.jsxs("span",{className:`cedros-admin__autosave-indicator cedros-admin__autosave-indicator--${n}`,style:{display:"inline-flex",alignItems:"center",gap:"0.375rem",fontSize:"0.8125rem",color:n==="error"?"var(--cedros-admin-error, #ef4444)":"var(--cedros-admin-text-muted, #64748b)"},children:[n==="pending"&&e.jsx("span",{style:{opacity:.7},children:"Unsaved changes"}),n==="saving"&&e.jsxs(e.Fragment,{children:[i.Icons.loading,e.jsx("span",{children:"Saving..."})]}),n==="saved"&&e.jsxs(e.Fragment,{children:[i.Icons.check,e.jsx("span",{style:{color:"var(--cedros-admin-success, #22c55e)"},children:"Saved"})]}),n==="error"&&e.jsxs("span",{children:["Save failed",r?`: ${r}`:""]})]})}exports.AutosaveIndicator=a;
1
+ "use strict";const e=require("react/jsx-runtime"),i=require("./index-C0g-JxJk.js");function a({status:n,error:r}){return n==="idle"?null:e.jsxs("span",{className:`cedros-admin__autosave-indicator cedros-admin__autosave-indicator--${n}`,style:{display:"inline-flex",alignItems:"center",gap:"0.375rem",fontSize:"0.8125rem",color:n==="error"?"var(--cedros-admin-error, #ef4444)":"var(--cedros-admin-text-muted, #64748b)"},children:[n==="pending"&&e.jsx("span",{style:{opacity:.7},children:"Unsaved changes"}),n==="saving"&&e.jsxs(e.Fragment,{children:[i.Icons.loading,e.jsx("span",{children:"Saving..."})]}),n==="saved"&&e.jsxs(e.Fragment,{children:[i.Icons.check,e.jsx("span",{style:{color:"var(--cedros-admin-success, #22c55e)"},children:"Saved"})]}),n==="error"&&e.jsxs("span",{children:["Save failed",r?`: ${r}`:""]})]})}exports.AutosaveIndicator=a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),i=require("./index-C0g-JxJk.js");function D({serverUrl:_,apiKey:l,pageSize:o=20,authManager:m}){const[g,b]=a.useState([]),[h,w]=a.useState(0),[r,u]=a.useState(0),[A,p]=a.useState(!0),[k,x]=a.useState(null),[d,T]=a.useState("all"),[y,v]=a.useState(null),[L,S]=a.useState(!1),f=a.useCallback(async t=>{if(m?.isAuthenticated())return m.fetchWithAuth(t);const n={"Content-Type":"application/json"};l&&(n["X-API-Key"]=l);const s=await fetch(`${_}${t}`,{headers:n});if(!s.ok)throw new Error(`Request failed: ${s.status}`);return s.json()},[_,l,m]),C=a.useCallback(async()=>{p(!0),x(null);try{const t=new URLSearchParams;t.set("limit",String(o)),t.set("offset",String(r)),d!=="all"&&t.set("status",d);const n=await f(`/admin/chats?${t.toString()}`);b(n.sessions??[]),w(n.total??0)}catch{x("Failed to load chat sessions"),b([])}finally{p(!1)}},[f,o,r,d]);a.useEffect(()=>{C()},[C]);const I=async t=>{S(!0);try{const n=await f(`/admin/chats/${encodeURIComponent(t)}`);v(n)}catch{x("Failed to load chat session")}finally{S(!1)}},j=Math.max(1,Math.ceil(h/o)),N=Math.floor(r/o)+1;if(y){const{session:t,messages:n}=y;return e.jsxs("div",{children:[e.jsx("button",{type:"button",className:"cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",onClick:()=>v(null),style:{marginBottom:"1rem"},children:"← Back to sessions"}),e.jsx("div",{className:"cedros-admin__section-header",children:e.jsxs("h3",{className:"cedros-admin__section-title",children:["Chat Session",e.jsxs("span",{className:"cedros-admin__badge cedros-admin__badge--muted",style:{marginLeft:"0.5rem"},children:[t.messageCount," messages"]})]})}),e.jsxs("div",{style:{fontSize:"0.85rem",color:"var(--cedros-admin-text-muted, #888)",marginBottom:"1rem"},children:[t.customerEmail&&e.jsxs("span",{children:["Customer: ",e.jsx("strong",{children:t.customerEmail})," · "]}),"Started ",i.formatDateTime(t.createdAt)," · Last message ",i.formatDateTime(t.lastMessageAt)]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",maxWidth:"640px"},children:n.map(s=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:s.role==="user"?"flex-end":"flex-start"},children:[e.jsx("div",{style:{maxWidth:"85%",padding:"0.5rem 0.75rem",borderRadius:"0.75rem",fontSize:"0.85rem",lineHeight:"1.4",background:s.role==="user"?"var(--cedros-admin-bg-dark, #1a1a1a)":"var(--cedros-admin-bg-muted, #f5f5f5)",color:s.role==="user"?"#fff":"var(--cedros-admin-text, #333)"},children:e.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s.content})}),s.products&&s.products.length>0&&e.jsx("div",{style:{maxWidth:"85%",marginTop:"0.25rem",display:"flex",flexWrap:"wrap",gap:"0.25rem"},children:s.products.map(c=>e.jsxs("span",{className:"cedros-admin__badge cedros-admin__badge--muted",style:{fontSize:"0.75rem"},children:[c.name,c.priceCents!=null?` ($${(c.priceCents/100).toFixed(2)})`:""]},c.id))}),s.actions&&s.actions.length>0&&e.jsx("div",{style:{maxWidth:"85%",marginTop:"0.25rem",fontSize:"0.75rem",fontStyle:"italic",color:"var(--cedros-admin-text-muted, #888)"},children:s.actions.join(" · ")}),e.jsx("div",{style:{fontSize:"0.7rem",color:"var(--cedros-admin-text-muted, #aaa)",marginTop:"0.15rem"},children:i.formatDateTime(s.createdAt)})]},s.id))})]})}return e.jsxs("div",{children:[e.jsx("div",{className:"cedros-admin__section-header",children:e.jsx("h3",{className:"cedros-admin__section-title",children:"Chat Logs"})}),e.jsx(i.ErrorBanner,{message:k}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginBottom:"1rem",alignItems:"center"},children:[e.jsxs("select",{className:"cedros-admin__input",value:d,onChange:t=>{T(t.target.value),u(0)},style:{width:"auto",fontSize:"0.85rem"},children:[e.jsx("option",{value:"all",children:"All statuses"}),e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"archived",children:"Archived"})]}),e.jsxs("span",{style:{fontSize:"0.85rem",color:"var(--cedros-admin-text-muted, #888)"},children:[h," session",h!==1?"s":""]})]}),A||L?e.jsxs("div",{className:"cedros-admin__loading",children:[i.Icons.loading," Loading chat sessions..."]}):g.length===0?e.jsx("div",{className:"cedros-admin__empty",children:"No chat sessions found."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"cedros-admin__table-container",children:e.jsxs("table",{className:"cedros-admin__table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Customer"}),e.jsx("th",{children:"Messages"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Last Message"}),e.jsx("th",{children:"Started"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{children:[e.jsx("td",{children:t.customerEmail?e.jsx("span",{title:t.customerId,children:t.customerEmail}):t.customerId?e.jsxs("code",{style:{fontSize:"0.75rem"},children:[t.customerId.slice(0,12),"..."]}):e.jsx("span",{style:{color:"var(--cedros-admin-text-muted, #888)"},children:"Anonymous"})}),e.jsx("td",{children:t.messageCount}),e.jsx("td",{children:e.jsx("span",{className:`cedros-admin__badge cedros-admin__badge--${t.status==="active"?"success":"muted"}`,children:t.status})}),e.jsx("td",{children:i.formatDateTime(t.lastMessageAt)}),e.jsx("td",{children:i.formatDateTime(t.createdAt)}),e.jsx("td",{children:e.jsx("button",{type:"button",className:"cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",onClick:()=>I(t.id),children:"View"})})]},t.id))})]})}),j>1&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"0.75rem",fontSize:"0.85rem"},children:[e.jsx("button",{type:"button",className:"cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",disabled:r===0,onClick:()=>u(Math.max(0,r-o)),children:"Previous"}),e.jsxs("span",{children:["Page ",N," of ",j]}),e.jsx("button",{type:"button",className:"cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",disabled:N>=j,onClick:()=>u(r+o),children:"Next"})]})]})]})}exports.ChatLogsSection=D;
@@ -0,0 +1,201 @@
1
+ import { jsxs as s, jsx as e, Fragment as W } from "react/jsx-runtime";
2
+ import { useState as i, useCallback as k, useEffect as j } from "react";
3
+ import { k as r, E as B, I as M } from "./index-DXnuQp5x.mjs";
4
+ function R({ serverUrl: b, apiKey: m, pageSize: o = 20, authManager: h }) {
5
+ const [y, v] = i([]), [u, I] = i(0), [d, f] = i(0), [E, x] = i(!0), [L, _] = i(null), [c, $] = i("all"), [S, C] = i(null), [F, N] = i(!1), p = k(async (t) => {
6
+ if (h?.isAuthenticated())
7
+ return h.fetchWithAuth(t);
8
+ const a = { "Content-Type": "application/json" };
9
+ m && (a["X-API-Key"] = m);
10
+ const n = await fetch(`${b}${t}`, { headers: a });
11
+ if (!n.ok) throw new Error(`Request failed: ${n.status}`);
12
+ return n.json();
13
+ }, [b, m, h]), w = k(async () => {
14
+ x(!0), _(null);
15
+ try {
16
+ const t = new URLSearchParams();
17
+ t.set("limit", String(o)), t.set("offset", String(d)), c !== "all" && t.set("status", c);
18
+ const a = await p(
19
+ `/admin/chats?${t.toString()}`
20
+ );
21
+ v(a.sessions ?? []), I(a.total ?? 0);
22
+ } catch {
23
+ _("Failed to load chat sessions"), v([]);
24
+ } finally {
25
+ x(!1);
26
+ }
27
+ }, [p, o, d, c]);
28
+ j(() => {
29
+ w();
30
+ }, [w]);
31
+ const T = async (t) => {
32
+ N(!0);
33
+ try {
34
+ const a = await p(`/admin/chats/${encodeURIComponent(t)}`);
35
+ C(a);
36
+ } catch {
37
+ _("Failed to load chat session");
38
+ } finally {
39
+ N(!1);
40
+ }
41
+ }, g = Math.max(1, Math.ceil(u / o)), A = Math.floor(d / o) + 1;
42
+ if (S) {
43
+ const { session: t, messages: a } = S;
44
+ return /* @__PURE__ */ s("div", { children: [
45
+ /* @__PURE__ */ e(
46
+ "button",
47
+ {
48
+ type: "button",
49
+ className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",
50
+ onClick: () => C(null),
51
+ style: { marginBottom: "1rem" },
52
+ children: "← Back to sessions"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ s("h3", { className: "cedros-admin__section-title", children: [
56
+ "Chat Session",
57
+ /* @__PURE__ */ s("span", { className: "cedros-admin__badge cedros-admin__badge--muted", style: { marginLeft: "0.5rem" }, children: [
58
+ t.messageCount,
59
+ " messages"
60
+ ] })
61
+ ] }) }),
62
+ /* @__PURE__ */ s("div", { style: { fontSize: "0.85rem", color: "var(--cedros-admin-text-muted, #888)", marginBottom: "1rem" }, children: [
63
+ t.customerEmail && /* @__PURE__ */ s("span", { children: [
64
+ "Customer: ",
65
+ /* @__PURE__ */ e("strong", { children: t.customerEmail }),
66
+ " · "
67
+ ] }),
68
+ "Started ",
69
+ r(t.createdAt),
70
+ " · Last message ",
71
+ r(t.lastMessageAt)
72
+ ] }),
73
+ /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: "0.75rem", maxWidth: "640px" }, children: a.map((n) => /* @__PURE__ */ s(
74
+ "div",
75
+ {
76
+ style: {
77
+ display: "flex",
78
+ flexDirection: "column",
79
+ alignItems: n.role === "user" ? "flex-end" : "flex-start"
80
+ },
81
+ children: [
82
+ /* @__PURE__ */ e(
83
+ "div",
84
+ {
85
+ style: {
86
+ maxWidth: "85%",
87
+ padding: "0.5rem 0.75rem",
88
+ borderRadius: "0.75rem",
89
+ fontSize: "0.85rem",
90
+ lineHeight: "1.4",
91
+ background: n.role === "user" ? "var(--cedros-admin-bg-dark, #1a1a1a)" : "var(--cedros-admin-bg-muted, #f5f5f5)",
92
+ color: n.role === "user" ? "#fff" : "var(--cedros-admin-text, #333)"
93
+ },
94
+ children: /* @__PURE__ */ e("span", { style: { whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: n.content })
95
+ }
96
+ ),
97
+ n.products && n.products.length > 0 && /* @__PURE__ */ e("div", { style: { maxWidth: "85%", marginTop: "0.25rem", display: "flex", flexWrap: "wrap", gap: "0.25rem" }, children: n.products.map((l) => /* @__PURE__ */ s("span", { className: "cedros-admin__badge cedros-admin__badge--muted", style: { fontSize: "0.75rem" }, children: [
98
+ l.name,
99
+ l.priceCents != null ? ` ($${(l.priceCents / 100).toFixed(2)})` : ""
100
+ ] }, l.id)) }),
101
+ n.actions && n.actions.length > 0 && /* @__PURE__ */ e("div", { style: { maxWidth: "85%", marginTop: "0.25rem", fontSize: "0.75rem", fontStyle: "italic", color: "var(--cedros-admin-text-muted, #888)" }, children: n.actions.join(" · ") }),
102
+ /* @__PURE__ */ e("div", { style: { fontSize: "0.7rem", color: "var(--cedros-admin-text-muted, #aaa)", marginTop: "0.15rem" }, children: r(n.createdAt) })
103
+ ]
104
+ },
105
+ n.id
106
+ )) })
107
+ ] });
108
+ }
109
+ return /* @__PURE__ */ s("div", { children: [
110
+ /* @__PURE__ */ e("div", { className: "cedros-admin__section-header", children: /* @__PURE__ */ e("h3", { className: "cedros-admin__section-title", children: "Chat Logs" }) }),
111
+ /* @__PURE__ */ e(B, { message: L }),
112
+ /* @__PURE__ */ s("div", { style: { display: "flex", gap: "0.5rem", marginBottom: "1rem", alignItems: "center" }, children: [
113
+ /* @__PURE__ */ s(
114
+ "select",
115
+ {
116
+ className: "cedros-admin__input",
117
+ value: c,
118
+ onChange: (t) => {
119
+ $(t.target.value), f(0);
120
+ },
121
+ style: { width: "auto", fontSize: "0.85rem" },
122
+ children: [
123
+ /* @__PURE__ */ e("option", { value: "all", children: "All statuses" }),
124
+ /* @__PURE__ */ e("option", { value: "active", children: "Active" }),
125
+ /* @__PURE__ */ e("option", { value: "archived", children: "Archived" })
126
+ ]
127
+ }
128
+ ),
129
+ /* @__PURE__ */ s("span", { style: { fontSize: "0.85rem", color: "var(--cedros-admin-text-muted, #888)" }, children: [
130
+ u,
131
+ " session",
132
+ u !== 1 ? "s" : ""
133
+ ] })
134
+ ] }),
135
+ E || F ? /* @__PURE__ */ s("div", { className: "cedros-admin__loading", children: [
136
+ M.loading,
137
+ " Loading chat sessions..."
138
+ ] }) : y.length === 0 ? /* @__PURE__ */ e("div", { className: "cedros-admin__empty", children: "No chat sessions found." }) : /* @__PURE__ */ s(W, { children: [
139
+ /* @__PURE__ */ e("div", { className: "cedros-admin__table-container", children: /* @__PURE__ */ s("table", { className: "cedros-admin__table", children: [
140
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
141
+ /* @__PURE__ */ e("th", { children: "Customer" }),
142
+ /* @__PURE__ */ e("th", { children: "Messages" }),
143
+ /* @__PURE__ */ e("th", { children: "Status" }),
144
+ /* @__PURE__ */ e("th", { children: "Last Message" }),
145
+ /* @__PURE__ */ e("th", { children: "Started" }),
146
+ /* @__PURE__ */ e("th", {})
147
+ ] }) }),
148
+ /* @__PURE__ */ e("tbody", { children: y.map((t) => /* @__PURE__ */ s("tr", { children: [
149
+ /* @__PURE__ */ e("td", { children: t.customerEmail ? /* @__PURE__ */ e("span", { title: t.customerId, children: t.customerEmail }) : t.customerId ? /* @__PURE__ */ s("code", { style: { fontSize: "0.75rem" }, children: [
150
+ t.customerId.slice(0, 12),
151
+ "..."
152
+ ] }) : /* @__PURE__ */ e("span", { style: { color: "var(--cedros-admin-text-muted, #888)" }, children: "Anonymous" }) }),
153
+ /* @__PURE__ */ e("td", { children: t.messageCount }),
154
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `cedros-admin__badge cedros-admin__badge--${t.status === "active" ? "success" : "muted"}`, children: t.status }) }),
155
+ /* @__PURE__ */ e("td", { children: r(t.lastMessageAt) }),
156
+ /* @__PURE__ */ e("td", { children: r(t.createdAt) }),
157
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
158
+ "button",
159
+ {
160
+ type: "button",
161
+ className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",
162
+ onClick: () => T(t.id),
163
+ children: "View"
164
+ }
165
+ ) })
166
+ ] }, t.id)) })
167
+ ] }) }),
168
+ g > 1 && /* @__PURE__ */ s("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginTop: "0.75rem", fontSize: "0.85rem" }, children: [
169
+ /* @__PURE__ */ e(
170
+ "button",
171
+ {
172
+ type: "button",
173
+ className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",
174
+ disabled: d === 0,
175
+ onClick: () => f(Math.max(0, d - o)),
176
+ children: "Previous"
177
+ }
178
+ ),
179
+ /* @__PURE__ */ s("span", { children: [
180
+ "Page ",
181
+ A,
182
+ " of ",
183
+ g
184
+ ] }),
185
+ /* @__PURE__ */ e(
186
+ "button",
187
+ {
188
+ type: "button",
189
+ className: "cedros-admin__button cedros-admin__button--ghost cedros-admin__button--sm",
190
+ disabled: A >= g,
191
+ onClick: () => f(d + o),
192
+ children: "Next"
193
+ }
194
+ )
195
+ ] })
196
+ ] })
197
+ ] });
198
+ }
199
+ export {
200
+ R as ChatLogsSection
201
+ };