@linktr.ee/messaging-react 1.31.0-rc-1776677746 → 1.31.0-rc-1776748331

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 (35) hide show
  1. package/dist/Card-B1gJkHn-.js +205 -0
  2. package/dist/Card-B1gJkHn-.js.map +1 -0
  3. package/dist/{Creator-DGe3CQ_j.js → Card-C5t3dZ5q.js} +177 -150
  4. package/dist/Card-C5t3dZ5q.js.map +1 -0
  5. package/dist/index.d.ts +35 -30
  6. package/dist/index.js +951 -956
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/ChannelView.tsx +24 -36
  10. package/src/components/CustomMessage/CustomMessage.stories.tsx +1 -14
  11. package/src/components/CustomMessage/context.tsx +20 -0
  12. package/src/components/CustomMessage/index.tsx +39 -28
  13. package/src/components/LockedAttachment/LockedAttachment.stories.tsx +8 -13
  14. package/src/components/LockedAttachment/components/Creator/Card.tsx +159 -0
  15. package/src/components/LockedAttachment/components/Creator/CardAudioPreview.tsx +161 -0
  16. package/src/components/LockedAttachment/components/Creator/CardCollapsedThumbnail.tsx +58 -0
  17. package/src/components/LockedAttachment/components/Creator/CardImagePreview.tsx +56 -0
  18. package/src/components/LockedAttachment/components/Creator/CardVideoPreview.tsx +91 -0
  19. package/src/components/LockedAttachment/components/Creator/index.tsx +2 -0
  20. package/src/components/LockedAttachment/components/Visitor/Card.tsx +192 -0
  21. package/src/components/LockedAttachment/components/Visitor/CardActions.tsx +71 -0
  22. package/src/components/LockedAttachment/components/Visitor/CardImagePreview.tsx +39 -0
  23. package/src/components/LockedAttachment/components/Visitor/CardMediaPreview.tsx +36 -0
  24. package/src/components/LockedAttachment/components/Visitor/CardThumbnailPreview.tsx +45 -0
  25. package/src/components/LockedAttachment/components/Visitor/index.ts +2 -0
  26. package/src/components/LockedAttachment/index.tsx +16 -23
  27. package/src/components/LockedAttachment/types.ts +14 -1
  28. package/src/components/MessagingShell/index.tsx +0 -6
  29. package/src/index.ts +4 -1
  30. package/src/types.ts +0 -21
  31. package/dist/Creator-DGe3CQ_j.js.map +0 -1
  32. package/dist/Visitor-DyJTWB2_.js +0 -204
  33. package/dist/Visitor-DyJTWB2_.js.map +0 -1
  34. package/src/components/LockedAttachment/components/Creator.tsx +0 -470
  35. package/src/components/LockedAttachment/components/Visitor.tsx +0 -356
