@braze/web-sdk 4.10.1 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/index.d.ts +26 -111
  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 +34 -1
  6. package/shared-lib/guid.js +10 -1
  7. package/shared-lib/indexed-db-adapter.js +352 -1
  8. package/shared-lib/logger.js +38 -1
  9. package/shared-lib/supported-options.js +26 -1
  10. package/shared-lib/types.js +1 -1
  11. package/src/Card/card-manager-factory.js +14 -1
  12. package/src/Card/card-manager.js +78 -1
  13. package/src/Card/display/card-display.js +138 -1
  14. package/src/Card/index.js +6 -1
  15. package/src/Card/log-card-click.js +11 -1
  16. package/src/Card/log-card-dismissal.js +11 -1
  17. package/src/Card/log-card-impressions.js +13 -1
  18. package/src/Card/log-content-card-click.js +4 -1
  19. package/src/Card/log-content-card-impressions.js +4 -1
  20. package/src/Card/models/captioned-image.js +33 -1
  21. package/src/Card/models/card.js +197 -1
  22. package/src/Card/models/classic-card.js +32 -1
  23. package/src/Card/models/control-card.js +23 -1
  24. package/src/Card/models/image-only.js +31 -1
  25. package/src/Card/models/index.js +5 -1
  26. package/src/Card/types.js +1 -1
  27. package/src/Card/util/card-factory.js +104 -1
  28. package/src/ContentCards/content-cards-provider-factory.js +20 -1
  29. package/src/ContentCards/content-cards-provider.js +391 -1
  30. package/src/ContentCards/content-cards.js +24 -1
  31. package/src/ContentCards/get-cached-content-cards.js +5 -1
  32. package/src/ContentCards/index.js +7 -1
  33. package/src/ContentCards/request-content-cards-refresh.js +5 -1
  34. package/src/ContentCards/subscribe-to-content-cards-updates.js +17 -1
  35. package/src/ContentCards/types.js +1 -1
  36. package/src/ContentCards/ui/hide-content-cards.js +8 -1
  37. package/src/ContentCards/ui/show-content-cards.js +77 -1
  38. package/src/ContentCards/ui/toggle-content-cards.js +8 -1
  39. package/src/Core/add-sdk-metadata.js +26 -1
  40. package/src/Core/braze-sdk-metadata.js +10 -1
  41. package/src/Core/change-user.js +17 -1
  42. package/src/Core/destroy.js +5 -1
  43. package/src/Core/device-properties.js +9 -1
  44. package/src/Core/disable-sdk.js +15 -1
  45. package/src/Core/enable-sdk.js +11 -1
  46. package/src/Core/get-device-id.js +13 -1
  47. package/src/Core/get-user.js +4 -1
  48. package/src/Core/handle-braze-action.js +87 -1
  49. package/src/Core/index.js +23 -1
  50. package/src/Core/initialize.js +4 -1
  51. package/src/Core/is-disabled.js +4 -1
  52. package/src/Core/log-custom-event.js +38 -1
  53. package/src/Core/log-purchase.js +245 -1
  54. package/src/Core/open-session.js +25 -1
  55. package/src/Core/remove-all-subscriptions.js +4 -1
  56. package/src/Core/remove-subscription.js +4 -1
  57. package/src/Core/request-immediate-data-flush.js +6 -1
  58. package/src/Core/set-logger.js +4 -1
  59. package/src/Core/set-sdk-authentication-signature.js +8 -1
  60. package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -1
  61. package/src/Core/toggle-logging.js +4 -1
  62. package/src/Core/types.js +1 -1
  63. package/src/Core/wipe-data.js +16 -1
  64. package/src/FeatureFlags/feature-flag-factory.js +24 -1
  65. package/src/FeatureFlags/feature-flag.js +64 -1
  66. package/src/FeatureFlags/feature-flags-provider-factory.js +19 -1
  67. package/src/FeatureFlags/feature-flags-provider.js +145 -1
  68. package/src/FeatureFlags/get-all-feature-flags.js +12 -1
  69. package/src/FeatureFlags/get-feature-flag.js +10 -1
  70. package/src/FeatureFlags/index.js +6 -1
  71. package/src/FeatureFlags/log-feature-flag-impression.js +23 -1
  72. package/src/FeatureFlags/refresh-feature-flags.js +9 -1
  73. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +9 -1
  74. package/src/FeatureFlags/types.js +1 -1
  75. package/src/Feed/feed-provider-factory.js +18 -1
  76. package/src/Feed/feed-provider.js +90 -1
  77. package/src/Feed/feed.js +20 -1
  78. package/src/Feed/get-cached-feed.js +5 -1
  79. package/src/Feed/index.js +8 -1
  80. package/src/Feed/log-feed-displayed.js +7 -1
  81. package/src/Feed/request-feed-refresh.js +5 -1
  82. package/src/Feed/subscribe-to-feed-updates.js +5 -1
  83. package/src/Feed/types.js +1 -1
  84. package/src/Feed/ui/hide-feed.js +7 -1
  85. package/src/Feed/ui/show-feed.js +96 -1
  86. package/src/Feed/ui/toggle-feed.js +8 -1
  87. package/src/InAppMessage/defer-in-app-message.js +13 -1
  88. package/src/InAppMessage/display/get-animation-effect.js +19 -1
  89. package/src/InAppMessage/display/html-message-to-html.js +243 -1
  90. package/src/InAppMessage/display/in-app-message-to-html.js +188 -1
  91. package/src/InAppMessage/display/modal-utils.js +73 -1
  92. package/src/InAppMessage/get-deferred-in-app-message.js +5 -1
  93. package/src/InAppMessage/in-app-message-factory.js +166 -1
  94. package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
  95. package/src/InAppMessage/in-app-message-manager.js +248 -1
  96. package/src/InAppMessage/index.js +16 -1
  97. package/src/InAppMessage/log-in-app-message-button-click.js +27 -1
  98. package/src/InAppMessage/log-in-app-message-click.js +19 -1
  99. package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
  100. package/src/InAppMessage/log-in-app-message-impression.js +13 -1
  101. package/src/InAppMessage/models/control-message.js +11 -1
  102. package/src/InAppMessage/models/full-screen-message.js +105 -1
  103. package/src/InAppMessage/models/html-message.js +68 -1
  104. package/src/InAppMessage/models/in-app-message-button.js +47 -1
  105. package/src/InAppMessage/models/in-app-message.js +382 -1
  106. package/src/InAppMessage/models/modal-message.js +101 -1
  107. package/src/InAppMessage/models/slide-up-message.js +84 -1
  108. package/src/InAppMessage/models/templated-in-app-message.js +19 -1
  109. package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
  110. package/src/InAppMessage/types.js +1 -1
  111. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
  112. package/src/InAppMessage/ui/show-in-app-message.js +181 -1
  113. package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
  114. package/src/Push/index.js +5 -1
  115. package/src/Push/is-push-blocked.js +5 -1
  116. package/src/Push/is-push-permission-granted.js +5 -1
  117. package/src/Push/is-push-supported.js +5 -1
  118. package/src/Push/push-manager-factory.js +30 -1
  119. package/src/Push/push-manager.js +387 -1
  120. package/src/Push/request-push-permission.js +9 -1
  121. package/src/Push/types.js +1 -1
  122. package/src/Push/unregister-push.js +5 -1
  123. package/src/Push/utils/push-utils.js +36 -1
  124. package/src/User/index.js +1 -1
  125. package/src/User/types.js +1 -1
  126. package/src/User/user-manager.js +73 -1
  127. package/src/User/user.js +302 -1
  128. package/src/common/base-feed.js +29 -1
  129. package/src/common/base-provider.js +6 -1
  130. package/src/common/constants.js +14 -1
  131. package/src/common/event-logger.js +31 -1
  132. package/src/common/feed-display.js +210 -1
  133. package/src/common/translations.js +148 -1
  134. package/src/common/types.js +1 -1
  135. package/src/index.js +9 -1
  136. package/src/l10n/l10n-manager-factory.js +22 -1
  137. package/src/l10n/l10n-manager.js +25 -1
  138. package/src/l10n/types.js +1 -1
  139. package/src/managers/auth-manager.js +51 -1
  140. package/src/managers/braze-instance.js +322 -1
  141. package/src/managers/device-manager.js +85 -1
  142. package/src/managers/network-manager.js +256 -1
  143. package/src/managers/server-config-manager.js +108 -1
  144. package/src/managers/session-manager.js +75 -1
  145. package/src/managers/storage-manager-factory.js +42 -1
  146. package/src/managers/storage-manager.js +426 -1
  147. package/src/managers/subscription-manager.js +28 -1
  148. package/src/managers/types.js +1 -1
  149. package/src/models/backend-errors.js +8 -1
  150. package/src/models/braze-event.js +47 -1
  151. package/src/models/braze-sdk-metadata.js +10 -1
  152. package/src/models/device.js +18 -1
  153. package/src/models/identifier.js +19 -1
  154. package/src/models/push-token.js +27 -1
  155. package/src/models/request-result.js +8 -1
  156. package/src/models/server-config.js +48 -1
  157. package/src/models/types.js +1 -1
  158. package/src/request-controller.js +311 -1
  159. package/src/triggers/models/custom-event-data.js +14 -1
  160. package/src/triggers/models/custom-event-property-data.js +21 -1
  161. package/src/triggers/models/filter-set.js +55 -1
  162. package/src/triggers/models/filter.js +102 -1
  163. package/src/triggers/models/in-app-message-click-data.js +25 -1
  164. package/src/triggers/models/purchase-data.js +14 -1
  165. package/src/triggers/models/purchase-property-data.js +21 -1
  166. package/src/triggers/models/push-click-data.js +15 -1
  167. package/src/triggers/models/trigger-condition.js +105 -1
  168. package/src/triggers/models/trigger-events.js +8 -1
  169. package/src/triggers/models/trigger.js +122 -1
  170. package/src/triggers/triggers-provider-factory.js +34 -1
  171. package/src/triggers/triggers-provider.js +326 -1
  172. package/src/triggers/types.js +1 -1
  173. package/src/types.js +1 -1
  174. package/src/ui/js/attach-css.js +13 -1
  175. package/src/ui/js/feed-css.js +12 -1
  176. package/src/ui/js/iam-css.js +12 -1
  177. package/src/ui/js/index.js +3 -1
  178. package/src/ui/js/load-font-awesome.js +13 -1
  179. package/src/util/base-device-parser.js +14 -1
  180. package/src/util/braze-actions.js +84 -1
  181. package/src/util/browser-detector.js +84 -1
  182. package/src/util/client-hints-parser.js +66 -1
  183. package/src/util/code-utils.js +100 -1
  184. package/src/util/color-utils.js +29 -1
  185. package/src/util/component-utils.js +26 -1
  186. package/src/util/date-utils.js +28 -1
  187. package/src/util/deprecation-utils.js +5 -1
  188. package/src/util/device-constants.js +13 -1
  189. package/src/util/dom-utils.js +91 -1
  190. package/src/util/error-utils.js +2 -1
  191. package/src/util/key-codes.js +1 -1
  192. package/src/util/math.js +5 -1
  193. package/src/util/net.js +71 -1
  194. package/src/util/request-header-utils.js +46 -1
  195. package/src/util/string-utils.js +22 -1
  196. package/src/util/types.js +1 -1
  197. package/src/util/url-utils.js +20 -1
  198. package/src/util/user-agent-parser.js +80 -1
  199. package/src/util/validation-utils.js +217 -1
  200. package/src/util/window-utils.js +34 -1
  201. package/src/Card/models/banner.js +0 -1
  202. package/src/ContentCards/log-content-cards-displayed.js +0 -1
