@braze/web-sdk 5.9.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +209 -283
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +27 -29
- package/shared-lib/guid.js +3 -3
- package/shared-lib/indexed-db-adapter.js +22 -22
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +22 -23
- package/src/Banner/banner-factory.js +2 -1
- package/src/Banner/banner-provider-factory.js +7 -7
- package/src/Banner/banner-provider.js +92 -98
- package/src/Banner/banner.js +21 -18
- package/src/Banner/display/banner-to-html.js +18 -30
- package/src/Banner/display/detect-banner-impressions.js +11 -11
- package/src/Banner/get-all-banners.js +5 -5
- package/src/Banner/get-banner.js +7 -7
- package/src/Banner/index.js +0 -1
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-impressions.js +9 -9
- package/src/Banner/request-banners-refresh.js +23 -27
- package/src/Banner/subscribe-to-banners-updates.js +9 -9
- package/src/Banner/ui/insert-banner.js +10 -10
- package/src/Card/card-manager-factory.js +7 -7
- package/src/Card/card-manager.js +45 -47
- package/src/Card/display/card-display.js +76 -74
- package/src/Card/index.js +0 -2
- package/src/Card/log-card-dismissal.js +4 -4
- package/src/Card/log-content-card-click.js +9 -2
- package/src/Card/log-content-card-impressions.js +11 -2
- package/src/Card/models/captioned-image.js +21 -21
- package/src/Card/models/card.js +116 -110
- package/src/Card/models/classic-card.js +21 -21
- package/src/Card/models/control-card.js +15 -15
- package/src/Card/models/image-only.js +20 -21
- package/src/Card/util/card-factory.js +58 -79
- package/src/ContentCards/content-cards-provider-factory.js +13 -13
- package/src/ContentCards/content-cards-provider.js +148 -148
- package/src/ContentCards/content-cards.js +21 -13
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +8 -8
- package/src/ContentCards/ui/hide-content-cards.js +5 -5
- package/src/ContentCards/ui/show-content-cards.js +35 -35
- package/src/Core/add-sdk-metadata.js +5 -5
- package/src/Core/change-user.js +7 -7
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +10 -10
- package/src/Core/enable-sdk.js +7 -7
- package/src/Core/get-device-id.js +4 -4
- package/src/Core/get-user.js +1 -1
- package/src/Core/handle-braze-action.js +10 -10
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/is-initialized.js +1 -1
- package/src/Core/log-custom-event.js +18 -18
- package/src/Core/log-purchase.js +19 -19
- package/src/Core/open-session.js +13 -13
- package/src/Core/request-immediate-data-flush.js +1 -1
- package/src/Core/set-logger.js +2 -2
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +9 -9
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +20 -71
- package/src/FeatureFlags/feature-flags-provider-factory.js +7 -7
- package/src/FeatureFlags/feature-flags-provider.js +86 -86
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +3 -3
- package/src/FeatureFlags/log-feature-flag-impression.js +8 -8
- package/src/FeatureFlags/refresh-feature-flags.js +1 -1
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +41 -41
- package/src/InAppMessage/display/in-app-message-to-html.js +145 -139
- package/src/InAppMessage/display/modal-utils.js +40 -42
- package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-factory.js +24 -16
- package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
- package/src/InAppMessage/in-app-message-manager.js +124 -122
- package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
- package/src/InAppMessage/log-in-app-message-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-html-click.js +11 -11
- package/src/InAppMessage/log-in-app-message-impression.js +4 -4
- package/src/InAppMessage/models/control-message.js +5 -5
- package/src/InAppMessage/models/full-screen-message.js +41 -35
- package/src/InAppMessage/models/html-message.js +28 -26
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +156 -152
- package/src/InAppMessage/models/modal-message.js +40 -34
- package/src/InAppMessage/models/slide-up-message.js +38 -32
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +68 -74
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +17 -17
- package/src/Push/push-manager.js +127 -127
- package/src/Push/request-push-permission.js +1 -1
- package/src/Push/utils/push-utils.js +25 -15
- package/src/User/user-manager.js +20 -20
- package/src/User/user.js +60 -61
- package/src/common/base-provider.js +1 -1
- package/src/common/content-cards-display.js +211 -0
- package/src/common/event-logger.js +12 -12
- package/src/common/properties-base.js +56 -0
- package/src/index.js +0 -1
- package/src/l10n/l10n-manager-factory.js +10 -10
- package/src/l10n/l10n-manager.js +7 -7
- package/src/managers/auth-manager.js +36 -36
- package/src/managers/braze-instance.js +184 -185
- package/src/managers/device-manager.js +26 -26
- package/src/managers/network-manager.js +194 -193
- package/src/managers/server-config-manager.js +75 -75
- package/src/managers/session-manager.js +29 -29
- package/src/managers/storage-manager-factory.js +13 -13
- package/src/managers/storage-manager.js +162 -164
- package/src/managers/subscription-manager.js +12 -12
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +16 -16
- package/src/models/device.js +3 -3
- package/src/models/identifier.js +8 -8
- package/src/models/push-token.js +10 -10
- package/src/models/request-result.js +4 -4
- package/src/models/server-config.js +33 -33
- package/src/request-controller.js +193 -192
- package/src/triggers/models/custom-event-data.js +7 -7
- package/src/triggers/models/custom-event-property-data.js +8 -8
- package/src/triggers/models/filter-set.js +8 -8
- package/src/triggers/models/filter.js +43 -43
- package/src/triggers/models/in-app-message-click-data.js +4 -4
- package/src/triggers/models/purchase-data.js +2 -2
- package/src/triggers/models/purchase-property-data.js +6 -6
- package/src/triggers/models/push-click-data.js +2 -2
- package/src/triggers/models/trigger-condition.js +52 -52
- package/src/triggers/models/trigger-events.js +4 -4
- package/src/triggers/models/trigger.js +19 -19
- package/src/triggers/triggers-provider-factory.js +14 -14
- package/src/triggers/triggers-provider.js +70 -70
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/banner-css.js +1 -1
- package/src/ui/js/iam-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +4 -4
- package/src/util/braze-actions.js +12 -18
- package/src/util/browser-detector.js +27 -20
- package/src/util/client-hints-parser.js +8 -8
- package/src/util/code-utils.js +2 -2
- package/src/util/component-utils.js +14 -14
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/device-constants.js +5 -5
- package/src/util/dom-utils.js +9 -9
- package/src/util/html-display-utils.js +38 -38
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +12 -12
- package/src/util/request-header-utils.js +22 -22
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +17 -17
- package/src/util/validation-utils.js +28 -28
- package/src/util/window-utils.js +2 -2
- package/src/Card/log-card-click.js +0 -11
- package/src/Card/log-card-impressions.js +0 -13
- package/src/Feed/feed-provider-factory.js +0 -18
- package/src/Feed/feed-provider.js +0 -90
- package/src/Feed/feed.js +0 -20
- package/src/Feed/get-cached-feed.js +0 -5
- package/src/Feed/index.js +0 -8
- package/src/Feed/log-feed-displayed.js +0 -7
- package/src/Feed/request-feed-refresh.js +0 -5
- package/src/Feed/subscribe-to-feed-updates.js +0 -5
- package/src/Feed/types.js +0 -1
- package/src/Feed/ui/hide-feed.js +0 -7
- package/src/Feed/ui/show-feed.js +0 -96
- package/src/Feed/ui/toggle-feed.js +0 -8
- package/src/common/base-feed.js +0 -29
- package/src/common/feed-display.js +0 -211
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
2
|
import u from "./subscription-manager.js";
|
|
3
|
-
import { logger as
|
|
4
|
-
export default class
|
|
3
|
+
import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
|
|
4
|
+
export default class Bt {
|
|
5
5
|
constructor(t, i, s) {
|
|
6
|
-
(this.
|
|
7
|
-
(this.
|
|
8
|
-
(this.
|
|
9
|
-
(this.
|
|
10
|
-
(this.
|
|
11
|
-
(this.
|
|
12
|
-
(this.
|
|
13
|
-
(this.
|
|
14
|
-
(this.
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return this.
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return this.
|
|
6
|
+
(this.j = t),
|
|
7
|
+
(this.Zn = i),
|
|
8
|
+
(this.gh = s),
|
|
9
|
+
(this.j = t),
|
|
10
|
+
(this.Zn = i || !1),
|
|
11
|
+
(this.gh = s),
|
|
12
|
+
(this.ph = new u()),
|
|
13
|
+
(this.Fh = 0),
|
|
14
|
+
(this.kh = 1);
|
|
15
|
+
}
|
|
16
|
+
fh() {
|
|
17
|
+
return this.Zn;
|
|
18
|
+
}
|
|
19
|
+
wh() {
|
|
20
|
+
return this.j.lt(s.ct.jh);
|
|
21
21
|
}
|
|
22
22
|
setSdkAuthenticationSignature(t) {
|
|
23
|
-
const i = this.
|
|
24
|
-
this.
|
|
25
|
-
const e =
|
|
26
|
-
new
|
|
23
|
+
const i = this.wh();
|
|
24
|
+
this.j.ft(s.ct.jh, t);
|
|
25
|
+
const e = et.Us.Rs;
|
|
26
|
+
new et(e, E).setItem(e.Fs.xh, this.kh, t), i !== t && this.Z();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
const t =
|
|
31
|
-
new
|
|
28
|
+
qh() {
|
|
29
|
+
this.j.Nt(s.ct.jh);
|
|
30
|
+
const t = et.Us.Rs;
|
|
31
|
+
new et(t, E).be(t.Fs.xh, this.kh);
|
|
32
32
|
}
|
|
33
33
|
subscribeToSdkAuthenticationFailures(t) {
|
|
34
|
-
return this.
|
|
34
|
+
return this.gh.wt(t);
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
this.
|
|
36
|
+
yh(t) {
|
|
37
|
+
this.gh.L(t);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
this.
|
|
39
|
+
Bh() {
|
|
40
|
+
this.ph.removeAllSubscriptions();
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
this.
|
|
42
|
+
Gh() {
|
|
43
|
+
this.Fh += 1;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
return this.
|
|
45
|
+
Hh() {
|
|
46
|
+
return this.Fh;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
this.
|
|
48
|
+
Z() {
|
|
49
|
+
this.Fh = 0;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,142 +1,141 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Bt from "./auth-manager.js";
|
|
2
2
|
import t from "../common/base-provider.js";
|
|
3
3
|
import ro from "../util/browser-detector.js";
|
|
4
4
|
import Ot from "./device-manager.js";
|
|
5
5
|
import DeviceProperties from "../Core/device-properties.js";
|
|
6
6
|
import {
|
|
7
|
-
isArray as
|
|
7
|
+
isArray as D,
|
|
8
8
|
keys as C,
|
|
9
9
|
validateValueIsFromEnum as ta,
|
|
10
|
-
values as
|
|
10
|
+
values as Pt,
|
|
11
11
|
} from "../util/code-utils.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
12
|
+
import Mt from "./network-manager.js";
|
|
13
|
+
import Wt from "../request-controller.js";
|
|
14
|
+
import Vt from "./server-config-manager.js";
|
|
15
|
+
import Kt from "./session-manager.js";
|
|
16
|
+
import ee, { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
17
|
+
import Gt from "./storage-manager-factory.js";
|
|
18
18
|
import u from "./subscription-manager.js";
|
|
19
|
-
import { TriggersProviderFactory as
|
|
20
|
-
import
|
|
19
|
+
import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
|
|
20
|
+
import bt from "../User/user-manager.js";
|
|
21
21
|
import { User } from "../User/index.js";
|
|
22
22
|
import { parseQueryStringKeyValues as ll } from "../util/url-utils.js";
|
|
23
23
|
import { WindowUtils as no } from "../util/window-utils.js";
|
|
24
|
-
import { BRAZE_MUST_BE_INITIALIZED_ERROR as
|
|
25
|
-
import { SupportedOptions as
|
|
24
|
+
import { BRAZE_MUST_BE_INITIALIZED_ERROR as w } from "../common/constants.js";
|
|
25
|
+
import { SupportedOptions as $t, logger as E } from "../../shared-lib/index.js";
|
|
26
26
|
import _t from "../models/identifier.js";
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
const z = {
|
|
28
|
+
_o: "allowCrawlerActivity",
|
|
29
|
+
Ro: "baseUrl",
|
|
30
|
+
Wo: "noCookies",
|
|
31
|
+
Vo: "devicePropertyAllowlist",
|
|
32
|
+
Aa: "disablePushTokenMaintenance",
|
|
33
|
+
Yo: "enableLogging",
|
|
34
|
+
Xo: "enableSdkAuthentication",
|
|
35
|
+
qa: "manageServiceWorkerExternally",
|
|
36
|
+
Zo: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
37
|
+
Wh: "sessionTimeoutInSeconds",
|
|
38
|
+
Vh: "appVersion",
|
|
39
|
+
Kh: "appVersionNumber",
|
|
40
|
+
Ma: "serviceWorkerLocation",
|
|
41
|
+
ka: "safariWebsitePushId",
|
|
42
|
+
Xn: "localization",
|
|
43
43
|
er: "contentSecurityNonce",
|
|
44
44
|
re: "allowUserSuppliedJavascript",
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
Jo: "inAppMessageZIndex",
|
|
46
|
+
Do: "openInAppMessagesInNewTab",
|
|
47
47
|
tn: "openCardsInNewTab",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Oa: "sdkFlavor",
|
|
48
|
+
Lh: "requireExplicitInAppMessageDismissal",
|
|
49
|
+
$h: "doNotLoadFontAwesome",
|
|
50
|
+
Jh: "deviceId",
|
|
51
|
+
_a: "serviceWorkerScope",
|
|
52
|
+
Yh: "sdkFlavor",
|
|
54
53
|
};
|
|
55
|
-
class
|
|
54
|
+
class Jt {
|
|
56
55
|
constructor() {
|
|
57
|
-
(this.
|
|
58
|
-
(this.
|
|
59
|
-
(this.
|
|
60
|
-
(this.
|
|
61
|
-
(this.
|
|
62
|
-
(this.S = null),
|
|
63
|
-
(this.Fi = null),
|
|
56
|
+
(this.sn = ""),
|
|
57
|
+
(this.Xh = ""),
|
|
58
|
+
(this.Zh = void 0),
|
|
59
|
+
(this.Qh = null),
|
|
60
|
+
(this.on = null),
|
|
64
61
|
(this.B = null),
|
|
65
|
-
(this.
|
|
62
|
+
(this.Cn = null),
|
|
63
|
+
(this.h = null),
|
|
66
64
|
(this.C = null),
|
|
65
|
+
(this.j = null),
|
|
67
66
|
(this.Cs = null),
|
|
68
|
-
(this.
|
|
67
|
+
(this.Ea = ""),
|
|
69
68
|
(this.isInitialized = !1),
|
|
70
|
-
(this.
|
|
71
|
-
(this.
|
|
72
|
-
(this.
|
|
69
|
+
(this.Ia = !1),
|
|
70
|
+
(this.Sa = new u()),
|
|
71
|
+
(this.Na = new u()),
|
|
73
72
|
(this.options = {}),
|
|
74
|
-
(this.
|
|
75
|
-
(this.
|
|
76
|
-
(this.
|
|
77
|
-
(this.
|
|
73
|
+
(this.Oa = []),
|
|
74
|
+
(this.Ta = []),
|
|
75
|
+
(this.yi = []),
|
|
76
|
+
(this.Xh = "6.1.0");
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
this.
|
|
78
|
+
Ra(t) {
|
|
79
|
+
this.Sa.wt(t);
|
|
81
80
|
}
|
|
82
|
-
|
|
83
|
-
this.
|
|
81
|
+
mh(t) {
|
|
82
|
+
this.Na.wt(t);
|
|
84
83
|
}
|
|
85
84
|
initialize(t, i) {
|
|
86
|
-
if (this.
|
|
87
|
-
return
|
|
85
|
+
if (this.ao())
|
|
86
|
+
return E.info("Braze has already been initialized with an API key."), !0;
|
|
88
87
|
this.options = i || {};
|
|
89
|
-
let e = this.ee(
|
|
90
|
-
const r = ll(no
|
|
88
|
+
let e = this.ee(z.Yo);
|
|
89
|
+
const r = ll(no.Ca());
|
|
91
90
|
if (
|
|
92
91
|
(r && "true" === r.brazeLogging && (e = !0),
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
E.init(e),
|
|
93
|
+
E.info(
|
|
95
94
|
`Initialization Options: ${JSON.stringify(this.options, null, 2)}`,
|
|
96
95
|
),
|
|
97
96
|
null == t || "" === t || "string" != typeof t)
|
|
98
97
|
)
|
|
99
|
-
return
|
|
100
|
-
this.
|
|
101
|
-
let n = this.ee(
|
|
98
|
+
return E.error("Braze requires a valid API key to be initialized."), !1;
|
|
99
|
+
this.sn = t;
|
|
100
|
+
let n = this.ee(z.Ro);
|
|
102
101
|
if (null == n || "" === n || "string" != typeof n)
|
|
103
|
-
return
|
|
102
|
+
return E.error("Braze requires a valid baseUrl to be initialized."), !1;
|
|
104
103
|
!1 === /^https?:/.test(n) && (n = `https://${n}`);
|
|
105
104
|
const o = n;
|
|
106
105
|
if (
|
|
107
106
|
((n = document.createElement("a")),
|
|
108
107
|
(n.href = o),
|
|
109
108
|
"/" === n.pathname && (n = `${n}api/v3`),
|
|
110
|
-
(this.
|
|
111
|
-
ro.
|
|
109
|
+
(this.Ea = n.toString()),
|
|
110
|
+
ro.Pa && !this.ee(z._o))
|
|
112
111
|
)
|
|
113
112
|
return (
|
|
114
|
-
|
|
115
|
-
(this.
|
|
113
|
+
E.info("Ignoring activity from crawler bot " + navigator.userAgent),
|
|
114
|
+
(this.Ia = !0),
|
|
116
115
|
!1
|
|
117
116
|
);
|
|
118
|
-
const h = this.ee(
|
|
117
|
+
const h = this.ee(z.Wo) || !1;
|
|
119
118
|
if (
|
|
120
|
-
((this.
|
|
119
|
+
((this.j = Gt.La(t, h)), h && this.j.Da(t), new ee.ne(null, !0).br(s.ie))
|
|
121
120
|
)
|
|
122
121
|
return (
|
|
123
|
-
|
|
124
|
-
(this.
|
|
122
|
+
E.info("Ignoring all activity due to previous opt out"),
|
|
123
|
+
(this.Ia = !0),
|
|
125
124
|
!1
|
|
126
125
|
);
|
|
127
126
|
for (const t of C(this.options))
|
|
128
|
-
-1 ===
|
|
129
|
-
|
|
127
|
+
-1 === Pt($t).indexOf(t) &&
|
|
128
|
+
E.warn(`Ignoring unknown initialization option '${t}'.`);
|
|
130
129
|
const a = ["mparticle", "wordpress", "tealium"];
|
|
131
|
-
if (null != this.ee(
|
|
132
|
-
const t = this.ee(
|
|
130
|
+
if (null != this.ee(z.Yh)) {
|
|
131
|
+
const t = this.ee(z.Yh);
|
|
133
132
|
-1 !== a.indexOf(t)
|
|
134
|
-
? (this.
|
|
135
|
-
:
|
|
133
|
+
? (this.Zh = t)
|
|
134
|
+
: E.error("Invalid sdk flavor passed: " + t);
|
|
136
135
|
}
|
|
137
|
-
let l = this.ee(
|
|
136
|
+
let l = this.ee($t.Vo);
|
|
138
137
|
if (null != l)
|
|
139
|
-
if (
|
|
138
|
+
if (D(l)) {
|
|
140
139
|
const t = [];
|
|
141
140
|
for (let i = 0; i < l.length; i++)
|
|
142
141
|
ta(
|
|
@@ -147,184 +146,184 @@ class Vt {
|
|
|
147
146
|
) && t.push(l[i]);
|
|
148
147
|
l = t;
|
|
149
148
|
} else
|
|
150
|
-
|
|
149
|
+
E.error(
|
|
151
150
|
"devicePropertyAllowlist must be an array. Defaulting to all properties.",
|
|
152
151
|
),
|
|
153
152
|
(l = null);
|
|
154
|
-
const c = this.ee(
|
|
153
|
+
const c = this.ee(z.Jh);
|
|
155
154
|
if (c) {
|
|
156
155
|
const t = new _t(c);
|
|
157
|
-
this.
|
|
156
|
+
this.j.uu(s.iu.Jh, t);
|
|
158
157
|
}
|
|
159
|
-
(this.
|
|
160
|
-
(this.
|
|
161
|
-
(this.Cs = new
|
|
162
|
-
(this.
|
|
158
|
+
(this.on = new Ot(this.j, l)),
|
|
159
|
+
(this.h = new Vt(this.j)),
|
|
160
|
+
(this.Cs = new bt(this.h, this.j)),
|
|
161
|
+
(this.C = new Kt(this.j, this.Cs, this.h, this.ee(z.Wh)));
|
|
163
162
|
const f = new u();
|
|
164
163
|
return (
|
|
165
|
-
(this.
|
|
166
|
-
this.
|
|
167
|
-
(this.
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
164
|
+
(this.Qh = new Bt(this.j, this.ee(z.Xo), f)),
|
|
165
|
+
this.q(f),
|
|
166
|
+
(this.B = new Mt(
|
|
167
|
+
this.on,
|
|
168
|
+
this.j,
|
|
169
|
+
this.Qh,
|
|
171
170
|
this.Cs,
|
|
172
|
-
this.
|
|
173
|
-
this.
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
178
|
-
this.ee(
|
|
179
|
-
this.ee(
|
|
171
|
+
this.C,
|
|
172
|
+
this.h,
|
|
173
|
+
this.sn,
|
|
174
|
+
this.Ea,
|
|
175
|
+
this.Xh,
|
|
176
|
+
this.Zh || "",
|
|
177
|
+
this.ee(z.Vh),
|
|
178
|
+
this.ee(z.Kh),
|
|
180
179
|
)),
|
|
181
|
-
(this.
|
|
182
|
-
this.
|
|
183
|
-
this.
|
|
184
|
-
this.T,
|
|
185
|
-
this.hn,
|
|
186
|
-
this.Cs,
|
|
187
|
-
this.B,
|
|
180
|
+
(this.Cn = new Wt(
|
|
181
|
+
this.sn,
|
|
182
|
+
this.Ea,
|
|
188
183
|
this.C,
|
|
184
|
+
this.on,
|
|
185
|
+
this.Cs,
|
|
186
|
+
this.h,
|
|
187
|
+
this.j,
|
|
189
188
|
(t) => {
|
|
190
|
-
if (this.
|
|
189
|
+
if (this.ao()) for (const i of this.lr()) i.N(t);
|
|
191
190
|
},
|
|
192
|
-
this.
|
|
193
|
-
this.
|
|
191
|
+
this.Qh,
|
|
192
|
+
this.B,
|
|
194
193
|
)),
|
|
195
|
-
this.
|
|
196
|
-
h || this.
|
|
197
|
-
|
|
194
|
+
this.Cn.initialize(),
|
|
195
|
+
h || this.j.Ua(),
|
|
196
|
+
E.info(
|
|
198
197
|
`Initialized for the Braze backend at "${this.ee(
|
|
199
|
-
|
|
200
|
-
)}" with API key "${this.
|
|
198
|
+
z.Ro,
|
|
199
|
+
)}" with API key "${this.sn}".`,
|
|
201
200
|
),
|
|
202
|
-
|
|
203
|
-
this.
|
|
201
|
+
rt.t(),
|
|
202
|
+
this.h.Ue(() => {
|
|
204
203
|
var t;
|
|
205
204
|
this.isInitialized &&
|
|
206
|
-
(null === (t = this.
|
|
205
|
+
(null === (t = this.h) || void 0 === t ? void 0 : t.Re()) &&
|
|
207
206
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
208
207
|
if (!this.isInitialized) return;
|
|
209
208
|
(0, t.default)();
|
|
210
209
|
});
|
|
211
210
|
}),
|
|
212
|
-
this.
|
|
211
|
+
this.Cn.rn(() => {
|
|
213
212
|
var t;
|
|
214
213
|
this.isInitialized &&
|
|
215
|
-
(null === (t = this.
|
|
214
|
+
(null === (t = this.h) || void 0 === t ? void 0 : t.Re()) &&
|
|
216
215
|
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
|
|
217
216
|
if (!this.isInitialized) return;
|
|
218
217
|
(0, t.default)(void 0, void 0, !0);
|
|
219
218
|
});
|
|
220
219
|
}),
|
|
221
|
-
this.
|
|
220
|
+
this.Sa.L(this.options),
|
|
222
221
|
(this.isInitialized = !0),
|
|
223
222
|
window.dispatchEvent(new CustomEvent("braze.initialized")),
|
|
224
223
|
!0
|
|
225
224
|
);
|
|
226
225
|
}
|
|
227
226
|
destroy(t) {
|
|
228
|
-
if ((
|
|
229
|
-
this.
|
|
230
|
-
for (const t of this.
|
|
231
|
-
this.
|
|
232
|
-
for (const t of this.
|
|
233
|
-
this.
|
|
234
|
-
(this.
|
|
227
|
+
if ((E.destroy(), this.ao())) {
|
|
228
|
+
this.Na.L(), this.Na.removeAllSubscriptions();
|
|
229
|
+
for (const t of this.Oa) t.destroy();
|
|
230
|
+
this.Oa = [];
|
|
231
|
+
for (const t of this.Ta) t.clearData(!1);
|
|
232
|
+
this.B && this.B.fo(),
|
|
233
|
+
(this.Ta = []),
|
|
235
234
|
this.removeAllSubscriptions(),
|
|
236
|
-
(this.
|
|
237
|
-
null != this.
|
|
238
|
-
(this.
|
|
239
|
-
(this.
|
|
240
|
-
(this.
|
|
241
|
-
(this.S = null),
|
|
235
|
+
(this.yi = []),
|
|
236
|
+
null != this.Cn && this.Cn.destroy(),
|
|
237
|
+
(this.Cn = null),
|
|
238
|
+
(this.Qh = null),
|
|
239
|
+
(this.on = null),
|
|
242
240
|
(this.B = null),
|
|
243
|
-
(this.
|
|
241
|
+
(this.h = null),
|
|
242
|
+
(this.C = null),
|
|
244
243
|
(this.Cs = null),
|
|
245
244
|
(this.options = {}),
|
|
246
|
-
(this.
|
|
245
|
+
(this.Zh = void 0),
|
|
247
246
|
(this.isInitialized = !1),
|
|
248
|
-
(this.
|
|
249
|
-
t && (this.
|
|
247
|
+
(this.Ia = !1),
|
|
248
|
+
t && (this.j = null);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
251
|
rr() {
|
|
253
|
-
return !this.
|
|
252
|
+
return !this.Wa() && (!!this.ao() || (console.warn(w), !1));
|
|
254
253
|
}
|
|
255
|
-
|
|
256
|
-
return this.
|
|
254
|
+
ba() {
|
|
255
|
+
return this.sn;
|
|
257
256
|
}
|
|
258
257
|
Sr() {
|
|
259
|
-
return this.
|
|
258
|
+
return this.Qh;
|
|
260
259
|
}
|
|
261
|
-
|
|
262
|
-
return this.
|
|
260
|
+
V() {
|
|
261
|
+
return this.Ea;
|
|
263
262
|
}
|
|
264
|
-
|
|
265
|
-
return this.
|
|
263
|
+
de() {
|
|
264
|
+
return this.on;
|
|
266
265
|
}
|
|
267
|
-
|
|
268
|
-
return this.
|
|
266
|
+
m() {
|
|
267
|
+
return this.B;
|
|
269
268
|
}
|
|
270
269
|
ee(t) {
|
|
271
270
|
return this.options[t];
|
|
272
271
|
}
|
|
273
|
-
|
|
274
|
-
return this.
|
|
275
|
-
}
|
|
276
|
-
rn() {
|
|
277
|
-
return this.Fi;
|
|
272
|
+
lr() {
|
|
273
|
+
return this.Ta;
|
|
278
274
|
}
|
|
279
|
-
|
|
280
|
-
return this.
|
|
275
|
+
nn() {
|
|
276
|
+
return this.Cn;
|
|
281
277
|
}
|
|
282
|
-
|
|
283
|
-
return this.
|
|
278
|
+
l() {
|
|
279
|
+
return this.h;
|
|
284
280
|
}
|
|
285
|
-
|
|
281
|
+
u() {
|
|
286
282
|
return this.C;
|
|
287
283
|
}
|
|
288
|
-
|
|
289
|
-
|
|
284
|
+
p() {
|
|
285
|
+
return this.j;
|
|
286
|
+
}
|
|
287
|
+
gr() {
|
|
288
|
+
if (this.Cs && this.Cn) return new User(this.Cs, this.Cn);
|
|
290
289
|
}
|
|
291
290
|
ir() {
|
|
292
291
|
return this.Cs;
|
|
293
292
|
}
|
|
294
293
|
tr() {
|
|
295
|
-
return !0 === this.ee(
|
|
294
|
+
return !0 === this.ee(z.re);
|
|
296
295
|
}
|
|
297
|
-
|
|
296
|
+
g(t) {
|
|
298
297
|
let i = !1;
|
|
299
|
-
for (const s of this.
|
|
300
|
-
i || this.
|
|
298
|
+
for (const s of this.Oa) s === t && (i = !0);
|
|
299
|
+
i || this.Oa.push(t);
|
|
301
300
|
}
|
|
302
|
-
|
|
301
|
+
v(i) {
|
|
303
302
|
let s = !1;
|
|
304
|
-
for (const t of this.
|
|
305
|
-
i instanceof t && !s && this.
|
|
303
|
+
for (const t of this.Ta) t.constructor === i.constructor && (s = !0);
|
|
304
|
+
i instanceof t && !s && this.Ta.push(i);
|
|
306
305
|
}
|
|
307
|
-
|
|
308
|
-
t instanceof u && this.
|
|
306
|
+
q(t) {
|
|
307
|
+
t instanceof u && this.yi.push(t);
|
|
309
308
|
}
|
|
310
309
|
removeAllSubscriptions() {
|
|
311
|
-
if (this.rr()) for (const t of this.
|
|
310
|
+
if (this.rr()) for (const t of this.yi) t.removeAllSubscriptions();
|
|
312
311
|
}
|
|
313
312
|
removeSubscription(t) {
|
|
314
|
-
if (this.rr()) for (const i of this.
|
|
313
|
+
if (this.rr()) for (const i of this.yi) i.removeSubscription(t);
|
|
315
314
|
}
|
|
316
|
-
|
|
317
|
-
this.
|
|
315
|
+
ce(t) {
|
|
316
|
+
this.Ia = t;
|
|
318
317
|
}
|
|
319
|
-
|
|
318
|
+
ao() {
|
|
320
319
|
return this.isInitialized;
|
|
321
320
|
}
|
|
322
|
-
|
|
323
|
-
return this.
|
|
321
|
+
Wa() {
|
|
322
|
+
return this.Ia;
|
|
324
323
|
}
|
|
325
|
-
|
|
326
|
-
return this.
|
|
324
|
+
Vs() {
|
|
325
|
+
return this.Xh;
|
|
327
326
|
}
|
|
328
327
|
}
|
|
329
|
-
const r = new
|
|
330
|
-
export { r as default,
|
|
328
|
+
const r = new Jt();
|
|
329
|
+
export { r as default, Jt as BrazeSdkInstance, z as OPTIONS };
|