@timardex/cluemart-shared 1.6.130 → 1.7.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/ad-CVkVX_z5.d.ts +296 -0
- package/dist/ad-DA9ECAhK.d.mts +296 -0
- package/dist/affiliate-1RtkLnLP.d.ts +35 -0
- package/dist/affiliate-Cos2Syz5.d.mts +35 -0
- package/dist/chunk-HZMP7GXC.mjs +5330 -0
- package/dist/chunk-HZMP7GXC.mjs.map +1 -0
- package/dist/chunk-KZTOISPA.mjs +272 -0
- package/dist/chunk-KZTOISPA.mjs.map +1 -0
- package/dist/chunk-MVQ3CFQR.mjs +230 -0
- package/dist/chunk-MVQ3CFQR.mjs.map +1 -0
- package/dist/chunk-NPFJ2CN2.mjs +109 -0
- package/dist/chunk-NPFJ2CN2.mjs.map +1 -0
- package/dist/chunk-RKIRWZCH.mjs +368 -0
- package/dist/chunk-RKIRWZCH.mjs.map +1 -0
- package/dist/{chunk-OHHJ3KJJ.mjs → chunk-TAECMXM4.mjs} +267 -304
- package/dist/chunk-TAECMXM4.mjs.map +1 -0
- package/dist/chunk-VA5YN2K3.mjs +48 -0
- package/dist/chunk-VA5YN2K3.mjs.map +1 -0
- package/dist/chunk-ZZJSCYJK.mjs +958 -0
- package/dist/chunk-ZZJSCYJK.mjs.map +1 -0
- package/dist/contactUs-DGrDzJaM.d.mts +11 -0
- package/dist/contactUs-H7799pWe.d.ts +11 -0
- package/dist/enums/index.cjs +223 -2
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +164 -5
- package/dist/enums/index.d.ts +164 -5
- package/dist/enums/index.mjs +41 -1
- package/dist/formFields/index.cjs +168 -403
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +3 -6
- package/dist/formFields/index.d.ts +3 -6
- package/dist/formFields/index.mjs +47 -921
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/global-BUUfmCo7.d.mts +698 -0
- package/dist/global-fKbMmluy.d.ts +698 -0
- package/dist/graphql/index.cjs +3329 -3340
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +487 -690
- package/dist/graphql/index.d.ts +487 -690
- package/dist/graphql/index.mjs +153 -2552
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +3478 -773
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +6 -13
- package/dist/hooks/index.d.ts +6 -13
- package/dist/hooks/index.mjs +99 -193
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/images/apple-maps-icon.webp.d.ts +1 -8
- package/dist/images/banner-horizontal.webp.d.ts +1 -8
- package/dist/images/banner-vertical.webp.d.ts +1 -8
- package/dist/images/cluiTui.webp.d.ts +1 -8
- package/dist/images/corporate.webp.d.ts +1 -8
- package/dist/images/facebook.webp.d.ts +1 -8
- package/dist/images/gazebo-top.webp.d.ts +1 -8
- package/dist/images/google-maps-icon.webp.d.ts +1 -8
- package/dist/images/googleMaps-logo-dark.webp.d.ts +1 -8
- package/dist/images/googleMaps-logo-light.webp.d.ts +1 -8
- package/dist/images/index.mjs +21 -86
- package/dist/images/index.mjs.map +1 -1
- package/dist/images/instagram.webp.d.ts +1 -8
- package/dist/images/logo-atr.webp.d.ts +1 -8
- package/dist/images/logo-dark.webp.d.ts +1 -8
- package/dist/images/logo.webp.d.ts +1 -8
- package/dist/images/meet.webp.d.ts +1 -8
- package/dist/images/mini-market1.webp.d.ts +1 -8
- package/dist/images/mini-market2.webp.d.ts +1 -8
- package/dist/images/mini-market3.webp.d.ts +1 -8
- package/dist/images/mini-market4.webp.d.ts +1 -8
- package/dist/images/mini-market5.webp.d.ts +1 -8
- package/dist/images/poll.webp.d.ts +1 -8
- package/dist/images/poster1.webp.d.ts +1 -8
- package/dist/images/poster2.webp.d.ts +1 -8
- package/dist/images/poster3.webp.d.ts +1 -8
- package/dist/images/poster4.webp.d.ts +1 -8
- package/dist/images/private.webp.d.ts +1 -8
- package/dist/images/qr-code.webp.d.ts +1 -8
- package/dist/images/school.webp.d.ts +1 -8
- package/dist/images/sima.webp.d.ts +1 -8
- package/dist/images/store-android.webp.d.ts +1 -8
- package/dist/images/store-ios.webp.d.ts +1 -8
- package/dist/images/tablas.webp.d.ts +1 -8
- package/dist/images/telefonos.webp.d.ts +1 -8
- package/dist/images/tiktok.webp.d.ts +1 -8
- package/dist/images/tip.webp.d.ts +1 -8
- package/dist/images/ugralos.webp.d.ts +1 -8
- package/dist/images/waze-maps-icon.webp.d.ts +1 -8
- package/dist/images/website.webp.d.ts +1 -8
- package/dist/images/youtube.webp.d.ts +1 -8
- package/dist/index.cjs +5883 -7079
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1692 -2966
- package/dist/index.d.ts +1692 -2966
- package/dist/index.mjs +5020 -6162
- package/dist/index.mjs.map +1 -1
- package/dist/map/index.cjs +9 -14
- package/dist/map/index.cjs.map +1 -1
- package/dist/map/index.d.mts +14 -18
- package/dist/map/index.d.ts +14 -18
- package/dist/map/index.mjs +9 -14
- package/dist/map/index.mjs.map +1 -1
- package/dist/resourceActivities-BL_12IAo.d.ts +125 -0
- package/dist/resourceActivities-zczOntNk.d.mts +125 -0
- package/dist/sharing/index.cjs +1272 -63
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +7 -32
- package/dist/sharing/index.d.ts +7 -32
- package/dist/sharing/index.mjs +30 -188
- package/dist/sharing/index.mjs.map +1 -1
- package/dist/theme/index.mjs +5 -41
- package/dist/theme/index.mjs.map +1 -1
- package/dist/types/index.cjs +110 -868
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +24 -230
- package/dist/types/index.d.ts +24 -230
- package/dist/types/index.mjs +27 -61
- package/dist/utils/index.cjs +214 -608
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +53 -107
- package/dist/utils/index.d.ts +53 -107
- package/dist/utils/index.mjs +15 -43
- package/package.json +12 -40
- package/dist/affiliate-Bqqlffw8.d.mts +0 -36
- package/dist/affiliate-Btlp5XUp.d.ts +0 -36
- package/dist/affiliateAdapters-BW3BY7c5.d.mts +0 -118
- package/dist/affiliateAdapters-C51ISmuA.d.ts +0 -118
- package/dist/apollo/index.cjs +0 -1383
- package/dist/apollo/index.cjs.map +0 -1
- package/dist/apollo/index.d.mts +0 -323
- package/dist/apollo/index.d.ts +0 -323
- package/dist/apollo/index.mjs +0 -1295
- package/dist/apollo/index.mjs.map +0 -1
- package/dist/auth/index.cjs +0 -3322
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.d.mts +0 -164
- package/dist/auth/index.d.ts +0 -164
- package/dist/auth/index.mjs +0 -379
- package/dist/auth/index.mjs.map +0 -1
- package/dist/auth-BOmAO53v.d.ts +0 -169
- package/dist/auth-CsITA95p.d.mts +0 -169
- package/dist/chunk-DATBGC2K.mjs +0 -347
- package/dist/chunk-DATBGC2K.mjs.map +0 -1
- package/dist/chunk-DDHECBJR.mjs +0 -726
- package/dist/chunk-DDHECBJR.mjs.map +0 -1
- package/dist/chunk-INQCDU24.mjs +0 -139
- package/dist/chunk-INQCDU24.mjs.map +0 -1
- package/dist/chunk-NWWKI4PJ.mjs +0 -297
- package/dist/chunk-NWWKI4PJ.mjs.map +0 -1
- package/dist/chunk-OHHJ3KJJ.mjs.map +0 -1
- package/dist/chunk-RAYUJODN.mjs +0 -45
- package/dist/chunk-RAYUJODN.mjs.map +0 -1
- package/dist/chunk-TOEFAEF2.mjs +0 -69
- package/dist/chunk-TOEFAEF2.mjs.map +0 -1
- package/dist/chunk-UKW7NZEQ.mjs +0 -2813
- package/dist/chunk-UKW7NZEQ.mjs.map +0 -1
- package/dist/dailyClue-C6WXY73z.d.mts +0 -105
- package/dist/dailyClue-C6WXY73z.d.ts +0 -105
- package/dist/event-C9K7CSg4.d.ts +0 -53
- package/dist/event-W0NhL5Cd.d.mts +0 -53
- package/dist/global-BbSFfYdd.d.ts +0 -181
- package/dist/global-C6v9tRji.d.mts +0 -181
- package/dist/graphql-CDOfA79A.d.ts +0 -1253
- package/dist/graphql-CcvzTs9k.d.mts +0 -1253
- package/dist/resourceActivities-CS8YRIIL.d.mts +0 -89
- package/dist/resourceActivities-DOdNPkhW.d.ts +0 -89
- package/dist/subscription-Cj_qBA7u.d.mts +0 -20
- package/dist/subscription-OiJ50uJb.d.ts +0 -20
- package/dist/vendor-DmMi2qmx.d.mts +0 -73
- package/dist/vendor-M9hVZlni.d.ts +0 -73
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/images/index.ts
|
|
2
|
+
var PKG = "@timardex/cluemart-shared";
|
|
3
|
+
var IMAGE_EXTENSION = ".webp";
|
|
4
|
+
var posterIds = [
|
|
5
|
+
"mini-market1",
|
|
6
|
+
"mini-market2",
|
|
7
|
+
"mini-market3",
|
|
8
|
+
"mini-market4",
|
|
9
|
+
"mini-market5",
|
|
10
|
+
"poster1",
|
|
11
|
+
"poster2",
|
|
12
|
+
"poster3",
|
|
13
|
+
"poster4"
|
|
14
|
+
];
|
|
15
|
+
var posterFiles = Object.fromEntries(
|
|
16
|
+
posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
17
|
+
);
|
|
18
|
+
var cluiIds = [
|
|
19
|
+
"cluiTui",
|
|
20
|
+
"sima",
|
|
21
|
+
"tablas",
|
|
22
|
+
"telefonos",
|
|
23
|
+
"ugralos"
|
|
24
|
+
];
|
|
25
|
+
var cluiFiles = Object.fromEntries(
|
|
26
|
+
cluiIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
27
|
+
);
|
|
28
|
+
var iconIds = [
|
|
29
|
+
"apple-maps-icon",
|
|
30
|
+
"facebook",
|
|
31
|
+
"google-maps-icon",
|
|
32
|
+
"instagram",
|
|
33
|
+
"meet",
|
|
34
|
+
"poll",
|
|
35
|
+
"tiktok",
|
|
36
|
+
"tip",
|
|
37
|
+
"waze-maps-icon",
|
|
38
|
+
"website",
|
|
39
|
+
"youtube"
|
|
40
|
+
];
|
|
41
|
+
var iconFiles = Object.fromEntries(
|
|
42
|
+
iconIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
43
|
+
);
|
|
44
|
+
var badgeIds = ["corporate", "private", "school"];
|
|
45
|
+
var badgeFiles = Object.fromEntries(
|
|
46
|
+
badgeIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
47
|
+
);
|
|
48
|
+
var logoIds = [
|
|
49
|
+
"googleMaps-logo-dark",
|
|
50
|
+
"googleMaps-logo-light",
|
|
51
|
+
"logo-atr",
|
|
52
|
+
"logo-dark",
|
|
53
|
+
"logo"
|
|
54
|
+
];
|
|
55
|
+
var logoFiles = Object.fromEntries(
|
|
56
|
+
logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
57
|
+
);
|
|
58
|
+
var otherImagesIds = [
|
|
59
|
+
"banner-horizontal",
|
|
60
|
+
"banner-vertical",
|
|
61
|
+
"gazebo-top",
|
|
62
|
+
"qr-code",
|
|
63
|
+
"store-android",
|
|
64
|
+
"store-ios"
|
|
65
|
+
];
|
|
66
|
+
var otherImagesFiles = Object.fromEntries(
|
|
67
|
+
otherImagesIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
68
|
+
);
|
|
69
|
+
var posters = Object.fromEntries(
|
|
70
|
+
Object.entries(posterFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
71
|
+
);
|
|
72
|
+
var cluiImages = Object.fromEntries(
|
|
73
|
+
Object.entries(cluiFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
74
|
+
);
|
|
75
|
+
var icons = Object.fromEntries(
|
|
76
|
+
Object.entries(iconFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
77
|
+
);
|
|
78
|
+
var badges = Object.fromEntries(
|
|
79
|
+
Object.entries(badgeFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
80
|
+
);
|
|
81
|
+
var logos = Object.fromEntries(
|
|
82
|
+
Object.entries(logoFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
83
|
+
);
|
|
84
|
+
var otherImages = Object.fromEntries(
|
|
85
|
+
Object.entries(otherImagesFiles).map(([key, file]) => [key, `${PKG}/images/${file}`])
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
IMAGE_EXTENSION,
|
|
90
|
+
posterIds,
|
|
91
|
+
posterFiles,
|
|
92
|
+
cluiIds,
|
|
93
|
+
cluiFiles,
|
|
94
|
+
iconIds,
|
|
95
|
+
iconFiles,
|
|
96
|
+
badgeIds,
|
|
97
|
+
badgeFiles,
|
|
98
|
+
logoIds,
|
|
99
|
+
logoFiles,
|
|
100
|
+
otherImagesIds,
|
|
101
|
+
otherImagesFiles,
|
|
102
|
+
posters,
|
|
103
|
+
cluiImages,
|
|
104
|
+
icons,
|
|
105
|
+
badges,
|
|
106
|
+
logos,
|
|
107
|
+
otherImages
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=chunk-NPFJ2CN2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/images/index.ts"],"sourcesContent":["const PKG = \"@timardex/cluemart-shared\" as const;\nexport const IMAGE_EXTENSION = \".webp\" as const;\n\n/**\n * Basenames under the shared images directory — use with `getSharedImagePath` from `@timardex/cluemart-shared/images/node` (Express / Node).\n * This object is the single source of poster keys; `posters` is derived from it. Add an image with `IMAGE_EXTENSION` under `src/images/posters/` when adding an entry.\n * `images/node` reads this at runtime for `getSharedImagePath` allow-listing.\n */\nexport const posterIds = [\n \"mini-market1\",\n \"mini-market2\",\n \"mini-market3\",\n \"mini-market4\",\n \"mini-market5\",\n \"poster1\",\n \"poster2\",\n \"poster3\",\n \"poster4\",\n] as const;\n\nexport const posterFiles = Object.fromEntries(\n posterIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`]),\n) as {\n readonly [K in (typeof posterIds)[number]]: `${K}${typeof IMAGE_EXTENSION}`;\n};\n\n/**\n * Basenames for assets under `src/images/clui/` in source; they are copied flat into `dist/images/` (same as posters).\n * `images/node` reads this at runtime for `getSharedImagePath` allow-listing.\n */\nexport const cluiIds = [\n \"cluiTui\",\n \"sima\",\n \"tablas\",\n \"telefonos\",\n \"ugralos\",\n] as const;\n\nexport const cluiFiles = Object.fromEntries(\n cluiIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`]),\n) as {\n readonly [K in (typeof cluiIds)[number]]: `${K}${typeof IMAGE_EXTENSION}`;\n};\n\nexport const iconIds = [\n \"apple-maps-icon\",\n \"facebook\",\n \"google-maps-icon\",\n \"instagram\",\n \"meet\",\n \"poll\",\n \"tiktok\",\n \"tip\",\n \"waze-maps-icon\",\n \"website\",\n \"youtube\",\n] as const;\n\nexport const iconFiles = Object.fromEntries(\n iconIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`]),\n) as {\n readonly [K in (typeof iconIds)[number]]: `${K}${typeof IMAGE_EXTENSION}`;\n};\n\nexport const badgeIds = [\"corporate\", \"private\", \"school\"] as const;\n\nexport const badgeFiles = Object.fromEntries(\n badgeIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`]),\n) as {\n readonly [K in (typeof badgeIds)[number]]: `${K}${typeof IMAGE_EXTENSION}`;\n};\n\nexport const logoIds = [\n \"googleMaps-logo-dark\",\n \"googleMaps-logo-light\",\n \"logo-atr\",\n \"logo-dark\",\n \"logo\",\n] as const;\n\nexport const logoFiles = Object.fromEntries(\n logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`]),\n) as {\n readonly [K in (typeof logoIds)[number]]: `${K}${typeof IMAGE_EXTENSION}`;\n};\n\nexport const otherImagesIds = [\n \"banner-horizontal\",\n \"banner-vertical\",\n \"gazebo-top\",\n \"qr-code\",\n \"store-android\",\n \"store-ios\",\n] as const;\n\nexport const otherImagesFiles = Object.fromEntries(\n otherImagesIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`]),\n) as {\n readonly [K in (typeof otherImagesIds)[number]]: `${K}${typeof IMAGE_EXTENSION}`;\n};\n\n/**\n * Module specifiers for each poster (not resolved file URLs). Use a static import or require with these paths\n * so your bundler resolves the file, e.g.\n * `import poster1 from \"@timardex/cluemart-shared/images/poster1.webp\"`\n * or `require(\"@timardex/cluemart-shared/images/poster1.webp\")` (React Native / Metro).\n *\n * Derived from `posterFiles` so keys and filenames stay aligned.\n */\nexport const posters = Object.fromEntries(\n (\n Object.entries(posterFiles) as [\n keyof typeof posterFiles,\n (typeof posterFiles)[keyof typeof posterFiles],\n ][]\n ).map(([key, file]) => [key, `${PKG}/images/${file}`]),\n) as {\n readonly [K in keyof typeof posterFiles]: `${typeof PKG}/images/${(typeof posterFiles)[K]}`;\n};\n\n/**\n * Module specifiers for Clui assets (same flat `@…/images/<file>.webp` pattern as posters), e.g.\n * `import clui from \"@timardex/cluemart-shared/images/cluiTui.webp\"`.\n */\nexport const cluiImages = Object.fromEntries(\n (\n Object.entries(cluiFiles) as [\n keyof typeof cluiFiles,\n (typeof cluiFiles)[keyof typeof cluiFiles],\n ][]\n ).map(([key, file]) => [key, `${PKG}/images/${file}`]),\n) as {\n readonly [K in keyof typeof cluiFiles]: `${typeof PKG}/images/${(typeof cluiFiles)[K]}`;\n};\n\nexport const icons = Object.fromEntries(\n (\n Object.entries(iconFiles) as [\n keyof typeof iconFiles,\n (typeof iconFiles)[keyof typeof iconFiles],\n ][]\n ).map(([key, file]) => [key, `${PKG}/images/${file}`]),\n) as {\n readonly [K in keyof typeof iconFiles]: `${typeof PKG}/images/${(typeof iconFiles)[K]}`;\n};\n\nexport const badges = Object.fromEntries(\n (\n Object.entries(badgeFiles) as [\n keyof typeof badgeFiles,\n (typeof badgeFiles)[keyof typeof badgeFiles],\n ][]\n ).map(([key, file]) => [key, `${PKG}/images/${file}`]),\n) as {\n readonly [K in keyof typeof badgeFiles]: `${typeof PKG}/images/${(typeof badgeFiles)[K]}`;\n};\n\nexport const logos = Object.fromEntries(\n (\n Object.entries(logoFiles) as [\n keyof typeof logoFiles,\n (typeof logoFiles)[keyof typeof logoFiles],\n ][]\n ).map(([key, file]) => [key, `${PKG}/images/${file}`]),\n) as {\n readonly [K in keyof typeof logoFiles]: `${typeof PKG}/images/${(typeof logoFiles)[K]}`;\n};\n\nexport const otherImages = Object.fromEntries(\n (\n Object.entries(otherImagesFiles) as [\n keyof typeof otherImagesFiles,\n (typeof otherImagesFiles)[keyof typeof otherImagesFiles],\n ][]\n ).map(([key, file]) => [key, `${PKG}/images/${file}`]),\n) as {\n readonly [K in keyof typeof otherImagesFiles]: `${typeof PKG}/images/${(typeof otherImagesFiles)[K]}`;\n};\n\nexport type PosterAssetId = keyof typeof posters;\n\n/** A single filename under the shared images directory (values of `posterFiles`). */\nexport type PosterImageBasename = (typeof posterFiles)[PosterAssetId];\n\nexport type CluiImageId = keyof typeof cluiImages;\n\n/** Basename under the shared images directory (values of `cluiFiles`). */\nexport type CluiImageBasename = (typeof cluiFiles)[CluiImageId];\n\nexport type IconId = keyof typeof icons;\nexport type IconBasename = (typeof iconFiles)[IconId];\n\nexport type BadgeId = keyof typeof badges;\nexport type BadgeBasename = (typeof badgeFiles)[BadgeId];\n\nexport type LogoId = keyof typeof logos;\nexport type LogoBasename = (typeof logoFiles)[LogoId];\n\nexport type OtherImagesId = keyof typeof otherImages;\nexport type OtherImagesBasename = (typeof otherImagesFiles)[OtherImagesId];\n"],"mappings":";AAAA,IAAM,MAAM;AACL,IAAM,kBAAkB;AAOxB,IAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,cAAc,OAAO;AAAA,EAChC,UAAU,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,EAAE,GAAG,eAAe,EAAE,CAAC;AACvD;AAQO,IAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,YAA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;AAIO,IAAM,QAAQ,OAAO;AAAA,EAExB,OAAO,QAAQ,SAAS,EAIxB,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,WAAW,IAAI,EAAE,CAAC;AACvD;AAIO,IAAM,SAAS,OAAO;AAAA,EAEzB,OAAO,QAAQ,UAAU,EAIzB,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,WAAW,IAAI,EAAE,CAAC;AACvD;AAIO,IAAM,QAAQ,OAAO;AAAA,EAExB,OAAO,QAAQ,SAAS,EAIxB,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,WAAW,IAAI,EAAE,CAAC;AACvD;AAIO,IAAM,cAAc,OAAO;AAAA,EAE9B,OAAO,QAAQ,gBAAgB,EAI/B,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,WAAW,IAAI,EAAE,CAAC;AACvD;","names":[]}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLUEMART_MAIN_DOMAIN_URL,
|
|
3
|
+
formatDate
|
|
4
|
+
} from "./chunk-TAECMXM4.mjs";
|
|
5
|
+
|
|
6
|
+
// src/sharing/relationShareTypes.ts
|
|
7
|
+
var RELATION_SHARE_INVITATION = "invitation";
|
|
8
|
+
var RELATION_SHARE_APPLICATION = "application";
|
|
9
|
+
var RELATION_OVERLAY_LAYOUT_VERSION = 36;
|
|
10
|
+
var RELATION_SHARE_RESOURCE_TYPES = [
|
|
11
|
+
RELATION_SHARE_INVITATION,
|
|
12
|
+
RELATION_SHARE_APPLICATION
|
|
13
|
+
];
|
|
14
|
+
function isRelationShareResourceType(resourceType) {
|
|
15
|
+
return RELATION_SHARE_RESOURCE_TYPES.includes(
|
|
16
|
+
resourceType
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/sharing/constants.ts
|
|
21
|
+
var SOCIAL_IMAGE_WIDTH = 1200;
|
|
22
|
+
var SOCIAL_IMAGE_HEIGHT = 630;
|
|
23
|
+
var SHARE_SITE_URL = CLUEMART_MAIN_DOMAIN_URL;
|
|
24
|
+
var SHARE_CALENDAR_ICON = "\u{1F4C5}";
|
|
25
|
+
var SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;
|
|
26
|
+
var SHARE_CHECKMARK_ICON = "\u2705";
|
|
27
|
+
var SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;
|
|
28
|
+
var SHARE_INFO_ICON = "\u2139\uFE0F";
|
|
29
|
+
var SHARE_TAGS_SECTION_HEADING = `${SHARE_INFO_ICON} Tags:`;
|
|
30
|
+
var SHARE_RAIN_OR_SHINE_LINE = "Rain or Shine";
|
|
31
|
+
var SHARE_FOOD_TRUCK_LINE = "Food Truck";
|
|
32
|
+
var SHARE_COMPLIANCE_PREFIX = `${SHARE_CHECKMARK_ICON} Compliance:`;
|
|
33
|
+
var SHARE_CATEGORY_ICON = "\u{1F3F7}\uFE0F";
|
|
34
|
+
var SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;
|
|
35
|
+
var SHARE_RULER_ICON = "\u{1F4CF}";
|
|
36
|
+
var SHARE_STALL_SIZE_PREFIX = `${SHARE_RULER_ICON} Stall size:`;
|
|
37
|
+
var SHARE_DOLLAR_ICON = "$";
|
|
38
|
+
var SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;
|
|
39
|
+
var SHARE_CLOCK_ICON = "\u23F0";
|
|
40
|
+
var SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;
|
|
41
|
+
var SHARE_MORE_INFO_LINE = "Shared from ClueMart";
|
|
42
|
+
var DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;
|
|
43
|
+
var RESOURCE_SHARE_TYPES = [
|
|
44
|
+
"market",
|
|
45
|
+
"stallholder",
|
|
46
|
+
"partner"
|
|
47
|
+
];
|
|
48
|
+
var POST_SHARE_RESOURCE_TYPES = [
|
|
49
|
+
"market_faces",
|
|
50
|
+
"clue_bites",
|
|
51
|
+
"play_and_win"
|
|
52
|
+
];
|
|
53
|
+
var SHARE_RESOURCE_LABEL = {
|
|
54
|
+
[RELATION_SHARE_APPLICATION]: "Application",
|
|
55
|
+
[RELATION_SHARE_INVITATION]: "Invitation",
|
|
56
|
+
clue_bites: "Clue Bites",
|
|
57
|
+
market_faces: "Market Faces",
|
|
58
|
+
play_and_win: "Play & Win",
|
|
59
|
+
market: "Market",
|
|
60
|
+
partner: "Partner",
|
|
61
|
+
stallholder: "Stallholder"
|
|
62
|
+
};
|
|
63
|
+
function isPostShareResourceType(resourceType) {
|
|
64
|
+
return POST_SHARE_RESOURCE_TYPES.includes(
|
|
65
|
+
resourceType
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/sharing/formatCategoryLabel.ts
|
|
70
|
+
function formatCategoryLabel(category) {
|
|
71
|
+
const subcategoryNames = category.subcategories.map((subcategory) => subcategory.name).filter(Boolean);
|
|
72
|
+
if (subcategoryNames.length === 0) {
|
|
73
|
+
return category.name;
|
|
74
|
+
}
|
|
75
|
+
return `${category.name} (${subcategoryNames.join(", ")})`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/sharing/joinShareDescriptionSections.ts
|
|
79
|
+
var SHARE_DESCRIPTION_SECTION_BREAK = "\n\n";
|
|
80
|
+
var OG_DESCRIPTION_LINE_BREAK = " ";
|
|
81
|
+
function joinShareOgDescriptionSections(sections) {
|
|
82
|
+
return sections.map((section) => typeof section === "string" ? section.trim() : "").filter((section) => section.length > 0).map((section) => section.replace(/\n/g, OG_DESCRIPTION_LINE_BREAK)).join(OG_DESCRIPTION_LINE_BREAK);
|
|
83
|
+
}
|
|
84
|
+
function joinShareDescriptionSections(sections) {
|
|
85
|
+
return sections.filter((section) => Boolean(section)).join(SHARE_DESCRIPTION_SECTION_BREAK);
|
|
86
|
+
}
|
|
87
|
+
function appendShareMoreInfoLine(description) {
|
|
88
|
+
const trimmed = description.trim();
|
|
89
|
+
if (trimmed.startsWith(SHARE_MORE_INFO_LINE)) {
|
|
90
|
+
return trimmed;
|
|
91
|
+
}
|
|
92
|
+
if (trimmed.length === 0) {
|
|
93
|
+
return SHARE_MORE_INFO_LINE;
|
|
94
|
+
}
|
|
95
|
+
return joinShareDescriptionSections([SHARE_MORE_INFO_LINE, trimmed]);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/sharing/buildRelationShareDescription.ts
|
|
99
|
+
function formatShareMarketDate(dateStr) {
|
|
100
|
+
return formatDate(dateStr, "date");
|
|
101
|
+
}
|
|
102
|
+
function formatStallCapacityLabel(stallCapacity) {
|
|
103
|
+
return stallCapacity > 0 ? ` (${stallCapacity} spaces available)` : " - Full";
|
|
104
|
+
}
|
|
105
|
+
function formatShareStallLine(stall) {
|
|
106
|
+
return ` - ${stall.label} \u2014 $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;
|
|
107
|
+
}
|
|
108
|
+
function formatShareInvitationMarketDatesSection(dateTime) {
|
|
109
|
+
const dateBlocks = dateTime.map((date) => {
|
|
110
|
+
const formattedDate = formatShareMarketDate(date.startDate);
|
|
111
|
+
const stallLines = date.stallTypes.map(formatShareStallLine);
|
|
112
|
+
return [`- ${formattedDate}`, ...stallLines].join("\n");
|
|
113
|
+
});
|
|
114
|
+
return `${SHARE_MARKET_DATES_SECTION_HEADING}
|
|
115
|
+
${dateBlocks.join("\n")}`;
|
|
116
|
+
}
|
|
117
|
+
function formatShareRainOrShineLine(rainOrShine) {
|
|
118
|
+
return rainOrShine ? SHARE_RAIN_OR_SHINE_LINE : null;
|
|
119
|
+
}
|
|
120
|
+
function formatShareIsFoodTrueLine(foodTruck) {
|
|
121
|
+
return foodTruck ? SHARE_FOOD_TRUCK_LINE : null;
|
|
122
|
+
}
|
|
123
|
+
function formatShareInvitationRequirementsSection(requirements) {
|
|
124
|
+
const bullets = (requirements ?? []).filter((item) => item.value).map((item) => item.label.trim()).filter((label) => label.length > 0).map((label) => `- ${label}`);
|
|
125
|
+
if (bullets.length === 0) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return `${SHARE_REQUIREMENTS_SECTION_HEADING}
|
|
129
|
+
${bullets.join("\n")}`;
|
|
130
|
+
}
|
|
131
|
+
function formatShareTagsSection(tags) {
|
|
132
|
+
const bullets = tags.map((tag) => tag.trim()).filter((tag) => tag.length > 0).map((tag) => `- ${tag}`);
|
|
133
|
+
if (bullets.length === 0) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return `${SHARE_TAGS_SECTION_HEADING}
|
|
137
|
+
${bullets.join("\n")}`;
|
|
138
|
+
}
|
|
139
|
+
function formatShareApplicationCategoriesSection(categories) {
|
|
140
|
+
const bullets = categories.map((category) => formatCategoryLabel(category).trim()).filter((label) => label.length > 0).map((label) => `- ${label}`);
|
|
141
|
+
if (bullets.length === 0) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
return `${SHARE_CATEGORIES_SECTION_HEADING}
|
|
145
|
+
${bullets.join("\n")}`;
|
|
146
|
+
}
|
|
147
|
+
function formatShareApplicationStallSizeLine(size) {
|
|
148
|
+
return `${SHARE_STALL_SIZE_PREFIX} ${size.width}m \xD7 ${size.depth}m`;
|
|
149
|
+
}
|
|
150
|
+
function formatShareApplicationComplianceSection(compliance) {
|
|
151
|
+
const bullets = [
|
|
152
|
+
compliance?.liabilityInsurance && "Liability insurance",
|
|
153
|
+
compliance?.foodBeverageLicense && "Food & beverage licence"
|
|
154
|
+
].filter((label) => Boolean(label)).map((label) => `- ${label}`);
|
|
155
|
+
if (bullets.length === 0) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return `${SHARE_COMPLIANCE_PREFIX}
|
|
159
|
+
${bullets.join("\n")}`;
|
|
160
|
+
}
|
|
161
|
+
function formatShareApplicationPriceRangeLine(priceRange) {
|
|
162
|
+
return `${SHARE_PRICE_RANGE_PREFIX} $${priceRange.min} \u2013 $${priceRange.max}`;
|
|
163
|
+
}
|
|
164
|
+
function formatShareInvitationApplicationDeadlineLine(applicationDeadlineHours) {
|
|
165
|
+
return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;
|
|
166
|
+
}
|
|
167
|
+
function buildInvitationShareDescription(event, eventInfo) {
|
|
168
|
+
const stallTypes = eventInfo?.dateTime?.flatMap((date) => date.stallTypes) ?? [];
|
|
169
|
+
if (!eventInfo || stallTypes.length === 0) {
|
|
170
|
+
return event.description?.trim() || "";
|
|
171
|
+
}
|
|
172
|
+
const sections = [
|
|
173
|
+
event.location.fullAddress,
|
|
174
|
+
formatShareRainOrShineLine(event.rainOrShine),
|
|
175
|
+
formatShareTagsSection(event.tags),
|
|
176
|
+
formatShareInvitationMarketDatesSection(eventInfo.dateTime),
|
|
177
|
+
formatShareInvitationApplicationDeadlineLine(
|
|
178
|
+
eventInfo.applicationDeadlineHours
|
|
179
|
+
),
|
|
180
|
+
formatShareInvitationRequirementsSection(eventInfo.requirements)
|
|
181
|
+
];
|
|
182
|
+
return joinShareDescriptionSections(sections);
|
|
183
|
+
}
|
|
184
|
+
function buildApplicationShareDescription(vendor, vendorInfo) {
|
|
185
|
+
if (!vendorInfo) {
|
|
186
|
+
return vendor.description?.trim() || "";
|
|
187
|
+
}
|
|
188
|
+
const profileDescription = vendor.description?.trim();
|
|
189
|
+
const sections = [
|
|
190
|
+
formatShareIsFoodTrueLine(vendor.foodTruck),
|
|
191
|
+
formatShareApplicationCategoriesSection(vendor.categories),
|
|
192
|
+
formatShareApplicationStallSizeLine(vendorInfo.stallInfo.size),
|
|
193
|
+
formatShareApplicationComplianceSection(vendorInfo.compliance),
|
|
194
|
+
formatShareApplicationPriceRangeLine(vendorInfo.product.priceRange),
|
|
195
|
+
profileDescription
|
|
196
|
+
];
|
|
197
|
+
return joinShareDescriptionSections(sections);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// src/sharing/buildPublicShareDescription.ts
|
|
201
|
+
function buildPublicEventShareDescription(event) {
|
|
202
|
+
return joinShareDescriptionSections([
|
|
203
|
+
formatShareRainOrShineLine(event.rainOrShine),
|
|
204
|
+
formatShareTagsSection(event.tags),
|
|
205
|
+
event.description?.trim()
|
|
206
|
+
]);
|
|
207
|
+
}
|
|
208
|
+
function buildPublicVendorShareDescription(vendor) {
|
|
209
|
+
return joinShareDescriptionSections([
|
|
210
|
+
formatShareIsFoodTrueLine(vendor.foodTruck),
|
|
211
|
+
vendor.description?.trim()
|
|
212
|
+
]);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/sharing/buildShareUrl.ts
|
|
216
|
+
var PUBLIC_SHARE_PATH_TYPES = [
|
|
217
|
+
...RESOURCE_SHARE_TYPES,
|
|
218
|
+
...POST_SHARE_RESOURCE_TYPES
|
|
219
|
+
];
|
|
220
|
+
var SHARE_TYPE_PATH_REGEX = [
|
|
221
|
+
...PUBLIC_SHARE_PATH_TYPES,
|
|
222
|
+
RELATION_SHARE_APPLICATION,
|
|
223
|
+
RELATION_SHARE_INVITATION
|
|
224
|
+
].join("|");
|
|
225
|
+
function buildShareUrl(type, slug, utmMedium = "app") {
|
|
226
|
+
return `${SHARE_SITE_URL}/${type}/${encodeURIComponent(slug)}?utm_source=share&utm_medium=${utmMedium}&utm_campaign=${type}`;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// src/sharing/normalizeShareDescription.ts
|
|
230
|
+
var LEADING_WHITESPACE = /^[ \t]*/;
|
|
231
|
+
function normalizeShareText(value) {
|
|
232
|
+
if (value == null) {
|
|
233
|
+
return "";
|
|
234
|
+
}
|
|
235
|
+
return value.trim().split("\n").map((line) => {
|
|
236
|
+
const leading = LEADING_WHITESPACE.exec(line)?.[0] ?? "";
|
|
237
|
+
const rest = line.slice(leading.length).trim().replace(/[ \t]{2,}/g, " ");
|
|
238
|
+
return leading + rest;
|
|
239
|
+
}).join("\n").replace(/\n{3,}/g, "\n\n");
|
|
240
|
+
}
|
|
241
|
+
function shareMessageFooterPlacementForType(_shareType) {
|
|
242
|
+
return "before-body";
|
|
243
|
+
}
|
|
244
|
+
function buildShareMessageSections(input) {
|
|
245
|
+
const title = normalizeShareText(input.title);
|
|
246
|
+
const description = normalizeShareText(input.description);
|
|
247
|
+
return [SHARE_MORE_INFO_LINE, title, description].filter(
|
|
248
|
+
(section) => section.length > 0
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
function splitShareDescriptionSections(value) {
|
|
252
|
+
const trimmed = normalizeShareText(value);
|
|
253
|
+
if (!trimmed) {
|
|
254
|
+
return [];
|
|
255
|
+
}
|
|
256
|
+
if (/\n\n/.test(trimmed)) {
|
|
257
|
+
return trimmed.split(/\n\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
258
|
+
}
|
|
259
|
+
if (/\n/.test(trimmed)) {
|
|
260
|
+
return trimmed.split(/\n+/).map((section) => normalizeShareText(section)).filter((section) => section.length > 0);
|
|
261
|
+
}
|
|
262
|
+
return [trimmed];
|
|
263
|
+
}
|
|
264
|
+
function normalizeShareOgDescription(value) {
|
|
265
|
+
return joinShareOgDescriptionSections(splitShareDescriptionSections(value));
|
|
266
|
+
}
|
|
267
|
+
function buildFacebookShareQuote(title, description, shareType) {
|
|
268
|
+
const sections = buildShareMessageSections({ description, shareType, title });
|
|
269
|
+
const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();
|
|
270
|
+
return quote.length > 0 ? quote : void 0;
|
|
271
|
+
}
|
|
272
|
+
function buildShareOgDescriptionFromSections(sections) {
|
|
273
|
+
return joinShareOgDescriptionSections(sections);
|
|
274
|
+
}
|
|
275
|
+
function buildShareOgDescription(_title, description) {
|
|
276
|
+
return joinShareOgDescriptionSections(
|
|
277
|
+
splitShareDescriptionSections(description)
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/sharing/normalizeShareRouteId.ts
|
|
282
|
+
function normalizeShareRouteId(id) {
|
|
283
|
+
try {
|
|
284
|
+
return decodeURIComponent(id);
|
|
285
|
+
} catch {
|
|
286
|
+
return id;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function buildSharePagePath(resourceType, slug) {
|
|
290
|
+
return `/${resourceType}/${encodeURIComponent(normalizeShareRouteId(slug))}`;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// src/sharing/shareSlugResource.ts
|
|
294
|
+
function shareSlugResourceId(resource) {
|
|
295
|
+
return resource?._id ?? null;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export {
|
|
299
|
+
RELATION_SHARE_INVITATION,
|
|
300
|
+
RELATION_SHARE_APPLICATION,
|
|
301
|
+
RELATION_OVERLAY_LAYOUT_VERSION,
|
|
302
|
+
RELATION_SHARE_RESOURCE_TYPES,
|
|
303
|
+
isRelationShareResourceType,
|
|
304
|
+
SOCIAL_IMAGE_WIDTH,
|
|
305
|
+
SOCIAL_IMAGE_HEIGHT,
|
|
306
|
+
SHARE_SITE_URL,
|
|
307
|
+
SHARE_CALENDAR_ICON,
|
|
308
|
+
SHARE_MARKET_DATES_SECTION_HEADING,
|
|
309
|
+
SHARE_CHECKMARK_ICON,
|
|
310
|
+
SHARE_REQUIREMENTS_SECTION_HEADING,
|
|
311
|
+
SHARE_INFO_ICON,
|
|
312
|
+
SHARE_TAGS_SECTION_HEADING,
|
|
313
|
+
SHARE_RAIN_OR_SHINE_LINE,
|
|
314
|
+
SHARE_FOOD_TRUCK_LINE,
|
|
315
|
+
SHARE_COMPLIANCE_PREFIX,
|
|
316
|
+
SHARE_CATEGORY_ICON,
|
|
317
|
+
SHARE_CATEGORIES_SECTION_HEADING,
|
|
318
|
+
SHARE_RULER_ICON,
|
|
319
|
+
SHARE_STALL_SIZE_PREFIX,
|
|
320
|
+
SHARE_DOLLAR_ICON,
|
|
321
|
+
SHARE_PRICE_RANGE_PREFIX,
|
|
322
|
+
SHARE_CLOCK_ICON,
|
|
323
|
+
SHARE_APPLICATION_DEADLINE_PREFIX,
|
|
324
|
+
SHARE_MORE_INFO_LINE,
|
|
325
|
+
DEFAULT_SHARE_OG_IMAGE,
|
|
326
|
+
RESOURCE_SHARE_TYPES,
|
|
327
|
+
POST_SHARE_RESOURCE_TYPES,
|
|
328
|
+
SHARE_RESOURCE_LABEL,
|
|
329
|
+
isPostShareResourceType,
|
|
330
|
+
formatCategoryLabel,
|
|
331
|
+
SHARE_DESCRIPTION_SECTION_BREAK,
|
|
332
|
+
OG_DESCRIPTION_LINE_BREAK,
|
|
333
|
+
joinShareOgDescriptionSections,
|
|
334
|
+
joinShareDescriptionSections,
|
|
335
|
+
appendShareMoreInfoLine,
|
|
336
|
+
formatShareMarketDate,
|
|
337
|
+
formatStallCapacityLabel,
|
|
338
|
+
formatShareStallLine,
|
|
339
|
+
formatShareInvitationMarketDatesSection,
|
|
340
|
+
formatShareRainOrShineLine,
|
|
341
|
+
formatShareIsFoodTrueLine,
|
|
342
|
+
formatShareInvitationRequirementsSection,
|
|
343
|
+
formatShareTagsSection,
|
|
344
|
+
formatShareApplicationCategoriesSection,
|
|
345
|
+
formatShareApplicationStallSizeLine,
|
|
346
|
+
formatShareApplicationComplianceSection,
|
|
347
|
+
formatShareApplicationPriceRangeLine,
|
|
348
|
+
formatShareInvitationApplicationDeadlineLine,
|
|
349
|
+
buildInvitationShareDescription,
|
|
350
|
+
buildApplicationShareDescription,
|
|
351
|
+
buildPublicEventShareDescription,
|
|
352
|
+
buildPublicVendorShareDescription,
|
|
353
|
+
PUBLIC_SHARE_PATH_TYPES,
|
|
354
|
+
SHARE_TYPE_PATH_REGEX,
|
|
355
|
+
buildShareUrl,
|
|
356
|
+
normalizeShareText,
|
|
357
|
+
shareMessageFooterPlacementForType,
|
|
358
|
+
buildShareMessageSections,
|
|
359
|
+
splitShareDescriptionSections,
|
|
360
|
+
normalizeShareOgDescription,
|
|
361
|
+
buildFacebookShareQuote,
|
|
362
|
+
buildShareOgDescriptionFromSections,
|
|
363
|
+
buildShareOgDescription,
|
|
364
|
+
normalizeShareRouteId,
|
|
365
|
+
buildSharePagePath,
|
|
366
|
+
shareSlugResourceId
|
|
367
|
+
};
|
|
368
|
+
//# sourceMappingURL=chunk-RKIRWZCH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sharing/relationShareTypes.ts","../src/sharing/constants.ts","../src/sharing/formatCategoryLabel.ts","../src/sharing/joinShareDescriptionSections.ts","../src/sharing/buildRelationShareDescription.ts","../src/sharing/buildPublicShareDescription.ts","../src/sharing/buildShareUrl.ts","../src/sharing/normalizeShareDescription.ts","../src/sharing/normalizeShareRouteId.ts","../src/sharing/shareSlugResource.ts"],"sourcesContent":["/** Path segments for relation share URLs — must match mobile `RelationTitle` values. */\nexport const RELATION_SHARE_INVITATION = \"invitation\" as const;\nexport const RELATION_SHARE_APPLICATION = \"application\" as const;\n\n/**\n * Bump when relation overlay SVG/layout changes so og:image URLs and API ETags\n * invalidate after deploy. Facebook caches preview JPEGs by exact URL — changing\n * this value forces crawlers to fetch a fresh image after server deploy.\n */\nexport const RELATION_OVERLAY_LAYOUT_VERSION = 36;\n\nexport const RELATION_SHARE_RESOURCE_TYPES = [\n RELATION_SHARE_INVITATION,\n RELATION_SHARE_APPLICATION,\n] as const;\n\nexport type RelationShareResourceType =\n (typeof RELATION_SHARE_RESOURCE_TYPES)[number];\n\nexport function isRelationShareResourceType(\n resourceType: string,\n): resourceType is RelationShareResourceType {\n return (RELATION_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import { CLUEMART_MAIN_DOMAIN_URL } from \"src/utils\";\n\nimport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\nexport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n RELATION_OVERLAY_LAYOUT_VERSION,\n RELATION_SHARE_RESOURCE_TYPES,\n isRelationShareResourceType,\n type RelationShareResourceType,\n} from \"./relationShareTypes\";\n\n/** Open Graph recommended preview size (must match admin `SHARE_OG_IMAGE_*`). */\nexport const SOCIAL_IMAGE_WIDTH = 1200;\n\n/** Open Graph recommended preview size (must match admin `SHARE_OG_IMAGE_*`). */\nexport const SOCIAL_IMAGE_HEIGHT = 630;\n\nexport const SHARE_SITE_URL = CLUEMART_MAIN_DOMAIN_URL;\n\n/** Calendar marker for invitation market-dates share copy (U+1F4C5 📅). */\nexport const SHARE_CALENDAR_ICON = \"\\u{1F4C5}\";\n\nexport const SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;\n\n/** Check mark for invitation requirements share copy (U+2705 ✅). */\nexport const SHARE_CHECKMARK_ICON = \"\\u{2705}\";\n\nexport const SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;\n\n/** Information marker for tags share copy (U+2139 ℹ️). */\nexport const SHARE_INFO_ICON = \"\\u{2139}\\u{FE0F}\";\n\nexport const SHARE_TAGS_SECTION_HEADING = `${SHARE_INFO_ICON} Tags:`;\n\n/** Standalone line when `rainOrShine` is true (invitation share + OG section parsing). */\nexport const SHARE_RAIN_OR_SHINE_LINE = \"Rain or Shine\";\n\n/** Standalone line when `foodTruck` is true (application share + OG section parsing). */\nexport const SHARE_FOOD_TRUCK_LINE = \"Food Truck\";\n\n/** Prefix for application compliance line (share text + OG section parsing). */\nexport const SHARE_COMPLIANCE_PREFIX = `${SHARE_CHECKMARK_ICON} Compliance:`;\n\n/** Label tag for application categories share copy (U+1F3F7 🏷️). */\nexport const SHARE_CATEGORY_ICON = \"\\u{1F3F7}\\u{FE0F}\";\n\nexport const SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;\n\n/** Straight ruler for application stall-size share copy (U+1F4CF 📏). */\nexport const SHARE_RULER_ICON = \"\\u{1F4CF}\";\n\n/** Prefix for application stall-size line (share text + OG section parsing). */\nexport const SHARE_STALL_SIZE_PREFIX = `${SHARE_RULER_ICON} Stall size:`;\n\n/** Dollar marker for price-range share copy (U+0024 $ — text, not emoji, so it stays black). */\nexport const SHARE_DOLLAR_ICON = \"$\";\n\n/** Prefix for application price-range line (share text + OG section parsing). */\nexport const SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;\n\n/** Alarm clock for invitation application-deadline share copy (U+23F0 ⏰). */\nexport const SHARE_CLOCK_ICON = \"\\u{23F0}\";\n\n/** Prefix for the invitation application-deadline sentence (share text + OG section parsing). */\nexport const SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;\n\n/** First line on share sheet messages, Facebook SDK quote, and `og:description`. */\nexport const SHARE_MORE_INFO_LINE = \"Shared from ClueMart\";\n\nexport const DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;\n\nexport const RESOURCE_SHARE_TYPES = [\n \"market\",\n \"stallholder\",\n \"partner\",\n] as const;\n\nexport type ResourceShareType = (typeof RESOURCE_SHARE_TYPES)[number];\n\nexport const POST_SHARE_RESOURCE_TYPES = [\n \"market_faces\",\n \"clue_bites\",\n \"play_and_win\",\n] as const;\n\nexport type PostShareResourceType = (typeof POST_SHARE_RESOURCE_TYPES)[number];\n\nexport type ShareResourceType =\n | ResourceShareType\n | PostShareResourceType\n | RelationShareResourceType;\n\nexport const SHARE_RESOURCE_LABEL: Record<ShareResourceType, string> = {\n [RELATION_SHARE_APPLICATION]: \"Application\",\n [RELATION_SHARE_INVITATION]: \"Invitation\",\n clue_bites: \"Clue Bites\",\n market_faces: \"Market Faces\",\n play_and_win: \"Play & Win\",\n market: \"Market\",\n partner: \"Partner\",\n stallholder: \"Stallholder\",\n};\n\nexport function isPostShareResourceType(\n resourceType: ShareResourceType,\n): resourceType is PostShareResourceType {\n return (POST_SHARE_RESOURCE_TYPES as readonly string[]).includes(\n resourceType,\n );\n}\n","import type { Category } from \"../types/global\";\n\nexport function formatCategoryLabel(category: Category): string {\n const subcategoryNames = category.subcategories\n .map((subcategory) => subcategory.name)\n .filter(Boolean);\n\n if (subcategoryNames.length === 0) {\n return category.name;\n }\n\n return `${category.name} (${subcategoryNames.join(\", \")})`;\n}\n","import { SHARE_MORE_INFO_LINE } from \"./constants\";\n\n/** Blank line between share sections — title, address, dates, URL, etc. */\nexport const SHARE_DESCRIPTION_SECTION_BREAK = \"\\n\\n\";\n\n/**\n * Line break for `og:description` meta content. Use instead of `\\n` — Next.js\n * HTML serialisation collapses literal newlines to spaces; Facebook reads ` `.\n */\nexport const OG_DESCRIPTION_LINE_BREAK = \" \";\n\n/** Joins OG description sections for Facebook link cards (and Twitter). */\nexport function joinShareOgDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .map((section) => (typeof section === \"string\" ? section.trim() : \"\"))\n .filter((section): section is string => section.length > 0)\n .map((section) => section.replace(/\\n/g, OG_DESCRIPTION_LINE_BREAK))\n .join(OG_DESCRIPTION_LINE_BREAK);\n}\n\nexport function joinShareDescriptionSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return sections\n .filter((section): section is string => Boolean(section))\n .join(SHARE_DESCRIPTION_SECTION_BREAK);\n}\n\n/** Prepends the standard share branding line when assembling display text. */\nexport function appendShareMoreInfoLine(description: string): string {\n const trimmed = description.trim();\n if (trimmed.startsWith(SHARE_MORE_INFO_LINE)) {\n return trimmed;\n }\n if (trimmed.length === 0) {\n return SHARE_MORE_INFO_LINE;\n }\n return joinShareDescriptionSections([SHARE_MORE_INFO_LINE, trimmed]);\n}\n","import type { StallType } from \"../types/event\";\nimport { formatDate } from \"../utils/date\";\n\nimport {\n SHARE_APPLICATION_DEADLINE_PREFIX,\n SHARE_CATEGORIES_SECTION_HEADING,\n SHARE_FOOD_TRUCK_LINE,\n SHARE_MARKET_DATES_SECTION_HEADING,\n SHARE_RAIN_OR_SHINE_LINE,\n SHARE_REQUIREMENTS_SECTION_HEADING,\n SHARE_COMPLIANCE_PREFIX,\n SHARE_PRICE_RANGE_PREFIX,\n SHARE_STALL_SIZE_PREFIX,\n SHARE_TAGS_SECTION_HEADING,\n} from \"./constants\";\nimport { formatCategoryLabel } from \"./formatCategoryLabel\";\nimport { joinShareDescriptionSections } from \"./joinShareDescriptionSections\";\nimport type {\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\nexport type {\n ShareEventForInvitation,\n ShareEventInfoForInvitation,\n ShareVendorForApplication,\n ShareVendorInfoForApplication,\n} from \"./shareRelationTypes\";\n\n/** Formats event `startDate` (`DD-MM-YYYY`) for share copy — same as share preview UI. */\nexport function formatShareMarketDate(dateStr: string): string {\n return formatDate(dateStr, \"date\");\n}\n\nexport function formatStallCapacityLabel(stallCapacity: number): string {\n return stallCapacity > 0 ? ` (${stallCapacity} spaces available)` : \" - Full\";\n}\n\nexport function formatShareStallLine(stall: StallType): string {\n return ` - ${stall.label} — $${stall.price}${formatStallCapacityLabel(stall.stallCapacity)}`;\n}\n\n/** Nested market dates + per-date stall lines for invitation share copy. */\nexport function formatShareInvitationMarketDatesSection(\n dateTime: ShareEventInfoForInvitation[\"dateTime\"],\n): string {\n const dateBlocks = dateTime.map((date) => {\n const formattedDate = formatShareMarketDate(date.startDate);\n const stallLines = date.stallTypes.map(formatShareStallLine);\n return [`- ${formattedDate}`, ...stallLines].join(\"\\n\");\n });\n\n return `${SHARE_MARKET_DATES_SECTION_HEADING}\\n${dateBlocks.join(\"\\n\")}`;\n}\n\nexport function formatShareRainOrShineLine(\n rainOrShine: boolean,\n): string | null {\n return rainOrShine ? SHARE_RAIN_OR_SHINE_LINE : null;\n}\n\nexport function formatShareIsFoodTrueLine(foodTruck: boolean): string | null {\n return foodTruck ? SHARE_FOOD_TRUCK_LINE : null;\n}\n\n/** Bulleted requirements list for invitation share copy. */\nexport function formatShareInvitationRequirementsSection(\n requirements: ShareEventInfoForInvitation[\"requirements\"] | null,\n): string | null {\n const bullets = (requirements ?? [])\n .filter((item) => item.value)\n .map((item) => item.label.trim())\n .filter((label) => label.length > 0)\n .map((label) => `- ${label}`);\n if (bullets.length === 0) {\n return null;\n }\n return `${SHARE_REQUIREMENTS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\nexport function formatShareTagsSection(tags: string[]): string | null {\n const bullets = tags\n .map((tag) => tag.trim())\n .filter((tag) => tag.length > 0)\n .map((tag) => `- ${tag}`);\n if (bullets.length === 0) {\n return null;\n }\n return `${SHARE_TAGS_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Bulleted categories list for application share copy. */\nexport function formatShareApplicationCategoriesSection(\n categories: ShareVendorForApplication[\"categories\"],\n): string | null {\n const bullets = categories\n .map((category) => formatCategoryLabel(category).trim())\n .filter((label) => label.length > 0)\n .map((label) => `- ${label}`);\n if (bullets.length === 0) {\n return null;\n }\n return `${SHARE_CATEGORIES_SECTION_HEADING}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Stall dimensions line for application share copy. */\nexport function formatShareApplicationStallSizeLine(size: {\n width: string;\n depth: string;\n}): string {\n return `${SHARE_STALL_SIZE_PREFIX} ${size.width}m × ${size.depth}m`;\n}\n\n/** Bulleted compliance list for application share copy. */\nexport function formatShareApplicationComplianceSection(\n compliance: ShareVendorInfoForApplication[\"compliance\"],\n): string | null {\n const bullets = [\n compliance?.liabilityInsurance && \"Liability insurance\",\n compliance?.foodBeverageLicense && \"Food & beverage licence\",\n ]\n .filter((label): label is string => Boolean(label))\n .map((label) => `- ${label}`);\n if (bullets.length === 0) {\n return null;\n }\n return `${SHARE_COMPLIANCE_PREFIX}\\n${bullets.join(\"\\n\")}`;\n}\n\n/** Price range line for application share copy. */\nexport function formatShareApplicationPriceRangeLine(priceRange: {\n min: string;\n max: string;\n}): string {\n return `${SHARE_PRICE_RANGE_PREFIX} $${priceRange.min} – $${priceRange.max}`;\n}\n\n/** Application-deadline sentence for invitation share copy. */\nexport function formatShareInvitationApplicationDeadlineLine(\n applicationDeadlineHours: number,\n): string {\n return `${SHARE_APPLICATION_DEADLINE_PREFIX} vendors must apply at least ${applicationDeadlineHours} hours before each market date.`;\n}\n\nexport function buildInvitationShareDescription(\n event: ShareEventForInvitation,\n eventInfo: ShareEventInfoForInvitation | null | undefined,\n): string {\n const stallTypes =\n eventInfo?.dateTime?.flatMap((date) => date.stallTypes) ?? [];\n\n if (!eventInfo || stallTypes.length === 0) {\n return event.description?.trim() || \"\";\n }\n\n const sections = [\n event.location.fullAddress,\n formatShareRainOrShineLine(event.rainOrShine),\n formatShareTagsSection(event.tags),\n formatShareInvitationMarketDatesSection(eventInfo.dateTime),\n formatShareInvitationApplicationDeadlineLine(\n eventInfo.applicationDeadlineHours,\n ),\n formatShareInvitationRequirementsSection(eventInfo.requirements),\n ];\n\n return joinShareDescriptionSections(sections);\n}\n\nexport function buildApplicationShareDescription(\n vendor: ShareVendorForApplication,\n vendorInfo: ShareVendorInfoForApplication | null | undefined,\n): string {\n if (!vendorInfo) {\n return vendor.description?.trim() || \"\";\n }\n\n const profileDescription = vendor.description?.trim();\n\n const sections = [\n formatShareIsFoodTrueLine(vendor.foodTruck),\n formatShareApplicationCategoriesSection(vendor.categories),\n formatShareApplicationStallSizeLine(vendorInfo.stallInfo.size),\n formatShareApplicationComplianceSection(vendorInfo.compliance),\n formatShareApplicationPriceRangeLine(vendorInfo.product.priceRange),\n profileDescription,\n ];\n\n return joinShareDescriptionSections(sections);\n}\n","import {\n formatShareIsFoodTrueLine,\n formatShareRainOrShineLine,\n formatShareTagsSection,\n} from \"./buildRelationShareDescription\";\nimport { joinShareDescriptionSections } from \"./joinShareDescriptionSections\";\n\n/** Minimal event fields for public (market) share copy — matches in-app preview. */\nexport type ShareEventForPublic = {\n description?: string | null;\n rainOrShine: boolean;\n tags: string[];\n};\n\n/** Minimal vendor fields for public (stallholder) share copy — matches in-app preview. */\nexport type ShareVendorForPublic = {\n description?: string | null;\n foodTruck: boolean;\n};\n\nexport function buildPublicEventShareDescription(\n event: ShareEventForPublic,\n): string {\n return joinShareDescriptionSections([\n formatShareRainOrShineLine(event.rainOrShine),\n formatShareTagsSection(event.tags),\n event.description?.trim(),\n ]);\n}\n\nexport function buildPublicVendorShareDescription(\n vendor: ShareVendorForPublic,\n): string {\n return joinShareDescriptionSections([\n formatShareIsFoodTrueLine(vendor.foodTruck),\n vendor.description?.trim(),\n ]);\n}\n","import {\n POST_SHARE_RESOURCE_TYPES,\n RESOURCE_SHARE_TYPES,\n SHARE_SITE_URL,\n} from \"./constants\";\nimport {\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n} from \"./relationShareTypes\";\n\n/** Path segments for public resource share URLs (markets, posts, etc.). */\nexport const PUBLIC_SHARE_PATH_TYPES = [\n ...RESOURCE_SHARE_TYPES,\n ...POST_SHARE_RESOURCE_TYPES,\n] as const;\n\nexport type PublicSharePathType = (typeof PUBLIC_SHARE_PATH_TYPES)[number];\n\nexport type RelationSharePathType =\n | typeof RELATION_SHARE_INVITATION\n | typeof RELATION_SHARE_APPLICATION;\n\nexport type ShareType = PublicSharePathType | RelationSharePathType;\n\n/** Alternation for deep-link regexes — keep in sync with {@link ShareType}. */\nexport const SHARE_TYPE_PATH_REGEX = [\n ...PUBLIC_SHARE_PATH_TYPES,\n RELATION_SHARE_APPLICATION,\n RELATION_SHARE_INVITATION,\n].join(\"|\");\n\nexport function buildShareUrl(\n type: ShareType,\n slug: string,\n utmMedium: string = \"app\",\n): string {\n return `${SHARE_SITE_URL}/${type}/${encodeURIComponent(slug)}?utm_source=share&utm_medium=${utmMedium}&utm_campaign=${type}`;\n}\n","import { SHARE_MORE_INFO_LINE, type ShareResourceType } from \"./constants\";\nimport {\n joinShareOgDescriptionSections,\n SHARE_DESCRIPTION_SECTION_BREAK,\n} from \"./joinShareDescriptionSections\";\n\nexport {\n joinShareOgDescriptionSections,\n OG_DESCRIPTION_LINE_BREAK,\n SHARE_DESCRIPTION_SECTION_BREAK,\n} from \"./joinShareDescriptionSections\";\n\n/** Trims share text and collapses spaces per line; preserves `\\n\\n` section breaks. */\nconst LEADING_WHITESPACE = /^[ \\t]*/;\n\nexport function normalizeShareText(value: string | null | undefined): string {\n if (value == null) {\n return \"\";\n }\n return value\n .trim()\n .split(\"\\n\")\n .map((line) => {\n const leading = LEADING_WHITESPACE.exec(line)?.[0] ?? \"\";\n const rest = line\n .slice(leading.length)\n .trim()\n .replace(/[ \\t]{2,}/g, \" \");\n return leading + rest;\n })\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\");\n}\n\n/** Branding line placement — first so Facebook truncation does not drop it. */\nexport type ShareMessageFooterPlacement = \"before-body\";\n\nexport function shareMessageFooterPlacementForType(\n _shareType?: ShareResourceType,\n): ShareMessageFooterPlacement {\n return \"before-body\";\n}\n\n/**\n * Ordered sections for share-sheet / Facebook SDK quote text:\n * {@link SHARE_MORE_INFO_LINE} → title → description (full body or post caption).\n */\nexport function buildShareMessageSections(input: {\n title?: string | null;\n description?: string | null;\n shareType?: ShareResourceType;\n}): string[] {\n const title = normalizeShareText(input.title);\n const description = normalizeShareText(input.description);\n\n return [SHARE_MORE_INFO_LINE, title, description].filter(\n (section) => section.length > 0,\n );\n}\n\nexport function splitShareDescriptionSections(value: string): string[] {\n const trimmed = normalizeShareText(value);\n if (!trimmed) {\n return [];\n }\n\n if (/\\n\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n if (/\\n/.test(trimmed)) {\n return trimmed\n .split(/\\n+/)\n .map((section) => normalizeShareText(section))\n .filter((section) => section.length > 0);\n }\n\n return [trimmed];\n}\n\n/**\n * Formats share descriptions for Open Graph / Twitter meta tags.\n * Sections are joined with {@link OG_DESCRIPTION_LINE_BREAK} (` `).\n */\nexport function normalizeShareOgDescription(value: string): string {\n return joinShareOgDescriptionSections(splitShareDescriptionSections(value));\n}\n\n/**\n * Quote text for Facebook ShareDialog on iOS (`ShareLinkContent.quote`).\n *\n * Title + blank lines + body sections. URL is omitted — `contentUrl` supplies\n * the link card (OG on resource landing pages controls card title/image).\n */\nexport function buildFacebookShareQuote(\n title: string,\n description: string,\n shareType?: ShareResourceType,\n): string | undefined {\n const sections = buildShareMessageSections({ description, shareType, title });\n const quote = sections.join(SHARE_DESCRIPTION_SECTION_BREAK).trim();\n return quote.length > 0 ? quote : undefined;\n}\n\n/**\n * Open Graph / Twitter description from pre-built section strings.\n * Prefer {@link joinShareOgDescriptionSections} when sections are already known.\n */\nexport function buildShareOgDescriptionFromSections(\n sections: ReadonlyArray<string | false | null | undefined>,\n): string {\n return joinShareOgDescriptionSections(sections);\n}\n\n/** Open Graph / Twitter description — body sections only (`og:title` is separate). */\nexport function buildShareOgDescription(\n _title: string,\n description: string,\n): string {\n return joinShareOgDescriptionSections(\n splitShareDescriptionSections(description),\n );\n}\n","import type { ShareResourceType } from \"./constants\";\n\nexport function normalizeShareRouteId(id: string): string {\n try {\n return decodeURIComponent(id);\n } catch {\n return id;\n }\n}\n\n/** Relative path for a public share landing page (`/market/demo-market`). */\nexport function buildSharePagePath(\n resourceType: ShareResourceType,\n slug: string,\n): string {\n return `/${resourceType}/${encodeURIComponent(normalizeShareRouteId(slug))}`;\n}\n","export type ShareSlugResource = {\n _id: string;\n};\n\nexport function shareSlugResourceId(\n resource: ShareSlugResource | null | undefined,\n): string | null {\n return resource?._id ?? null;\n}\n"],"mappings":";;;;;;AACO,IAAM,4BAA4B;AAClC,IAAM,6BAA6B;AAOnC,IAAM,kCAAkC;AAExC,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AACF;AAKO,SAAS,4BACd,cAC2C;AAC3C,SA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