@@ -1 +1,68 @@
1
- import InAppMessage from"./in-app-message.js";export default class HtmlMessage extends InAppMessage{constructor(i,o,e,r,d,t,s,v,n,u,a){super(i,void 0,void 0,o,e,void 0,void 0,void 0,r=r||InAppMessage.DismissType.MANUAL,d,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,t,s,void 0,void 0,void 0,v,void 0,void 0,void 0,n,u),this.messageFields=a,this.messageFields=a}io(){return!1}p(i){if(this.Pe===InAppMessage.qe.ln){if(this.do)return!1;this.do=!0}return this.ht.Et(i),!0}ss(){const i=super.ss(HtmlMessage.es);return i[InAppMessage.hs.vo]=this.messageFields,i}static an(i){return new HtmlMessage(i[InAppMessage.hs.ea],i[InAppMessage.hs.xs],i[InAppMessage.hs.sa],i[InAppMessage.hs.oa],i[InAppMessage.hs.pa],i[InAppMessage.hs.ga],i[InAppMessage.hs.ja],i[InAppMessage.hs.va],i[InAppMessage.hs.ba],i[InAppMessage.hs.CSS],i[InAppMessage.hs.vo])}}HtmlMessage.es=InAppMessage.qe.ln;
1
+ import InAppMessage from "./in-app-message.js";
2
+ export default class HtmlMessage extends InAppMessage {
3
+ constructor(i, o, e, r, d, t, s, v, n, u, a) {
4
+ super(
5
+ i,
6
+ void 0,
7
+ void 0,
8
+ o,
9
+ e,
10
+ void 0,
11
+ void 0,
12
+ void 0,
13
+ (r = r || InAppMessage.DismissType.MANUAL),
14
+ d,
15
+ void 0,
16
+ void 0,
17
+ void 0,
18
+ void 0,
19
+ void 0,
20
+ void 0,
21
+ void 0,
22
+ void 0,
23
+ t,
24
+ s,
25
+ void 0,
26
+ void 0,
27
+ void 0,
28
+ v,
29
+ void 0,
30
+ void 0,
31
+ void 0,
32
+ n,
33
+ u,
34
+ ),
35
+ (this.messageFields = a),
36
+ (this.messageFields = a);
37
+ }
38
+ io() {
39
+ return !1;
40
+ }
41
+ p(i) {
42
+ if (this.Pe === InAppMessage.qe.ln) {
43
+ if (this.do) return !1;
44
+ this.do = !0;
45
+ }
46
+ return this.Et.Dt(i), !0;
47
+ }
48
+ tt() {
49
+ const i = super.tt(HtmlMessage.et);
50
+ return (i[InAppMessage.it.vo] = this.messageFields), i;
51
+ }
52
+ static an(i) {
53
+ return new HtmlMessage(
54
+ i[InAppMessage.it.ea],
55
+ i[InAppMessage.it.jt],
56
+ i[InAppMessage.it.sa],
57
+ i[InAppMessage.it.oa],
58
+ i[InAppMessage.it.pa],
59
+ i[InAppMessage.it.ga],
60
+ i[InAppMessage.it.ja],
61
+ i[InAppMessage.it.va],
62
+ i[InAppMessage.it.ba],
63
+ i[InAppMessage.it.CSS],
64
+ i[InAppMessage.it.vo],
65
+ );
66
+ }
67
+ }
68
+ HtmlMessage.et = InAppMessage.qe.ln;
@@ -1 +1,47 @@
1
- import InAppMessage from"./in-app-message.js";import E from"../../managers/subscription-manager.js";export default class InAppMessageButton{constructor(s,t,i,r,h,e,n){this.text=s,this.backgroundColor=t,this.textColor=i,this.borderColor=r,this.clickAction=h,this.uri=e,this.id=n,this.text=s||"",this.backgroundColor=t||InAppMessage.th.sh,this.textColor=i||InAppMessage.th.ih,this.borderColor=r||this.backgroundColor,this.clickAction=h||InAppMessage.ClickAction.NONE,this.uri=e,null==n&&(n=InAppMessageButton.Yi),this.id=n,this.do=!1,this.ht=new E}subscribeToClickedEvent(s){return this.ht.lt(s)}removeSubscription(s){this.ht.removeSubscription(s)}removeAllSubscriptions(){this.ht.removeAllSubscriptions()}p(){return!this.do&&(this.do=!0,this.ht.Et(),!0)}static fromJson(s){return new InAppMessageButton(s.text,s.bg_color,s.text_color,s.border_color,s.click_action,s.uri,s.id)}}InAppMessageButton.Yi=-1;
1
+ import InAppMessage from "./in-app-message.js";
2
+ import E from "../../managers/subscription-manager.js";
3
+ export default class InAppMessageButton {
4
+ constructor(s, t, i, r, h, e, n) {
5
+ (this.text = s),
6
+ (this.backgroundColor = t),
7
+ (this.textColor = i),
8
+ (this.borderColor = r),
9
+ (this.clickAction = h),
10
+ (this.uri = e),
11
+ (this.id = n),
12
+ (this.text = s || ""),
13
+ (this.backgroundColor = t || InAppMessage.th.sh),
14
+ (this.textColor = i || InAppMessage.th.ih),
15
+ (this.borderColor = r || this.backgroundColor),
16
+ (this.clickAction = h || InAppMessage.ClickAction.NONE),
17
+ (this.uri = e),
18
+ null == n && (n = InAppMessageButton.Yi),
19
+ (this.id = n),
20
+ (this.do = !1),
21
+ (this.Et = new E());
22
+ }
23
+ subscribeToClickedEvent(s) {
24
+ return this.Et.It(s);
25
+ }
26
+ removeSubscription(s) {
27
+ this.Et.removeSubscription(s);
28
+ }
29
+ removeAllSubscriptions() {
30
+ this.Et.removeAllSubscriptions();
31
+ }
32
+ p() {
33
+ return !this.do && ((this.do = !0), this.Et.Dt(), !0);
34
+ }
35
+ static fromJson(s) {
36
+ return new InAppMessageButton(
37
+ s.text,
38
+ s.bg_color,
39
+ s.text_color,
40
+ s.border_color,
41
+ s.click_action,
42
+ s.uri,
43
+ s.id,
44
+ );
45
+ }
46
+ }
47
+ InAppMessageButton.Yi = -1;
@@ -1 +1,382 @@
1
- import e,{OPTIONS as L}from"../../managers/braze-instance.js";import V from"../../util/browser-detector.js";import{clickElement as Et,supportsPassive as Tt}from"../../util/dom-utils.js";import{KeyCodes as lt}from"../../util/key-codes.js";import E from"../../managers/subscription-manager.js";import{isIFrame as It}from"../utils/in-app-message-utils.js";export default class InAppMessage{constructor(t,s,i,h,e,n,T,o,r,l,u,a,I,c,O,A,L,_,m,N,R,S,D,M,C,d,U,b,P){this.message=t,this.messageAlignment=s,this.slideFrom=i,this.extras=h,this.triggerId=e,this.clickAction=n,this.uri=T,this.openTarget=o,this.dismissType=r,this.duration=l,this.icon=u,this.imageUrl=a,this.imageStyle=I,this.iconColor=c,this.iconBackgroundColor=O,this.backgroundColor=A,this.textColor=L,this.closeButtonColor=_,this.animateIn=m,this.animateOut=N,this.header=R,this.headerAlignment=S,this.headerTextColor=D,this.frameColor=M,this.buttons=C,this.cropType=d,this.orientation=U,this.htmlId=b,this.css=P,this.message=t,this.messageAlignment=s||InAppMessage.TextAlignment.CENTER,this.duration=l||5e3,this.slideFrom=i||InAppMessage.SlideFrom.BOTTOM,this.extras=h||{},this.triggerId=e,this.clickAction=n||InAppMessage.ClickAction.NONE,this.uri=T,this.openTarget=o||InAppMessage.OpenTarget.NONE,this.dismissType=r||InAppMessage.DismissType.AUTO_DISMISS,this.icon=u,this.imageUrl=a,this.imageStyle=I||InAppMessage.ImageStyle.TOP,this.iconColor=c||InAppMessage.th.ih,this.iconBackgroundColor=O||InAppMessage.th.sh,this.backgroundColor=A||InAppMessage.th.ih,this.textColor=L||InAppMessage.th.hh,this.closeButtonColor=_||InAppMessage.th.eh,this.animateIn=m,null==this.animateIn&&(this.animateIn=!0),this.animateOut=N,null==this.animateOut&&(this.animateOut=!0),this.header=R,this.headerAlignment=S||InAppMessage.TextAlignment.CENTER,this.headerTextColor=D||InAppMessage.th.hh,this.frameColor=M||InAppMessage.th.Eh,this.buttons=C||[],this.cropType=d||InAppMessage.CropType.FIT_CENTER,this.orientation=U,this.htmlId=b,this.css=P,this.isControl=!1,this.nh=!1,this.Th=!1,this.do=!1,this.oh=!1,this.Me=null,this.ke=null,this.ht=new E,this.rh=new E,this.Te=InAppMessage.TextAlignment.CENTER}subscribeToClickedEvent(t){return this.ht.lt(t)}subscribeToDismissedEvent(t){return this.rh.lt(t)}removeSubscription(t){this.ht.removeSubscription(t),this.rh.removeSubscription(t)}removeAllSubscriptions(){this.ht.removeAllSubscriptions(),this.rh.removeAllSubscriptions()}closeMessage(){this.ye(this.Me)}xe(){return!0}io(){return this.xe()}Ne(){return null!=this.htmlId&&this.htmlId.length>4}Ae(){return this.Ne()&&null!=this.css&&this.css.length>0}Ce(){if(this.Ne()&&this.Ae())return this.htmlId+"-css"}M(){return!this.Th&&(this.Th=!0,!0)}so(){return this.Th}p(t){return!this.do&&(this.do=!0,this.ht.Et(),!0)}F(){return!this.oh&&(this.oh=!0,this.rh.Et(),!0)}hide(t){if(t&&t.parentNode){let s=t.closest(".ab-iam-root");if(null==s&&(s=t),this.xe()&&null!=s.parentNode){const t=s.parentNode.classList;t&&t.contains(InAppMessage.lh)&&t.remove(InAppMessage.lh),document.body.removeEventListener("touchmove",InAppMessage.uh)}s.className=s.className.replace(InAppMessage.ah,InAppMessage.Ih)}return this.animateOut||!1}ye(t,s){if(null==t)return;let i;this.Me=null,i=-1===t.className.indexOf("ab-in-app-message")?t.getElementsByClassName("ab-in-app-message")[0]:t;let h=!1;i&&(h=this.hide(i));const e=document.body;let E;null!=e&&(E=e.scrollTop);const n=()=>{if(t&&t.parentNode){let s=t.closest(".ab-iam-root");null==s&&(s=t),s.parentNode&&s.parentNode.removeChild(s)}const i=this.Ce();if(null!=i){const t=document.getElementById(i);t&&t.parentNode&&t.parentNode.removeChild(t)}null!=e&&"Safari"===V.browser&&(e.scrollTop=E),s?s():this.F()};h?setTimeout(n,InAppMessage.Oh):n(),this.ke&&this.ke.focus()}Ge(){return document.createTextNode(this.message||"")}Be(t){let s="";this.message||this.header||!this.xe()||(s="Modal Image"),t.setAttribute("alt",s)}static uh(t){if(t.targetTouches&&t.targetTouches.length>1)return;const s=t.target;s&&s.classList&&s.classList.contains("ab-message-text")&&s.scrollHeight>s.clientHeight||document.querySelector(`.${InAppMessage.lh}`)&&t.preventDefault()}Ah(t){const s=t.parentNode;this.xe()&&null!=s&&this.orientation!==InAppMessage.Orientation.LANDSCAPE&&(null!=s.classList&&s.classList.add(InAppMessage.lh),document.body.addEventListener("touchmove",InAppMessage.uh,!!Tt()&&{passive:!1})),t.className+=" "+InAppMessage.ah}static Lh(t){if(t.keyCode===lt._h&&!e.nn(L.mh)&&document.querySelectorAll(".ab-modal-interactions").length>0){const t=document.getElementsByClassName("ab-html-message");let s=!1;for(const i of t){let t=null;It(i)&&i.contentWindow&&(t=i.contentWindow.document.getElementsByClassName("ab-programmatic-close-button")[0]),null!=t&&(Et(t),s=!0)}if(!s){const t=document.querySelectorAll(".ab-modal-interactions > .ab-close-button")[0];null!=t&&Et(t)}}}Nh(){this.nh||e.nn(L.mh)||(document.addEventListener("keydown",InAppMessage.Lh,!1),e.Rh((()=>{document.removeEventListener("keydown",InAppMessage.Lh)})),this.nh=!0)}ss(t){const s={};return t?(s[InAppMessage.hs.ea]=this.message,s[InAppMessage.hs.ra]=this.messageAlignment,s[InAppMessage.hs.Sh]=this.slideFrom,s[InAppMessage.hs.xs]=this.extras,s[InAppMessage.hs.sa]=this.triggerId,s[InAppMessage.hs.ta]=this.clickAction,s[InAppMessage.hs.URI]=this.uri,s[InAppMessage.hs.ia]=this.openTarget,s[InAppMessage.hs.oa]=this.dismissType,s[InAppMessage.hs.pa]=this.duration,s[InAppMessage.hs.ma]=this.icon,s[InAppMessage.hs.os]=this.imageUrl,s[InAppMessage.hs.na]=this.imageStyle,s[InAppMessage.hs.ua]=this.iconColor,s[InAppMessage.hs.ca]=this.iconBackgroundColor,s[InAppMessage.hs.fa]=this.backgroundColor,s[InAppMessage.hs.da]=this.textColor,s[InAppMessage.hs.la]=this.closeButtonColor,s[InAppMessage.hs.ga]=this.animateIn,s[InAppMessage.hs.ja]=this.animateOut,s[InAppMessage.hs.xa]=this.header,s[InAppMessage.hs.za]=this.headerAlignment,s[InAppMessage.hs.ha]=this.headerTextColor,s[InAppMessage.hs.va]=this.frameColor,s[InAppMessage.hs.wa]=this.buttons,s[InAppMessage.hs.ya]=this.cropType,s[InAppMessage.hs.Sa]=this.orientation,s[InAppMessage.hs.ba]=this.htmlId,s[InAppMessage.hs.CSS]=this.css,s[InAppMessage.hs.ts]=t,s):s}}InAppMessage.th={hh:4281545523,ih:4294967295,sh:4278219733,Dh:4293914607,Mh:4283782485,Eh:3224580915,eh:4288387995},InAppMessage.Ie={Ch:"hd",Le:"ias",dh:"of",Uh:"do",Xr:"umt",Qr:"tf",bh:"te"},InAppMessage.SlideFrom={TOP:"TOP",BOTTOM:"BOTTOM"},InAppMessage.ClickAction={NEWS_FEED:"NEWS_FEED",URI:"URI",NONE:"NONE"},InAppMessage.DismissType={AUTO_DISMISS:"AUTO_DISMISS",MANUAL:"SWIPE"},InAppMessage.OpenTarget={NONE:"NONE",BLANK:"BLANK"},InAppMessage.ImageStyle={TOP:"TOP",GRAPHIC:"GRAPHIC"},InAppMessage.Orientation={PORTRAIT:"PORTRAIT",LANDSCAPE:"LANDSCAPE"},InAppMessage.TextAlignment={START:"START",CENTER:"CENTER",END:"END"},InAppMessage.CropType={CENTER_CROP:"CENTER_CROP",FIT_CENTER:"FIT_CENTER"},InAppMessage.qe={pn:"SLIDEUP",un:"MODAL",Se:"MODAL_STYLED",on:"FULL",ln:"WEB_HTML",Ee:"HTML",Ue:"HTML_FULL"},InAppMessage.Oh=500,InAppMessage.Ph=200,InAppMessage.ah="ab-show",InAppMessage.Ih="ab-hide",InAppMessage.lh="ab-pause-scrolling",InAppMessage.hs={ea:"m",ra:"ma",Sh:"sf",xs:"e",sa:"ti",ta:"ca",URI:"u",ia:"oa",oa:"dt",pa:"d",ma:"i",os:"iu",na:"is",ua:"ic",ca:"ibc",fa:"bc",da:"tc",la:"cbc",ga:"ai",ja:"ao",xa:"h",za:"ha",ha:"htc",va:"fc",wa:"b",ya:"ct",Sa:"o",ba:"hi",CSS:"css",ts:"type",vo:"messageFields"};
1
+ import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
+ import Q from "../../util/browser-detector.js";
3
+ import {
4
+ clickElement as Et,
5
+ supportsPassive as Tt,
6
+ } from "../../util/dom-utils.js";
7
+ import { KeyCodes as at } from "../../util/key-codes.js";
8
+ import E from "../../managers/subscription-manager.js";
9
+ import { isIFrame as It } from "../utils/in-app-message-utils.js";
10
+ export default class InAppMessage {
11
+ constructor(
12
+ t,
13
+ s,
14
+ i,
15
+ h,
16
+ e,
17
+ n,
18
+ T,
19
+ o,
20
+ r,
21
+ l,
22
+ u,
23
+ a,
24
+ I,
25
+ c,
26
+ O,
27
+ A,
28
+ L,
29
+ _,
30
+ m,
31
+ N,
32
+ R,
33
+ S,
34
+ D,
35
+ M,
36
+ C,
37
+ d,
38
+ U,
39
+ b,
40
+ P,
41
+ ) {
42
+ (this.message = t),
43
+ (this.messageAlignment = s),
44
+ (this.slideFrom = i),
45
+ (this.extras = h),
46
+ (this.triggerId = e),
47
+ (this.clickAction = n),
48
+ (this.uri = T),
49
+ (this.openTarget = o),
50
+ (this.dismissType = r),
51
+ (this.duration = l),
52
+ (this.icon = u),
53
+ (this.imageUrl = a),
54
+ (this.imageStyle = I),
55
+ (this.iconColor = c),
56
+ (this.iconBackgroundColor = O),
57
+ (this.backgroundColor = A),
58
+ (this.textColor = L),
59
+ (this.closeButtonColor = _),
60
+ (this.animateIn = m),
61
+ (this.animateOut = N),
62
+ (this.header = R),
63
+ (this.headerAlignment = S),
64
+ (this.headerTextColor = D),
65
+ (this.frameColor = M),
66
+ (this.buttons = C),
67
+ (this.cropType = d),
68
+ (this.orientation = U),
69
+ (this.htmlId = b),
70
+ (this.css = P),
71
+ (this.message = t),
72
+ (this.messageAlignment = s || InAppMessage.TextAlignment.CENTER),
73
+ (this.duration = l || 5e3),
74
+ (this.slideFrom = i || InAppMessage.SlideFrom.BOTTOM),
75
+ (this.extras = h || {}),
76
+ (this.triggerId = e),
77
+ (this.clickAction = n || InAppMessage.ClickAction.NONE),
78
+ (this.uri = T),
79
+ (this.openTarget = o || InAppMessage.OpenTarget.NONE),
80
+ (this.dismissType = r || InAppMessage.DismissType.AUTO_DISMISS),
81
+ (this.icon = u),
82
+ (this.imageUrl = a),
83
+ (this.imageStyle = I || InAppMessage.ImageStyle.TOP),
84
+ (this.iconColor = c || InAppMessage.th.ih),
85
+ (this.iconBackgroundColor = O || InAppMessage.th.sh),
86
+ (this.backgroundColor = A || InAppMessage.th.ih),
87
+ (this.textColor = L || InAppMessage.th.hh),
88
+ (this.closeButtonColor = _ || InAppMessage.th.eh),
89
+ (this.animateIn = m),
90
+ null == this.animateIn && (this.animateIn = !0),
91
+ (this.animateOut = N),
92
+ null == this.animateOut && (this.animateOut = !0),
93
+ (this.header = R),
94
+ (this.headerAlignment = S || InAppMessage.TextAlignment.CENTER),
95
+ (this.headerTextColor = D || InAppMessage.th.hh),
96
+ (this.frameColor = M || InAppMessage.th.Eh),
97
+ (this.buttons = C || []),
98
+ (this.cropType = d || InAppMessage.CropType.FIT_CENTER),
99
+ (this.orientation = U),
100
+ (this.htmlId = b),
101
+ (this.css = P),
102
+ (this.isControl = !1),
103
+ (this.nh = !1),
104
+ (this.Th = !1),
105
+ (this.do = !1),
106
+ (this.oh = !1),
107
+ (this.Me = null),
108
+ (this.ke = null),
109
+ (this.Et = new E()),
110
+ (this.rh = new E()),
111
+ (this.Te = InAppMessage.TextAlignment.CENTER);
112
+ }
113
+ subscribeToClickedEvent(t) {
114
+ return this.Et.It(t);
115
+ }
116
+ subscribeToDismissedEvent(t) {
117
+ return this.rh.It(t);
118
+ }
119
+ removeSubscription(t) {
120
+ this.Et.removeSubscription(t), this.rh.removeSubscription(t);
121
+ }
122
+ removeAllSubscriptions() {
123
+ this.Et.removeAllSubscriptions(), this.rh.removeAllSubscriptions();
124
+ }
125
+ closeMessage() {
126
+ this.ye(this.Me);
127
+ }
128
+ xe() {
129
+ return !0;
130
+ }
131
+ io() {
132
+ return this.xe();
133
+ }
134
+ Ne() {
135
+ return null != this.htmlId && this.htmlId.length > 4;
136
+ }
137
+ Ae() {
138
+ return this.Ne() && null != this.css && this.css.length > 0;
139
+ }
140
+ Ce() {
141
+ if (this.Ne() && this.Ae()) return this.htmlId + "-css";
142
+ }
143
+ M() {
144
+ return !this.Th && ((this.Th = !0), !0);
145
+ }
146
+ so() {
147
+ return this.Th;
148
+ }
149
+ p(t) {
150
+ return !this.do && ((this.do = !0), this.Et.Dt(), !0);
151
+ }
152
+ F() {
153
+ return !this.oh && ((this.oh = !0), this.rh.Dt(), !0);
154
+ }
155
+ hide(t) {
156
+ if (t && t.parentNode) {
157
+ let s = t.closest(".ab-iam-root");
158
+ if ((null == s && (s = t), this.xe() && null != s.parentNode)) {
159
+ const t = s.parentNode.classList;
160
+ t && t.contains(InAppMessage.lh) && t.remove(InAppMessage.lh),
161
+ document.body.removeEventListener("touchmove", InAppMessage.uh);
162
+ }
163
+ s.className = s.className.replace(InAppMessage.ah, InAppMessage.Ih);
164
+ }
165
+ return this.animateOut || !1;
166
+ }
167
+ ye(t, s) {
168
+ if (null == t) return;
169
+ let i;
170
+ (this.Me = null),
171
+ (i =
172
+ -1 === t.className.indexOf("ab-in-app-message")
173
+ ? t.getElementsByClassName("ab-in-app-message")[0]
174
+ : t);
175
+ let h = !1;
176
+ i && (h = this.hide(i));
177
+ const e = document.body;
178
+ let E;
179
+ null != e && (E = e.scrollTop);
180
+ const n = () => {
181
+ if (t && t.parentNode) {
182
+ let s = t.closest(".ab-iam-root");
183
+ null == s && (s = t), s.parentNode && s.parentNode.removeChild(s);
184
+ }
185
+ const i = this.Ce();
186
+ if (null != i) {
187
+ const t = document.getElementById(i);
188
+ t && t.parentNode && t.parentNode.removeChild(t);
189
+ }
190
+ null != e && "Safari" === Q.browser && (e.scrollTop = E),
191
+ s ? s() : this.F();
192
+ };
193
+ h ? setTimeout(n, InAppMessage.Oh) : n(), this.ke && this.ke.focus();
194
+ }
195
+ Ge() {
196
+ return document.createTextNode(this.message || "");
197
+ }
198
+ Be(t) {
199
+ let s = "";
200
+ this.message || this.header || !this.xe() || (s = "Modal Image"),
201
+ t.setAttribute("alt", s);
202
+ }
203
+ static uh(t) {
204
+ if (t.targetTouches && t.targetTouches.length > 1) return;
205
+ const s = t.target;
206
+ (s &&
207
+ s.classList &&
208
+ s.classList.contains("ab-message-text") &&
209
+ s.scrollHeight > s.clientHeight) ||
210
+ (document.querySelector(`.${InAppMessage.lh}`) && t.preventDefault());
211
+ }
212
+ Ah(t) {
213
+ const s = t.parentNode;
214
+ this.xe() &&
215
+ null != s &&
216
+ this.orientation !== InAppMessage.Orientation.LANDSCAPE &&
217
+ (null != s.classList && s.classList.add(InAppMessage.lh),
218
+ document.body.addEventListener(
219
+ "touchmove",
220
+ InAppMessage.uh,
221
+ !!Tt() && { passive: !1 },
222
+ )),
223
+ (t.className += " " + InAppMessage.ah);
224
+ }
225
+ static Lh(t) {
226
+ if (
227
+ t.keyCode === at._h &&
228
+ !e.nn(L.mh) &&
229
+ document.querySelectorAll(".ab-modal-interactions").length > 0
230
+ ) {
231
+ const t = document.getElementsByClassName("ab-html-message");
232
+ let s = !1;
233
+ for (const i of t) {
234
+ let t = null;
235
+ It(i) &&
236
+ i.contentWindow &&
237
+ (t = i.contentWindow.document.getElementsByClassName(
238
+ "ab-programmatic-close-button",
239
+ )[0]),
240
+ null != t && (Et(t), (s = !0));
241
+ }
242
+ if (!s) {
243
+ const t = document.querySelectorAll(
244
+ ".ab-modal-interactions > .ab-close-button",
245
+ )[0];
246
+ null != t && Et(t);
247
+ }
248
+ }
249
+ }
250
+ Nh() {
251
+ this.nh ||
252
+ e.nn(L.mh) ||
253
+ (document.addEventListener("keydown", InAppMessage.Lh, !1),
254
+ e.Rh(() => {
255
+ document.removeEventListener("keydown", InAppMessage.Lh);
256
+ }),
257
+ (this.nh = !0));
258
+ }
259
+ tt(t) {
260
+ const s = {};
261
+ return t
262
+ ? ((s[InAppMessage.it.ea] = this.message),
263
+ (s[InAppMessage.it.ra] = this.messageAlignment),
264
+ (s[InAppMessage.it.Sh] = this.slideFrom),
265
+ (s[InAppMessage.it.jt] = this.extras),
266
+ (s[InAppMessage.it.sa] = this.triggerId),
267
+ (s[InAppMessage.it.ta] = this.clickAction),
268
+ (s[InAppMessage.it.URI] = this.uri),
269
+ (s[InAppMessage.it.ia] = this.openTarget),
270
+ (s[InAppMessage.it.oa] = this.dismissType),
271
+ (s[InAppMessage.it.pa] = this.duration),
272
+ (s[InAppMessage.it.ma] = this.icon),
273
+ (s[InAppMessage.it.nt] = this.imageUrl),
274
+ (s[InAppMessage.it.na] = this.imageStyle),
275
+ (s[InAppMessage.it.ua] = this.iconColor),
276
+ (s[InAppMessage.it.ca] = this.iconBackgroundColor),
277
+ (s[InAppMessage.it.fa] = this.backgroundColor),
278
+ (s[InAppMessage.it.da] = this.textColor),
279
+ (s[InAppMessage.it.la] = this.closeButtonColor),
280
+ (s[InAppMessage.it.ga] = this.animateIn),
281
+ (s[InAppMessage.it.ja] = this.animateOut),
282
+ (s[InAppMessage.it.xa] = this.header),
283
+ (s[InAppMessage.it.za] = this.headerAlignment),
284
+ (s[InAppMessage.it.ha] = this.headerTextColor),
285
+ (s[InAppMessage.it.va] = this.frameColor),
286
+ (s[InAppMessage.it.wa] = this.buttons),
287
+ (s[InAppMessage.it.ya] = this.cropType),
288
+ (s[InAppMessage.it.Sa] = this.orientation),
289
+ (s[InAppMessage.it.ba] = this.htmlId),
290
+ (s[InAppMessage.it.CSS] = this.css),
291
+ (s[InAppMessage.it.st] = t),
292
+ s)
293
+ : s;
294
+ }
295
+ }
296
+ (InAppMessage.th = {
297
+ hh: 4281545523,
298
+ ih: 4294967295,
299
+ sh: 4278219733,
300
+ Dh: 4293914607,
301
+ Mh: 4283782485,
302
+ Eh: 3224580915,
303
+ eh: 4288387995,
304
+ }),
305
+ (InAppMessage.Ie = {
306
+ Ch: "hd",
307
+ Le: "ias",
308
+ dh: "of",
309
+ Uh: "do",
310
+ Xr: "umt",
311
+ Qr: "tf",
312
+ bh: "te",
313
+ }),
314
+ (InAppMessage.SlideFrom = { TOP: "TOP", BOTTOM: "BOTTOM" }),
315
+ (InAppMessage.ClickAction = {
316
+ NEWS_FEED: "NEWS_FEED",
317
+ URI: "URI",
318
+ NONE: "NONE",
319
+ }),
320
+ (InAppMessage.DismissType = {
321
+ AUTO_DISMISS: "AUTO_DISMISS",
322
+ MANUAL: "SWIPE",
323
+ }),
324
+ (InAppMessage.OpenTarget = { NONE: "NONE", BLANK: "BLANK" }),
325
+ (InAppMessage.ImageStyle = { TOP: "TOP", GRAPHIC: "GRAPHIC" }),
326
+ (InAppMessage.Orientation = { PORTRAIT: "PORTRAIT", LANDSCAPE: "LANDSCAPE" }),
327
+ (InAppMessage.TextAlignment = {
328
+ START: "START",
329
+ CENTER: "CENTER",
330
+ END: "END",
331
+ }),
332
+ (InAppMessage.CropType = {
333
+ CENTER_CROP: "CENTER_CROP",
334
+ FIT_CENTER: "FIT_CENTER",
335
+ }),
336
+ (InAppMessage.qe = {
337
+ pn: "SLIDEUP",
338
+ un: "MODAL",
339
+ Se: "MODAL_STYLED",
340
+ on: "FULL",
341
+ ln: "WEB_HTML",
342
+ Ee: "HTML",
343
+ Ue: "HTML_FULL",
344
+ }),
345
+ (InAppMessage.Oh = 500),
346
+ (InAppMessage.Ph = 200),
347
+ (InAppMessage.ah = "ab-show"),
348
+ (InAppMessage.Ih = "ab-hide"),
349
+ (InAppMessage.lh = "ab-pause-scrolling"),
350
+ (InAppMessage.it = {
351
+ ea: "m",
352
+ ra: "ma",
353
+ Sh: "sf",
354
+ jt: "e",
355
+ sa: "ti",
356
+ ta: "ca",
357
+ URI: "u",
358
+ ia: "oa",
359
+ oa: "dt",
360
+ pa: "d",
361
+ ma: "i",
362
+ nt: "iu",
363
+ na: "is",
364
+ ua: "ic",
365
+ ca: "ibc",
366
+ fa: "bc",
367
+ da: "tc",
368
+ la: "cbc",
369
+ ga: "ai",
370
+ ja: "ao",
371
+ xa: "h",
372
+ za: "ha",
373
+ ha: "htc",
374
+ va: "fc",
375
+ wa: "b",
376
+ ya: "ct",
377
+ Sa: "o",
378
+ ba: "hi",
379
+ CSS: "css",
380
+ st: "type",
381
+ vo: "messageFields",
382
+ });
@@ -1 +1,101 @@
1
- import{buttonsFromSerializedInAppMessage as pe}from"../in-app-message-factory.js";import InAppMessage from"./in-app-message.js";export default class ModalMessage extends InAppMessage{constructor(e,r,s,t,i,o,a,p,m,n,u,c,d,f,l,g,j,v,x,z,h,w,y,S,b,k,q){super(e,r,void 0,s,t,i,o,a,p=p||InAppMessage.DismissType.MANUAL,m,n,u,c,d,f,l,g,j,v,x,z,h,w,y,S,b=b||InAppMessage.CropType.FIT_CENTER,void 0,k,q),this.Te=InAppMessage.TextAlignment.CENTER}ss(){return super.ss(ModalMessage.es)}static an(e){return new ModalMessage(e[InAppMessage.hs.ea],e[InAppMessage.hs.ra],e[InAppMessage.hs.xs],e[InAppMessage.hs.sa],e[InAppMessage.hs.ta],e[InAppMessage.hs.URI],e[InAppMessage.hs.ia],e[InAppMessage.hs.oa],e[InAppMessage.hs.pa],e[InAppMessage.hs.ma],e[InAppMessage.hs.os],e[InAppMessage.hs.na],e[InAppMessage.hs.ua],e[InAppMessage.hs.ca],e[InAppMessage.hs.fa],e[InAppMessage.hs.da],e[InAppMessage.hs.la],e[InAppMessage.hs.ga],e[InAppMessage.hs.ja],e[InAppMessage.hs.xa],e[InAppMessage.hs.za],e[InAppMessage.hs.ha],e[InAppMessage.hs.va],pe(e[InAppMessage.hs.wa]),e[InAppMessage.hs.ya],e[InAppMessage.hs.ba],e[InAppMessage.hs.CSS])}}ModalMessage.es=InAppMessage.qe.un;
1
+ import { buttonsFromSerializedInAppMessage as pe } from "../in-app-message-factory.js";
2
+ import InAppMessage from "./in-app-message.js";
3
+ export default class ModalMessage extends InAppMessage {
4
+ constructor(
5
+ e,
6
+ r,
7
+ s,
8
+ t,
9
+ i,
10
+ o,
11
+ a,
12
+ p,
13
+ m,
14
+ n,
15
+ u,
16
+ c,
17
+ d,
18
+ f,
19
+ l,
20
+ g,
21
+ j,
22
+ v,
23
+ x,
24
+ z,
25
+ h,
26
+ w,
27
+ y,
28
+ S,
29
+ b,
30
+ k,
31
+ q,
32
+ ) {
33
+ super(
34
+ e,
35
+ r,
36
+ void 0,
37
+ s,
38
+ t,
39
+ i,
40
+ o,
41
+ a,
42
+ (p = p || InAppMessage.DismissType.MANUAL),
43
+ m,
44
+ n,
45
+ u,
46
+ c,
47
+ d,
48
+ f,
49
+ l,
50
+ g,
51
+ j,
52
+ v,
53
+ x,
54
+ z,
55
+ h,
56
+ w,
57
+ y,
58
+ S,
59
+ (b = b || InAppMessage.CropType.FIT_CENTER),
60
+ void 0,
61
+ k,
62
+ q,
63
+ ),
64
+ (this.Te = InAppMessage.TextAlignment.CENTER);
65
+ }
66
+ tt() {
67
+ return super.tt(ModalMessage.et);
68
+ }
69
+ static an(e) {
70
+ return new ModalMessage(
71
+ e[InAppMessage.it.ea],
72
+ e[InAppMessage.it.ra],
73
+ e[InAppMessage.it.jt],
74
+ e[InAppMessage.it.sa],
75
+ e[InAppMessage.it.ta],
76
+ e[InAppMessage.it.URI],
77
+ e[InAppMessage.it.ia],
78
+ e[InAppMessage.it.oa],
79
+ e[InAppMessage.it.pa],
80
+ e[InAppMessage.it.ma],
81
+ e[InAppMessage.it.nt],
82
+ e[InAppMessage.it.na],
83
+ e[InAppMessage.it.ua],
84
+ e[InAppMessage.it.ca],
85
+ e[InAppMessage.it.fa],
86
+ e[InAppMessage.it.da],
87
+ e[InAppMessage.it.la],
88
+ e[InAppMessage.it.ga],
89
+ e[InAppMessage.it.ja],
90
+ e[InAppMessage.it.xa],
91
+ e[InAppMessage.it.za],
92
+ e[InAppMessage.it.ha],
93
+ e[InAppMessage.it.va],
94
+ pe(e[InAppMessage.it.wa]),
95
+ e[InAppMessage.it.ya],
96
+ e[InAppMessage.it.ba],
97
+ e[InAppMessage.it.CSS],
98
+ );
99
+ }
100
+ }
101
+ ModalMessage.et = InAppMessage.qe.un;
@@ -1 +1,84 @@
1
- import InAppMessage from"./in-app-message.js";import{DOMUtils as ue}from"../../util/dom-utils.js";export default class SlideUpMessage extends InAppMessage{constructor(e,t,s,o,i,r,n,d,a,u,p,m,c,l,v,x,f,h,g,I,M){x=x||InAppMessage.th.Mh,v=v||InAppMessage.th.Dh,super(e,t=t||InAppMessage.TextAlignment.START,s,o,i,r,n,d,a,u,p,m,void 0,c,l,v,x,f,h,g,void 0,void 0,void 0,void 0,void 0,void 0,void 0,I,M),this.Te=InAppMessage.TextAlignment.START}xe(){return!1}Ge(){const e=document.createElement("span");return e.appendChild(document.createTextNode(this.message||"")),e}Ah(e){const t=e.getElementsByClassName("ab-in-app-message")[0];ue.no(t,!0,!0)||(this.slideFrom===InAppMessage.SlideFrom.TOP?t.style.top="0px":t.style.bottom="0px"),super.Ah(e)}ss(){return super.ss(SlideUpMessage.es)}static an(e){return new SlideUpMessage(e[InAppMessage.hs.ea],e[InAppMessage.hs.ra],e[InAppMessage.hs.Sh],e[InAppMessage.hs.xs],e[InAppMessage.hs.sa],e[InAppMessage.hs.ta],e[InAppMessage.hs.URI],e[InAppMessage.hs.ia],e[InAppMessage.hs.oa],e[InAppMessage.hs.pa],e[InAppMessage.hs.ma],e[InAppMessage.hs.os],e[InAppMessage.hs.ua],e[InAppMessage.hs.ca],e[InAppMessage.hs.fa],e[InAppMessage.hs.da],e[InAppMessage.hs.la],e[InAppMessage.hs.ga],e[InAppMessage.hs.ja],e[InAppMessage.hs.ba],e[InAppMessage.hs.CSS])}}SlideUpMessage.es=InAppMessage.qe.pn;
1
+ import InAppMessage from "./in-app-message.js";
2
+ import { DOMUtils as de } from "../../util/dom-utils.js";
3
+ export default class SlideUpMessage extends InAppMessage {
4
+ constructor(e, t, s, o, i, r, n, d, a, u, p, m, c, l, v, x, f, h, g, I, M) {
5
+ (x = x || InAppMessage.th.Mh),
6
+ (v = v || InAppMessage.th.Dh),
7
+ super(
8
+ e,
9
+ (t = t || InAppMessage.TextAlignment.START),
10
+ s,
11
+ o,
12
+ i,
13
+ r,
14
+ n,
15
+ d,
16
+ a,
17
+ u,
18
+ p,
19
+ m,
20
+ void 0,
21
+ c,
22
+ l,
23
+ v,
24
+ x,
25
+ f,
26
+ h,
27
+ g,
28
+ void 0,
29
+ void 0,
30
+ void 0,
31
+ void 0,
32
+ void 0,
33
+ void 0,
34
+ void 0,
35
+ I,
36
+ M,
37
+ ),
38
+ (this.Te = InAppMessage.TextAlignment.START);
39
+ }
40
+ xe() {
41
+ return !1;
42
+ }
43
+ Ge() {
44
+ const e = document.createElement("span");
45
+ return e.appendChild(document.createTextNode(this.message || "")), e;
46
+ }
47
+ Ah(e) {
48
+ const t = e.getElementsByClassName("ab-in-app-message")[0];
49
+ de.no(t, !0, !0) ||
50
+ (this.slideFrom === InAppMessage.SlideFrom.TOP
51
+ ? (t.style.top = "0px")
52
+ : (t.style.bottom = "0px")),
53
+ super.Ah(e);
54
+ }
55
+ tt() {
56
+ return super.tt(SlideUpMessage.et);
57
+ }
58
+ static an(e) {
59
+ return new SlideUpMessage(
60
+ e[InAppMessage.it.ea],
61
+ e[InAppMessage.it.ra],
62
+ e[InAppMessage.it.Sh],
63
+ e[InAppMessage.it.jt],
64
+ e[InAppMessage.it.sa],
65
+ e[InAppMessage.it.ta],
66
+ e[InAppMessage.it.URI],
67
+ e[InAppMessage.it.ia],
68
+ e[InAppMessage.it.oa],
69
+ e[InAppMessage.it.pa],
70
+ e[InAppMessage.it.ma],
71
+ e[InAppMessage.it.nt],
72
+ e[InAppMessage.it.ua],
73
+ e[InAppMessage.it.ca],
74
+ e[InAppMessage.it.fa],
75
+ e[InAppMessage.it.da],
76
+ e[InAppMessage.it.la],
77
+ e[InAppMessage.it.ga],
78
+ e[InAppMessage.it.ja],
79
+ e[InAppMessage.it.ba],
80
+ e[InAppMessage.it.CSS],
81
+ );
82
+ }
83
+ }
84
+ SlideUpMessage.et = InAppMessage.qe.pn;