@se-studio/brightline-shared 0.0.5 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/adapters/BrightlineAnalyticsAdapter.d.ts +4 -0
  2. package/dist/adapters/BrightlineAnalyticsAdapter.d.ts.map +1 -0
  3. package/dist/adapters/BrightlineAnalyticsAdapter.js +26 -0
  4. package/dist/adapters/BrightlineAnalyticsAdapter.js.map +1 -0
  5. package/dist/components/GTMScript.d.ts +5 -0
  6. package/dist/components/GTMScript.d.ts.map +1 -0
  7. package/dist/components/GTMScript.js +37 -0
  8. package/dist/components/GTMScript.js.map +1 -0
  9. package/dist/components/NavigationEvents.d.ts +5 -0
  10. package/dist/components/NavigationEvents.d.ts.map +1 -0
  11. package/dist/components/NavigationEvents.js +28 -0
  12. package/dist/components/NavigationEvents.js.map +1 -0
  13. package/dist/components/PrivacyFooterLinks.d.ts +2 -0
  14. package/dist/components/PrivacyFooterLinks.d.ts.map +1 -0
  15. package/dist/components/PrivacyFooterLinks.js +26 -0
  16. package/dist/components/PrivacyFooterLinks.js.map +1 -0
  17. package/dist/components/index.d.ts +6 -0
  18. package/dist/components/index.d.ts.map +1 -0
  19. package/dist/components/index.js +4 -0
  20. package/dist/components/index.js.map +1 -0
  21. package/dist/config.d.ts +11 -0
  22. package/dist/config.d.ts.map +1 -0
  23. package/dist/config.js +2 -0
  24. package/dist/config.js.map +1 -0
  25. package/dist/consent/index.d.ts +4 -0
  26. package/dist/consent/index.d.ts.map +1 -0
  27. package/dist/consent/index.js +2 -0
  28. package/dist/consent/index.js.map +1 -0
  29. package/dist/consent/oursPrivacy.d.ts +10 -0
  30. package/dist/consent/oursPrivacy.d.ts.map +1 -0
  31. package/dist/consent/oursPrivacy.js +121 -0
  32. package/dist/consent/oursPrivacy.js.map +1 -0
  33. package/dist/consent/types.d.ts +21 -0
  34. package/dist/consent/types.d.ts.map +1 -0
  35. package/dist/consent/types.js +2 -0
  36. package/dist/consent/types.js.map +1 -0
  37. package/dist/context.d.ts +8 -0
  38. package/dist/context.d.ts.map +1 -0
  39. package/dist/context.js +11 -0
  40. package/dist/context.js.map +1 -0
  41. package/dist/index.d.ts +10 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +6 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/init.d.ts +3 -0
  46. package/dist/init.d.ts.map +1 -0
  47. package/dist/init.js +5 -0
  48. package/dist/init.js.map +1 -0
  49. package/dist/tracking/analytics.d.ts +9 -0
  50. package/dist/tracking/analytics.d.ts.map +1 -0
  51. package/dist/tracking/analytics.js +36 -0
  52. package/dist/tracking/analytics.js.map +1 -0
  53. package/dist/tracking/fbcTracking.d.ts +3 -0
  54. package/dist/tracking/fbcTracking.d.ts.map +1 -0
  55. package/dist/tracking/fbcTracking.js +38 -0
  56. package/dist/tracking/fbcTracking.js.map +1 -0
  57. package/dist/tracking/gtm.d.ts +13 -0
  58. package/dist/tracking/gtm.d.ts.map +1 -0
  59. package/dist/tracking/gtm.js +53 -0
  60. package/dist/tracking/gtm.js.map +1 -0
  61. package/dist/tracking/index.d.ts +6 -0
  62. package/dist/tracking/index.d.ts.map +1 -0
  63. package/dist/tracking/index.js +4 -0
  64. package/dist/tracking/index.js.map +1 -0
  65. package/dist/tracking/landingPageHistory.d.ts +19 -0
  66. package/dist/tracking/landingPageHistory.d.ts.map +1 -0
  67. package/dist/tracking/landingPageHistory.js +123 -0
  68. package/dist/tracking/landingPageHistory.js.map +1 -0
  69. package/dist/tracking/landingPageProperties.d.ts +10 -0
  70. package/dist/tracking/landingPageProperties.d.ts.map +1 -0
  71. package/dist/tracking/landingPageProperties.js +23 -0
  72. package/dist/tracking/landingPageProperties.js.map +1 -0
  73. package/dist/tracking/oursPrivacySdk.d.ts +7 -0
  74. package/dist/tracking/oursPrivacySdk.d.ts.map +1 -0
  75. package/dist/tracking/oursPrivacySdk.js +105 -0
  76. package/dist/tracking/oursPrivacySdk.js.map +1 -0
  77. package/dist/tracking/segment.d.ts +8 -0
  78. package/dist/tracking/segment.d.ts.map +1 -0
  79. package/dist/tracking/segment.js +163 -0
  80. package/dist/tracking/segment.js.map +1 -0
  81. package/package.json +5 -4
