@salesmind-ai/design-system 0.1.7 → 0.1.9
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/audit-CiyPkxk1.d.cts +194 -0
- package/dist/audit-CiyPkxk1.d.ts +194 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.css.map +1 -1
- package/dist/core/index.d.cts +5 -4
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +426 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +66 -21
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +405 -14
- package/dist/index.js.map +1 -1
- package/dist/marketing/index.cjs +136 -12
- package/dist/marketing/index.cjs.map +1 -1
- package/dist/marketing/index.css +26 -1
- package/dist/marketing/index.css.map +1 -1
- package/dist/marketing/index.js +138 -14
- package/dist/marketing/index.js.map +1 -1
- package/dist/report/index.cjs +1 -1
- package/dist/report/index.cjs.map +1 -1
- package/dist/report/index.css.map +1 -1
- package/dist/report/index.js +1 -1
- package/dist/report/index.js.map +1 -1
- package/dist/styles/styles.css +7 -4
- package/dist/web/index.cjs +427 -10
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +28 -2
- package/dist/web/index.d.ts +28 -2
- package/dist/web/index.js +405 -12
- package/dist/web/index.js.map +1 -1
- package/package.json +14 -12
package/dist/index.cjs
CHANGED
|
@@ -4050,23 +4050,146 @@ var PlatformBadge = React30.forwardRef(
|
|
|
4050
4050
|
}
|
|
4051
4051
|
);
|
|
4052
4052
|
PlatformBadge.displayName = "PlatformBadge";
|
|
4053
|
+
var UtmContext = React30.createContext(null);
|
|
4054
|
+
|
|
4055
|
+
// src/web/utm/useUtmDefaults.ts
|
|
4056
|
+
function useUtmDefaults() {
|
|
4057
|
+
return React30.useContext(UtmContext);
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
// src/web/utm/builders.ts
|
|
4061
|
+
var PLACEHOLDER_ORIGIN = "https://__placeholder__.internal";
|
|
4062
|
+
function buildUtmUrl(baseUrl, params) {
|
|
4063
|
+
const isRelative = baseUrl.startsWith("/");
|
|
4064
|
+
let url;
|
|
4065
|
+
try {
|
|
4066
|
+
url = isRelative ? new URL(baseUrl, PLACEHOLDER_ORIGIN) : new URL(baseUrl);
|
|
4067
|
+
} catch {
|
|
4068
|
+
return baseUrl;
|
|
4069
|
+
}
|
|
4070
|
+
const existingParams = [];
|
|
4071
|
+
url.searchParams.forEach((value, key) => {
|
|
4072
|
+
existingParams.push([key, value]);
|
|
4073
|
+
});
|
|
4074
|
+
for (const [key] of existingParams) {
|
|
4075
|
+
url.searchParams.delete(key);
|
|
4076
|
+
}
|
|
4077
|
+
for (const [key, value] of existingParams) {
|
|
4078
|
+
if (!key.startsWith("utm_")) {
|
|
4079
|
+
url.searchParams.set(key, value);
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
url.searchParams.set("utm_source", params.source);
|
|
4083
|
+
url.searchParams.set("utm_medium", params.medium);
|
|
4084
|
+
url.searchParams.set("utm_campaign", params.campaign);
|
|
4085
|
+
if (params.term !== void 0) {
|
|
4086
|
+
url.searchParams.set("utm_term", params.term);
|
|
4087
|
+
}
|
|
4088
|
+
if (params.content !== void 0) {
|
|
4089
|
+
url.searchParams.set("utm_content", params.content);
|
|
4090
|
+
}
|
|
4091
|
+
if (isRelative) {
|
|
4092
|
+
return url.href.replace(PLACEHOLDER_ORIGIN, "");
|
|
4093
|
+
}
|
|
4094
|
+
return url.href;
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
// src/web/utm/classifiers.ts
|
|
4098
|
+
var INTERNAL_PATTERNS = [
|
|
4099
|
+
/^\/(?!\/)/,
|
|
4100
|
+
// Relative paths
|
|
4101
|
+
/^https?:\/\/(www\.)?sales-mind\.ai/i,
|
|
4102
|
+
// Marketing site
|
|
4103
|
+
/^https?:\/\/app\.sales-mind\.ai/i,
|
|
4104
|
+
// Web app
|
|
4105
|
+
/^https?:\/\/apps\.sales-mind\.ai/i,
|
|
4106
|
+
// Web app (legacy)
|
|
4107
|
+
/^https?:\/\/meet\.sales-mind\.ai/i,
|
|
4108
|
+
// Booking
|
|
4109
|
+
/^https?:\/\/docs\.sales-mind\.ai/i
|
|
4110
|
+
// Docs
|
|
4111
|
+
];
|
|
4112
|
+
var SYSTEM_PATTERNS = [
|
|
4113
|
+
/^https?:\/\/.*\/api\//i,
|
|
4114
|
+
// API endpoints
|
|
4115
|
+
/^https?:\/\/.*\/webhook/i,
|
|
4116
|
+
// Webhooks
|
|
4117
|
+
/^https?:\/\/.*\/oauth/i,
|
|
4118
|
+
// OAuth callbacks
|
|
4119
|
+
/^https?:\/\/.*\/callback/i,
|
|
4120
|
+
// Callbacks
|
|
4121
|
+
/^https?:\/\/.*\.supabase\.(co|com)/i,
|
|
4122
|
+
// Supabase
|
|
4123
|
+
/^https?:\/\/.*\.firebaseapp\.com/i,
|
|
4124
|
+
// Firebase
|
|
4125
|
+
/^https?:\/\/.*\.cloudfunctions\.net/i
|
|
4126
|
+
// Cloud Functions
|
|
4127
|
+
];
|
|
4128
|
+
var ASSET_PATTERNS = [
|
|
4129
|
+
/\.(css|js|mjs|map|woff2?|ttf|eot|svg|png|jpe?g|gif|webp|avif|ico|pdf)(\?.*)?$/i
|
|
4130
|
+
];
|
|
4131
|
+
var CONVERSION_PATTERNS = [
|
|
4132
|
+
/^https?:\/\/(www\.)?calendly\.com/i,
|
|
4133
|
+
/^https?:\/\/(checkout\.)?stripe\.com/i,
|
|
4134
|
+
/^https?:\/\/buy\.stripe\.com/i,
|
|
4135
|
+
/^https?:\/\/chromewebstore\.google\.com/i,
|
|
4136
|
+
/^https?:\/\/meet\.sales-mind\.ai/i
|
|
4137
|
+
];
|
|
4138
|
+
var PROTOCOL_EXEMPT = [
|
|
4139
|
+
/^mailto:/i,
|
|
4140
|
+
/^tel:/i,
|
|
4141
|
+
/^#/,
|
|
4142
|
+
/^javascript:/i
|
|
4143
|
+
];
|
|
4144
|
+
function classifyUrl(url) {
|
|
4145
|
+
if (PROTOCOL_EXEMPT.some((p) => p.test(url))) return "protocol";
|
|
4146
|
+
if (ASSET_PATTERNS.some((p) => p.test(url))) return "asset";
|
|
4147
|
+
if (SYSTEM_PATTERNS.some((p) => p.test(url))) return "system";
|
|
4148
|
+
if (CONVERSION_PATTERNS.some((p) => p.test(url))) return "conversion";
|
|
4149
|
+
if (INTERNAL_PATTERNS.some((p) => p.test(url))) return "internal";
|
|
4150
|
+
return "external";
|
|
4151
|
+
}
|
|
4152
|
+
function requiresUtm(url) {
|
|
4153
|
+
const classification = classifyUrl(url);
|
|
4154
|
+
return classification === "external" || classification === "conversion";
|
|
4155
|
+
}
|
|
4156
|
+
function isUtmExempt(url) {
|
|
4157
|
+
const classification = classifyUrl(url);
|
|
4158
|
+
return classification === "protocol" || classification === "asset" || classification === "system" || classification === "internal";
|
|
4159
|
+
}
|
|
4053
4160
|
|
|
4054
4161
|
// src/components/OutboundLink/outbound-link-utils.ts
|
|
4055
|
-
var
|
|
4162
|
+
var LEGACY_UTM_SOURCE = "salesmind";
|
|
4056
4163
|
var EXEMPT_PATTERNS = [
|
|
4057
4164
|
/^https?:\/\/(www\.)?(stripe\.com|checkout\.stripe\.com|paypal\.com)/i,
|
|
4058
4165
|
/^https?:\/\/(www\.)?github\.com\/login\/oauth/i
|
|
4059
4166
|
];
|
|
4060
4167
|
var isExemptUrl = (urlStr) => {
|
|
4061
4168
|
if (urlStr.startsWith("mailto:") || urlStr.startsWith("tel:")) return true;
|
|
4169
|
+
const classification = classifyUrl(urlStr);
|
|
4170
|
+
if (classification === "system" || classification === "protocol" || classification === "asset") {
|
|
4171
|
+
return true;
|
|
4172
|
+
}
|
|
4062
4173
|
return EXEMPT_PATTERNS.some((pattern) => pattern.test(urlStr));
|
|
4063
4174
|
};
|
|
4175
|
+
var appendGovernedUTMs = (href, params, preserveExisting = true) => {
|
|
4176
|
+
try {
|
|
4177
|
+
const url = new URL(href);
|
|
4178
|
+
if (preserveExisting) {
|
|
4179
|
+
const hasAll = url.searchParams.has("utm_source") && url.searchParams.has("utm_medium") && url.searchParams.has("utm_campaign");
|
|
4180
|
+
if (hasAll) return href;
|
|
4181
|
+
}
|
|
4182
|
+
return buildUtmUrl(href, params);
|
|
4183
|
+
} catch {
|
|
4184
|
+
return href;
|
|
4185
|
+
}
|
|
4186
|
+
};
|
|
4064
4187
|
var appendUTMs = (href, context, pageSlug, options) => {
|
|
4065
4188
|
try {
|
|
4066
4189
|
const url = new URL(href);
|
|
4067
4190
|
const { mediumOverride = "outbound_link", campaignOverride, preserveExisting = true } = options;
|
|
4068
4191
|
const utms = {
|
|
4069
|
-
utm_source:
|
|
4192
|
+
utm_source: LEGACY_UTM_SOURCE,
|
|
4070
4193
|
utm_medium: mediumOverride,
|
|
4071
4194
|
utm_campaign: campaignOverride || pageSlug,
|
|
4072
4195
|
utm_content: context
|
|
@@ -4093,10 +4216,13 @@ var OutboundLink = React30.forwardRef(
|
|
|
4093
4216
|
preserveExistingUTM = true,
|
|
4094
4217
|
openInNewTab = true,
|
|
4095
4218
|
disableTracking = false,
|
|
4219
|
+
utmParams,
|
|
4096
4220
|
onClick,
|
|
4097
4221
|
children,
|
|
4098
4222
|
...props
|
|
4099
4223
|
}, ref) => {
|
|
4224
|
+
const contextParams = useUtmDefaults();
|
|
4225
|
+
const resolvedUtmParams = utmParams ?? contextParams;
|
|
4100
4226
|
let hostname = "";
|
|
4101
4227
|
try {
|
|
4102
4228
|
const url = new URL(href);
|
|
@@ -4121,16 +4247,20 @@ var OutboundLink = React30.forwardRef(
|
|
|
4121
4247
|
}
|
|
4122
4248
|
const isExempt = isExemptUrl(href) || disableTracking;
|
|
4123
4249
|
if (isExternal && !isExempt) {
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4250
|
+
if (resolvedUtmParams) {
|
|
4251
|
+
setFinalHref(appendGovernedUTMs(href, resolvedUtmParams, preserveExistingUTM));
|
|
4252
|
+
} else {
|
|
4253
|
+
const pageSlug = window.location.pathname.replace(/^\/|\/$/g, "") || "home";
|
|
4254
|
+
setFinalHref(appendUTMs(href, context, pageSlug, {
|
|
4255
|
+
mediumOverride: currentMedium,
|
|
4256
|
+
campaignOverride,
|
|
4257
|
+
preserveExisting: preserveExistingUTM
|
|
4258
|
+
}));
|
|
4259
|
+
}
|
|
4130
4260
|
} else {
|
|
4131
4261
|
setFinalHref(href);
|
|
4132
4262
|
}
|
|
4133
|
-
}, [href, context, mediumOverride, campaignOverride, preserveExistingUTM, disableTracking]);
|
|
4263
|
+
}, [href, context, mediumOverride, campaignOverride, preserveExistingUTM, disableTracking, resolvedUtmParams]);
|
|
4134
4264
|
const handleClick = (e) => {
|
|
4135
4265
|
if (typeof window === "undefined" || disableTracking) {
|
|
4136
4266
|
onClick?.(e);
|
|
@@ -5904,7 +6034,7 @@ var ArticleCard = React30.forwardRef(
|
|
|
5904
6034
|
onClick: handleClick,
|
|
5905
6035
|
...props,
|
|
5906
6036
|
children: [
|
|
5907
|
-
imageUrl
|
|
6037
|
+
imageUrl ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-article-card__image-wrapper", children: [
|
|
5908
6038
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5909
6039
|
"img",
|
|
5910
6040
|
{
|
|
@@ -5915,9 +6045,11 @@ var ArticleCard = React30.forwardRef(
|
|
|
5915
6045
|
}
|
|
5916
6046
|
),
|
|
5917
6047
|
category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-article-card__category-badge", children: category })
|
|
6048
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-article-card__placeholder", children: [
|
|
6049
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "ds-article-card__placeholder-icon", "aria-hidden": "true" }),
|
|
6050
|
+
category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-article-card__category-badge", children: category })
|
|
5918
6051
|
] }),
|
|
5919
6052
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-article-card__content", children: [
|
|
5920
|
-
!imageUrl && category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ds-article-card__category-text", children: category }),
|
|
5921
6053
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "ds-article-card__title", children: title }),
|
|
5922
6054
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "ds-article-card__excerpt", children: excerpt }),
|
|
5923
6055
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ds-article-card__meta", children: [
|
|
@@ -16692,6 +16824,265 @@ function JsonIcon() {
|
|
|
16692
16824
|
);
|
|
16693
16825
|
}
|
|
16694
16826
|
|
|
16827
|
+
// src/web/utm/constants.ts
|
|
16828
|
+
var UTM_SOURCES = [
|
|
16829
|
+
"linkedin",
|
|
16830
|
+
"whatsapp",
|
|
16831
|
+
"intercom",
|
|
16832
|
+
"email",
|
|
16833
|
+
"website",
|
|
16834
|
+
"app",
|
|
16835
|
+
"chromeStore",
|
|
16836
|
+
"stripe",
|
|
16837
|
+
"direct"
|
|
16838
|
+
];
|
|
16839
|
+
var UTM_MEDIUMS_MESSAGING = [
|
|
16840
|
+
"dm",
|
|
16841
|
+
"group",
|
|
16842
|
+
"email",
|
|
16843
|
+
"inAppChat",
|
|
16844
|
+
"organicPost",
|
|
16845
|
+
"paidAd",
|
|
16846
|
+
"qrCode",
|
|
16847
|
+
"redirect",
|
|
16848
|
+
"storeListing"
|
|
16849
|
+
];
|
|
16850
|
+
var UTM_MEDIUMS_APP = [
|
|
16851
|
+
"appHome",
|
|
16852
|
+
"appDashboard",
|
|
16853
|
+
"appInbox",
|
|
16854
|
+
"appContacts",
|
|
16855
|
+
"appCampaigns",
|
|
16856
|
+
"appSettings",
|
|
16857
|
+
"appBilling",
|
|
16858
|
+
"appCheckout",
|
|
16859
|
+
"appOnboarding",
|
|
16860
|
+
"appSupport",
|
|
16861
|
+
"appCalendar"
|
|
16862
|
+
];
|
|
16863
|
+
var UTM_MEDIUMS_WEB = [
|
|
16864
|
+
"webHome",
|
|
16865
|
+
"webDemo",
|
|
16866
|
+
"webPricing",
|
|
16867
|
+
"webFeatures",
|
|
16868
|
+
"webUseCase",
|
|
16869
|
+
"webSolution",
|
|
16870
|
+
"webIndustry",
|
|
16871
|
+
"webIntegrations",
|
|
16872
|
+
"webBlog",
|
|
16873
|
+
"webBlogPost",
|
|
16874
|
+
"webLanding",
|
|
16875
|
+
"webComparison",
|
|
16876
|
+
"webCaseStudy",
|
|
16877
|
+
"webAbout",
|
|
16878
|
+
"webContact",
|
|
16879
|
+
"webCareers",
|
|
16880
|
+
"webLegal",
|
|
16881
|
+
"webDocs",
|
|
16882
|
+
"webAffiliate"
|
|
16883
|
+
];
|
|
16884
|
+
var UTM_MEDIUMS_ALL = [
|
|
16885
|
+
...UTM_MEDIUMS_MESSAGING,
|
|
16886
|
+
...UTM_MEDIUMS_APP,
|
|
16887
|
+
...UTM_MEDIUMS_WEB
|
|
16888
|
+
];
|
|
16889
|
+
var UTM_CAMPAIGNS = [
|
|
16890
|
+
"discoveryCall",
|
|
16891
|
+
"demo",
|
|
16892
|
+
"trial",
|
|
16893
|
+
"onboarding",
|
|
16894
|
+
"upgrade",
|
|
16895
|
+
"renewal",
|
|
16896
|
+
"retention",
|
|
16897
|
+
"accountSupport",
|
|
16898
|
+
"supportCall",
|
|
16899
|
+
"partnerCall",
|
|
16900
|
+
"hiring",
|
|
16901
|
+
"interviewCall"
|
|
16902
|
+
];
|
|
16903
|
+
var UTM_TERMS = [
|
|
16904
|
+
"julienGadea",
|
|
16905
|
+
"bramSmith",
|
|
16906
|
+
"florentDupont",
|
|
16907
|
+
"sawLin",
|
|
16908
|
+
"evaSupport",
|
|
16909
|
+
"team",
|
|
16910
|
+
"auto"
|
|
16911
|
+
];
|
|
16912
|
+
var UTM_CONTENTS = [
|
|
16913
|
+
"ctaPrimary",
|
|
16914
|
+
"ctaSecondary",
|
|
16915
|
+
"ctaHeader",
|
|
16916
|
+
"ctaFooter",
|
|
16917
|
+
"ctaInline",
|
|
16918
|
+
"buttonPrimary",
|
|
16919
|
+
"buttonSecondary",
|
|
16920
|
+
"banner",
|
|
16921
|
+
"popup",
|
|
16922
|
+
"variantA",
|
|
16923
|
+
"variantB",
|
|
16924
|
+
"variantC"
|
|
16925
|
+
];
|
|
16926
|
+
var UTM_SOURCES_REQUIRING_SELLER = [
|
|
16927
|
+
"linkedin",
|
|
16928
|
+
"whatsapp",
|
|
16929
|
+
"intercom",
|
|
16930
|
+
"email"
|
|
16931
|
+
];
|
|
16932
|
+
|
|
16933
|
+
// src/web/utm/validators.ts
|
|
16934
|
+
function validateUtmField(field, value) {
|
|
16935
|
+
switch (field) {
|
|
16936
|
+
case "source":
|
|
16937
|
+
return UTM_SOURCES.includes(value);
|
|
16938
|
+
case "medium":
|
|
16939
|
+
return UTM_MEDIUMS_ALL.includes(value);
|
|
16940
|
+
case "campaign":
|
|
16941
|
+
return UTM_CAMPAIGNS.includes(value);
|
|
16942
|
+
case "term":
|
|
16943
|
+
return UTM_TERMS.includes(value);
|
|
16944
|
+
case "content":
|
|
16945
|
+
return UTM_CONTENTS.includes(value);
|
|
16946
|
+
default:
|
|
16947
|
+
return false;
|
|
16948
|
+
}
|
|
16949
|
+
}
|
|
16950
|
+
function isValidUtmParams(params) {
|
|
16951
|
+
if (!params.source || !params.medium || !params.campaign) {
|
|
16952
|
+
return false;
|
|
16953
|
+
}
|
|
16954
|
+
if (!validateUtmField("source", params.source)) return false;
|
|
16955
|
+
if (!validateUtmField("medium", params.medium)) return false;
|
|
16956
|
+
if (!validateUtmField("campaign", params.campaign)) return false;
|
|
16957
|
+
if (params.term !== void 0 && !validateUtmField("term", params.term)) return false;
|
|
16958
|
+
if (params.content !== void 0 && !validateUtmField("content", params.content)) return false;
|
|
16959
|
+
return true;
|
|
16960
|
+
}
|
|
16961
|
+
function validateCompliance(url, params) {
|
|
16962
|
+
const errors = [];
|
|
16963
|
+
const classification = classifyUrl(url);
|
|
16964
|
+
const needsUtm = requiresUtm(url);
|
|
16965
|
+
if (!needsUtm) {
|
|
16966
|
+
return {
|
|
16967
|
+
status: "compliant",
|
|
16968
|
+
url,
|
|
16969
|
+
params: params ?? null,
|
|
16970
|
+
errors: []
|
|
16971
|
+
};
|
|
16972
|
+
}
|
|
16973
|
+
if (!params) {
|
|
16974
|
+
return {
|
|
16975
|
+
status: "blocked",
|
|
16976
|
+
url,
|
|
16977
|
+
params: null,
|
|
16978
|
+
errors: [`URL classified as '${classification}' requires UTM parameters but none provided`]
|
|
16979
|
+
};
|
|
16980
|
+
}
|
|
16981
|
+
if (!params.source) errors.push("Missing required field: utm_source");
|
|
16982
|
+
if (!params.medium) errors.push("Missing required field: utm_medium");
|
|
16983
|
+
if (!params.campaign) errors.push("Missing required field: utm_campaign");
|
|
16984
|
+
if (params.source && !validateUtmField("source", params.source)) {
|
|
16985
|
+
errors.push(`Invalid utm_source: '${params.source}'. Must be one of: ${UTM_SOURCES.join(", ")}`);
|
|
16986
|
+
}
|
|
16987
|
+
if (params.medium && !validateUtmField("medium", params.medium)) {
|
|
16988
|
+
errors.push(`Invalid utm_medium: '${params.medium}'. Must be one of governed enum values`);
|
|
16989
|
+
}
|
|
16990
|
+
if (params.campaign && !validateUtmField("campaign", params.campaign)) {
|
|
16991
|
+
errors.push(`Invalid utm_campaign: '${params.campaign}'. Must be one of: ${UTM_CAMPAIGNS.join(", ")}`);
|
|
16992
|
+
}
|
|
16993
|
+
if (params.term !== void 0 && params.term && !validateUtmField("term", params.term)) {
|
|
16994
|
+
errors.push(`Invalid utm_term: '${params.term}'. Must be one of: ${UTM_TERMS.join(", ")}`);
|
|
16995
|
+
}
|
|
16996
|
+
if (params.content !== void 0 && params.content && !validateUtmField("content", params.content)) {
|
|
16997
|
+
errors.push(`Invalid utm_content: '${params.content}'. Must be one of: ${UTM_CONTENTS.join(", ")}`);
|
|
16998
|
+
}
|
|
16999
|
+
const allValues = [];
|
|
17000
|
+
if (params.source) allValues.push(params.source);
|
|
17001
|
+
if (params.medium) allValues.push(params.medium);
|
|
17002
|
+
if (params.campaign) allValues.push(params.campaign);
|
|
17003
|
+
if (params.term) allValues.push(params.term);
|
|
17004
|
+
if (params.content) allValues.push(params.content);
|
|
17005
|
+
for (const value of allValues) {
|
|
17006
|
+
if (/\s/.test(value)) errors.push(`Value '${value}' contains spaces`);
|
|
17007
|
+
if (/_/.test(value)) errors.push(`Value '${value}' contains underscores`);
|
|
17008
|
+
if (/-/.test(value)) errors.push(`Value '${value}' contains hyphens`);
|
|
17009
|
+
if (/[^\x20-\x7E]/.test(value)) errors.push(`Value '${value}' contains non-ASCII characters`);
|
|
17010
|
+
if (value === value.toUpperCase() && value.length > 1) errors.push(`Value '${value}' is ALL CAPS`);
|
|
17011
|
+
}
|
|
17012
|
+
const status = errors.length === 0 ? "compliant" : "blocked";
|
|
17013
|
+
return { status, url, params, errors };
|
|
17014
|
+
}
|
|
17015
|
+
function classifyAndEnforce(url, params) {
|
|
17016
|
+
return validateCompliance(url, params);
|
|
17017
|
+
}
|
|
17018
|
+
function buildBlockedError(reason, url) {
|
|
17019
|
+
return {
|
|
17020
|
+
status: "UTM_COMPLIANCE_BLOCKED",
|
|
17021
|
+
reason,
|
|
17022
|
+
requiredFix: reason,
|
|
17023
|
+
correctedExample: url ?? null
|
|
17024
|
+
};
|
|
17025
|
+
}
|
|
17026
|
+
|
|
17027
|
+
// src/web/utm/attribution.ts
|
|
17028
|
+
function parseUtmParams(search) {
|
|
17029
|
+
if (!search) return {};
|
|
17030
|
+
const params = new URLSearchParams(search);
|
|
17031
|
+
const result = {};
|
|
17032
|
+
const source = params.get("utm_source");
|
|
17033
|
+
if (source && UTM_SOURCES.includes(source)) {
|
|
17034
|
+
result.source = source;
|
|
17035
|
+
}
|
|
17036
|
+
const medium = params.get("utm_medium");
|
|
17037
|
+
if (medium) {
|
|
17038
|
+
result.medium = medium;
|
|
17039
|
+
}
|
|
17040
|
+
const campaign = params.get("utm_campaign");
|
|
17041
|
+
if (campaign && UTM_CAMPAIGNS.includes(campaign)) {
|
|
17042
|
+
result.campaign = campaign;
|
|
17043
|
+
}
|
|
17044
|
+
const term = params.get("utm_term");
|
|
17045
|
+
if (term && UTM_TERMS.includes(term)) {
|
|
17046
|
+
result.term = term;
|
|
17047
|
+
}
|
|
17048
|
+
const content = params.get("utm_content");
|
|
17049
|
+
if (content && UTM_CONTENTS.includes(content)) {
|
|
17050
|
+
result.content = content;
|
|
17051
|
+
}
|
|
17052
|
+
return result;
|
|
17053
|
+
}
|
|
17054
|
+
function toFirstTouchAttribution(params) {
|
|
17055
|
+
return {
|
|
17056
|
+
firstTouchSource: params.source,
|
|
17057
|
+
firstTouchMedium: params.medium,
|
|
17058
|
+
firstTouchCampaign: params.campaign,
|
|
17059
|
+
firstTouchSeller: params.term ?? null
|
|
17060
|
+
};
|
|
17061
|
+
}
|
|
17062
|
+
function requiresSellerAttribution(source) {
|
|
17063
|
+
return UTM_SOURCES_REQUIRING_SELLER.includes(source);
|
|
17064
|
+
}
|
|
17065
|
+
|
|
17066
|
+
// src/web/utm/audit.ts
|
|
17067
|
+
function createAuditEntry(url, params, generatorContext, confidence) {
|
|
17068
|
+
const utmParts = [];
|
|
17069
|
+
if (params) {
|
|
17070
|
+
if (params.source) utmParts.push(`utm_source=${params.source}`);
|
|
17071
|
+
if (params.medium) utmParts.push(`utm_medium=${params.medium}`);
|
|
17072
|
+
if (params.campaign) utmParts.push(`utm_campaign=${params.campaign}`);
|
|
17073
|
+
if (params.term) utmParts.push(`utm_term=${params.term}`);
|
|
17074
|
+
if (params.content) utmParts.push(`utm_content=${params.content}`);
|
|
17075
|
+
}
|
|
17076
|
+
return {
|
|
17077
|
+
url,
|
|
17078
|
+
utmString: utmParts.join("&"),
|
|
17079
|
+
generatorContext,
|
|
17080
|
+
sellerAttribution: params?.term ?? null,
|
|
17081
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17082
|
+
confidence
|
|
17083
|
+
};
|
|
17084
|
+
}
|
|
17085
|
+
|
|
16695
17086
|
Object.defineProperty(exports, "FormattedDate", {
|
|
16696
17087
|
enumerable: true,
|
|
16697
17088
|
get: function () { return reactIntl.FormattedDate; }
|
|
@@ -16999,6 +17390,15 @@ exports.TooltipProvider = TooltipProvider;
|
|
|
16999
17390
|
exports.TooltipRoot = TooltipRoot;
|
|
17000
17391
|
exports.TooltipTrigger = TooltipTrigger;
|
|
17001
17392
|
exports.TrendIndicator = TrendIndicator;
|
|
17393
|
+
exports.UTM_CAMPAIGNS = UTM_CAMPAIGNS;
|
|
17394
|
+
exports.UTM_CONTENTS = UTM_CONTENTS;
|
|
17395
|
+
exports.UTM_MEDIUMS_ALL = UTM_MEDIUMS_ALL;
|
|
17396
|
+
exports.UTM_MEDIUMS_APP = UTM_MEDIUMS_APP;
|
|
17397
|
+
exports.UTM_MEDIUMS_MESSAGING = UTM_MEDIUMS_MESSAGING;
|
|
17398
|
+
exports.UTM_MEDIUMS_WEB = UTM_MEDIUMS_WEB;
|
|
17399
|
+
exports.UTM_SOURCES = UTM_SOURCES;
|
|
17400
|
+
exports.UTM_SOURCES_REQUIRING_SELLER = UTM_SOURCES_REQUIRING_SELLER;
|
|
17401
|
+
exports.UTM_TERMS = UTM_TERMS;
|
|
17002
17402
|
exports.VARIANTS = VARIANTS;
|
|
17003
17403
|
exports.ValueAnchor = ValueAnchor;
|
|
17004
17404
|
exports.VersionedSeriesNavigator = VersionedSeriesNavigator;
|
|
@@ -17012,23 +17412,35 @@ exports.Z_INDEX = Z_INDEX;
|
|
|
17012
17412
|
exports.alertMessages = alertMessages;
|
|
17013
17413
|
exports.allMessages = allMessages;
|
|
17014
17414
|
exports.appearanceMessages = appearanceMessages;
|
|
17415
|
+
exports.appendGovernedUTMs = appendGovernedUTMs;
|
|
17015
17416
|
exports.appendUTMs = appendUTMs;
|
|
17016
17417
|
exports.authMessages = authMessages;
|
|
17418
|
+
exports.buildBlockedError = buildBlockedError;
|
|
17419
|
+
exports.buildUtmUrl = buildUtmUrl;
|
|
17017
17420
|
exports.calendarMessages = calendarMessages;
|
|
17018
17421
|
exports.carouselMessages = carouselMessages;
|
|
17422
|
+
exports.classifyAndEnforce = classifyAndEnforce;
|
|
17423
|
+
exports.classifyUrl = classifyUrl;
|
|
17019
17424
|
exports.commonMessages = commonMessages;
|
|
17425
|
+
exports.createAuditEntry = createAuditEntry;
|
|
17020
17426
|
exports.dialogMessages = dialogMessages;
|
|
17021
17427
|
exports.extractSpacingStyles = extractSpacingStyles;
|
|
17022
17428
|
exports.formMessages = formMessages;
|
|
17023
17429
|
exports.hexToRgb = hexToRgb;
|
|
17024
17430
|
exports.initializeAppearance = initializeAppearance;
|
|
17025
17431
|
exports.isExemptUrl = isExemptUrl;
|
|
17432
|
+
exports.isUtmExempt = isUtmExempt;
|
|
17433
|
+
exports.isValidUtmParams = isValidUtmParams;
|
|
17026
17434
|
exports.methodologyMessages = methodologyMessages;
|
|
17027
17435
|
exports.navigationMessages = navigationMessages;
|
|
17028
17436
|
exports.paginationMessages = paginationMessages;
|
|
17437
|
+
exports.parseUtmParams = parseUtmParams;
|
|
17029
17438
|
exports.prefersReducedMotion = prefersReducedMotion;
|
|
17030
17439
|
exports.reportMessages = reportMessages;
|
|
17440
|
+
exports.requiresSellerAttribution = requiresSellerAttribution;
|
|
17441
|
+
exports.requiresUtm = requiresUtm;
|
|
17031
17442
|
exports.resolveSpacing = resolveSpacing;
|
|
17443
|
+
exports.toFirstTouchAttribution = toFirstTouchAttribution;
|
|
17032
17444
|
exports.toastMessages = toastMessages;
|
|
17033
17445
|
exports.useAppearance = useAppearance;
|
|
17034
17446
|
exports.useDateFormat = useDateFormat;
|
|
@@ -17040,5 +17452,7 @@ exports.useNumberFormat = useNumberFormat;
|
|
|
17040
17452
|
exports.useRelativeTime = useRelativeTime;
|
|
17041
17453
|
exports.useTextDirection = useTextDirection;
|
|
17042
17454
|
exports.useToast = useToast;
|
|
17043
|
-
|
|
17455
|
+
exports.validateCompliance = validateCompliance;
|
|
17456
|
+
exports.validateUtmField = validateUtmField;
|
|
17457
|
+
//# sourceMappingURL=out.js.map
|
|
17044
17458
|
//# sourceMappingURL=index.cjs.map
|