@@ -0,0 +1,205 @@
1
+ import { jsx as e, jsxs as i, Fragment as T } from "react/jsx-runtime";
2
+ import { LockSimpleIcon as U, DownloadSimpleIcon as z, CheckCircleIcon as M, LockOpenIcon as O } from "@phosphor-icons/react";
3
+ import _, { useState as y, useRef as x, useCallback as L, useEffect as j } from "react";
4
+ import { r as A, M as H, g as K } from "./MediaPlayer-BCsdmsON.js";
5
+ const P = (t) => {
6
+ const {
7
+ isLocked: c,
8
+ isUnlocking: s = !1,
9
+ sourceUrl: n,
10
+ redeemUrl: r,
11
+ onUnlockClicked: a,
12
+ onDownloadClicked: o
13
+ } = t;
14
+ return c && a != null ? /* @__PURE__ */ e(
15
+ "button",
16
+ {
17
+ type: "button",
18
+ onClick: a,
19
+ disabled: s,
20
+ className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
21
+ children: s ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ i(_.Fragment, { children: [
22
+ /* @__PURE__ */ e(U, { className: "size-4", weight: "fill" }),
23
+ "Unlock"
24
+ ] })
25
+ }
26
+ ) : !c && o != null && n != null ? /* @__PURE__ */ i(
27
+ "a",
28
+ {
29
+ href: r ?? n,
30
+ target: "_blank",
31
+ rel: "noopener noreferrer",
32
+ onClick: o,
33
+ className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none !text-white hover:bg-[#2a2928]",
34
+ children: [
35
+ /* @__PURE__ */ e(z, { className: "size-4", weight: "bold" }),
36
+ "Download"
37
+ ]
38
+ }
39
+ ) : null;
40
+ }, R = () => /* @__PURE__ */ i("span", { className: "flex items-center gap-1", children: [
41
+ /* @__PURE__ */ e("span", { className: "size-1 rounded-full bg-white animate-bounce [animation-delay:-0.3s]" }),
42
+ /* @__PURE__ */ e("span", { className: "size-1 rounded-full bg-white animate-bounce [animation-delay:-0.15s]" }),
43
+ /* @__PURE__ */ e("span", { className: "size-1 rounded-full bg-white animate-bounce" })
44
+ ] }), N = (t) => {
45
+ const { thumbnailUrl: c, mimeType: s, LockIcon: n } = t;
46
+ return /* @__PURE__ */ i("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: [
47
+ c != null ? /* @__PURE__ */ e(
48
+ "img",
49
+ {
50
+ src: c,
51
+ alt: "",
52
+ className: "absolute inset-0 h-full w-full object-cover"
53
+ }
54
+ ) : /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: A(s, {
55
+ className: "size-12 text-black/20",
56
+ weight: "regular"
57
+ }) }),
58
+ n != null ? /* @__PURE__ */ e(S, { icon: n }) : null
59
+ ] });
60
+ }, S = ({ icon: t }) => /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-black/30", children: /* @__PURE__ */ e("div", { className: "absolute left-3 top-3 flex size-8 items-center justify-center rounded-full bg-black/60", children: /* @__PURE__ */ e(t, { className: "size-4 text-white", weight: "fill" }) }) }), B = (t) => {
61
+ const { sourceUrl: c, thumbnailUrl: s, mimeType: n, title: r, LockIcon: a } = t, [o, h] = y(!1);
62
+ return a != null ? /* @__PURE__ */ e(
63
+ N,
64
+ {
65
+ thumbnailUrl: s,
66
+ mimeType: n,
67
+ LockIcon: a
68
+ }
69
+ ) : /* @__PURE__ */ e("div", { className: "relative overflow-hidden bg-black/5", children: /* @__PURE__ */ e(
70
+ "img",
71
+ {
72
+ src: c,
73
+ alt: r,
74
+ className: `block w-full transition-opacity duration-300 ${o ? "opacity-100" : "opacity-0"}`,
75
+ onLoad: () => h(!0)
76
+ }
77
+ ) });
78
+ }, V = (t) => {
79
+ const { sourceUrl: c, thumbnailUrl: s, mimeType: n, LockIcon: r } = t;
80
+ return r != null ? /* @__PURE__ */ e(
81
+ N,
82
+ {
83
+ thumbnailUrl: s,
84
+ mimeType: n,
85
+ LockIcon: r
86
+ }
87
+ ) : /* @__PURE__ */ e(
88
+ H,
89
+ {
90
+ source: c ?? "",
91
+ mimeType: n,
92
+ poster: s
93
+ }
94
+ );
95
+ };
96
+ function $(t) {
97
+ return t === "paid" ? O : U;
98
+ }
99
+ const Q = ({
100
+ title: t,
101
+ amountText: c,
102
+ thumbnailUrl: s,
103
+ mimeType: n = "application/octet-stream",
104
+ detail: r,
105
+ onUnlockClick: a,
106
+ onFetchSource: o,
107
+ onDownloadClick: h,
108
+ paymentStatus: d,
109
+ isUnlocking: E = !1
110
+ }) => {
111
+ const [l, D] = y(), k = x(!1), g = x(!1), u = x(o);
112
+ u.current = o;
113
+ const w = l === void 0, v = K(n), p = w ? $(d) : void 0, m = L(async () => {
114
+ var C;
115
+ if (!g.current) {
116
+ console.log("[LOCKED ATTACHMENT] fetchSource: starting fetch"), g.current = !0;
117
+ try {
118
+ const b = await ((C = u.current) == null ? void 0 : C.call(u));
119
+ console.log("[LOCKED ATTACHMENT] fetchSource: result received", { hasResult: !!b }), b && D(b);
120
+ } finally {
121
+ g.current = !1;
122
+ }
123
+ }
124
+ }, []);
125
+ j(() => {
126
+ if (!k.current) {
127
+ k.current = !0;
128
+ return;
129
+ }
130
+ console.log("[LOCKED ATTACHMENT] paymentStatus changed", { paymentStatus: d }), d === "paid" && (console.log("[LOCKED ATTACHMENT] paymentStatus=paid: auto-fetching source"), m());
131
+ }, [d, m]);
132
+ const I = L(() => {
133
+ d === "paid" ? (console.log("[LOCKED ATTACHMENT] handleUnlockClick: already paid, fetching source"), m()) : (console.log("[LOCKED ATTACHMENT] handleUnlockClick: not paid, opening checkout"), a == null || a());
134
+ }, [d, a, m]);
135
+ let f;
136
+ return v === "image" ? f = /* @__PURE__ */ e(
137
+ B,
138
+ {
139
+ sourceUrl: l == null ? void 0 : l.sourceUrl,
140
+ thumbnailUrl: s,
141
+ mimeType: n,
142
+ title: t,
143
+ LockIcon: p
144
+ },
145
+ l == null ? void 0 : l.sourceUrl
146
+ ) : v === "document" ? f = /* @__PURE__ */ e(
147
+ N,
148
+ {
149
+ thumbnailUrl: s,
150
+ mimeType: n,
151
+ LockIcon: p
152
+ },
153
+ l == null ? void 0 : l.sourceUrl
154
+ ) : f = /* @__PURE__ */ e(
155
+ V,
156
+ {
157
+ sourceUrl: l == null ? void 0 : l.sourceUrl,
158
+ thumbnailUrl: s,
159
+ mimeType: n,
160
+ LockIcon: p
161
+ },
162
+ l == null ? void 0 : l.sourceUrl
163
+ ), /* @__PURE__ */ i("div", { className: "w-[280px] select-none overflow-hidden rounded-[24px] bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]", children: [
164
+ f,
165
+ /* @__PURE__ */ i("div", { className: "px-4 pb-3 pt-3", children: [
166
+ /* @__PURE__ */ e("p", { className: "mb-1.5 truncate text-base font-medium text-black", children: t }),
167
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
168
+ A(n, {
169
+ className: "size-5 shrink-0 text-black/55",
170
+ weight: "regular"
171
+ }),
172
+ r != null ? /* @__PURE__ */ e("span", { className: "text-xs font-medium text-black/55", children: r }) : null,
173
+ d === "paid" ? /* @__PURE__ */ i(T, { children: [
174
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-black/55", children: "•" }),
175
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-[#008236]", children: "Purchased" }),
176
+ /* @__PURE__ */ e(
177
+ M,
178
+ {
179
+ className: "size-4 text-[#008236]",
180
+ weight: "bold"
181
+ }
182
+ )
183
+ ] }) : c != null ? /* @__PURE__ */ i(T, { children: [
184
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-black/55", children: "•" }),
185
+ /* @__PURE__ */ e("span", { className: "text-xs font-medium text-black/55", children: c })
186
+ ] }) : null
187
+ ] }),
188
+ /* @__PURE__ */ e(
189
+ P,
190
+ {
191
+ isLocked: w,
192
+ isUnlocking: E,
193
+ sourceUrl: l == null ? void 0 : l.sourceUrl,
194
+ redeemUrl: l == null ? void 0 : l.redeemUrl,
195
+ onUnlockClicked: I,
196
+ onDownloadClicked: h
197
+ }
198
+ )
199
+ ] })
200
+ ] });
201
+ };
202
+ export {
203
+ Q as default
204
+ };
205
+ //# sourceMappingURL=Card-B1gJkHn-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card-B1gJkHn-.js","sources":["../src/components/LockedAttachment/components/Visitor/CardActions.tsx","../src/components/LockedAttachment/components/Visitor/CardThumbnailPreview.tsx","../src/components/LockedAttachment/components/Visitor/CardImagePreview.tsx","../src/components/LockedAttachment/components/Visitor/CardMediaPreview.tsx","../src/components/LockedAttachment/components/Visitor/Card.tsx"],"sourcesContent":["import { DownloadSimpleIcon, LockSimpleIcon } from '@phosphor-icons/react'\nimport React from 'react'\n\ninterface CardActionsProps {\n isLocked: boolean\n isUnlocking?: boolean\n sourceUrl?: string\n redeemUrl?: string\n onUnlockClicked?: () => void\n onDownloadClicked?: () => void\n}\n\nconst CardActions: React.FC<CardActionsProps> = (props) => {\n const {\n isLocked,\n isUnlocking = false,\n sourceUrl,\n redeemUrl,\n onUnlockClicked,\n onDownloadClicked,\n } = props\n\n if (isLocked && onUnlockClicked != null) {\n return (\n <button\n type=\"button\"\n onClick={onUnlockClicked}\n disabled={isUnlocking}\n className=\"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70\"\n >\n {isUnlocking ? (\n <LoadingDots />\n ) : (\n <React.Fragment>\n <LockSimpleIcon className=\"size-4\" weight=\"fill\" />\n Unlock\n </React.Fragment>\n )}\n </button>\n )\n }\n\n if (!isLocked && onDownloadClicked != null && sourceUrl != null) {\n return (\n <a\n href={redeemUrl ?? sourceUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={onDownloadClicked}\n className=\"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none !text-white hover:bg-[#2a2928]\"\n >\n <DownloadSimpleIcon className=\"size-4\" weight=\"bold\" />\n Download\n </a>\n )\n }\n\n return null\n}\n\nconst LoadingDots: React.FC = () => {\n return (\n <span className=\"flex items-center gap-1\">\n <span className=\"size-1 rounded-full bg-white animate-bounce [animation-delay:-0.3s]\" />\n <span className=\"size-1 rounded-full bg-white animate-bounce [animation-delay:-0.15s]\" />\n <span className=\"size-1 rounded-full bg-white animate-bounce\" />\n </span>\n )\n}\n\nexport default CardActions\n","import React from 'react'\n\nimport { renderTypeIcon } from '../../utils/icons'\n\ninterface ThumbnailPreviewProps {\n thumbnailUrl?: string\n mimeType: string\n LockIcon?: React.ElementType\n}\n\nconst ThumbnailPreview: React.FC<ThumbnailPreviewProps> = (props) => {\n const { thumbnailUrl, mimeType, LockIcon } = props\n\n return (\n <div className=\"relative aspect-video overflow-hidden bg-black/5\">\n {thumbnailUrl != null ? (\n <img\n src={thumbnailUrl}\n alt=\"\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n ) : (\n <div className=\"absolute inset-0 flex items-center justify-center\">\n {renderTypeIcon(mimeType, {\n className: 'size-12 text-black/20',\n weight: 'regular',\n })}\n </div>\n )}\n {LockIcon != null ? <LockOverlay icon={LockIcon} /> : null}\n </div>\n )\n}\n\nconst LockOverlay: React.FC<{ icon: React.ElementType }> = ({ icon: Icon }) => {\n return (\n <div className=\"absolute inset-0 bg-black/30\">\n <div className=\"absolute left-3 top-3 flex size-8 items-center justify-center rounded-full bg-black/60\">\n <Icon className=\"size-4 text-white\" weight=\"fill\" />\n </div>\n </div>\n )\n}\n\nexport default ThumbnailPreview\n","import React, { useState } from 'react'\n\nimport ThumbnailPreview from './CardThumbnailPreview'\n\ninterface ImagePreviewProps {\n sourceUrl?: string\n thumbnailUrl?: string\n mimeType: string\n title?: string\n LockIcon?: React.ElementType\n}\n\nconst ImagePreview: React.FC<ImagePreviewProps> = (props) => {\n const { sourceUrl, thumbnailUrl, mimeType, title, LockIcon } = props\n const [sourceReady, setSourceReady] = useState(false)\n\n if (LockIcon != null) {\n return (\n <ThumbnailPreview\n thumbnailUrl={thumbnailUrl}\n mimeType={mimeType}\n LockIcon={LockIcon}\n />\n )\n }\n\n return (\n <div className=\"relative overflow-hidden bg-black/5\">\n <img\n src={sourceUrl}\n alt={title}\n className={`block w-full transition-opacity duration-300 ${sourceReady ? 'opacity-100' : 'opacity-0'}`}\n onLoad={() => setSourceReady(true)}\n />\n </div>\n )\n}\n\nexport default ImagePreview\n","import React from 'react'\n\nimport MediaPlayer from '../MediaPlayer'\n\nimport ThumbnailPreview from './CardThumbnailPreview'\n\ninterface MediaPreviewProps {\n sourceUrl?: string\n thumbnailUrl?: string\n mimeType: string\n LockIcon?: React.ElementType\n}\n\nconst MediaPreview: React.FC<MediaPreviewProps> = (props) => {\n const { sourceUrl, thumbnailUrl, mimeType, LockIcon } = props\n\n if (LockIcon != null) {\n return (\n <ThumbnailPreview\n thumbnailUrl={thumbnailUrl}\n mimeType={mimeType}\n LockIcon={LockIcon}\n />\n )\n }\n\n return (\n <MediaPlayer\n source={sourceUrl ?? ''}\n mimeType={mimeType}\n poster={thumbnailUrl}\n />\n )\n}\n\nexport default MediaPreview\n","import {\n CheckCircleIcon,\n LockOpenIcon,\n LockSimpleIcon,\n} from '@phosphor-icons/react'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\n\nimport type {\n LockedAttachmentBaseProps,\n LockedAttachmentSource,\n PaymentStatus,\n} from '../../types'\nimport { renderTypeIcon } from '../../utils/icons'\nimport { getSourceType } from '../../utils/mimeType'\n\nimport CardActions from './CardActions'\nimport ImagePreview from './CardImagePreview'\nimport MediaPreview from './CardMediaPreview'\nimport ThumbnailPreview from './CardThumbnailPreview'\n\nexport interface VisitorCardProps extends LockedAttachmentBaseProps {\n /**\n * Called when the visitor clicks Unlock on an unpaid attachment.\n * Use this to open a checkout flow. Omit to hide the Unlock button.\n */\n onUnlockClick?: () => void\n /**\n * Called to fetch the attachment source — fired automatically when\n * paymentStatus transitions to 'paid', or immediately on click when\n * paymentStatus is already 'paid'. Return a LockedAttachmentSource to\n * unlock the card.\n */\n onFetchSource?: () => Promise<LockedAttachmentSource | void>\n /**\n * Called when the visitor clicks Download on an unlocked card.\n * Omit to hide the Download button.\n */\n onDownloadClick?: () => void\n /**\n * When true, shows loading dots on the Unlock button.\n * Driven by the LockedAttachmentContext (e.g. checkout in progress, payment processing).\n */\n isUnlocking?: boolean\n}\n\nfunction getLockIcon(paymentStatus?: PaymentStatus): React.ElementType {\n return paymentStatus === 'paid' ? LockOpenIcon : LockSimpleIcon\n}\n\nconst VisitorCard: React.FC<VisitorCardProps> = ({\n title,\n amountText,\n thumbnailUrl,\n mimeType = 'application/octet-stream',\n detail,\n onUnlockClick,\n onFetchSource,\n onDownloadClick,\n paymentStatus,\n isUnlocking = false,\n}) => {\n const [source, setSource] = useState<LockedAttachmentSource | undefined>()\n const hasMounted = useRef(false)\n const fetchingRef = useRef(false)\n // Stable ref so fetchSource doesn't change identity when onFetchSource prop changes\n const onFetchSourceRef = useRef(onFetchSource)\n onFetchSourceRef.current = onFetchSource\n\n const isLocked = source === undefined\n const sourceType = getSourceType(mimeType)\n const LockIcon = isLocked ? getLockIcon(paymentStatus) : undefined\n\n const fetchSource = useCallback(async (): Promise<void> => {\n if (fetchingRef.current) return\n console.log('[LOCKED ATTACHMENT] fetchSource: starting fetch')\n fetchingRef.current = true\n try {\n const result = await onFetchSourceRef.current?.()\n console.log('[LOCKED ATTACHMENT] fetchSource: result received', { hasResult: Boolean(result) })\n if (result) setSource(result)\n } finally {\n fetchingRef.current = false\n }\n }, []) // stable — reads onFetchSource via ref\n\n // When paymentStatus transitions to 'paid' (e.g. after checkout completes),\n // automatically fetch the source. Skipped on mount.\n useEffect(() => {\n if (!hasMounted.current) {\n hasMounted.current = true\n return\n }\n\n console.log('[LOCKED ATTACHMENT] paymentStatus changed', { paymentStatus })\n if (paymentStatus === 'paid') {\n console.log('[LOCKED ATTACHMENT] paymentStatus=paid: auto-fetching source')\n void fetchSource()\n }\n }, [paymentStatus, fetchSource])\n\n const handleUnlockClick = useCallback(() => {\n if (paymentStatus === 'paid') {\n console.log('[LOCKED ATTACHMENT] handleUnlockClick: already paid, fetching source')\n void fetchSource()\n } else {\n console.log('[LOCKED ATTACHMENT] handleUnlockClick: not paid, opening checkout')\n onUnlockClick?.()\n }\n }, [paymentStatus, onUnlockClick, fetchSource])\n\n let mediaPreview: React.ReactNode\n if (sourceType === 'image') {\n mediaPreview = (\n <ImagePreview\n key={source?.sourceUrl}\n sourceUrl={source?.sourceUrl}\n thumbnailUrl={thumbnailUrl}\n mimeType={mimeType}\n title={title}\n LockIcon={LockIcon}\n />\n )\n } else if (sourceType === 'document') {\n mediaPreview = (\n <ThumbnailPreview\n key={source?.sourceUrl}\n thumbnailUrl={thumbnailUrl}\n mimeType={mimeType}\n LockIcon={LockIcon}\n />\n )\n } else {\n mediaPreview = (\n <MediaPreview\n key={source?.sourceUrl}\n sourceUrl={source?.sourceUrl}\n thumbnailUrl={thumbnailUrl}\n mimeType={mimeType}\n LockIcon={LockIcon}\n />\n )\n }\n\n return (\n <div className=\"w-[280px] select-none overflow-hidden rounded-[24px] bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]\">\n {mediaPreview}\n <div className=\"px-4 pb-3 pt-3\">\n <p className=\"mb-1.5 truncate text-base font-medium text-black\">\n {title}\n </p>\n <div className=\"flex items-center gap-1\">\n {renderTypeIcon(mimeType, {\n className: 'size-5 shrink-0 text-black/55',\n weight: 'regular',\n })}\n {detail != null ? (\n <span className=\"text-xs font-medium text-black/55\">{detail}</span>\n ) : null}\n {paymentStatus === 'paid' ? (\n <>\n <span className=\"text-xs font-medium text-black/55\">•</span>\n <span className=\"text-xs font-medium text-[#008236]\">\n Purchased\n </span>\n <CheckCircleIcon\n className=\"size-4 text-[#008236]\"\n weight=\"bold\"\n />\n </>\n ) : amountText != null ? (\n <>\n <span className=\"text-xs font-medium text-black/55\">•</span>\n <span className=\"text-xs font-medium text-black/55\">\n {amountText}\n </span>\n </>\n ) : null}\n </div>\n <CardActions\n isLocked={isLocked}\n isUnlocking={isUnlocking}\n sourceUrl={source?.sourceUrl}\n redeemUrl={source?.redeemUrl}\n onUnlockClicked={handleUnlockClick}\n onDownloadClicked={onDownloadClick}\n />\n </div>\n </div>\n )\n}\n\nexport default VisitorCard\n"],"names":["CardActions","props","isLocked","isUnlocking","sourceUrl","redeemUrl","onUnlockClicked","onDownloadClicked","jsx","LoadingDots","jsxs","React","LockSimpleIcon","DownloadSimpleIcon","ThumbnailPreview","thumbnailUrl","mimeType","LockIcon","LockOverlay","Icon","ImagePreview","title","sourceReady","setSourceReady","useState","MediaPreview","MediaPlayer","getLockIcon","paymentStatus","LockOpenIcon","VisitorCard","amountText","detail","onUnlockClick","onFetchSource","onDownloadClick","source","setSource","hasMounted","useRef","fetchingRef","onFetchSourceRef","sourceType","getSourceType","fetchSource","useCallback","result","_a","useEffect","handleUnlockClick","mediaPreview","renderTypeIcon","Fragment","CheckCircleIcon"],"mappings":";;;;AAYA,MAAMA,IAA0C,CAACC,MAAU;AACzD,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,IACEN;AAEJ,SAAIC,KAAYI,KAAmB,OAE/B,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAASF;AAAA,MACT,UAAUH;AAAA,MACV,WAAU;AAAA,MAET,cACC,gBAAAK,EAACC,GAAA,CAAA,CAAY,IAEb,gBAAAC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