@@ -0,0 +1,4 @@
1
+ import type { AnalyticsAdapter } from '@se-studio/core-ui';
2
+ import type { BrightlineSharedConfig } from '../config';
3
+ export declare function createBrightlineAnalyticsAdapter(config: BrightlineSharedConfig | undefined | null): AnalyticsAdapter;
4
+ //# sourceMappingURL=BrightlineAnalyticsAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrightlineAnalyticsAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/BrightlineAnalyticsAdapter.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAOxD,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,sBAAsB,GAAG,SAAS,GAAG,IAAI,GAChD,gBAAgB,CAiClB"}
@@ -0,0 +1,26 @@
1
+ import { analyticsButtonClick, analyticsPageView, analyticsTrack } from '../tracking/analytics';
2
+ export function createBrightlineAnalyticsAdapter(config) {
3
+ const cfg = config ?? undefined;
4
+ return {
5
+ trackClick(properties) {
6
+ const sectionLabel = properties.location ?? undefined;
7
+ const trackingEventName = properties.trackingInfo?.trackingEventName ??
8
+ properties.componentType ??
9
+ properties.linkText;
10
+ const conversionId = properties.trackingInfo?.conversionId ?? undefined;
11
+ const conversionLabel = properties.trackingInfo?.conversionLabel ?? undefined;
12
+ const data = {
13
+ ...properties,
14
+ targetUrl: properties.targetUrl,
15
+ };
16
+ void analyticsButtonClick(cfg, sectionLabel, trackingEventName, data, conversionId, conversionLabel);
17
+ },
18
+ trackPage(_url, properties) {
19
+ void analyticsPageView(cfg, properties.pathname);
20
+ },
21
+ trackEvent(event, properties) {
22
+ void analyticsTrack(cfg, event, properties);
23
+ },
24
+ };
25
+ }
26
+ //# sourceMappingURL=BrightlineAnalyticsAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrightlineAnalyticsAdapter.js","sourceRoot":"","sources":["../../src/adapters/BrightlineAnalyticsAdapter.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMhG,MAAM,UAAU,gCAAgC,CAC9C,MAAiD;IAEjD,MAAM,GAAG,GAAG,MAAM,IAAI,SAAS,CAAC;IAChC,OAAO;QACL,UAAU,CAAC,UAAmC;YAC5C,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,IAAI,SAAS,CAAC;YACtD,MAAM,iBAAiB,GACrB,UAAU,CAAC,YAAY,EAAE,iBAAiB;gBAC1C,UAAU,CAAC,aAAa;gBACxB,UAAU,CAAC,QAAQ,CAAC;YACtB,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,YAAY,IAAI,SAAS,CAAC;YACxE,MAAM,eAAe,GAAG,UAAU,CAAC,YAAY,EAAE,eAAe,IAAI,SAAS,CAAC;YAC9E,MAAM,IAAI,GAAG;gBACX,GAAG,UAAU;gBACb,SAAS,EAAE,UAAU,CAAC,SAAS;aAChC,CAAC;YACF,KAAK,oBAAoB,CACvB,GAAG,EACH,YAAY,EACZ,iBAAiB,EACjB,IAAI,EACJ,YAAY,EACZ,eAAe,CAChB,CAAC;QACJ,CAAC;QAED,SAAS,CAAC,IAAY,EAAE,UAAkC;YACxD,KAAK,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QAED,UAAU,CAAC,KAAa,EAAE,UAAmC;YAC3D,KAAK,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface GTMScriptProps {
2
+ containerId?: string;
3
+ }
4
+ export declare function GTMScript({ containerId }: GTMScriptProps): React.ReactNode;
5
+ //# sourceMappingURL=GTMScript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GTMScript.d.ts","sourceRoot":"","sources":["../../src/components/GTMScript.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAQD,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,EAAE,cAAc,GAAG,KAAK,CAAC,SAAS,CA6C1E"}
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import Script from 'next/script';
4
+ import { useEffect, useState } from 'react';
5
+ import { isCategoryAccepted, onConsentReady } from '../consent';
6
+ export function GTMScript({ containerId }) {
7
+ const [consentGranted, setConsentGranted] = useState(() => isCategoryAccepted('analytics') || isCategoryAccepted('advertising'));
8
+ useEffect(() => {
9
+ const updateDataLayer = (state) => {
10
+ if (typeof window !== 'undefined') {
11
+ window.dataLayer = window.dataLayer || [];
12
+ window.dataLayer.push({
13
+ event: 'consent_update',
14
+ consent_granted: state,
15
+ });
16
+ }
17
+ };
18
+ updateDataLayer(consentGranted);
19
+ const unsubscribe = onConsentReady((categories) => {
20
+ const isAllowed = categories.includes('analytics') || categories.includes('advertising');
21
+ setConsentGranted(isAllowed);
22
+ updateDataLayer(isAllowed);
23
+ });
24
+ return unsubscribe;
25
+ }, [consentGranted]);
26
+ if (!consentGranted || !containerId) {
27
+ return null;
28
+ }
29
+ return (_jsx(Script, { id: "gtm-script", strategy: "afterInteractive", dangerouslySetInnerHTML: {
30
+ __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
31
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
32
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
33
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
34
+ })(window,document,'script','dataLayer','${containerId}');`,
35
+ } }));
36
+ }
37
+ //# sourceMappingURL=GTMScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GTMScript.js","sourceRoot":"","sources":["../../src/components/GTMScript.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAYhE,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,EAAkB;IACvD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAClD,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,kBAAkB,CAAC,aAAa,CAAC,CAC3E,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,CAAC,KAAc,EAAE,EAAE;YACzC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;gBAClC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;gBAC1C,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;oBACpB,KAAK,EAAE,gBAAgB;oBACvB,eAAe,EAAE,KAAK;iBACvB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC;QAEF,eAAe,CAAC,cAAc,CAAC,CAAC;QAEhC,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,UAAU,EAAE,EAAE;YAChD,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YACzF,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC7B,eAAe,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,IAAI,CAAC,cAAc,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,KAAC,MAAM,IACL,EAAE,EAAC,YAAY,EACf,QAAQ,EAAC,kBAAkB,EAE3B,uBAAuB,EAAE;YACvB,MAAM,EAAE;;;;2CAI2B,WAAW,KAAK;SACpD,GACD,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface NavigationEventsProps {
2
+ lang: string;
3
+ }
4
+ export declare function NavigationEvents({ lang }: NavigationEventsProps): null;
5
+ //# sourceMappingURL=NavigationEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationEvents.d.ts","sourceRoot":"","sources":["../../src/components/NavigationEvents.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;CACd;AAOD,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,qBAAqB,GAAG,IAAI,CAwBtE"}
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+ import { usePathname } from 'next/navigation';
3
+ import { useEffect, useState } from 'react';
4
+ import { isCategoryAccepted, onConsentReady } from '../consent';
5
+ import { useBrightlineConfig } from '../context';
6
+ import { analyticsPageView } from '../tracking/analytics';
7
+ import { recordLandingPageIfRequired } from '../tracking/landingPageHistory';
8
+ export function NavigationEvents({ lang }) {
9
+ const config = useBrightlineConfig();
10
+ const pathname = usePathname();
11
+ const [consentGranted, setConsentGranted] = useState(() => isCategoryAccepted('analytics'));
12
+ useEffect(() => {
13
+ void recordLandingPageIfRequired(lang);
14
+ }, [lang]);
15
+ useEffect(() => {
16
+ const unsubscribe = onConsentReady((categories) => {
17
+ setConsentGranted(categories.includes('analytics'));
18
+ });
19
+ return unsubscribe;
20
+ }, []);
21
+ useEffect(() => {
22
+ if (pathname && consentGranted) {
23
+ void analyticsPageView(config, pathname);
24
+ }
25
+ }, [config, pathname, consentGranted]);
26
+ return null;
27
+ }
28
+ //# sourceMappingURL=NavigationEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationEvents.js","sourceRoot":"","sources":["../../src/components/NavigationEvents.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAW7E,MAAM,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAyB;IAC9D,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE5F,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,2BAA2B,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,UAAU,EAAE,EAAE;YAChD,iBAAiB,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,IAAI,cAAc,EAAE,CAAC;YAC/B,KAAK,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function PrivacyFooterLinks(): React.ReactNode;
2
+ //# sourceMappingURL=PrivacyFooterLinks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivacyFooterLinks.d.ts","sourceRoot":"","sources":["../../src/components/PrivacyFooterLinks.tsx"],"names":[],"mappings":"AAaA,wBAAgB,kBAAkB,IAAI,KAAK,CAAC,SAAS,CA6CpD"}
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from 'react';
4
+ import { isOursCMPLoaded, onConsentReady } from '../consent';
5
+ export function PrivacyFooterLinks() {
6
+ const [isConsentLoaded, setIsConsentLoaded] = useState(false);
7
+ const [isAdvertisingAccepted, setIsAdvertisingAccepted] = useState(false);
8
+ useEffect(() => {
9
+ const unsubscribe = onConsentReady((categories) => {
10
+ setIsConsentLoaded(isOursCMPLoaded());
11
+ setIsAdvertisingAccepted(categories.includes('advertising'));
12
+ });
13
+ return unsubscribe;
14
+ }, []);
15
+ const handleEditCookieSettings = () => {
16
+ window.ours_consent?.show();
17
+ };
18
+ const handleDoNotSell = () => {
19
+ window.ours_consent?.rejectCategory('advertising');
20
+ };
21
+ if (!isConsentLoaded) {
22
+ return null;
23
+ }
24
+ return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: handleEditCookieSettings, className: "cursor-pointer underline-offset-2 hover:underline", children: "Edit Cookie and Privacy Settings" }), isAdvertisingAccepted && (_jsx("button", { type: "button", onClick: handleDoNotSell, className: "cursor-pointer underline-offset-2 hover:underline", children: "Do Not Sell or Share My Personal Information" }))] }));
25
+ }
26
+ //# sourceMappingURL=PrivacyFooterLinks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivacyFooterLinks.js","sourceRoot":"","sources":["../../src/components/PrivacyFooterLinks.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAU7D,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,UAAU,EAAE,EAAE;YAChD,kBAAkB,CAAC,eAAe,EAAE,CAAC,CAAC;YACtC,wBAAwB,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,wBAAwB,GAAG,GAAG,EAAE;QACpC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC;IAC9B,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC,CAAC;IAEF,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BACE,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAC,mDAAmD,iDAGtD,EACR,qBAAqB,IAAI,CACxB,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,mDAAmD,6DAGtD,CACV,IACA,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type { GTMScriptProps } from './GTMScript';
2
+ export { GTMScript } from './GTMScript';
3
+ export type { NavigationEventsProps } from './NavigationEvents';
4
+ export { NavigationEvents } from './NavigationEvents';
5
+ export { PrivacyFooterLinks } from './PrivacyFooterLinks';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { GTMScript } from './GTMScript';
2
+ export { NavigationEvents } from './NavigationEvents';
3
+ export { PrivacyFooterLinks } from './PrivacyFooterLinks';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface BrightlineSharedConfig {
2
+ site: 'brightline' | 'kids';
3
+ segmentWriteKey: string;
4
+ oursPrivacyKey: string;
5
+ oursPrivacyDomains: {
6
+ custom_domain: string;
7
+ custom_domain_ipv4: string;
8
+ };
9
+ signUpUrl: string;
10
+ }
11
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/dist/config.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type { ConsentChangeListener } from './oursPrivacy';
2
+ export { getAcceptedCategories, isAdvertisingAllowed, isCategoryAccepted, isOursCMPLoaded, isTrackingAllowed, onConsentReady, waitForOursCMP, } from './oursPrivacy';
3
+ export type { ConsentCategory, OursConsentChangeCallback, OursConsentObject } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consent/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getAcceptedCategories, isAdvertisingAllowed, isCategoryAccepted, isOursCMPLoaded, isTrackingAllowed, onConsentReady, waitForOursCMP, } from './oursPrivacy';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consent/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ConsentCategory } from './types';
2
+ export type ConsentChangeListener = (categories: ConsentCategory[]) => void;
3
+ export declare function isOursCMPLoaded(): boolean;
4
+ export declare function waitForOursCMP(): Promise<void>;
5
+ export declare function getAcceptedCategories(): ConsentCategory[];
6
+ export declare function isCategoryAccepted(category: ConsentCategory): boolean;
7
+ export declare function isTrackingAllowed(): boolean;
8
+ export declare function isAdvertisingAllowed(): boolean;
9
+ export declare function onConsentReady(listener: ConsentChangeListener): () => void;
10
+ //# sourceMappingURL=oursPrivacy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oursPrivacy.d.ts","sourceRoot":"","sources":["../../src/consent/oursPrivacy.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;AAQ5E,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAMD,wBAAgB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA4B9C;AA+BD,wBAAgB,qBAAqB,IAAI,eAAe,EAAE,CAKzD;AAKD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAErE;AAKD,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAKD,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAwCD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,IAAI,CAwB1E"}
@@ -0,0 +1,121 @@
1
+ const listeners = new Set();
2
+ let cmpListenerAttached = false;
3
+ export function isOursCMPLoaded() {
4
+ return typeof window !== 'undefined' && !!window.ours_consent;
5
+ }
6
+ export function waitForOursCMP() {
7
+ return new Promise((resolve) => {
8
+ if (typeof window === 'undefined') {
9
+ resolve();
10
+ return;
11
+ }
12
+ if (isOursCMPLoaded()) {
13
+ resolve();
14
+ return;
15
+ }
16
+ let attempts = 0;
17
+ const maxAttempts = 50;
18
+ const checkInterval = setInterval(() => {
19
+ attempts++;
20
+ if (isOursCMPLoaded()) {
21
+ clearInterval(checkInterval);
22
+ resolve();
23
+ }
24
+ else if (attempts >= maxAttempts) {
25
+ clearInterval(checkInterval);
26
+ console.warn('Ours Privacy CMP did not load within 5 seconds');
27
+ resolve();
28
+ }
29
+ }, 100);
30
+ });
31
+ }
32
+ function getOursCMPCategories() {
33
+ if (!isOursCMPLoaded() || !window.ours_consent) {
34
+ return ['necessary'];
35
+ }
36
+ try {
37
+ const acceptedCategories = window.ours_consent.getAcceptedCategories();
38
+ const categories = ['necessary'];
39
+ if (acceptedCategories.includes('analytics')) {
40
+ categories.push('analytics');
41
+ }
42
+ if (acceptedCategories.includes('advertising')) {
43
+ categories.push('advertising');
44
+ }
45
+ if (acceptedCategories.includes('3rd_party_source')) {
46
+ categories.push('3rd_party_source');
47
+ }
48
+ return categories;
49
+ }
50
+ catch (error) {
51
+ console.error('Failed to get consent categories from Ours CMP:', error);
52
+ return ['necessary'];
53
+ }
54
+ }
55
+ export function getAcceptedCategories() {
56
+ if (typeof window === 'undefined') {
57
+ return ['necessary'];
58
+ }
59
+ return getOursCMPCategories();
60
+ }
61
+ export function isCategoryAccepted(category) {
62
+ return getAcceptedCategories().includes(category);
63
+ }
64
+ export function isTrackingAllowed() {
65
+ return isCategoryAccepted('analytics');
66
+ }
67
+ export function isAdvertisingAllowed() {
68
+ return isCategoryAccepted('advertising');
69
+ }
70
+ function notifyListeners(categories) {
71
+ for (const listener of listeners) {
72
+ try {
73
+ listener(categories);
74
+ }
75
+ catch {
76
+ }
77
+ }
78
+ }
79
+ function setupOursCMPListener() {
80
+ if (!isOursCMPLoaded() || cmpListenerAttached || !window.ours_consent) {
81
+ return;
82
+ }
83
+ cmpListenerAttached = true;
84
+ try {
85
+ const cmp = window.ours_consent;
86
+ const handleConsent = () => {
87
+ const categories = getOursCMPCategories();
88
+ notifyListeners(categories);
89
+ };
90
+ cmp.on('firstConsent', handleConsent);
91
+ cmp.on('consent', handleConsent);
92
+ }
93
+ catch (error) {
94
+ console.error('Failed to set up Ours CMP consent listener:', error);
95
+ }
96
+ }
97
+ export function onConsentReady(listener) {
98
+ listeners.add(listener);
99
+ if (isOursCMPLoaded()) {
100
+ setupOursCMPListener();
101
+ try {
102
+ listener(getAcceptedCategories());
103
+ }
104
+ catch {
105
+ }
106
+ }
107
+ else {
108
+ waitForOursCMP().then(() => {
109
+ setupOursCMPListener();
110
+ try {
111
+ listener(getAcceptedCategories());
112
+ }
113
+ catch {
114
+ }
115
+ });
116
+ }
117
+ return () => {
118
+ listeners.delete(listener);
119
+ };
120
+ }
121
+ //# sourceMappingURL=oursPrivacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oursPrivacy.js","sourceRoot":"","sources":["../../src/consent/oursPrivacy.ts"],"names":[],"mappings":"AAaA,MAAM,SAAS,GAA+B,IAAI,GAAG,EAAE,CAAC;AACxD,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAKhC,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;AAChE,CAAC;AAMD,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QAED,IAAI,eAAe,EAAE,EAAE,CAAC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QACtC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAQD,MAAM,UAAU,cAAc,CAAC,QAA+B;IAC5D,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAExB,IAAI,eAAe,EAAE,EAAE,CAAC;QACtB,oBAAoB,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACH,CAAC;SAAM,CAAC;QACN,cAAc,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACzB,oBAAoB,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAC;YACpC,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,EAAE;QACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type ConsentCategory = 'necessary' | 'analytics' | 'advertising' | '3rd_party_source';
2
+ export interface OursConsentObject {
3
+ type: 'all' | 'custom' | 'necessary';
4
+ acceptedCategories: string[];
5
+ rejectedCategories: string[];
6
+ }
7
+ export type OursConsentChangeCallback = (consent: OursConsentObject) => void;
8
+ declare global {
9
+ interface Window {
10
+ ours_consent?: {
11
+ getConsent(): OursConsentObject;
12
+ getAcceptedCategories(): string[];
13
+ acceptCategory(category: string): void;
14
+ rejectCategory(category: string): void;
15
+ show(): void;
16
+ hide(): void;
17
+ on(event: 'change' | 'firstConsent' | 'consent', callback: OursConsentChangeCallback): void;
18
+ };
19
+ }
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/consent/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,kBAAkB,CAAC;AAE7F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAC;IACrC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAE7E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE;YACb,UAAU,IAAI,iBAAiB,CAAC;YAChC,qBAAqB,IAAI,MAAM,EAAE,CAAC;YAClC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;YACvC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;YACvC,IAAI,IAAI,IAAI,CAAC;YACb,IAAI,IAAI,IAAI,CAAC;YACb,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS,EAAE,QAAQ,EAAE,yBAAyB,GAAG,IAAI,CAAC;SAC7F,CAAC;KACH;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/consent/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { BrightlineSharedConfig } from './config';
2
+ export interface BrightlineConfigProviderProps {
3
+ config: BrightlineSharedConfig | undefined | null;
4
+ children: React.ReactNode;
5
+ }
6
+ export declare function BrightlineConfigProvider({ config, children }: BrightlineConfigProviderProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function useBrightlineConfig(): BrightlineSharedConfig | undefined;
8
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIvD,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,sBAAsB,GAAG,SAAS,GAAG,IAAI,CAAC;IAClD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,6BAA6B,2CAM3F;AAED,wBAAgB,mBAAmB,IAAI,sBAAsB,GAAG,SAAS,CAExE"}
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext } from 'react';
4
+ const BrightlineConfigContext = createContext(undefined);
5
+ export function BrightlineConfigProvider({ config, children }) {
6
+ return (_jsx(BrightlineConfigContext.Provider, { value: config ?? undefined, children: children }));
7
+ }
8
+ export function useBrightlineConfig() {
9
+ return useContext(BrightlineConfigContext);
10
+ }
11
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,uBAAuB,GAAG,aAAa,CAAqC,SAAS,CAAC,CAAC;AAO7F,MAAM,UAAU,wBAAwB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAiC;IAC1F,OAAO,CACL,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,IAAI,SAAS,YACzD,QAAQ,GACwB,CACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,11 @@
1
- export declare const SHARED_PKG_NAME = "@se-studio/brightline-shared";
1
+ export { createBrightlineAnalyticsAdapter } from './adapters/BrightlineAnalyticsAdapter';
2
+ export type { GTMScriptProps, NavigationEventsProps, } from './components';
3
+ export { GTMScript, NavigationEvents, PrivacyFooterLinks } from './components';
4
+ export type { BrightlineSharedConfig } from './config';
5
+ export type { ConsentCategory, ConsentChangeListener, OursConsentChangeCallback, OursConsentObject, } from './consent';
6
+ export { getAcceptedCategories, isAdvertisingAllowed, isCategoryAccepted, isOursCMPLoaded, isTrackingAllowed, onConsentReady, waitForOursCMP, } from './consent';
7
+ export { BrightlineConfigProvider, useBrightlineConfig } from './context';
8
+ export { initializeBrightlineTracking } from './init';
9
+ export type { LandingPageInformation, LandingPageProperties, } from './tracking';
10
+ export { analyticsButtonClick, analyticsFormSubmit, analyticsPageView, analyticsTrack, analyticsTrackingEventName, buildLandingPageProperties, cleanupFirstLp, clearFbcCache, getFbcValue, recordLandingPageIfRequired, tryGetLandingPageInformation, useAugmentedHref, useLandingPageInformationToBuildSignupUrl, } from './tracking';
2
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,YAAY,EACV,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/E,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AACtD,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,WAAW,EACX,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,yCAAyC,GAC1C,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,7 @@
1
- export const SHARED_PKG_NAME = '@se-studio/brightline-shared';
1
+ export { createBrightlineAnalyticsAdapter } from './adapters/BrightlineAnalyticsAdapter';
2
+ export { GTMScript, NavigationEvents, PrivacyFooterLinks } from './components';
3
+ export { getAcceptedCategories, isAdvertisingAllowed, isCategoryAccepted, isOursCMPLoaded, isTrackingAllowed, onConsentReady, waitForOursCMP, } from './consent';
4
+ export { BrightlineConfigProvider, useBrightlineConfig } from './context';
5
+ export { initializeBrightlineTracking } from './init';
6
+ export { analyticsButtonClick, analyticsFormSubmit, analyticsPageView, analyticsTrack, analyticsTrackingEventName, buildLandingPageProperties, cleanupFirstLp, clearFbcCache, getFbcValue, recordLandingPageIfRequired, tryGetLandingPageInformation, useAugmentedHref, useLandingPageInformationToBuildSignupUrl, } from './tracking';
2
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,eAAe,GAAG,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAMzF,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAQ/E,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC;AAMtD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,WAAW,EACX,2BAA2B,EAC3B,4BAA4B,EAC5B,gBAAgB,EAChB,yCAAyC,GAC1C,MAAM,YAAY,CAAC"}
package/dist/init.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { BrightlineSharedConfig } from './config';
2
+ export declare function initializeBrightlineTracking(config: BrightlineSharedConfig): Promise<void>;
3
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAOvD,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhG"}
package/dist/init.js ADDED
@@ -0,0 +1,5 @@
1
+ import { initializeOursPrivacy } from './tracking/oursPrivacySdk';
2
+ export async function initializeBrightlineTracking(config) {
3
+ await initializeOursPrivacy(config);
4
+ }
5
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAMlE,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,MAA8B;IAC/E,MAAM,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { EventProperties } from '@segment/analytics-next';
2
+ import type { BrightlineSharedConfig } from '../config';
3
+ export { buildLandingPageProperties } from './landingPageProperties';
4
+ export declare function analyticsPageView(config: BrightlineSharedConfig | undefined, path: string): Promise<void>;
5
+ export declare function analyticsFormSubmit<T extends EventProperties>(config: BrightlineSharedConfig | undefined, formName: string, sectionLabel: string | null | undefined, optIn: boolean | null, trackingEventName: string | null | undefined, data: T, partial?: boolean, conversionId?: string | null, conversionLabel?: string | null): Promise<void>;
6
+ export declare function analyticsButtonClick<T extends EventProperties>(config: BrightlineSharedConfig | undefined, sectionLabel: string | null | undefined, trackingEventName: string | null | undefined, data?: T, conversionId?: string | null, conversionLabel?: string | null): Promise<void>;
7
+ export declare function analyticsTrackingEventName<T extends EventProperties>(config: BrightlineSharedConfig | undefined, sectionLabel: string | null | undefined, trackingEventName: string | null | undefined, data?: T): Promise<void>;
8
+ export declare function analyticsTrack<T extends EventProperties>(config: BrightlineSharedConfig | undefined, eventName: string, data: T): Promise<void>;
9
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/tracking/analytics.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAcxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAMrE,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,sBAAsB,GAAG,SAAS,EAC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,CAKf"}
@@ -0,0 +1,36 @@
1
+ import { reportButtonClickToOurPrivacy, reportFormSubmitToOurPrivacy, trackWithOurPrivacy, } from './oursPrivacySdk';
2
+ import { reportButtonClick, reportFormSubmit, reportTrackingEventName, SegmentPageView, trackWithSegment, } from './segment';
3
+ export { buildLandingPageProperties } from './landingPageProperties';
4
+ export async function analyticsPageView(config, path) {
5
+ await SegmentPageView(config, path);
6
+ }
7
+ export async function analyticsFormSubmit(config, formName, sectionLabel, optIn, trackingEventName, data, partial, conversionId, conversionLabel) {
8
+ await Promise.all([
9
+ reportFormSubmit(config, formName, sectionLabel, optIn, trackingEventName, data, partial, conversionId, conversionLabel),
10
+ reportFormSubmitToOurPrivacy(formName, sectionLabel, optIn, trackingEventName, data, partial, conversionId, conversionLabel),
11
+ ]);
12
+ }
13
+ export async function analyticsButtonClick(config, sectionLabel, trackingEventName, data, conversionId, conversionLabel) {
14
+ await Promise.all([
15
+ reportButtonClick(config, sectionLabel, trackingEventName, data, conversionId, conversionLabel),
16
+ reportButtonClickToOurPrivacy(sectionLabel, trackingEventName, data, conversionId, conversionLabel),
17
+ ]);
18
+ }
19
+ export async function analyticsTrackingEventName(config, sectionLabel, trackingEventName, data) {
20
+ await Promise.all([
21
+ reportTrackingEventName(config, sectionLabel, trackingEventName, data),
22
+ trackingEventName
23
+ ? trackWithOurPrivacy(trackingEventName, {
24
+ ...(data || {}),
25
+ sectionLabel: sectionLabel ?? undefined,
26
+ })
27
+ : Promise.resolve(),
28
+ ]);
29
+ }
30
+ export async function analyticsTrack(config, eventName, data) {
31
+ await Promise.all([
32
+ trackWithSegment(config, eventName, data),
33
+ trackWithOurPrivacy(eventName, data),
34
+ ]);
35
+ }
36
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tracking/analytics.ts"],"names":[],"mappings":"AASA,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,mBAAmB,GACpB,M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5C,IAAQ;IAER,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,uBAAuB,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,IAAI,CAAC;QACtE,iBAAiB;YACf,CAAC,CAAC,mBAAmB,CAAC,iBAAiB,EAAE;gBACrC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;gBACf,YAAY,EAAE,YAAY,IAAI,SAAS;aACrB,CAAC;YACvB,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE;KACtB,CAAC,CAAC;AACL,CAAC;AAMD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA0C,EAC1C,SAAiB,EACjB,IAAO;IAEP,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC;QACzC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC;KACrC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function getFbcValue(): string | null;
2
+ export declare function clearFbcCache(): void;
3
+ //# sourceMappingURL=fbcTracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fbcTracking.d.ts","sourceRoot":"","sources":["../../src/tracking/fbcTracking.ts"],"names":[],"mappings":"AAkBA,wBAAgB,WAAW,IAAI,MAAM,GAAG,IAAI,CA+B3C;AAMD,wBAAgB,aAAa,IAAI,IAAI,CAUpC"}