@braze/web-sdk 4.3.0 → 4.5.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.
Files changed (178) hide show
  1. package/index.d.ts +68 -6
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +8 -1
  4. package/shared-lib/encoding-utils.js +12 -1
  5. package/shared-lib/event-types.js +32 -1
  6. package/shared-lib/guid.js +10 -1
  7. package/shared-lib/indexed-db-adapter.js +315 -1
  8. package/shared-lib/logger.js +38 -1
  9. package/shared-lib/supported-options.js +26 -1
  10. package/src/Card/card-manager-factory.js +14 -1
  11. package/src/Card/card-manager.js +72 -1
  12. package/src/Card/display/card-display.js +134 -1
  13. package/src/Card/index.js +5 -1
  14. package/src/Card/log-card-click.js +11 -1
  15. package/src/Card/log-card-dismissal.js +11 -1
  16. package/src/Card/log-card-impressions.js +13 -1
  17. package/src/Card/log-content-card-impressions.js +4 -1
  18. package/src/Card/models/banner.js +30 -1
  19. package/src/Card/models/captioned-image.js +32 -1
  20. package/src/Card/models/card.js +175 -1
  21. package/src/Card/models/classic-card.js +32 -1
  22. package/src/Card/models/control-card.js +39 -1
  23. package/src/Card/models/index.js +5 -1
  24. package/src/Card/util/card-factory.js +104 -1
  25. package/src/ContentCards/content-cards-provider-factory.js +20 -1
  26. package/src/ContentCards/content-cards-provider.js +283 -1
  27. package/src/ContentCards/content-cards.js +24 -1
  28. package/src/ContentCards/get-cached-content-cards.js +5 -1
  29. package/src/ContentCards/index.js +8 -1
  30. package/src/ContentCards/log-content-cards-displayed.js +5 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +5 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +14 -1
  33. package/src/ContentCards/ui/hide-content-cards.js +8 -1
  34. package/src/ContentCards/ui/show-content-cards.js +72 -1
  35. package/src/ContentCards/ui/toggle-content-cards.js +8 -1
  36. package/src/Core/add-sdk-metadata.js +27 -1
  37. package/src/Core/braze-sdk-metadata.js +10 -1
  38. package/src/Core/change-user.js +19 -1
  39. package/src/Core/destroy.js +5 -1
  40. package/src/Core/device-properties.js +9 -1
  41. package/src/Core/disable-sdk.js +10 -1
  42. package/src/Core/enable-sdk.js +8 -1
  43. package/src/Core/get-device-id.js +10 -1
  44. package/src/Core/get-user.js +4 -1
  45. package/src/Core/handle-braze-action.js +64 -1
  46. package/src/Core/index.js +23 -1
  47. package/src/Core/initialize.js +4 -1
  48. package/src/Core/is-disabled.js +4 -1
  49. package/src/Core/log-custom-event.js +36 -1
  50. package/src/Core/log-purchase.js +245 -1
  51. package/src/Core/open-session.js +23 -1
  52. package/src/Core/remove-all-subscriptions.js +4 -1
  53. package/src/Core/remove-subscription.js +4 -1
  54. package/src/Core/request-immediate-data-flush.js +4 -1
  55. package/src/Core/set-logger.js +4 -1
  56. package/src/Core/set-sdk-authentication-signature.js +9 -1
  57. package/src/Core/subscribe-to-sdk-authentication-failures.js +4 -1
  58. package/src/Core/toggle-logging.js +4 -1
  59. package/src/Core/wipe-data.js +15 -1
  60. package/src/FeatureFlags/feature-flag-factory.js +14 -0
  61. package/src/FeatureFlags/feature-flag.js +16 -0
  62. package/src/FeatureFlags/feature-flags-provider-factory.js +19 -0
  63. package/src/FeatureFlags/feature-flags-provider.js +94 -0
  64. package/src/FeatureFlags/get-all-feature-flags.js +12 -0
  65. package/src/FeatureFlags/get-feature-flag.js +12 -0
  66. package/src/FeatureFlags/index.js +4 -0
  67. package/src/FeatureFlags/refresh-feature-flags.js +9 -0
  68. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +6 -0
  69. package/src/Feed/feed-provider-factory.js +18 -1
  70. package/src/Feed/feed-provider.js +79 -1
  71. package/src/Feed/feed.js +20 -1
  72. package/src/Feed/get-cached-feed.js +5 -1
  73. package/src/Feed/index.js +8 -1
  74. package/src/Feed/log-feed-displayed.js +5 -1
  75. package/src/Feed/request-feed-refresh.js +5 -1
  76. package/src/Feed/subscribe-to-feed-updates.js +5 -1
  77. package/src/Feed/ui/hide-feed.js +7 -1
  78. package/src/Feed/ui/show-feed.js +89 -1
  79. package/src/Feed/ui/toggle-feed.js +8 -1
  80. package/src/InAppMessage/display/get-animation-effect.js +19 -1
  81. package/src/InAppMessage/display/html-message-to-html.js +223 -1
  82. package/src/InAppMessage/display/in-app-message-to-html.js +152 -1
  83. package/src/InAppMessage/display/modal-utils.js +68 -1
  84. package/src/InAppMessage/in-app-message-factory.js +145 -1
  85. package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
  86. package/src/InAppMessage/in-app-message-manager.js +189 -1
  87. package/src/InAppMessage/index.js +14 -1
  88. package/src/InAppMessage/log-in-app-message-button-click.js +19 -1
  89. package/src/InAppMessage/log-in-app-message-click.js +19 -1
  90. package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
  91. package/src/InAppMessage/log-in-app-message-impression.js +13 -1
  92. package/src/InAppMessage/models/control-message.js +8 -1
  93. package/src/InAppMessage/models/full-screen-message.js +71 -1
  94. package/src/InAppMessage/models/html-message.js +54 -1
  95. package/src/InAppMessage/models/in-app-message-button.js +40 -1
  96. package/src/InAppMessage/models/in-app-message.js +271 -1
  97. package/src/InAppMessage/models/modal-message.js +68 -1
  98. package/src/InAppMessage/models/slide-up-message.js +58 -1
  99. package/src/InAppMessage/models/templated-in-app-message.js +14 -1
  100. package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
  101. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
  102. package/src/InAppMessage/ui/show-in-app-message.js +170 -1
  103. package/src/Push/index.js +5 -1
  104. package/src/Push/is-push-blocked.js +5 -1
  105. package/src/Push/is-push-permission-granted.js +5 -1
  106. package/src/Push/is-push-supported.js +5 -1
  107. package/src/Push/push-manager-factory.js +30 -1
  108. package/src/Push/push-manager.js +360 -1
  109. package/src/Push/request-push-permission.js +8 -1
  110. package/src/Push/unregister-push.js +5 -1
  111. package/src/Push/utils/push-utils.js +34 -1
  112. package/src/User/index.js +1 -1
  113. package/src/User/user-manager.js +70 -1
  114. package/src/User/user.js +278 -1
  115. package/src/common/base-feed.js +25 -1
  116. package/src/common/base-provider.js +6 -1
  117. package/src/common/constants.js +5 -1
  118. package/src/common/event-logger.js +24 -1
  119. package/src/common/feed-display.js +200 -1
  120. package/src/common/translations.js +148 -1
  121. package/src/index.js +9 -1
  122. package/src/l10n/l10n-manager-factory.js +22 -1
  123. package/src/l10n/l10n-manager.js +21 -1
  124. package/src/managers/auth-manager.js +48 -1
  125. package/src/managers/braze-instance.js +307 -1
  126. package/src/managers/device-manager.js +80 -1
  127. package/src/managers/network-manager.js +219 -1
  128. package/src/managers/server-config-manager.js +88 -1
  129. package/src/managers/session-manager.js +68 -1
  130. package/src/managers/storage-manager-factory.js +35 -1
  131. package/src/managers/storage-manager.js +394 -1
  132. package/src/managers/subscription-manager.js +25 -1
  133. package/src/models/backend-errors.js +8 -1
  134. package/src/models/braze-event.js +41 -1
  135. package/src/models/braze-sdk-metadata.js +10 -1
  136. package/src/models/device.js +26 -1
  137. package/src/models/identifier.js +20 -1
  138. package/src/models/push-token.js +22 -1
  139. package/src/models/request-result.js +8 -1
  140. package/src/models/server-config.js +32 -1
  141. package/src/request-controller.js +288 -1
  142. package/src/triggers/models/custom-event-data.js +14 -1
  143. package/src/triggers/models/custom-event-property-data.js +21 -1
  144. package/src/triggers/models/filter-set.js +55 -1
  145. package/src/triggers/models/filter.js +98 -1
  146. package/src/triggers/models/in-app-message-click-data.js +25 -1
  147. package/src/triggers/models/purchase-data.js +14 -1
  148. package/src/triggers/models/purchase-property-data.js +21 -1
  149. package/src/triggers/models/push-click-data.js +15 -1
  150. package/src/triggers/models/trigger-condition.js +109 -1
  151. package/src/triggers/models/trigger-events.js +8 -1
  152. package/src/triggers/models/trigger.js +110 -1
  153. package/src/triggers/triggers-provider-factory.js +30 -1
  154. package/src/triggers/triggers-provider.js +307 -1
  155. package/src/ui/js/attach-css.js +12 -1
  156. package/src/ui/js/feed-css.js +12 -1
  157. package/src/ui/js/iam-css.js +12 -1
  158. package/src/ui/js/index.js +3 -1
  159. package/src/ui/js/load-font-awesome.js +13 -1
  160. package/src/util/base-device-parser.js +14 -1
  161. package/src/util/braze-actions.js +79 -1
  162. package/src/util/browser-detector.js +85 -1
  163. package/src/util/client-hints-parser.js +60 -1
  164. package/src/util/code-utils.js +92 -1
  165. package/src/util/color-utils.js +23 -1
  166. package/src/util/component-utils.js +26 -1
  167. package/src/util/date-utils.js +27 -1
  168. package/src/util/deprecation-utils.js +5 -1
  169. package/src/util/device-constants.js +14 -1
  170. package/src/util/dom-utils.js +87 -1
  171. package/src/util/key-codes.js +1 -1
  172. package/src/util/math.js +5 -1
  173. package/src/util/net.js +75 -1
  174. package/src/util/string-utils.js +22 -1
  175. package/src/util/url-utils.js +23 -1
  176. package/src/util/user-agent-parser.js +85 -1
  177. package/src/util/validation-utils.js +136 -1
  178. package/src/util/window-utils.js +35 -1
