@wealthreach/site-kit 0.0.0-stage → 1.0.1
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/README.md +20 -2
- package/dist/a11y/client.d.ts +23 -0
- package/dist/a11y/client.js +72 -0
- package/dist/a11y/index.d.ts +43 -0
- package/dist/a11y/index.js +194 -0
- package/dist/a11y/shell-client.d.ts +19 -0
- package/dist/a11y/shell-client.js +45 -0
- package/dist/analytics/index.d.ts +47 -0
- package/dist/analytics/index.js +122 -0
- package/dist/attribution-DQaAWtA5.d.ts +41 -0
- package/dist/blog/index.d.ts +131 -0
- package/dist/blog/index.js +259 -0
- package/dist/chunk-4YRCSRZZ.js +32 -0
- package/dist/chunk-7GDXQ6UB.js +772 -0
- package/dist/chunk-QQP7VG2C.js +231 -0
- package/dist/chunk-Y77ARZE4.js +214 -0
- package/dist/config/index.d.ts +20 -0
- package/dist/config/index.js +445 -0
- package/dist/consent/index.d.ts +103 -0
- package/dist/consent/index.js +61 -0
- package/dist/disclosures/index.d.ts +57 -0
- package/dist/disclosures/index.js +361 -0
- package/dist/forms/index.d.ts +128 -0
- package/dist/forms/index.js +449 -0
- package/dist/mdx/index.d.ts +15 -0
- package/dist/mdx/index.js +45 -0
- package/dist/next/config.cjs +140 -0
- package/dist/next/config.d.cts +36 -0
- package/dist/next/config.d.ts +36 -0
- package/dist/next/config.js +111 -0
- package/dist/next/draft-route.d.ts +10 -0
- package/dist/next/draft-route.js +49 -0
- package/dist/next/leads-route.d.ts +138 -0
- package/dist/next/leads-route.js +771 -0
- package/dist/next/privacy-mode.d.ts +14 -0
- package/dist/next/privacy-mode.js +86 -0
- package/dist/next/proxy.d.ts +19 -0
- package/dist/next/proxy.js +93 -0
- package/dist/regulatory-schema-uDKNJ7q8.d.ts +1301 -0
- package/dist/schema-C1ixytx2.d.ts +2911 -0
- package/dist/schema-DD0nDOD0.d.ts +1744 -0
- package/package.json +85 -3
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
// src/config/schema.ts
|
|
2
|
+
import { z as z2 } from "zod";
|
|
3
|
+
|
|
4
|
+
// src/disclosures/regulatory-schema.ts
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
var text = z.string().trim().min(1);
|
|
7
|
+
var httpsUrl = z.string().trim().url().refine((value) => value.startsWith("https://"), {
|
|
8
|
+
message: "must be an https:// URL"
|
|
9
|
+
});
|
|
10
|
+
var urlOrPath = z.string().trim().min(1).refine(
|
|
11
|
+
(value) => value.startsWith("https://") || value.startsWith("/") && !value.startsWith("//"),
|
|
12
|
+
{ message: "must be an https:// URL or site-relative /path" }
|
|
13
|
+
);
|
|
14
|
+
var US_STATES = {
|
|
15
|
+
AL: "Alabama",
|
|
16
|
+
AK: "Alaska",
|
|
17
|
+
AZ: "Arizona",
|
|
18
|
+
AR: "Arkansas",
|
|
19
|
+
CA: "California",
|
|
20
|
+
CO: "Colorado",
|
|
21
|
+
CT: "Connecticut",
|
|
22
|
+
DE: "Delaware",
|
|
23
|
+
DC: "District of Columbia",
|
|
24
|
+
FL: "Florida",
|
|
25
|
+
GA: "Georgia",
|
|
26
|
+
HI: "Hawaii",
|
|
27
|
+
ID: "Idaho",
|
|
28
|
+
IL: "Illinois",
|
|
29
|
+
IN: "Indiana",
|
|
30
|
+
IA: "Iowa",
|
|
31
|
+
KS: "Kansas",
|
|
32
|
+
KY: "Kentucky",
|
|
33
|
+
LA: "Louisiana",
|
|
34
|
+
ME: "Maine",
|
|
35
|
+
MD: "Maryland",
|
|
36
|
+
MA: "Massachusetts",
|
|
37
|
+
MI: "Michigan",
|
|
38
|
+
MN: "Minnesota",
|
|
39
|
+
MS: "Mississippi",
|
|
40
|
+
MO: "Missouri",
|
|
41
|
+
MT: "Montana",
|
|
42
|
+
NE: "Nebraska",
|
|
43
|
+
NV: "Nevada",
|
|
44
|
+
NH: "New Hampshire",
|
|
45
|
+
NJ: "New Jersey",
|
|
46
|
+
NM: "New Mexico",
|
|
47
|
+
NY: "New York",
|
|
48
|
+
NC: "North Carolina",
|
|
49
|
+
ND: "North Dakota",
|
|
50
|
+
OH: "Ohio",
|
|
51
|
+
OK: "Oklahoma",
|
|
52
|
+
OR: "Oregon",
|
|
53
|
+
PA: "Pennsylvania",
|
|
54
|
+
RI: "Rhode Island",
|
|
55
|
+
SC: "South Carolina",
|
|
56
|
+
SD: "South Dakota",
|
|
57
|
+
TN: "Tennessee",
|
|
58
|
+
TX: "Texas",
|
|
59
|
+
UT: "Utah",
|
|
60
|
+
VT: "Vermont",
|
|
61
|
+
VA: "Virginia",
|
|
62
|
+
WA: "Washington",
|
|
63
|
+
WV: "West Virginia",
|
|
64
|
+
WI: "Wisconsin",
|
|
65
|
+
WY: "Wyoming"
|
|
66
|
+
};
|
|
67
|
+
var PROVINCES = {
|
|
68
|
+
AB: "Alberta",
|
|
69
|
+
BC: "British Columbia",
|
|
70
|
+
MB: "Manitoba",
|
|
71
|
+
NB: "New Brunswick",
|
|
72
|
+
NL: "Newfoundland and Labrador",
|
|
73
|
+
NS: "Nova Scotia",
|
|
74
|
+
NT: "Northwest Territories",
|
|
75
|
+
NU: "Nunavut",
|
|
76
|
+
ON: "Ontario",
|
|
77
|
+
PE: "Prince Edward Island",
|
|
78
|
+
QC: "Quebec",
|
|
79
|
+
SK: "Saskatchewan",
|
|
80
|
+
YT: "Yukon"
|
|
81
|
+
};
|
|
82
|
+
var keys = (o) => Object.keys(o);
|
|
83
|
+
var usStateSchema = z.enum(keys(US_STATES));
|
|
84
|
+
var provinceSchema = z.enum(keys(PROVINCES));
|
|
85
|
+
var crdSchema = z.string().regex(/^[0-9]{1,10}$/, "must be a CRD number, digits only");
|
|
86
|
+
var statesSchema = z.array(usStateSchema).min(1, "must name at least one state");
|
|
87
|
+
var regulatorSchema = z.union([
|
|
88
|
+
z.strictObject({ sec: z.literal(true) }),
|
|
89
|
+
z.strictObject({
|
|
90
|
+
states: statesSchema,
|
|
91
|
+
exemptElsewhere: z.boolean().default(false)
|
|
92
|
+
})
|
|
93
|
+
]);
|
|
94
|
+
var membershipSchema = z.enum(["FINRA", "SIPC", "MSRB"]);
|
|
95
|
+
var adviserEntitySchema = z.strictObject({
|
|
96
|
+
legalName: text,
|
|
97
|
+
regulator: regulatorSchema,
|
|
98
|
+
crd: crdSchema.optional(),
|
|
99
|
+
formAdvUrl: urlOrPath.optional(),
|
|
100
|
+
formCrsUrl: urlOrPath.optional()
|
|
101
|
+
});
|
|
102
|
+
var brokerDealerEntitySchema = z.strictObject({
|
|
103
|
+
legalName: text,
|
|
104
|
+
memberships: z.array(membershipSchema).min(1),
|
|
105
|
+
crd: crdSchema.optional()
|
|
106
|
+
});
|
|
107
|
+
var dualFirmSchema = brokerDealerEntitySchema.extend({
|
|
108
|
+
regulator: regulatorSchema,
|
|
109
|
+
formAdvUrl: urlOrPath.optional(),
|
|
110
|
+
formCrsUrl: urlOrPath.optional()
|
|
111
|
+
});
|
|
112
|
+
var transactsSchema = z.union([statesSchema, z.literal("registered-states")]);
|
|
113
|
+
var addOns = {
|
|
114
|
+
affiliates: z.array(
|
|
115
|
+
z.strictObject({
|
|
116
|
+
role: z.enum(["insurance", "tax", "law", "planning"]),
|
|
117
|
+
legalName: text,
|
|
118
|
+
relation: z.enum(["affiliated", "unaffiliated"]),
|
|
119
|
+
licensedStates: statesSchema.optional()
|
|
120
|
+
})
|
|
121
|
+
).optional(),
|
|
122
|
+
custodian: text.optional()
|
|
123
|
+
};
|
|
124
|
+
var houseText = z.boolean().optional();
|
|
125
|
+
var regulatorySchema = z.discriminatedUnion("kind", [
|
|
126
|
+
z.strictObject({
|
|
127
|
+
kind: z.literal("adviser"),
|
|
128
|
+
regulator: regulatorSchema,
|
|
129
|
+
crd: crdSchema.optional(),
|
|
130
|
+
formAdvUrl: urlOrPath.optional(),
|
|
131
|
+
formCrsUrl: urlOrPath.optional(),
|
|
132
|
+
secFileNumber: z.string().regex(/^[0-9]{3}-[0-9]{1,6}$/, "must be an SEC file number such as 801-12345").optional(),
|
|
133
|
+
...addOns
|
|
134
|
+
}),
|
|
135
|
+
z.strictObject({
|
|
136
|
+
kind: z.literal("adviser-representative"),
|
|
137
|
+
adviser: adviserEntitySchema,
|
|
138
|
+
relation: z.enum(["dba", "affiliated", "unaffiliated"]),
|
|
139
|
+
...addOns
|
|
140
|
+
}),
|
|
141
|
+
z.strictObject({
|
|
142
|
+
kind: z.literal("broker-dealer-and-adviser"),
|
|
143
|
+
brokerDealer: brokerDealerEntitySchema,
|
|
144
|
+
adviser: adviserEntitySchema,
|
|
145
|
+
relation: z.literal("unaffiliated"),
|
|
146
|
+
transacts: transactsSchema,
|
|
147
|
+
clearingFirm: text.optional(),
|
|
148
|
+
brokerCheck: httpsUrl.optional(),
|
|
149
|
+
houseText,
|
|
150
|
+
...addOns
|
|
151
|
+
}),
|
|
152
|
+
z.strictObject({
|
|
153
|
+
kind: z.literal("dual-registrant"),
|
|
154
|
+
firm: dualFirmSchema,
|
|
155
|
+
capacities: z.array(z.enum(["registered-representative", "investment-adviser-representative"])).min(1),
|
|
156
|
+
transacts: transactsSchema,
|
|
157
|
+
brokerCheck: httpsUrl.optional(),
|
|
158
|
+
houseText,
|
|
159
|
+
...addOns
|
|
160
|
+
}),
|
|
161
|
+
z.strictObject({
|
|
162
|
+
kind: z.literal("broker-dealer-representative"),
|
|
163
|
+
brokerDealer: brokerDealerEntitySchema,
|
|
164
|
+
transacts: transactsSchema,
|
|
165
|
+
clearingFirm: text.optional(),
|
|
166
|
+
brokerCheck: httpsUrl.optional(),
|
|
167
|
+
houseText,
|
|
168
|
+
...addOns
|
|
169
|
+
}),
|
|
170
|
+
z.strictObject({
|
|
171
|
+
kind: z.literal("insurance-only"),
|
|
172
|
+
licensedStates: statesSchema,
|
|
173
|
+
...addOns
|
|
174
|
+
}),
|
|
175
|
+
z.strictObject({
|
|
176
|
+
kind: z.literal("canadian-dealer-representative"),
|
|
177
|
+
dealer: z.strictObject({
|
|
178
|
+
legalName: text,
|
|
179
|
+
sro: z.literal("CIRO"),
|
|
180
|
+
protectionFund: z.literal("CIPF")
|
|
181
|
+
}),
|
|
182
|
+
provinces: z.array(provinceSchema).min(1, "must name at least one province"),
|
|
183
|
+
tradeName: z.boolean(),
|
|
184
|
+
productScope: text.optional(),
|
|
185
|
+
...addOns
|
|
186
|
+
}),
|
|
187
|
+
z.strictObject({ kind: z.literal("not-regulated"), ...addOns }),
|
|
188
|
+
z.strictObject({
|
|
189
|
+
kind: z.literal("unclassified"),
|
|
190
|
+
crd: crdSchema.optional(),
|
|
191
|
+
formAdvUrl: urlOrPath.optional()
|
|
192
|
+
})
|
|
193
|
+
]);
|
|
194
|
+
|
|
195
|
+
// src/config/schema.ts
|
|
196
|
+
var DEFAULT_LEADS_API_URL = "https://attract.wealthreach.ai/api/attract/site-leads";
|
|
197
|
+
var DEFAULT_ANALYTICS_ENDPOINT = "https://attract.wealthreach.ai/api/analytics/events";
|
|
198
|
+
var navItemSchema = z2.object({
|
|
199
|
+
label: z2.string().trim().min(1),
|
|
200
|
+
href: z2.string().trim().min(1)
|
|
201
|
+
});
|
|
202
|
+
var ctaLinkSchema = z2.object({
|
|
203
|
+
label: z2.string().trim().min(1),
|
|
204
|
+
href: z2.string().trim().min(1)
|
|
205
|
+
});
|
|
206
|
+
var socialLinkSchema = z2.object({
|
|
207
|
+
platform: z2.string().trim().min(1),
|
|
208
|
+
url: z2.string().trim().min(1)
|
|
209
|
+
});
|
|
210
|
+
var footerGroupSchema = z2.object({
|
|
211
|
+
heading: z2.string().trim().min(1),
|
|
212
|
+
links: z2.array(navItemSchema)
|
|
213
|
+
});
|
|
214
|
+
var bookingConfigSchema = z2.object({
|
|
215
|
+
provider: z2.enum(["calendly", "calcom", "none"]).default("none"),
|
|
216
|
+
url: z2.string().trim().optional().default(""),
|
|
217
|
+
mode: z2.enum(["embed", "link"]).default("link")
|
|
218
|
+
});
|
|
219
|
+
var consentConfigSchema = z2.object({
|
|
220
|
+
enabled: z2.boolean().default(true),
|
|
221
|
+
message: z2.string().trim().optional().default(""),
|
|
222
|
+
policyUrl: z2.string().trim().optional().default("/privacy-policy"),
|
|
223
|
+
/** Legacy cookie names to migrate silently for returning visitors (e.g. Brandywine Oak). */
|
|
224
|
+
legacyConsentCookies: z2.array(z2.string().trim().min(1)).optional().default([]),
|
|
225
|
+
/** Additional US states requiring opt-in beyond California (CA is always opt-in). */
|
|
226
|
+
extraOptInUsRegions: z2.array(z2.string().trim().length(2)).optional().default([]),
|
|
227
|
+
/** Set true if the site renders its own footer PrivacyChoicesButton instead of the floating one. */
|
|
228
|
+
hideFloatingPrivacyButton: z2.boolean().optional().default(false)
|
|
229
|
+
});
|
|
230
|
+
var visitorsConfigSchema = z2.object({
|
|
231
|
+
enabled: z2.boolean().default(false),
|
|
232
|
+
siteScriptUrl: z2.string().trim().optional().default("")
|
|
233
|
+
});
|
|
234
|
+
var blogConfigSchema = z2.object({
|
|
235
|
+
enabled: z2.boolean().optional().default(true),
|
|
236
|
+
routeSegment: z2.string().trim().min(1).optional().default("blog"),
|
|
237
|
+
postsDir: z2.string().trim().min(1).optional().default("data/blog"),
|
|
238
|
+
model: z2.enum(["data-module", "content-collection"]).optional().default("content-collection")
|
|
239
|
+
});
|
|
240
|
+
var complianceConfigSchema = z2.object({
|
|
241
|
+
disclosures: z2.array(z2.string()).default([]),
|
|
242
|
+
regulatory: regulatorySchema.optional(),
|
|
243
|
+
formAdvUrl: z2.string().trim().optional(),
|
|
244
|
+
formCrsUrl: z2.string().trim().optional(),
|
|
245
|
+
crd: z2.string().trim().optional(),
|
|
246
|
+
brokerCheckUrl: z2.string().trim().optional()
|
|
247
|
+
});
|
|
248
|
+
var integrationsConfigSchema = z2.object({
|
|
249
|
+
gtmId: z2.string().trim().optional(),
|
|
250
|
+
ga4MeasurementId: z2.string().trim().optional(),
|
|
251
|
+
vercelAnalytics: z2.boolean().optional().default(false)
|
|
252
|
+
});
|
|
253
|
+
var siteConfigSchema = z2.object({
|
|
254
|
+
version: z2.number().int().min(3).default(3),
|
|
255
|
+
siteId: z2.string().trim().optional().default(""),
|
|
256
|
+
advisorId: z2.string().trim().optional().default(""),
|
|
257
|
+
leadsApiUrl: z2.string().trim().optional().default(DEFAULT_LEADS_API_URL),
|
|
258
|
+
analyticsEndpoint: z2.string().trim().optional().default(DEFAULT_ANALYTICS_ENDPOINT),
|
|
259
|
+
analyticsApiKey: z2.string().trim().optional().default(""),
|
|
260
|
+
brand: z2.object({
|
|
261
|
+
legalName: z2.string().trim().min(1),
|
|
262
|
+
displayName: z2.string().trim().optional().default(""),
|
|
263
|
+
tagline: z2.string().trim().optional().default(""),
|
|
264
|
+
logoUrl: z2.string().trim().optional(),
|
|
265
|
+
ogImageUrl: z2.string().trim().optional()
|
|
266
|
+
}),
|
|
267
|
+
contact: z2.object({
|
|
268
|
+
email: z2.string().trim().optional().default(""),
|
|
269
|
+
phone: z2.string().trim().optional().default(""),
|
|
270
|
+
address: z2.string().trim().optional().default(""),
|
|
271
|
+
calendarUrl: z2.string().trim().optional().default("")
|
|
272
|
+
}).optional().default({ email: "", phone: "", address: "", calendarUrl: "" }),
|
|
273
|
+
booking: bookingConfigSchema.optional().default({
|
|
274
|
+
provider: "none",
|
|
275
|
+
url: "",
|
|
276
|
+
mode: "link"
|
|
277
|
+
}),
|
|
278
|
+
consent: consentConfigSchema.optional().default({
|
|
279
|
+
enabled: true,
|
|
280
|
+
message: "",
|
|
281
|
+
policyUrl: "/privacy-policy",
|
|
282
|
+
legacyConsentCookies: [],
|
|
283
|
+
extraOptInUsRegions: [],
|
|
284
|
+
hideFloatingPrivacyButton: false
|
|
285
|
+
}),
|
|
286
|
+
visitors: visitorsConfigSchema.optional(),
|
|
287
|
+
integrations: integrationsConfigSchema.optional().default({
|
|
288
|
+
vercelAnalytics: false
|
|
289
|
+
}),
|
|
290
|
+
forms: z2.object({
|
|
291
|
+
allowCustomEmailDispatch: z2.boolean().optional().default(false),
|
|
292
|
+
exemptFormIds: z2.array(z2.string()).optional().default([]),
|
|
293
|
+
lead: z2.union([
|
|
294
|
+
z2.literal(false),
|
|
295
|
+
z2.object({
|
|
296
|
+
enabled: z2.boolean().optional().default(true),
|
|
297
|
+
heading: z2.string().optional(),
|
|
298
|
+
buttonText: z2.string().optional(),
|
|
299
|
+
showPhone: z2.boolean().optional(),
|
|
300
|
+
showMessage: z2.boolean().optional()
|
|
301
|
+
}).passthrough()
|
|
302
|
+
]).optional()
|
|
303
|
+
}).passthrough().optional().default({ allowCustomEmailDispatch: false, exemptFormIds: [] }),
|
|
304
|
+
blog: blogConfigSchema.optional().default({
|
|
305
|
+
enabled: true,
|
|
306
|
+
routeSegment: "blog",
|
|
307
|
+
postsDir: "data/blog",
|
|
308
|
+
model: "content-collection"
|
|
309
|
+
}),
|
|
310
|
+
header: z2.object({
|
|
311
|
+
nav: z2.array(navItemSchema).optional().default([]),
|
|
312
|
+
cta: ctaLinkSchema.optional()
|
|
313
|
+
}).optional().default({ nav: [] }),
|
|
314
|
+
footer: z2.object({
|
|
315
|
+
groups: z2.array(footerGroupSchema).optional().default([]),
|
|
316
|
+
social: z2.array(socialLinkSchema).optional().default([])
|
|
317
|
+
}).optional().default({ groups: [], social: [] }),
|
|
318
|
+
seo: z2.object({
|
|
319
|
+
siteUrl: z2.string().trim().optional().default(""),
|
|
320
|
+
lang: z2.string().trim().optional().default("en"),
|
|
321
|
+
defaultTitle: z2.string().trim().optional().default(""),
|
|
322
|
+
titleTemplate: z2.string().trim().optional().default(""),
|
|
323
|
+
defaultDescription: z2.string().trim().optional().default(""),
|
|
324
|
+
ogImageUrl: z2.string().trim().optional(),
|
|
325
|
+
twitterHandle: z2.string().trim().optional()
|
|
326
|
+
}).optional().default({
|
|
327
|
+
siteUrl: "",
|
|
328
|
+
lang: "en",
|
|
329
|
+
defaultTitle: "",
|
|
330
|
+
titleTemplate: "",
|
|
331
|
+
defaultDescription: ""
|
|
332
|
+
}),
|
|
333
|
+
jsonLd: z2.object({
|
|
334
|
+
organization: z2.object({
|
|
335
|
+
type: z2.string().optional().default("FinancialService"),
|
|
336
|
+
sameAs: z2.array(z2.string()).optional(),
|
|
337
|
+
areaServed: z2.union([z2.string(), z2.array(z2.string())]).optional()
|
|
338
|
+
}).optional()
|
|
339
|
+
}).optional(),
|
|
340
|
+
compliance: complianceConfigSchema.optional().default({ disclosures: [] }),
|
|
341
|
+
theme: z2.record(z2.string(), z2.unknown()).optional()
|
|
342
|
+
}).passthrough().transform((parsed) => ({
|
|
343
|
+
...parsed,
|
|
344
|
+
brand: {
|
|
345
|
+
...parsed.brand,
|
|
346
|
+
displayName: parsed.brand.displayName || displayNameFromLegal(parsed.brand.legalName)
|
|
347
|
+
}
|
|
348
|
+
}));
|
|
349
|
+
var LEGAL_SUFFIX_RE = /,?\s+\b(?:LLC|L\.L\.C\.|LLP|L\.L\.P\.|Inc\.?|Corp\.?|Corporation|Ltd\.?|Limited|Co\.?|LP|L\.P\.|PC|P\.C\.|PLLC)\.?$/i;
|
|
350
|
+
function displayNameFromLegal(legalName) {
|
|
351
|
+
return legalName.trim().replace(LEGAL_SUFFIX_RE, "").trim() || legalName.trim();
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// src/config/loader.ts
|
|
355
|
+
var cachedConfig = null;
|
|
356
|
+
function normalizeSiteConfig(raw) {
|
|
357
|
+
return siteConfigSchema.parse(raw);
|
|
358
|
+
}
|
|
359
|
+
function defineSiteConfig(raw) {
|
|
360
|
+
let instance = null;
|
|
361
|
+
return () => {
|
|
362
|
+
if (!instance) {
|
|
363
|
+
instance = normalizeSiteConfig(raw);
|
|
364
|
+
}
|
|
365
|
+
return instance;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function setGlobalSiteConfig(config) {
|
|
369
|
+
cachedConfig = config;
|
|
370
|
+
}
|
|
371
|
+
function getGlobalSiteConfig() {
|
|
372
|
+
return cachedConfig;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// src/config/metadata.ts
|
|
376
|
+
function buildMetadata(config, overrides) {
|
|
377
|
+
const { brand, seo } = config;
|
|
378
|
+
const title = seo.defaultTitle || brand.displayName;
|
|
379
|
+
const description = seo.defaultDescription || brand.tagline;
|
|
380
|
+
const ogImage = seo.ogImageUrl ?? brand.ogImageUrl;
|
|
381
|
+
let metadataBase;
|
|
382
|
+
if (seo.siteUrl) {
|
|
383
|
+
try {
|
|
384
|
+
metadataBase = new URL(seo.siteUrl);
|
|
385
|
+
} catch {
|
|
386
|
+
metadataBase = void 0;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
...metadataBase ? { metadataBase } : {},
|
|
391
|
+
title: {
|
|
392
|
+
default: title,
|
|
393
|
+
template: seo.titleTemplate || `%s \u2014 ${brand.displayName}`
|
|
394
|
+
},
|
|
395
|
+
description,
|
|
396
|
+
icons: { icon: "/favicon.svg" },
|
|
397
|
+
openGraph: {
|
|
398
|
+
title,
|
|
399
|
+
description,
|
|
400
|
+
type: "website",
|
|
401
|
+
...ogImage ? { images: [ogImage] } : {}
|
|
402
|
+
},
|
|
403
|
+
...seo.twitterHandle ? { twitter: { site: seo.twitterHandle, card: "summary_large_image" } } : {},
|
|
404
|
+
...overrides
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function buildOrganizationJsonLd(config) {
|
|
408
|
+
const org = config.jsonLd?.organization;
|
|
409
|
+
if (!org) return null;
|
|
410
|
+
return {
|
|
411
|
+
"@context": "https://schema.org",
|
|
412
|
+
"@type": org.type ?? "FinancialService",
|
|
413
|
+
name: config.brand.legalName,
|
|
414
|
+
...config.seo.siteUrl ? { url: config.seo.siteUrl } : {},
|
|
415
|
+
...config.brand.logoUrl ? { logo: config.brand.logoUrl } : {},
|
|
416
|
+
...org.sameAs ? { sameAs: org.sameAs } : {},
|
|
417
|
+
...org.areaServed ? { areaServed: org.areaServed } : {}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function serializeJsonLd(data) {
|
|
421
|
+
return JSON.stringify(data).replace(/</g, "\\u003c");
|
|
422
|
+
}
|
|
423
|
+
export {
|
|
424
|
+
DEFAULT_ANALYTICS_ENDPOINT,
|
|
425
|
+
DEFAULT_LEADS_API_URL,
|
|
426
|
+
blogConfigSchema,
|
|
427
|
+
bookingConfigSchema,
|
|
428
|
+
buildMetadata,
|
|
429
|
+
buildOrganizationJsonLd,
|
|
430
|
+
complianceConfigSchema,
|
|
431
|
+
consentConfigSchema,
|
|
432
|
+
ctaLinkSchema,
|
|
433
|
+
defineSiteConfig,
|
|
434
|
+
displayNameFromLegal,
|
|
435
|
+
footerGroupSchema,
|
|
436
|
+
getGlobalSiteConfig,
|
|
437
|
+
integrationsConfigSchema,
|
|
438
|
+
navItemSchema,
|
|
439
|
+
normalizeSiteConfig,
|
|
440
|
+
serializeJsonLd,
|
|
441
|
+
setGlobalSiteConfig,
|
|
442
|
+
siteConfigSchema,
|
|
443
|
+
socialLinkSchema,
|
|
444
|
+
visitorsConfigSchema
|
|
445
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { S as SiteConfig } from '../schema-DD0nDOD0.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Unified BrandywineOak Consent Engine.
|
|
7
|
+
* Mirrors Brandywine Oak's geo + GPC + 180-day cookie model across every site.
|
|
8
|
+
*/
|
|
9
|
+
declare const CONSENT_COOKIE = "wr_consent";
|
|
10
|
+
declare const MODE_COOKIE = "privacy_mode";
|
|
11
|
+
declare const CONSENT_MAX_AGE: number;
|
|
12
|
+
declare const MODE_MAX_AGE: number;
|
|
13
|
+
declare const VISITOR_SCRIPT_ID = "wr-site-script";
|
|
14
|
+
declare const GTM_SCRIPT_ID = "wr-gtm-script";
|
|
15
|
+
declare const GA4_SCRIPT_ID = "wr-ga4-script";
|
|
16
|
+
type PrivacyMode = "opt-in" | "opt-out";
|
|
17
|
+
type ConsentValue = "analytics:yes" | "analytics:no";
|
|
18
|
+
/** EU 27 + EEA (IS, LI, NO) + UK + Switzerland require prior opt-in consent. */
|
|
19
|
+
declare const OPT_IN_COUNTRIES: Set<string>;
|
|
20
|
+
/** US states requiring prior opt-in by default (CA for CIPA pen-register protection). */
|
|
21
|
+
declare const DEFAULT_OPT_IN_US_REGIONS: Set<string>;
|
|
22
|
+
declare function privacyModeForLocation(country: string | null, region: string | null, extraOptInUsRegions?: readonly string[]): PrivacyMode;
|
|
23
|
+
declare function analyticsAllowed(consent: ConsentValue | null, mode: PrivacyMode, gpcSignal: boolean): boolean;
|
|
24
|
+
declare function parseConsentValue(raw: string | null): ConsentValue | null;
|
|
25
|
+
declare function readCookieFromString(cookieHeader: string, name: string): string | null;
|
|
26
|
+
declare function readBrowserCookie(name: string): string | null;
|
|
27
|
+
declare function readStoredConsent(legacyCookieNames?: readonly string[]): ConsentValue | null;
|
|
28
|
+
declare function writeConsentCookie(value: ConsentValue): void;
|
|
29
|
+
declare function readGpcSignal(): boolean;
|
|
30
|
+
declare function resolveGeoFromHeaders(headers: Headers): {
|
|
31
|
+
country: string | null;
|
|
32
|
+
region: string | null;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
interface ConsentBootstrapOptions {
|
|
36
|
+
visitorScriptUrl?: string;
|
|
37
|
+
gtmId?: string;
|
|
38
|
+
ga4MeasurementId?: string;
|
|
39
|
+
legacyConsentCookies?: readonly string[];
|
|
40
|
+
}
|
|
41
|
+
declare function sanitizeVisitorScriptUrl(raw?: string): string;
|
|
42
|
+
declare function sanitizeGtmId(raw?: string): string;
|
|
43
|
+
declare function sanitizeGa4Id(raw?: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Generates an inline `<script>` snippet run in `<head>` during HTML parse,
|
|
46
|
+
* before React hydrates. Loads tracking scripts ONLY when BrandywineOak consent
|
|
47
|
+
* allows it (`wr_consent=analytics:yes`, or `privacy_mode=opt-out` with GPC off).
|
|
48
|
+
*/
|
|
49
|
+
declare function buildConsentBootstrapScript(options: ConsentBootstrapOptions): string | null;
|
|
50
|
+
|
|
51
|
+
interface ConsentContextValue {
|
|
52
|
+
config: SiteConfig;
|
|
53
|
+
mode: PrivacyMode;
|
|
54
|
+
decision: ConsentValue | null;
|
|
55
|
+
gpc: boolean;
|
|
56
|
+
allowed: boolean;
|
|
57
|
+
ready: boolean;
|
|
58
|
+
bannerOpen: boolean;
|
|
59
|
+
reopened: boolean;
|
|
60
|
+
accept: () => void;
|
|
61
|
+
decline: () => void;
|
|
62
|
+
openPreferences: () => void;
|
|
63
|
+
closePreferences: () => void;
|
|
64
|
+
/** Internal ref to restore focus to the Privacy Choices trigger when closing. */
|
|
65
|
+
registerTriggerRef: (el: HTMLButtonElement | null) => void;
|
|
66
|
+
}
|
|
67
|
+
interface ConsentProviderProps {
|
|
68
|
+
config: SiteConfig;
|
|
69
|
+
/** Override 304 fallback endpoint (defaults to "/api/privacy-mode"). */
|
|
70
|
+
privacyModeEndpoint?: string;
|
|
71
|
+
children: React__default.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
declare function ConsentProvider({ config, privacyModeEndpoint, children, }: ConsentProviderProps): React__default.JSX.Element;
|
|
74
|
+
declare function useConsent(): ConsentContextValue;
|
|
75
|
+
/** Renders children ONLY when BrandywineOak consent currently permits optional analytics/embeds. */
|
|
76
|
+
declare function ConsentGate({ children, fallback, }: {
|
|
77
|
+
children: React__default.ReactNode;
|
|
78
|
+
fallback?: React__default.ReactNode;
|
|
79
|
+
}): React__default.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface PrivacyChoicesButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
82
|
+
label?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Accessible persistent trigger to reopen cookie preferences from any bespoke
|
|
86
|
+
* footer or floating control. Stamps `data-wr-privacy-choices` for conformance.
|
|
87
|
+
*/
|
|
88
|
+
declare function PrivacyChoicesButton({ label, className, onClick, ...rest }: PrivacyChoicesButtonProps): React__default.JSX.Element;
|
|
89
|
+
interface ConsentBannerProps {
|
|
90
|
+
/** Override floating button styles when not using a custom footer button. */
|
|
91
|
+
floatingButtonClassName?: string;
|
|
92
|
+
/** Override banner container styles (or replace the whole banner via SiteShell `consentBanner`). */
|
|
93
|
+
bannerClassName?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Accessible default BrandywineOak consent banner styled with CSS tokens
|
|
97
|
+
* (`--wr-surface`, `--wr-foreground`, `--wr-border`, `--wr-primary`, `--wr-primary-foreground`)
|
|
98
|
+
* with safe high-contrast fallbacks.
|
|
99
|
+
*/
|
|
100
|
+
declare function ConsentBanner({ floatingButtonClassName, bannerClassName, }?: ConsentBannerProps): React__default.JSX.Element | null;
|
|
101
|
+
|
|
102
|
+
export { CONSENT_COOKIE, CONSENT_MAX_AGE, ConsentBanner, ConsentGate, ConsentProvider, DEFAULT_OPT_IN_US_REGIONS, GA4_SCRIPT_ID, GTM_SCRIPT_ID, MODE_COOKIE, MODE_MAX_AGE, OPT_IN_COUNTRIES, PrivacyChoicesButton, VISITOR_SCRIPT_ID, analyticsAllowed, buildConsentBootstrapScript, parseConsentValue, privacyModeForLocation, readBrowserCookie, readCookieFromString, readGpcSignal, readStoredConsent, resolveGeoFromHeaders, sanitizeGa4Id, sanitizeGtmId, sanitizeVisitorScriptUrl, useConsent, writeConsentCookie };
|
|
103
|
+
export type { ConsentBannerProps, ConsentBootstrapOptions, ConsentContextValue, ConsentProviderProps, ConsentValue, PrivacyChoicesButtonProps, PrivacyMode };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ConsentBanner,
|
|
4
|
+
PrivacyChoicesButton
|
|
5
|
+
} from "../chunk-Y77ARZE4.js";
|
|
6
|
+
import {
|
|
7
|
+
CONSENT_COOKIE,
|
|
8
|
+
CONSENT_MAX_AGE,
|
|
9
|
+
ConsentGate,
|
|
10
|
+
ConsentProvider,
|
|
11
|
+
DEFAULT_OPT_IN_US_REGIONS,
|
|
12
|
+
GA4_SCRIPT_ID,
|
|
13
|
+
GTM_SCRIPT_ID,
|
|
14
|
+
MODE_COOKIE,
|
|
15
|
+
MODE_MAX_AGE,
|
|
16
|
+
OPT_IN_COUNTRIES,
|
|
17
|
+
VISITOR_SCRIPT_ID,
|
|
18
|
+
analyticsAllowed,
|
|
19
|
+
buildConsentBootstrapScript,
|
|
20
|
+
parseConsentValue,
|
|
21
|
+
privacyModeForLocation,
|
|
22
|
+
readBrowserCookie,
|
|
23
|
+
readCookieFromString,
|
|
24
|
+
readGpcSignal,
|
|
25
|
+
readStoredConsent,
|
|
26
|
+
resolveGeoFromHeaders,
|
|
27
|
+
sanitizeGa4Id,
|
|
28
|
+
sanitizeGtmId,
|
|
29
|
+
sanitizeVisitorScriptUrl,
|
|
30
|
+
useConsent,
|
|
31
|
+
writeConsentCookie
|
|
32
|
+
} from "../chunk-7GDXQ6UB.js";
|
|
33
|
+
export {
|
|
34
|
+
CONSENT_COOKIE,
|
|
35
|
+
CONSENT_MAX_AGE,
|
|
36
|
+
ConsentBanner,
|
|
37
|
+
ConsentGate,
|
|
38
|
+
ConsentProvider,
|
|
39
|
+
DEFAULT_OPT_IN_US_REGIONS,
|
|
40
|
+
GA4_SCRIPT_ID,
|
|
41
|
+
GTM_SCRIPT_ID,
|
|
42
|
+
MODE_COOKIE,
|
|
43
|
+
MODE_MAX_AGE,
|
|
44
|
+
OPT_IN_COUNTRIES,
|
|
45
|
+
PrivacyChoicesButton,
|
|
46
|
+
VISITOR_SCRIPT_ID,
|
|
47
|
+
analyticsAllowed,
|
|
48
|
+
buildConsentBootstrapScript,
|
|
49
|
+
parseConsentValue,
|
|
50
|
+
privacyModeForLocation,
|
|
51
|
+
readBrowserCookie,
|
|
52
|
+
readCookieFromString,
|
|
53
|
+
readGpcSignal,
|
|
54
|
+
readStoredConsent,
|
|
55
|
+
resolveGeoFromHeaders,
|
|
56
|
+
sanitizeGa4Id,
|
|
57
|
+
sanitizeGtmId,
|
|
58
|
+
sanitizeVisitorScriptUrl,
|
|
59
|
+
useConsent,
|
|
60
|
+
writeConsentCookie
|
|
61
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { R as Regulatory, M as Membership, a as Regulator } from '../regulatory-schema-uDKNJ7q8.js';
|
|
2
|
+
export { P as PROVINCES, b as Province, c as RegulatoryKind, U as US_STATES, d as UsState, e as crdSchema, i as isClassified, m as membershipSchema, p as provinceSchema, r as regulatorSchema, f as regulatorySchema, u as usStateSchema } from '../regulatory-schema-uDKNJ7q8.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
interface DisclosureSourceConfig {
|
|
6
|
+
brand: {
|
|
7
|
+
legalName: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
compliance: {
|
|
11
|
+
disclosures?: string[];
|
|
12
|
+
regulatory?: Regulatory;
|
|
13
|
+
formAdvUrl?: string;
|
|
14
|
+
formCrsUrl?: string;
|
|
15
|
+
crd?: string;
|
|
16
|
+
brokerCheckUrl?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface DisclosureLink {
|
|
20
|
+
/** The `data-wr-disclosure` mark the footer stamps and conformance reads. */
|
|
21
|
+
mark: "form-adv" | "form-crs" | "crd" | "brokercheck";
|
|
22
|
+
label: string;
|
|
23
|
+
/** Absent for the CRD, which is a label, not a link. */
|
|
24
|
+
href?: string;
|
|
25
|
+
}
|
|
26
|
+
interface SiteDisclosures {
|
|
27
|
+
/** Signed regulatory lines generated from `compliance.regulatory` (ENG-1460). */
|
|
28
|
+
lines: string[];
|
|
29
|
+
/** Labelled regulatory links/marks with conformance `mark` keys. */
|
|
30
|
+
links: DisclosureLink[];
|
|
31
|
+
/** Firm-specific disclosures beneath the generated lines. */
|
|
32
|
+
firmDisclosures: string[];
|
|
33
|
+
/** Entity names required to appear in `firmDisclosures` (affiliates, custodian, house text). */
|
|
34
|
+
requiredFirmNames: string[];
|
|
35
|
+
}
|
|
36
|
+
declare function registeredPhrase(r: Regulator): string;
|
|
37
|
+
declare function membershipPhrase(memberships: readonly Membership[]): string;
|
|
38
|
+
/** Signed-off regulatory lines (ENG-1460), in order. Empty for `unclassified`, absent regulatory, or `houseText`. */
|
|
39
|
+
declare function regulatoryLines(config: DisclosureSourceConfig): string[];
|
|
40
|
+
/** Labelled links in canonical order. Supports both typed `compliance.regulatory` and legacy v3 fields. */
|
|
41
|
+
declare function regulatoryLinks(config: DisclosureSourceConfig): DisclosureLink[];
|
|
42
|
+
/** Entity names required inside `compliance.disclosures` (add-ons or broker-dealer house text). */
|
|
43
|
+
declare function namesTheFirmTextCarries(config: DisclosureSourceConfig): string[];
|
|
44
|
+
/** Complete disclosure bundle for any bespoke footer component. */
|
|
45
|
+
declare function getDisclosures(config: DisclosureSourceConfig): SiteDisclosures;
|
|
46
|
+
|
|
47
|
+
/** Spread onto the footer container wrapping regulatory disclosures. */
|
|
48
|
+
declare function disclosureRegionProps(): {
|
|
49
|
+
readonly "data-wr-disclosures": "";
|
|
50
|
+
};
|
|
51
|
+
/** Spread onto each regulatory disclosure link or CRD text span. */
|
|
52
|
+
declare function disclosureLinkProps(mark: DisclosureLink["mark"]): {
|
|
53
|
+
readonly "data-wr-disclosure": "form-adv" | "form-crs" | "crd" | "brokercheck";
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { Membership, Regulator, Regulatory, disclosureLinkProps, disclosureRegionProps, getDisclosures, membershipPhrase, namesTheFirmTextCarries, registeredPhrase, regulatoryLines, regulatoryLinks };
|
|
57
|
+
export type { DisclosureLink, DisclosureSourceConfig, SiteDisclosures };
|