@@ -1 +1,8 @@
1
- export default{OPEN:"open",Rr:"purchase",vr:"push_click",be:"custom_event",Ar:"iam_click",ks:"test"};
1
+ export default {
2
+ OPEN: "open",
3
+ Rr: "purchase",
4
+ vr: "push_click",
5
+ be: "custom_event",
6
+ Ar: "iam_click",
7
+ ks: "test"
8
+ };
@@ -1 +1,110 @@
1
- import{dateFromUnixTimestamp as h,rehydrateDateAfterJsonization as w}from"../../util/date-utils.js";import r from"../../../shared-lib/braze-shared-lib.js";import Gt from"./trigger-condition.js";import{validateValueIsFromEnum as F}from"../../util/code-utils.js";export default class ut{constructor(t,i,s,e,r,l,o,n,h,a,u,d){this.id=t,this.Ph=i||[],void 0===s&&(s=null),this.startTime=s,void 0===e&&(e=null),this.endTime=e,this.priority=r||0,this.type=l,this.bh=n||0,null==a&&(a=1e3*(this.bh+30)),this.vi=a,this.data=o,null==h&&(h=ut.jh),this.$h=h,this.xh=u,this.Ch=d||null}Fh(t){return null==this.Ch||this.$h!==ut.jh&&t-this.Ch>=1e3*this.$h}Jh(t){this.Ch=t}Vh(t){const i=t+1e3*this.bh;return Math.max(i-(new Date).valueOf(),0)}kh(t){const i=(new Date).valueOf()-t,s=null==t||isNaN(i)||null==this.vi||i<this.vi;return s||r.D.info(`Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.vi}ms.`),!s}static fromJson(t){const i=t.id,s=[];for(let i=0;i<t.trigger_condition.length;i++)s.push(Gt.fromJson(t.trigger_condition[i]));const e=h(t.start_time),r=h(t.end_time),l=t.priority,o=t.type,n=t.delay,a=t.re_eligibility,u=t.timeout,d=t.data,m=t.min_seconds_since_last_trigger;return F(ut.gi,o,"Could not construct Trigger from server data","Trigger.Types")?new ut(i,s,e,r,l,o,d,n,a,u,m):null}ss(){const t=[];for(let i=0;i<this.Ph.length;i++)t.push(this.Ph[i].ss());return{i:this.id,c:t,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.bh,r:this.$h,tm:this.vi,ss:this.xh,ld:this.Ch}}static yn(t){const i=[];for(let s=0;s<t.c.length;s++)i.push(Gt.yn(t.c[s]));return new ut(t.i,i,w(t.s),w(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}}ut.jh=-1,ut.gi={mi:"inapp",qh:"templated_iam"};
1
+ import {
2
+ dateFromUnixTimestamp as h,
3
+ rehydrateDateAfterJsonization as w
4
+ } from "../../util/date-utils.js";
5
+ import r from "../../../shared-lib/braze-shared-lib.js";
6
+ import Kt from "./trigger-condition.js";
7
+ import { validateValueIsFromEnum as F } from "../../util/code-utils.js";
8
+ export default class mt {
9
+ constructor(t, i, s, e, r, l, o, n, h, a, u, d) {
10
+ (this.id = t),
11
+ (this.Ph = i || []),
12
+ void 0 === s && (s = null),
13
+ (this.startTime = s),
14
+ void 0 === e && (e = null),
15
+ (this.endTime = e),
16
+ (this.priority = r || 0),
17
+ (this.type = l),
18
+ (this.$h = n || 0),
19
+ null == a && (a = 1e3 * (this.$h + 30)),
20
+ (this.$i = a),
21
+ (this.data = o),
22
+ null == h && (h = mt.Vh),
23
+ (this.qh = h),
24
+ (this.Kh = u),
25
+ (this.Wh = d || null);
26
+ }
27
+ Yh(t) {
28
+ return (
29
+ null == this.Wh || (this.qh !== mt.Vh && t - this.Wh >= 1e3 * this.qh)
30
+ );
31
+ }
32
+ Zh(t) {
33
+ this.Wh = t;
34
+ }
35
+ gu(t) {
36
+ const i = t + 1e3 * this.$h;
37
+ return Math.max(i - new Date().valueOf(), 0);
38
+ }
39
+ pu(t) {
40
+ const i = new Date().valueOf() - t,
41
+ s = null == t || isNaN(i) || null == this.$i || i < this.$i;
42
+ return (
43
+ s ||
44
+ r.D.info(
45
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.$i}ms.`
46
+ ),
47
+ !s
48
+ );
49
+ }
50
+ static fromJson(t) {
51
+ const i = t.id,
52
+ s = [];
53
+ for (let i = 0; i < t.trigger_condition.length; i++)
54
+ s.push(Kt.fromJson(t.trigger_condition[i]));
55
+ const e = h(t.start_time),
56
+ r = h(t.end_time),
57
+ l = t.priority,
58
+ o = t.type,
59
+ n = t.delay,
60
+ a = t.re_eligibility,
61
+ u = t.timeout,
62
+ d = t.data,
63
+ m = t.min_seconds_since_last_trigger;
64
+ return F(
65
+ mt._i,
66
+ o,
67
+ "Could not construct Trigger from server data",
68
+ "Trigger.Types"
69
+ )
70
+ ? new mt(i, s, e, r, l, o, d, n, a, u, m)
71
+ : null;
72
+ }
73
+ ss() {
74
+ const t = [];
75
+ for (let i = 0; i < this.Ph.length; i++) t.push(this.Ph[i].ss());
76
+ return {
77
+ i: this.id,
78
+ c: t,
79
+ s: this.startTime,
80
+ e: this.endTime,
81
+ p: this.priority,
82
+ t: this.type,
83
+ da: this.data,
84
+ d: this.$h,
85
+ r: this.qh,
86
+ tm: this.$i,
87
+ ss: this.Kh,
88
+ ld: this.Wh
89
+ };
90
+ }
91
+ static Sn(t) {
92
+ const i = [];
93
+ for (let s = 0; s < t.c.length; s++) i.push(Kt.Sn(t.c[s]));
94
+ return new mt(
95
+ t.i,
96
+ i,
97
+ w(t.s),
98
+ w(t.e),
99
+ t.p,
100
+ t.t,
101
+ t.da,
102
+ t.d,
103
+ t.r,
104
+ t.tm,
105
+ t.ss,
106
+ t.ld
107
+ );
108
+ }
109
+ }
110
+ (mt.Vh = -1), (mt._i = { Ti: "inapp", Tu: "templated_iam" });
@@ -1 +1,30 @@
1
- import pe from"../InAppMessage/in-app-message-manager-factory.js";import e,{OPTIONS as T}from"../managers/braze-instance.js";import ir from"./triggers-provider.js";export const TriggersProviderFactory={t:!1,provider:null,er:()=>(TriggersProviderFactory.init(),TriggersProviderFactory.provider),rg:()=>{if(!TriggersProviderFactory.provider){const r=e.nn(T.ho);TriggersProviderFactory.provider=new ir(null!=r?r:30,pe.m().Be(),e.l(),e.mr(),pe.m()),e.ar(TriggersProviderFactory.provider)}},init:()=>{TriggersProviderFactory.t||(TriggersProviderFactory.rg(),e.u(TriggersProviderFactory),TriggersProviderFactory.t=!0)},destroy:()=>{TriggersProviderFactory.provider=null,TriggersProviderFactory.t=!1}};
1
+ import pe from "../InAppMessage/in-app-message-manager-factory.js";
2
+ import e, { OPTIONS as T } from "../managers/braze-instance.js";
3
+ import gr from "./triggers-provider.js";
4
+ export const TriggersProviderFactory = {
5
+ t: !1,
6
+ provider: null,
7
+ er: () => (TriggersProviderFactory.init(), TriggersProviderFactory.provider),
8
+ rg: () => {
9
+ if (!TriggersProviderFactory.provider) {
10
+ const r = e.nn(T.Ao);
11
+ (TriggersProviderFactory.provider = new gr(
12
+ null != r ? r : 30,
13
+ pe.m().Ve(),
14
+ e.l(),
15
+ e.mr(),
16
+ pe.m()
17
+ )),
18
+ e.ar(TriggersProviderFactory.provider);
19
+ }
20
+ },
21
+ init: () => {
22
+ TriggersProviderFactory.t ||
23
+ (TriggersProviderFactory.rg(),
24
+ e.u(TriggersProviderFactory),
25
+ (TriggersProviderFactory.t = !0));
26
+ },
27
+ destroy: () => {
28
+ (TriggersProviderFactory.provider = null), (TriggersProviderFactory.t = !1);
29
+ }
30
+ };
@@ -1 +1,307 @@
1
- import y from"../common/base-provider.js";import{newInAppMessageFromJson as it}from"../InAppMessage/in-app-message-factory.js";import ue from"../models/braze-event.js";import{InAppMessage}from"../InAppMessage/index.js";import{isArray as p,isEqual as ii,validateValueIsFromEnum as F}from"../util/code-utils.js";import{STORAGE_KEYS as o}from"../managers/storage-manager.js";import ft from"../InAppMessage/models/templated-in-app-message.js";import ut from"./models/trigger.js";import V from"./models/trigger-events.js";import r from"../../shared-lib/braze-shared-lib.js";export default class ir extends y{constructor(t,i,s,e,r){super(),this.Wh=t,this.yt=i,this.h=s,this.si=e,this.Gh=r,this.Kh=[],this.Yh=[],this.Zh=null,this.tg={},this.ig={},this.sg(),this.eg()}hg(){this.Zh=this.h.I(o.q.Ya)||this.Zh,this.tg=this.h.I(o.q.Da)||this.tg,this.ig=this.h.I(o.q.Ka)||this.ig;for(let t=0;t<this.og.length;t++){const i=this.og[t];null!=this.ig[i.id]&&i.Jh(this.ig[i.id])}}sg(){this.ng=this.h.I(o.q.Ia)||0;const t=this.h.I(o.q.ba)||[],i=[];for(let s=0;s<t.length;s++)i.push(ut.yn(t[s]));this.og=i,this.hg()}eg(){const t=this,i=function(i,s,e,r,h){return function(){t.lg(i,s,e,r,h)}},s={};for(let t=0;t<this.og.length;t++)s[this.og[t].id]=this.og[t];let e=!1;for(let t=0;t<this.og.length;t++){const r=this.og[t];if(null!=this.tg[r.id]){const t=this.tg[r.id],h=[];for(let e=0;e<t.length;e++){const o=t[e],n=r.Vh(o.di);if(n>0){let t,e;h.push(o),null!=o.ag&&(t=o.ag),null!=o.gg&&ue.Ma(o.gg)&&(e=ue.yn(o.gg));const l=[];if(p(o.fg))for(let t=0;t<o.fg.length;t++){const i=s[o.fg[t]];null!=i&&l.push(i)}this.Yh.push(setTimeout(i(r,o.di,t,e,l),n))}}this.tg[r.id].length>h.length&&(this.tg[r.id]=h,e=!0,0===this.tg[r.id].length&&delete this.tg[r.id])}}e&&this.h.B(o.q.Da,this.tg)}cg(){const t=[];for(let i=0;i<this.og.length;i++)t.push(this.og[i].ss());this.ng=(new Date).valueOf(),this.h.B(o.q.ba,t),this.h.B(o.q.Ia,this.ng)}ug(){(this.h.I(o.q.Ia)||0)>this.ng?this.sg():this.hg()}Rs(t){let i=!1;if(null!=t&&t.triggers){this.hg();const s={},e={};this.og=[];for(let r=0;r<t.triggers.length;r++){const h=ut.fromJson(t.triggers[r]);null!=this.ig[h.id]&&(h.Jh(this.ig[h.id]),s[h.id]=this.ig[h.id]),null!=this.tg[h.id]&&(e[h.id]=this.tg[h.id]);for(let t=0;t<h.Ph.length;t++)if(h.Ph[t].qa(V.ks,null)){i=!0;break}null!=h&&this.og.push(h)}ii(this.ig,s)||(this.ig=s,this.h.B(o.q.Ka,this.ig)),ii(this.tg,e)||(this.tg=e,this.h.B(o.q.Da,this.tg)),this.cg(),i&&(r.D.info("Trigger with test condition found, firing test."),this.je(V.ks)),this.je(V.OPEN);const h=this.Kh;this.Kh=[];for(let t=0;t<h.length;t++)this.je.apply(this,h[t])}}async lg(t,i,s,e,h){const o=e=>{this.hg();const h=(new Date).valueOf();if(!t.kh(i))return!1===navigator.onLine&&t.type===ut.gi.mi&&e.imageUrl?(r.D.info(`Not showing ${t.type} trigger action ${t.id} due to offline state.`),void this.Gh.qe(t.id,InAppMessage.Oe.Ki)):void(t.Fh(h)&&this.dg(t,h,s)?(this.yt.St([e]),this.mg(t,h)):r.D.info(`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`));t.type===ut.gi.qh?this.Gh.qe(t.id,InAppMessage.Oe.ui):this.Gh.qe(t.id,InAppMessage.Oe.Yi)},n=()=>{this.hg();const o=h.pop();if(null!=o)if(this.pg(o,i,s,e,h),o.kh(i)){let t=`Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;h.length>0&&(t+=" Continuing to fall back."),r.D.info(t),this.Gh.qe(o.id,InAppMessage.Oe.Yi),n()}else{r.D.info(`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`);const n=1e3*o.bh-((new Date).valueOf()-i);n>0?this.Yh.push(setTimeout((()=>{this.lg(o,i,s,e,h)}),n)):this.lg(o,i,s,e,h)}};switch(t.type){case ut.gi.mi:const h=it(t.data);if(null==h){r.D.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`),this.Gh.qe(t.id,InAppMessage.Oe.ci);break}let l=this.Gh.Ve(h);if(l){r.D.error(l),n();break}o(h);break;case ut.gi.qh:const a=ft.fromJson(t.data,o,n,i,t.vi);if(null==a){r.D.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`),this.Gh.qe(t.id,InAppMessage.Oe.ci);break}this.Gh.Ze(a,s,e);break;default:r.D.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`),this.Gh.qe(t.id,InAppMessage.Oe.ci)}}je(t,i,s){if(!F(V,t,"Cannot fire trigger action.","TriggerEvents"))return;if(this.si.Il())return r.D.info("Trigger sync is currently in progress, awaiting sync completion before firing trigger event."),void this.Kh.push(arguments);this.ug();const e=(new Date).valueOf(),h=e-this.Zh;let o=!0,n=!0;const l=[];for(let s=0;s<this.og.length;s++){const r=this.og[s],h=e+1e3*r.bh;if(r.Fh(h)&&(null==r.startTime||r.startTime<=e)&&(null==r.endTime||r.endTime>=e)){let s=!1;for(let e=0;e<r.Ph.length;e++)if(r.Ph[e].qa(t,i)){s=!0;break}s&&(o=!1,this.dg(r,h,t)&&(n=!1,l.push(r)))}}if(o)return void r.D.info(`Trigger event ${t} did not match any trigger conditions.`);if(n)return void r.D.info(`Ignoring ${t} trigger event because a trigger was displayed ${h/1e3}s ago.`);l.sort(((t,i)=>t.priority-i.priority));const a=l.pop();null!=a&&(r.D.info(`Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`),this.pg(a,e,t,s,l),0===a.bh?this.lg(a,e,t,s,l):this.Yh.push(setTimeout((()=>{this.lg(a,e,t,s,l)}),1e3*a.bh)))}changeUser(t){if(this.og=[],this.h.Xs(o.q.ba),!t){this.Kh=[],this.Zh=null,this.ig={},this.tg={};for(let t=0;t<this.Yh.length;t++)clearTimeout(this.Yh[t]);this.Yh=[],this.h.Xs(o.q.Ya),this.h.Xs(o.q.Ka),this.h.Xs(o.q.Da)}}clearData(){this.og=[],this.Zh=null,this.ig={},this.tg={};for(let t=0;t<this.Yh.length;t++)clearTimeout(this.Yh[t]);this.Yh=[]}dg(t,i,s){if(null==this.Zh)return!0;if(s===V.ks)return r.D.info("Ignoring minimum interval between trigger because it is a test type."),!0;let e=t.xh;return null==e&&(e=this.Wh),i-this.Zh>=1e3*e}pg(t,i,s,e,r){this.hg(),this.tg[t.id]=this.tg[t.id]||[];const h={};let n;h.di=i,h.ag=s,null!=e&&(n=e.ss()),h.gg=n;const l=[];for(let t=0;t<r.length;t++)l.push(r[t].id);h.fg=l,this.tg[t.id].push(h),this.h.B(o.q.Da,this.tg)}mg(t,i){this.hg(),t.Jh(i),this.Zh=i,this.h.B(o.q.Ya,i),this.ig[t.id]=i,this.h.B(o.q.Ka,this.ig)}}
1
+ import y from "../common/base-provider.js";
2
+ import { newInAppMessageFromJson as lt } from "../InAppMessage/in-app-message-factory.js";
3
+ import ue from "../models/braze-event.js";
4
+ import { InAppMessage } from "../InAppMessage/index.js";
5
+ import {
6
+ isArray as p,
7
+ isEqual as ii,
8
+ validateValueIsFromEnum as F
9
+ } from "../util/code-utils.js";
10
+ import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
11
+ import wt from "../InAppMessage/models/templated-in-app-message.js";
12
+ import mt from "./models/trigger.js";
13
+ import V from "./models/trigger-events.js";
14
+ import r from "../../shared-lib/braze-shared-lib.js";
15
+ export default class gr extends y {
16
+ constructor(t, i, s, e, r) {
17
+ super(),
18
+ (this.tg = t),
19
+ (this.yt = i),
20
+ (this.h = s),
21
+ (this.si = e),
22
+ (this.ig = r),
23
+ (this.sg = []),
24
+ (this.eg = []),
25
+ (this.hg = null),
26
+ (this.og = {}),
27
+ (this.ng = {}),
28
+ this.ag(),
29
+ this.lg();
30
+ }
31
+ gg() {
32
+ (this.hg = this.h.I(o.q.Na) || this.hg),
33
+ (this.og = this.h.I(o.q.va) || this.og),
34
+ (this.ng = this.h.I(o.q.Ga) || this.ng);
35
+ for (let t = 0; t < this.cg.length; t++) {
36
+ const i = this.cg[t];
37
+ null != this.ng[i.id] && i.Zh(this.ng[i.id]);
38
+ }
39
+ }
40
+ ag() {
41
+ this.fg = this.h.I(o.q.Da) || 0;
42
+ const t = this.h.I(o.q.Ya) || [],
43
+ i = [];
44
+ for (let s = 0; s < t.length; s++) i.push(mt.Sn(t[s]));
45
+ (this.cg = i), this.gg();
46
+ }
47
+ lg() {
48
+ const t = this,
49
+ i = function(i, s, e, r, h) {
50
+ return function() {
51
+ t.ug(i, s, e, r, h);
52
+ };
53
+ },
54
+ s = {};
55
+ for (let t = 0; t < this.cg.length; t++) s[this.cg[t].id] = this.cg[t];
56
+ let e = !1;
57
+ for (let t = 0; t < this.cg.length; t++) {
58
+ const r = this.cg[t];
59
+ if (null != this.og[r.id]) {
60
+ const t = this.og[r.id],
61
+ h = [];
62
+ for (let e = 0; e < t.length; e++) {
63
+ const o = t[e],
64
+ n = r.gu(o.Si);
65
+ if (n > 0) {
66
+ let t, e;
67
+ h.push(o),
68
+ null != o.dg && (t = o.dg),
69
+ null != o.mg && ue.Fa(o.mg) && (e = ue.Sn(o.mg));
70
+ const a = [];
71
+ if (p(o.pg))
72
+ for (let t = 0; t < o.pg.length; t++) {
73
+ const i = s[o.pg[t]];
74
+ null != i && a.push(i);
75
+ }
76
+ this.eg.push(setTimeout(i(r, o.Si, t, e, a), n));
77
+ }
78
+ }
79
+ this.og[r.id].length > h.length &&
80
+ ((this.og[r.id] = h),
81
+ (e = !0),
82
+ 0 === this.og[r.id].length && delete this.og[r.id]);
83
+ }
84
+ }
85
+ e && this.h.B(o.q.va, this.og);
86
+ }
87
+ bg() {
88
+ const t = [];
89
+ for (let i = 0; i < this.cg.length; i++) t.push(this.cg[i].ss());
90
+ (this.fg = new Date().valueOf()),
91
+ this.h.B(o.q.Ya, t),
92
+ this.h.B(o.q.Da, this.fg);
93
+ }
94
+ Tg() {
95
+ (this.h.I(o.q.Da) || 0) > this.fg ? this.ag() : this.gg();
96
+ }
97
+ Rs(t) {
98
+ let i = !1;
99
+ if (null != t && t.triggers) {
100
+ this.gg();
101
+ const s = {},
102
+ e = {};
103
+ this.cg = [];
104
+ for (let r = 0; r < t.triggers.length; r++) {
105
+ const h = mt.fromJson(t.triggers[r]);
106
+ null != this.ng[h.id] &&
107
+ (h.Zh(this.ng[h.id]), (s[h.id] = this.ng[h.id])),
108
+ null != this.og[h.id] && (e[h.id] = this.og[h.id]);
109
+ for (let t = 0; t < h.Ph.length; t++)
110
+ if (h.Ph[t].ec(V.ks, null)) {
111
+ i = !0;
112
+ break;
113
+ }
114
+ null != h && this.cg.push(h);
115
+ }
116
+ ii(this.ng, s) || ((this.ng = s), this.h.B(o.q.Ga, this.ng)),
117
+ ii(this.og, e) || ((this.og = e), this.h.B(o.q.va, this.og)),
118
+ this.bg(),
119
+ i &&
120
+ (r.D.info("Trigger with test condition found, firing test."),
121
+ this.je(V.ks)),
122
+ this.je(V.OPEN);
123
+ const h = this.sg;
124
+ this.sg = [];
125
+ for (let t = 0; t < h.length; t++) this.je.apply(this, h[t]);
126
+ }
127
+ }
128
+ async ug(t, i, s, e, h) {
129
+ const o = e => {
130
+ this.gg();
131
+ const h = new Date().valueOf();
132
+ if (!t.pu(i))
133
+ return !1 === navigator.onLine && t.type === mt._i.Ti && e.imageUrl
134
+ ? (r.D.info(
135
+ `Not showing ${t.type} trigger action ${t.id} due to offline state.`
136
+ ),
137
+ void this.ig.ni(t.id, InAppMessage.li.nh))
138
+ : void (t.Yh(h) && this.yg(t, h, s)
139
+ ? 0 === this.yt.bu()
140
+ ? r.D.info(
141
+ `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`
142
+ )
143
+ : (this.yt.St([e]), this.vg(t, h))
144
+ : r.D.info(
145
+ `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`
146
+ ));
147
+ t.type === mt._i.Tu
148
+ ? this.ig.ni(t.id, InAppMessage.li.zi)
149
+ : this.ig.ni(t.id, InAppMessage.li.rh);
150
+ },
151
+ n = () => {
152
+ this.gg();
153
+ const o = h.pop();
154
+ if (null != o)
155
+ if ((this.wg(o, i, s, e, h), o.pu(i))) {
156
+ let t = `Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;
157
+ h.length > 0 && (t += " Continuing to fall back."),
158
+ r.D.info(t),
159
+ this.ig.ni(o.id, InAppMessage.li.rh),
160
+ n();
161
+ } else {
162
+ r.D.info(
163
+ `Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`
164
+ );
165
+ const n = 1e3 * o.$h - (new Date().valueOf() - i);
166
+ n > 0
167
+ ? this.eg.push(
168
+ setTimeout(() => {
169
+ this.ug(o, i, s, e, h);
170
+ }, n)
171
+ )
172
+ : this.ug(o, i, s, e, h);
173
+ }
174
+ };
175
+ switch (t.type) {
176
+ case mt._i.Ti:
177
+ const h = lt(t.data);
178
+ if (null == h) {
179
+ r.D.error(
180
+ `Could not parse trigger data for trigger ${t.id}, ignoring.`
181
+ ),
182
+ this.ig.ni(t.id, InAppMessage.li.ki);
183
+ break;
184
+ }
185
+ let a = this.ig.vi(h);
186
+ if (a) {
187
+ r.D.error(a), n();
188
+ break;
189
+ }
190
+ o(h);
191
+ break;
192
+ case mt._i.Tu:
193
+ const l = wt.fromJson(t.data, o, n, i, t.$i);
194
+ if (null == l) {
195
+ r.D.error(
196
+ `Could not parse trigger data for trigger ${t.id}, ignoring.`
197
+ ),
198
+ this.ig.ni(t.id, InAppMessage.li.ki);
199
+ break;
200
+ }
201
+ this.ig.Ii(l, s, e);
202
+ break;
203
+ default:
204
+ r.D.error(
205
+ `Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`
206
+ ),
207
+ this.ig.ni(t.id, InAppMessage.li.ki);
208
+ }
209
+ }
210
+ je(t, i, s) {
211
+ if (!F(V, t, "Cannot fire trigger action.", "TriggerEvents")) return;
212
+ if (this.si.Ml())
213
+ return (
214
+ r.D.info(
215
+ "Trigger sync is currently in progress, awaiting sync completion before firing trigger event."
216
+ ),
217
+ void this.sg.push(arguments)
218
+ );
219
+ this.Tg();
220
+ const e = new Date().valueOf(),
221
+ h = e - this.hg;
222
+ let o = !0,
223
+ n = !0;
224
+ const a = [];
225
+ for (let s = 0; s < this.cg.length; s++) {
226
+ const r = this.cg[s],
227
+ h = e + 1e3 * r.$h;
228
+ if (
229
+ r.Yh(h) &&
230
+ (null == r.startTime || r.startTime <= e) &&
231
+ (null == r.endTime || r.endTime >= e)
232
+ ) {
233
+ let s = !1;
234
+ for (let e = 0; e < r.Ph.length; e++)
235
+ if (r.Ph[e].ec(t, i)) {
236
+ s = !0;
237
+ break;
238
+ }
239
+ s && ((o = !1), this.yg(r, h, t) && ((n = !1), a.push(r)));
240
+ }
241
+ }
242
+ if (o)
243
+ return void r.D.info(
244
+ `Trigger event ${t} did not match any trigger conditions.`
245
+ );
246
+ if (n)
247
+ return void r.D.info(
248
+ `Ignoring ${t} trigger event because a trigger was displayed ${h /
249
+ 1e3}s ago.`
250
+ );
251
+ a.sort((t, i) => t.priority - i.priority);
252
+ const l = a.pop();
253
+ null != l &&
254
+ (r.D.info(
255
+ `Firing ${l.type} trigger action ${l.id} from trigger event ${t}.`
256
+ ),
257
+ this.wg(l, e, t, s, a),
258
+ 0 === l.$h
259
+ ? this.ug(l, e, t, s, a)
260
+ : this.eg.push(
261
+ setTimeout(() => {
262
+ this.ug(l, e, t, s, a);
263
+ }, 1e3 * l.$h)
264
+ ));
265
+ }
266
+ changeUser(t) {
267
+ if (((this.cg = []), this.h.Xs(o.q.Ya), !t)) {
268
+ (this.sg = []), (this.hg = null), (this.ng = {}), (this.og = {});
269
+ for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
270
+ (this.eg = []), this.h.Xs(o.q.Na), this.h.Xs(o.q.Ga), this.h.Xs(o.q.va);
271
+ }
272
+ }
273
+ clearData() {
274
+ (this.cg = []), (this.hg = null), (this.ng = {}), (this.og = {});
275
+ for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
276
+ this.eg = [];
277
+ }
278
+ yg(t, i, s) {
279
+ if (null == this.hg) return !0;
280
+ if (s === V.ks)
281
+ return (
282
+ r.D.info(
283
+ "Ignoring minimum interval between trigger because it is a test type."
284
+ ),
285
+ !0
286
+ );
287
+ let e = t.Kh;
288
+ return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
289
+ }
290
+ wg(t, i, s, e, r) {
291
+ this.gg(), (this.og[t.id] = this.og[t.id] || []);
292
+ const h = {};
293
+ let n;
294
+ (h.Si = i), (h.dg = s), null != e && (n = e.ss()), (h.mg = n);
295
+ const a = [];
296
+ for (let t = 0; t < r.length; t++) a.push(r[t].id);
297
+ (h.pg = a), this.og[t.id].push(h), this.h.B(o.q.va, this.og);
298
+ }
299
+ vg(t, i) {
300
+ this.gg(),
301
+ t.Zh(i),
302
+ (this.hg = i),
303
+ this.h.B(o.q.Na, i),
304
+ (this.ng[t.id] = i),
305
+ this.h.B(o.q.Ga, this.ng);
306
+ }
307
+ }
@@ -1 +1,12 @@
1
- import e,{OPTIONS as T}from"../../managers/braze-instance.js";export function attachCSS(n,t,o){const c=n||document.querySelector("head"),s=`ab-${t}-css-definitions-${"4.3.0".replace(/\./g,"-")}`,a=c.ownerDocument||document;if(null==a.getElementById(s)){const n=a.createElement("style");n.innerHTML=o,n.id=s;const t=e.nn(T.ao);null!=t&&n.setAttribute("nonce",t),c.appendChild(n)}}
1
+ import e, { OPTIONS as T } from "../../managers/braze-instance.js";
2
+ export function attachCSS(n, t, o) {
3
+ const c = n || document.querySelector("head"),
4
+ s = `ab-${t}-css-definitions-${"4.5.0".replace(/\./g, "-")}`,
5
+ a = c.ownerDocument || document;
6
+ if (null == a.getElementById(s)) {
7
+ const n = a.createElement("style");
8
+ (n.innerHTML = o), (n.id = s);
9
+ const t = e.nn(T.ao);
10
+ null != t && n.setAttribute("nonce", t), c.appendChild(n);
11
+ }
12
+ }
@@ -1 +1,12 @@
1
- import{attachCSS as Xt}from"./attach-css.js";import{loadFontAwesome as Yt}from"./load-font-awesome.js";export function attachFeedCSS(t){Xt(t,"feed","body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021;opacity:0;-webkit-transition:.5s;-moz-transition:.5s;-o-transition:.5s;transition:.5s}.ab-feed .ab-card .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b}.ab-feed .ab-card .ab-close-button svg.ab-chevron{display:none}.ab-feed .ab-card .ab-close-button:active{background-color:transparent}.ab-feed .ab-card .ab-close-button:focus{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover svg{fill-opacity:.8}.ab-feed .ab-card .ab-close-button:hover{opacity:1}.ab-feed .ab-card .ab-close-button:focus{opacity:1}.ab-feed .ab-card a{float:none;color:inherit;text-decoration:none}.ab-feed .ab-card a:hover{text-decoration:underline}.ab-feed .ab-card .ab-image-area{float:none;display:inline-block;vertical-align:top;line-height:0;overflow:hidden;width:100%;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.ab-feed .ab-card .ab-image-area img{float:none;height:auto;width:100%}.ab-feed .ab-card.ab-banner .ab-card-body{display:none}.ab-feed .ab-card .ab-card-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:100%;position:relative}.ab-feed .ab-card .ab-unread-indicator{position:absolute;bottom:0;margin-right:-1px;width:100%;height:5px;background-color:#1676d0}.ab-feed .ab-card .ab-unread-indicator.read{background-color:transparent}.ab-feed .ab-card .ab-title{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:18px;line-height:130%;padding:20px 25px 0 25px}.ab-feed .ab-card .ab-description{float:none;color:#545454;padding:15px 25px 20px 25px;word-wrap:break-word;white-space:pre-wrap}.ab-feed .ab-card .ab-description.ab-no-title{padding-top:20px}.ab-feed .ab-card .ab-url-area{float:none;color:#1676d0;margin-top:12px;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-feed .ab-card.ab-classic-card .ab-card-body{min-height:40px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body{min-height:100px;padding-left:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area{width:60px;height:60px;padding:20px 0 25px 25px;position:absolute}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;max-width:100%;max-height:100%;width:auto;height:auto}.ab-feed .ab-card.ab-classic-card.with-image .ab-title{background-color:transparent;font-size:16px}.ab-feed .ab-card.ab-classic-card.with-image .ab-description{padding-top:10px}.ab-feed .ab-card.ab-control-card{height:0;width:0;margin:0;border:0}.ab-feed .ab-feed-buttons-wrapper{float:none;position:relative;background-color:#282828;height:50px;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);z-index:1}.ab-feed .ab-feed-buttons-wrapper .ab-close-button,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{float:none;cursor:pointer;color:#fff;font-size:18px;padding:16px;-webkit-transition:.2s;-moz-transition:.2s;-o-transition:.2s;transition:.2s}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{font-size:22px}.ab-feed .ab-feed-buttons-wrapper .ab-close-button{float:right}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover{padding-top:12px;padding-right:14px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{padding-left:17px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{padding-top:13px;padding-left:14px}.ab-feed .ab-no-cards-message{text-align:center;margin-bottom:20px}@media (max-width:600px){body>.ab-feed{width:100%}}")}export function setupFeedUI(){attachFeedCSS(),Yt()}
1
+ import { attachCSS as Zt } from "./attach-css.js";
2
+ import { loadFontAwesome as $t } from "./load-font-awesome.js";
3
+ export function attachFeedCSS(t) {
4
+ Zt(
5
+ t,
6
+ "feed",
7
+ "body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;right:0;top:0;z-index:9021;opacity:0;-webkit-transition:.5s;-moz-transition:.5s;-o-transition:.5s;transition:.5s}.ab-feed .ab-card .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b}.ab-feed .ab-card .ab-close-button svg.ab-chevron{display:none}.ab-feed .ab-card .ab-close-button:active{background-color:transparent}.ab-feed .ab-card .ab-close-button:focus{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover svg{fill-opacity:.8}.ab-feed .ab-card .ab-close-button:hover{opacity:1}.ab-feed .ab-card .ab-close-button:focus{opacity:1}.ab-feed .ab-card a{float:none;color:inherit;text-decoration:none}.ab-feed .ab-card a:hover{text-decoration:underline}.ab-feed .ab-card .ab-image-area{float:none;display:inline-block;vertical-align:top;line-height:0;overflow:hidden;width:100%;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.ab-feed .ab-card .ab-image-area img{float:none;height:auto;width:100%}.ab-feed .ab-card.ab-banner .ab-card-body{display:none}.ab-feed .ab-card .ab-card-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:100%;position:relative}.ab-feed .ab-card .ab-unread-indicator{position:absolute;bottom:0;margin-right:-1px;width:100%;height:5px;background-color:#1676d0}.ab-feed .ab-card .ab-unread-indicator.read{background-color:transparent}.ab-feed .ab-card .ab-title{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:18px;line-height:130%;padding:20px 25px 0 25px}.ab-feed .ab-card .ab-description{float:none;color:#545454;padding:15px 25px 20px 25px;word-wrap:break-word;white-space:pre-wrap}.ab-feed .ab-card .ab-description.ab-no-title{padding-top:20px}.ab-feed .ab-card .ab-url-area{float:none;color:#1676d0;margin-top:12px;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif}.ab-feed .ab-card.ab-classic-card .ab-card-body{min-height:40px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body{min-height:100px;padding-left:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area{width:60px;height:60px;padding:20px 0 25px 25px;position:absolute}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;max-width:100%;max-height:100%;width:auto;height:auto}.ab-feed .ab-card.ab-classic-card.with-image .ab-title{background-color:transparent;font-size:16px}.ab-feed .ab-card.ab-classic-card.with-image .ab-description{padding-top:10px}.ab-feed .ab-card.ab-control-card{height:0;width:0;margin:0;border:0}.ab-feed .ab-feed-buttons-wrapper{float:none;position:relative;background-color:#282828;height:50px;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);z-index:1}.ab-feed .ab-feed-buttons-wrapper .ab-close-button,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{float:none;cursor:pointer;color:#fff;font-size:18px;padding:16px;-webkit-transition:.2s;-moz-transition:.2s;-o-transition:.2s;transition:.2s}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{font-size:22px}.ab-feed .ab-feed-buttons-wrapper .ab-close-button{float:right}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover{padding-top:12px;padding-right:14px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{padding-left:17px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{padding-top:13px;padding-left:14px}.ab-feed .ab-no-cards-message{text-align:center;margin-bottom:20px}@media (max-width:600px){body>.ab-feed{width:100%}}"
8
+ );
9
+ }
10
+ export function setupFeedUI() {
11
+ attachFeedCSS(), $t();
12
+ }