@adobe/alloy 2.32.1-beta.1 → 2.33.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 (264) hide show
  1. package/components.json +7 -2
  2. package/dist/alloy.js +11283 -11142
  3. package/dist/alloy.min.js +1 -1
  4. package/dist/alloyServiceWorker.js +1 -1
  5. package/dist/types/{core → browser}/src/components/Advertising/constants/index.d.ts +3 -0
  6. package/dist/types/{core → browser}/src/components/Advertising/handlers/createOnBeforeSendEventHandler.d.ts +4 -1
  7. package/dist/types/{core → browser}/src/components/Advertising/handlers/sendAdConversion.d.ts +3 -1
  8. package/dist/types/{core → browser}/src/components/Advertising/handlers/viewThroughHandler.d.ts +3 -1
  9. package/dist/types/{core → browser}/src/components/Advertising/identities/collectAllIdentities.d.ts +1 -1
  10. package/dist/types/browser/src/components/Advertising/identities/collectSurferId.d.ts +15 -0
  11. package/dist/types/browser/src/components/Advertising/identities/createHashedIpHandler.d.ts +9 -0
  12. package/dist/types/browser/src/components/Advertising/identities/initiateAdvertisingIdentityCall.d.ts +5 -0
  13. package/dist/types/{core → browser}/src/components/Advertising/utils/helpers.d.ts +14 -0
  14. package/dist/types/browser/src/components/Advertising/utils/murmurHash128GuavaHex.d.ts +2 -0
  15. package/dist/types/browser/src/components/Personalization/constants/surface.d.ts +4 -0
  16. package/dist/types/browser/src/components/Personalization/dom-actions/dom/isDomElement.d.ts +2 -0
  17. package/dist/types/browser/src/components/Personalization/utils/addRenderAttemptedToDecisions.d.ts +5 -0
  18. package/dist/types/browser/src/components/Personalization/utils/surfaceUtils.d.ts +3 -0
  19. package/dist/types/{core → browser}/src/components/PushNotifications/helpers/saveToIndexedDb.d.ts +1 -1
  20. package/dist/types/{core → browser}/src/components/PushNotifications/index.d.ts +6 -6
  21. package/dist/types/{core → browser}/src/components/PushNotifications/request/createSendPushSubscriptionPayload.d.ts +2 -2
  22. package/dist/types/browser/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +6 -0
  23. package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.d.ts +6 -6
  24. package/dist/types/{core → browser}/src/components/PushNotifications/types.d.ts +1 -1
  25. package/dist/types/browser/src/components/componentCreators.d.ts +3 -0
  26. package/dist/types/browser/src/components/requiredComponentCreators.d.ts +1 -0
  27. package/dist/types/core/src/components/Identity/injectAddQueryStringIdentityToPayload.d.ts +2 -1
  28. package/dist/types/core/src/core/componentCreators.d.ts +0 -3
  29. package/dist/types/core/src/core/requiredComponentCreators.d.ts +0 -1
  30. package/dist/types/core/src/types.d.ts +0 -4
  31. package/package.json +2 -2
  32. package/src/components/Advertising/configValidators.js +32 -0
  33. package/src/components/Advertising/constants/index.js +80 -0
  34. package/src/components/Advertising/createComponent.js +24 -0
  35. package/src/components/Advertising/handlers/clickThroughHandler.js +94 -0
  36. package/src/components/Advertising/handlers/createAdConversionHandler.js +50 -0
  37. package/src/components/Advertising/handlers/createOnBeforeSendEventHandler.js +177 -0
  38. package/src/components/Advertising/handlers/sendAdConversion.js +74 -0
  39. package/src/components/Advertising/handlers/viewThroughHandler.js +107 -0
  40. package/src/components/Advertising/identities/collectAllIdentities.js +57 -0
  41. package/src/components/Advertising/identities/collectID5Id.js +133 -0
  42. package/src/components/Advertising/identities/collectRampId.js +265 -0
  43. package/src/components/Advertising/identities/collectSurferId.js +72 -0
  44. package/src/components/Advertising/identities/createHashedIpHandler.js +36 -0
  45. package/src/components/Advertising/identities/initiateAdvertisingIdentityCall.js +153 -0
  46. package/src/components/Advertising/index.js +109 -0
  47. package/src/components/Advertising/utils/advertisingCookieManager.js +92 -0
  48. package/src/components/Advertising/utils/helpers.js +190 -0
  49. package/src/components/Advertising/utils/murmurHash128GuavaHex.js +195 -0
  50. package/src/components/Context/createComponent.js +35 -0
  51. package/src/components/Context/implementationDetails.js +23 -0
  52. package/src/components/Context/index.js +56 -0
  53. package/src/components/Context/injectDevice.js +77 -0
  54. package/src/components/Context/injectEnvironment.js +38 -0
  55. package/src/components/Context/injectHighEntropyUserAgentHints.js +55 -0
  56. package/src/components/Context/injectOneTimeAnalyticsReferrer.js +61 -0
  57. package/src/components/Context/injectPlaceContext.js +38 -0
  58. package/src/components/Context/injectWeb.js +26 -0
  59. package/src/components/Personalization/constants/loggerMessage.js +14 -0
  60. package/src/components/Personalization/constants/scopeType.js +15 -0
  61. package/src/components/Personalization/constants/surface.js +16 -0
  62. package/src/components/Personalization/createApplyPropositions.js +136 -0
  63. package/src/components/Personalization/createClickStorage.js +56 -0
  64. package/src/components/Personalization/createComponent.js +133 -0
  65. package/src/components/Personalization/createFetchDataHandler.js +149 -0
  66. package/src/components/Personalization/createGetPageLocation.js +16 -0
  67. package/src/components/Personalization/createHandleConsentFlicker.js +22 -0
  68. package/src/components/Personalization/createInteractionStorage.js +104 -0
  69. package/src/components/Personalization/createNotificationHandler.js +49 -0
  70. package/src/components/Personalization/createOnClickHandler.js +102 -0
  71. package/src/components/Personalization/createOnDecisionHandler.js +98 -0
  72. package/src/components/Personalization/createPersonalizationDetails.js +138 -0
  73. package/src/components/Personalization/createSetTargetMigration.js +22 -0
  74. package/src/components/Personalization/createViewCacheManager.js +101 -0
  75. package/src/components/Personalization/createViewChangeHandler.js +53 -0
  76. package/src/components/Personalization/dom-actions/action.js +97 -0
  77. package/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +37 -0
  78. package/src/components/Personalization/dom-actions/appendHtml.js +42 -0
  79. package/src/components/Personalization/dom-actions/clicks/collectClicks.js +89 -0
  80. package/src/components/Personalization/dom-actions/clicks/collectInteractions.js +113 -0
  81. package/src/components/Personalization/dom-actions/collectInteractions.js +15 -0
  82. package/src/components/Personalization/dom-actions/createPreprocess.js +21 -0
  83. package/src/components/Personalization/dom-actions/createRedirect.js +23 -0
  84. package/src/components/Personalization/dom-actions/dom/createFragment.js +18 -0
  85. package/src/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
  86. package/src/components/Personalization/dom-actions/dom/getChildNodes.js +23 -0
  87. package/src/components/Personalization/dom-actions/dom/getChildren.js +23 -0
  88. package/src/components/Personalization/dom-actions/dom/getElementById.js +21 -0
  89. package/src/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
  90. package/src/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
  91. package/src/components/Personalization/dom-actions/dom/getNonce.js +33 -0
  92. package/src/components/Personalization/dom-actions/dom/getParent.js +15 -0
  93. package/src/components/Personalization/dom-actions/dom/helperForEq.js +22 -0
  94. package/src/components/Personalization/dom-actions/dom/index.js +26 -0
  95. package/src/components/Personalization/dom-actions/dom/insertAfter.js +26 -0
  96. package/src/components/Personalization/dom-actions/dom/insertBefore.js +25 -0
  97. package/src/components/Personalization/dom-actions/dom/isDomElement.js +13 -0
  98. package/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
  99. package/src/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
  100. package/src/components/Personalization/dom-actions/dom/selectNodesWithEq.js +101 -0
  101. package/src/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
  102. package/src/components/Personalization/dom-actions/dom/setStyle.js +23 -0
  103. package/src/components/Personalization/dom-actions/dom/util.js +17 -0
  104. package/src/components/Personalization/dom-actions/images.js +34 -0
  105. package/src/components/Personalization/dom-actions/index.js +13 -0
  106. package/src/components/Personalization/dom-actions/initDomActionsModules.js +67 -0
  107. package/src/components/Personalization/dom-actions/insertHtmlAfter.js +43 -0
  108. package/src/components/Personalization/dom-actions/insertHtmlBefore.js +40 -0
  109. package/src/components/Personalization/dom-actions/move.js +28 -0
  110. package/src/components/Personalization/dom-actions/prependHtml.js +60 -0
  111. package/src/components/Personalization/dom-actions/rearrangeChildren.js +34 -0
  112. package/src/components/Personalization/dom-actions/remapCustomCodeOffers.js +33 -0
  113. package/src/components/Personalization/dom-actions/remapHeadOffers.js +63 -0
  114. package/src/components/Personalization/dom-actions/replaceHtml.js +20 -0
  115. package/src/components/Personalization/dom-actions/resize.js +28 -0
  116. package/src/components/Personalization/dom-actions/scripts.js +106 -0
  117. package/src/components/Personalization/dom-actions/setAttributes.js +21 -0
  118. package/src/components/Personalization/dom-actions/setHtml.js +27 -0
  119. package/src/components/Personalization/dom-actions/setStyles.js +23 -0
  120. package/src/components/Personalization/dom-actions/setText.js +16 -0
  121. package/src/components/Personalization/dom-actions/swapImage.js +32 -0
  122. package/src/components/Personalization/flicker/index.js +106 -0
  123. package/src/components/Personalization/handlers/createDecorateProposition.js +100 -0
  124. package/src/components/Personalization/handlers/createProcessDomAction.js +79 -0
  125. package/src/components/Personalization/handlers/createProcessHtmlContent.js +60 -0
  126. package/src/components/Personalization/handlers/createProcessInAppMessage.js +91 -0
  127. package/src/components/Personalization/handlers/createProcessPropositions.js +228 -0
  128. package/src/components/Personalization/handlers/createProcessRedirect.js +54 -0
  129. package/src/components/Personalization/handlers/createRenderStatusHandler.js +62 -0
  130. package/src/components/Personalization/handlers/injectCreateProposition.js +121 -0
  131. package/src/components/Personalization/handlers/processDefaultContent.js +20 -0
  132. package/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +309 -0
  133. package/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +18 -0
  134. package/src/components/Personalization/in-app-message-actions/utils.js +55 -0
  135. package/src/components/Personalization/index.js +223 -0
  136. package/src/components/Personalization/utils/addRenderAttemptedToDecisions.js +15 -0
  137. package/src/components/Personalization/utils/createAsyncArray.js +37 -0
  138. package/src/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
  139. package/src/components/Personalization/utils/metaUtils.js +27 -0
  140. package/src/components/Personalization/utils/surfaceUtils.js +120 -0
  141. package/src/components/Personalization/validateApplyPropositionsOptions.js +56 -0
  142. package/src/components/PushNotifications/helpers/constants.js +16 -0
  143. package/src/components/PushNotifications/helpers/getPushSubscriptionDetails.js +122 -0
  144. package/src/components/PushNotifications/helpers/readFromIndexedDb.js +50 -0
  145. package/src/components/PushNotifications/helpers/saveToIndexedDb.js +64 -0
  146. package/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.js +84 -0
  147. package/src/components/PushNotifications/helpers/serviceWorkerPushListener.js +72 -0
  148. package/src/components/PushNotifications/index.js +128 -0
  149. package/src/components/PushNotifications/request/createSendPushSubscriptionPayload.js +66 -0
  150. package/src/components/PushNotifications/request/createSendPushSubscriptionRequest.js +35 -0
  151. package/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +98 -0
  152. package/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.js +154 -0
  153. package/src/components/PushNotifications/types.js +104 -0
  154. package/src/components/componentCreators.js +3 -0
  155. package/src/components/requiredComponentCreators.js +13 -0
  156. package/src/createEventListeners.js +81 -0
  157. package/src/index.js +5 -1
  158. package/src/serviceWorker.js +2 -2
  159. package/dist/types/core/src/components/Advertising/identities/collectSurferId.d.ts +0 -2
  160. package/dist/types/core/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +0 -6
  161. /package/dist/types/{core → browser}/src/components/Advertising/configValidators.d.ts +0 -0
  162. /package/dist/types/{core → browser}/src/components/Advertising/createComponent.d.ts +0 -0
  163. /package/dist/types/{core → browser}/src/components/Advertising/handlers/clickThroughHandler.d.ts +0 -0
  164. /package/dist/types/{core → browser}/src/components/Advertising/handlers/createAdConversionHandler.d.ts +0 -0
  165. /package/dist/types/{core → browser}/src/components/Advertising/identities/collectID5Id.d.ts +0 -0
  166. /package/dist/types/{core → browser}/src/components/Advertising/identities/collectRampId.d.ts +0 -0
  167. /package/dist/types/{core → browser}/src/components/Advertising/index.d.ts +0 -0
  168. /package/dist/types/{core → browser}/src/components/Advertising/utils/advertisingCookieManager.d.ts +0 -0
  169. /package/dist/types/{core → browser}/src/components/Context/createComponent.d.ts +0 -0
  170. /package/dist/types/{core → browser}/src/components/Context/implementationDetails.d.ts +0 -0
  171. /package/dist/types/{core → browser}/src/components/Context/index.d.ts +0 -0
  172. /package/dist/types/{core → browser}/src/components/Context/injectDevice.d.ts +0 -0
  173. /package/dist/types/{core → browser}/src/components/Context/injectEnvironment.d.ts +0 -0
  174. /package/dist/types/{core → browser}/src/components/Context/injectHighEntropyUserAgentHints.d.ts +0 -0
  175. /package/dist/types/{core → browser}/src/components/Context/injectOneTimeAnalyticsReferrer.d.ts +0 -0
  176. /package/dist/types/{core → browser}/src/components/Context/injectPlaceContext.d.ts +0 -0
  177. /package/dist/types/{core → browser}/src/components/Context/injectWeb.d.ts +0 -0
  178. /package/dist/types/{core → browser}/src/components/Personalization/constants/loggerMessage.d.ts +0 -0
  179. /package/dist/types/{core → browser}/src/components/Personalization/constants/scopeType.d.ts +0 -0
  180. /package/dist/types/{core → browser}/src/components/Personalization/createApplyPropositions.d.ts +0 -0
  181. /package/dist/types/{core → browser}/src/components/Personalization/createClickStorage.d.ts +0 -0
  182. /package/dist/types/{core → browser}/src/components/Personalization/createComponent.d.ts +0 -0
  183. /package/dist/types/{core → browser}/src/components/Personalization/createFetchDataHandler.d.ts +0 -0
  184. /package/dist/types/{core → browser}/src/components/Personalization/createGetPageLocation.d.ts +0 -0
  185. /package/dist/types/{core → browser}/src/components/Personalization/createHandleConsentFlicker.d.ts +0 -0
  186. /package/dist/types/{core → browser}/src/components/Personalization/createInteractionStorage.d.ts +0 -0
  187. /package/dist/types/{core → browser}/src/components/Personalization/createNotificationHandler.d.ts +0 -0
  188. /package/dist/types/{core → browser}/src/components/Personalization/createOnClickHandler.d.ts +0 -0
  189. /package/dist/types/{core → browser}/src/components/Personalization/createOnDecisionHandler.d.ts +0 -0
  190. /package/dist/types/{core → browser}/src/components/Personalization/createPersonalizationDetails.d.ts +0 -0
  191. /package/dist/types/{core → browser}/src/components/Personalization/createSetTargetMigration.d.ts +0 -0
  192. /package/dist/types/{core → browser}/src/components/Personalization/createViewCacheManager.d.ts +0 -0
  193. /package/dist/types/{core → browser}/src/components/Personalization/createViewChangeHandler.d.ts +0 -0
  194. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/action.d.ts +0 -0
  195. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.d.ts +0 -0
  196. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/appendHtml.d.ts +0 -0
  197. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectClicks.d.ts +0 -0
  198. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectInteractions.d.ts +0 -0
  199. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/collectInteractions.d.ts +0 -0
  200. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createPreprocess.d.ts +0 -0
  201. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createRedirect.d.ts +0 -0
  202. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/createFragment.d.ts +0 -0
  203. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getAttribute.d.ts +0 -0
  204. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildNodes.d.ts +0 -0
  205. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildren.d.ts +0 -0
  206. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getElementById.d.ts +0 -0
  207. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getFirstChild.d.ts +0 -0
  208. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNextSibling.d.ts +0 -0
  209. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNonce.d.ts +0 -0
  210. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getParent.d.ts +0 -0
  211. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/helperForEq.d.ts +0 -0
  212. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/index.d.ts +0 -0
  213. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertAfter.d.ts +0 -0
  214. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertBefore.d.ts +0 -0
  215. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.d.ts +0 -0
  216. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/removeAttribute.d.ts +0 -0
  217. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/selectNodesWithEq.d.ts +0 -0
  218. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setAttribute.d.ts +0 -0
  219. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setStyle.d.ts +0 -0
  220. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/util.d.ts +0 -0
  221. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/images.d.ts +0 -0
  222. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/index.d.ts +0 -0
  223. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/initDomActionsModules.d.ts +0 -0
  224. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlAfter.d.ts +0 -0
  225. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlBefore.d.ts +0 -0
  226. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/move.d.ts +0 -0
  227. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/prependHtml.d.ts +0 -0
  228. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/rearrangeChildren.d.ts +0 -0
  229. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapCustomCodeOffers.d.ts +0 -0
  230. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapHeadOffers.d.ts +0 -0
  231. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/replaceHtml.d.ts +0 -0
  232. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/resize.d.ts +0 -0
  233. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/scripts.d.ts +0 -0
  234. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setAttributes.d.ts +0 -0
  235. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setHtml.d.ts +0 -0
  236. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setStyles.d.ts +0 -0
  237. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setText.d.ts +0 -0
  238. /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/swapImage.d.ts +0 -0
  239. /package/dist/types/{core → browser}/src/components/Personalization/flicker/index.d.ts +0 -0
  240. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createDecorateProposition.d.ts +0 -0
  241. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessDomAction.d.ts +0 -0
  242. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessHtmlContent.d.ts +0 -0
  243. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessInAppMessage.d.ts +0 -0
  244. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessPropositions.d.ts +0 -0
  245. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessRedirect.d.ts +0 -0
  246. /package/dist/types/{core → browser}/src/components/Personalization/handlers/createRenderStatusHandler.d.ts +0 -0
  247. /package/dist/types/{core → browser}/src/components/Personalization/handlers/injectCreateProposition.d.ts +0 -0
  248. /package/dist/types/{core → browser}/src/components/Personalization/handlers/processDefaultContent.d.ts +0 -0
  249. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.d.ts +0 -0
  250. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.d.ts +0 -0
  251. /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/utils.d.ts +0 -0
  252. /package/dist/types/{core → browser}/src/components/Personalization/index.d.ts +0 -0
  253. /package/dist/types/{core → browser}/src/components/Personalization/utils/createAsyncArray.d.ts +0 -0
  254. /package/dist/types/{core → browser}/src/components/Personalization/utils/isAuthoringModeEnabled.d.ts +0 -0
  255. /package/dist/types/{core → browser}/src/components/Personalization/utils/metaUtils.d.ts +0 -0
  256. /package/dist/types/{core → browser}/src/components/Personalization/validateApplyPropositionsOptions.d.ts +0 -0
  257. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/constants.d.ts +0 -0
  258. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/getPushSubscriptionDetails.d.ts +0 -0
  259. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/readFromIndexedDb.d.ts +0 -0
  260. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.d.ts +0 -0
  261. /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerPushListener.d.ts +0 -0
  262. /package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.d.ts +0 -0
  263. /package/dist/types/{core → browser}/src/createEventListeners.d.ts +0 -0
  264. /package/dist/types/core/src/{components/Context → utils}/injectTimestamp.d.ts +0 -0
@@ -0,0 +1,177 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { SURFER_ID, HASHED_IP, ID5_ID, RAMP_ID } from "../constants/index.js";
14
+ import { AUTO, WAIT } from "@adobe/alloy-core/constants/consentStatus.js";
15
+ import { CHROME } from "@adobe/alloy-core/constants/browser.js";
16
+
17
+ const isAdvertisingDisabled = (advertising) => {
18
+ return ![AUTO, WAIT].includes(
19
+ advertising?.handleAdvertisingData?.toLowerCase(),
20
+ );
21
+ };
22
+
23
+ const waitForAdvertisingId = (advertising) => {
24
+ return advertising?.handleAdvertisingData?.toLowerCase() === WAIT;
25
+ };
26
+
27
+ /**
28
+ * Creates an onBeforeSendEvent handler that appends advertising IDs to events.
29
+ *
30
+ * @param {Object} dependencies
31
+ * @param {Object} dependencies.cookieManager
32
+ * @param {Object} dependencies.logger
33
+ * @param {Object} dependencies.componentConfig
34
+ * @param {Function} dependencies.getBrowser
35
+ * @param {Object} dependencies.consent
36
+ * @param {Function} dependencies.collectSurferId - factory-created, already bound to cookieManager/getBrowser
37
+ * @param {Function} dependencies.getID5Id
38
+ * @param {Function} dependencies.getRampId
39
+ * @param {Function} dependencies.appendAdvertisingIdQueryToEvent
40
+ * @param {Function} dependencies.appendAdCloudIdentityToEvent
41
+ * @param {Function} dependencies.collectHashedIPAddr
42
+ * @param {Function} dependencies.getUrlParams
43
+ * @param {Function} dependencies.isThrottled
44
+ * @param {Function} dependencies.normalizeAdvertiser
45
+ */
46
+ export default ({
47
+ cookieManager,
48
+ logger,
49
+ componentConfig,
50
+ getBrowser,
51
+ consent,
52
+ collectSurferId,
53
+ getID5Id,
54
+ getRampId,
55
+ appendAdvertisingIdQueryToEvent,
56
+ appendAdCloudIdentityToEvent,
57
+ collectHashedIPAddr,
58
+ getUrlParams,
59
+ isThrottled,
60
+ normalizeAdvertiser,
61
+ }) => {
62
+ /**
63
+ * Appends advertising identity IDs to AEP event query if not already added.
64
+ *
65
+ * @param {Object} options
66
+ * @param {Object} options.event
67
+ * @param {Object} [options.advertising={}]
68
+ * @returns {Promise<void>}
69
+ */
70
+ return async ({ event, advertising = {} }) => {
71
+ const { state } = consent.current();
72
+ if (state !== "in") {
73
+ return;
74
+ }
75
+ const { skwcid, efid } = getUrlParams();
76
+ const isClickThru = !!(skwcid && efid);
77
+ // Skip identity resolution when no enabled advertiser IDs are configured —
78
+ // there is nothing meaningful to enrich the event with downstream.
79
+ const activeAdvertiserIds = normalizeAdvertiser(
80
+ componentConfig?.advertiserSettings,
81
+ );
82
+ const hasAdvertiserIds = activeAdvertiserIds.length > 0;
83
+ if (
84
+ isAdvertisingDisabled(advertising) ||
85
+ isClickThru ||
86
+ !hasAdvertiserIds ||
87
+ (isThrottled(SURFER_ID, cookieManager) &&
88
+ isThrottled(ID5_ID, cookieManager) &&
89
+ isThrottled(RAMP_ID, cookieManager))
90
+ )
91
+ return;
92
+
93
+ try {
94
+ const useShortTimeout = waitForAdvertisingId(advertising);
95
+
96
+ let rampIdPromise = null;
97
+ if (!getBrowser || getBrowser() !== CHROME) {
98
+ rampIdPromise = getRampId(
99
+ logger,
100
+ componentConfig.rampIdJSPath,
101
+ cookieManager,
102
+ useShortTimeout,
103
+ useShortTimeout,
104
+ );
105
+ }
106
+ const id5Promise = componentConfig.id5PartnerId
107
+ ? getID5Id(
108
+ logger,
109
+ componentConfig.id5PartnerId,
110
+ useShortTimeout,
111
+ useShortTimeout,
112
+ )
113
+ : Promise.resolve(null);
114
+
115
+ const [surferIdResult, hashedIPResult, id5IdResult, rampIdResult] =
116
+ await Promise.allSettled([
117
+ collectSurferId(useShortTimeout),
118
+ collectHashedIPAddr(),
119
+ id5Promise,
120
+ rampIdPromise,
121
+ ]);
122
+
123
+ const availableIds = {};
124
+ const availableIdsForIdentity = {};
125
+
126
+ if (surferIdResult.status === "fulfilled" && surferIdResult.value) {
127
+ availableIdsForIdentity[SURFER_ID] = surferIdResult.value;
128
+ if (!isThrottled(SURFER_ID, cookieManager)) {
129
+ availableIds[SURFER_ID] = surferIdResult.value;
130
+ }
131
+ }
132
+ if (hashedIPResult.status === "fulfilled" && hashedIPResult.value) {
133
+ availableIdsForIdentity[HASHED_IP] = hashedIPResult.value;
134
+ if (!isThrottled(SURFER_ID, cookieManager)) {
135
+ availableIds[HASHED_IP] = hashedIPResult.value;
136
+ }
137
+ }
138
+ if (
139
+ id5IdResult.status === "fulfilled" &&
140
+ id5IdResult.value &&
141
+ !isThrottled(ID5_ID, cookieManager)
142
+ ) {
143
+ availableIds.id5Id = id5IdResult.value;
144
+ }
145
+ if (
146
+ rampIdResult.status === "fulfilled" &&
147
+ rampIdResult.value &&
148
+ !isThrottled(RAMP_ID, cookieManager)
149
+ ) {
150
+ availableIds.rampId = rampIdResult.value;
151
+ }
152
+
153
+ if (Object.keys(availableIdsForIdentity).length !== 0) {
154
+ appendAdCloudIdentityToEvent(availableIdsForIdentity, event);
155
+ }
156
+
157
+ // If no IDs are available and any ID is throttled, skip — no new info to send
158
+ if (
159
+ Object.keys(availableIds).length === 0 &&
160
+ (isThrottled(SURFER_ID, cookieManager) ||
161
+ isThrottled(ID5_ID, cookieManager) ||
162
+ isThrottled(RAMP_ID, cookieManager))
163
+ ) {
164
+ return;
165
+ }
166
+
167
+ appendAdvertisingIdQueryToEvent(
168
+ availableIds,
169
+ event,
170
+ cookieManager,
171
+ componentConfig,
172
+ );
173
+ } catch (error) {
174
+ logger.error("Error in onBeforeSendEvent hook:", error);
175
+ }
176
+ };
177
+ };
@@ -0,0 +1,74 @@
1
+ /*
2
+ Copyright 2023 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import handleClickThrough from "./clickThroughHandler.js";
14
+ import handleViewThrough from "./viewThroughHandler.js";
15
+ import { getUrlParams, normalizeAdvertiser } from "../utils/helpers.js";
16
+
17
+ /**
18
+ * Creates a handler for sending ad conversions.
19
+ * Handles both click-through and view-through conversions.
20
+ * This is a workaround to avoid the full lifecycle of the eventManager.sendEvent
21
+ */
22
+ export default ({
23
+ eventManager,
24
+ cookieManager,
25
+ adConversionHandler,
26
+ logger,
27
+ componentConfig,
28
+ getBrowser,
29
+ consent,
30
+ collectSurferId,
31
+ collectHashedIPAddr,
32
+ }) => {
33
+ const activeAdvertiserIds = componentConfig?.advertiserSettings
34
+ ? normalizeAdvertiser(componentConfig.advertiserSettings)
35
+ : "";
36
+
37
+ return async () => {
38
+ try {
39
+ // Wait for consent before any ad conversion processing.
40
+ // This ensures no advertising cookies are set without user consent.
41
+ // If consent is declined, awaitConsent() rejects and we exit gracefully.
42
+ await consent.awaitConsent();
43
+
44
+ const { skwcid, efid } = getUrlParams();
45
+ const isClickThru = !!(skwcid || efid);
46
+
47
+ if (isClickThru) {
48
+ // wait for click through to complete
49
+ return handleClickThrough({
50
+ eventManager,
51
+ cookieManager,
52
+ adConversionHandler,
53
+ logger,
54
+ skwcid,
55
+ efid,
56
+ });
57
+ } else if (activeAdvertiserIds) {
58
+ // fire and forget view through
59
+ handleViewThrough({
60
+ eventManager,
61
+ cookieManager,
62
+ logger,
63
+ componentConfig,
64
+ adConversionHandler,
65
+ getBrowser,
66
+ collectSurferId,
67
+ collectHashedIPAddr,
68
+ }).catch((error) => logger.error("Error in view through:", error));
69
+ }
70
+ } catch (error) {
71
+ logger.error("Error in sendAdConversion:", error);
72
+ }
73
+ };
74
+ };
@@ -0,0 +1,107 @@
1
+ /*
2
+ Copyright 2025 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import collectAllIdentities from "../identities/collectAllIdentities.js";
14
+ import {
15
+ LOG_ERROR_RESOLVING_ID,
16
+ LOG_AD_CONVERSION_FAILED,
17
+ AD_CONVERSION_VIEW_EVENT_TYPE,
18
+ HASHED_IP,
19
+ } from "../constants/index.js";
20
+ import {
21
+ isAnyIdUnused,
22
+ appendAdvertisingIdQueryToEvent,
23
+ markIdsAsConverted,
24
+ } from "../utils/helpers.js";
25
+
26
+ export default async function handleViewThrough({
27
+ eventManager,
28
+ cookieManager,
29
+ logger,
30
+ componentConfig,
31
+ adConversionHandler,
32
+ getBrowser,
33
+ collectSurferId,
34
+ collectHashedIPAddr,
35
+ }) {
36
+ const resolvedIds = {};
37
+ const usedIdTracker = {};
38
+
39
+ // Start hashedIp collection early — shares the same iframe as surferId so
40
+ // it resolves at the same time. Awaiting it in triggerConversion adds no
41
+ // real delay and keeps the enrichment to a single call.
42
+ const hashedIpPromise = collectHashedIPAddr
43
+ ? collectHashedIPAddr().catch(() => null)
44
+ : Promise.resolve(null);
45
+
46
+ const triggerConversion = async () => {
47
+ if (!isAnyIdUnused(resolvedIds, usedIdTracker)) return null;
48
+
49
+ const hashedIp = await hashedIpPromise;
50
+ const idsForEvent = hashedIp
51
+ ? { ...resolvedIds, [HASHED_IP]: hashedIp }
52
+ : { ...resolvedIds };
53
+
54
+ const idTypesToUse = Object.keys(resolvedIds);
55
+
56
+ try {
57
+ const event = appendAdvertisingIdQueryToEvent(
58
+ idsForEvent,
59
+ eventManager.createEvent(),
60
+ cookieManager,
61
+ componentConfig,
62
+ true,
63
+ );
64
+ const xdm = {
65
+ eventType: AD_CONVERSION_VIEW_EVENT_TYPE,
66
+ timestamp: new Date().toISOString(),
67
+ };
68
+ event.setUserXdm(xdm);
69
+
70
+ const result = await adConversionHandler.trackAdConversion({ event });
71
+
72
+ markIdsAsConverted(idTypesToUse, usedIdTracker, cookieManager, logger);
73
+ return result;
74
+ } catch (error) {
75
+ logger.error(LOG_AD_CONVERSION_FAILED, error);
76
+ return null;
77
+ }
78
+ };
79
+
80
+ const identityPromisesMap = collectAllIdentities(
81
+ logger,
82
+ componentConfig,
83
+ cookieManager,
84
+ getBrowser,
85
+ collectSurferId,
86
+ );
87
+
88
+ if (Object.keys(identityPromisesMap).length === 0) {
89
+ return [];
90
+ }
91
+
92
+ const identityPromises = Object.entries(identityPromisesMap).map(
93
+ ([idType, idPromise]) =>
94
+ idPromise
95
+ .then((idValue) => {
96
+ if (idValue) {
97
+ resolvedIds[idType] = idValue;
98
+ return triggerConversion();
99
+ }
100
+ })
101
+ .catch((error) => {
102
+ logger.error(LOG_ERROR_RESOLVING_ID.replace("{0}", idType), error);
103
+ return null;
104
+ }),
105
+ );
106
+ return Promise.allSettled(identityPromises);
107
+ }
@@ -0,0 +1,57 @@
1
+ /*
2
+ Copyright 2025 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { getRampId } from "./collectRampId.js";
14
+ import { getID5Id } from "./collectID5Id.js";
15
+ import { ID5_ID, RAMP_ID, SURFER_ID } from "../constants/index.js";
16
+ import { isThrottled } from "../utils/helpers.js";
17
+
18
+ const collectAllIdentities = (
19
+ logger,
20
+ componentConfig,
21
+ cookieManager,
22
+ getBrowser,
23
+ collectSurferId,
24
+ ) => {
25
+ const promises = {};
26
+
27
+ if (!isThrottled(SURFER_ID, cookieManager)) {
28
+ promises.surferId = collectSurferId(true).catch(() => null);
29
+ }
30
+
31
+ if (
32
+ componentConfig.id5PartnerId &&
33
+ componentConfig.dspEnabled &&
34
+ !isThrottled(ID5_ID, cookieManager)
35
+ ) {
36
+ promises.id5Id = getID5Id(logger, componentConfig.id5PartnerId).catch(
37
+ () => null,
38
+ );
39
+ }
40
+
41
+ if (
42
+ componentConfig.rampIdJSPath &&
43
+ componentConfig.dspEnabled &&
44
+ !isThrottled(RAMP_ID, cookieManager)
45
+ ) {
46
+ promises.rampId = getRampId(
47
+ logger,
48
+ componentConfig.rampIdJSPath,
49
+ cookieManager,
50
+ true,
51
+ ).catch(() => null);
52
+ }
53
+
54
+ return promises;
55
+ };
56
+
57
+ export default collectAllIdentities;
@@ -0,0 +1,133 @@
1
+ /*
2
+ Copyright 2025 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+ import { loadScript } from "@adobe/alloy-core/utils/dom";
13
+ import { ID5_SCRIPT_URL } from "../constants/index.js";
14
+
15
+ let id5Id = "";
16
+ let inProgressId5Promise = null;
17
+ const SHORT_TIMEOUT_MS = 2000;
18
+ const DEFAULT_TIMEOUT_MS = 30000;
19
+
20
+ const initiateID5Call = (partnerId, useShortTimeout, logger) => {
21
+ partnerId = Math.floor(Number(partnerId));
22
+
23
+ if (inProgressId5Promise) {
24
+ return inProgressId5Promise;
25
+ }
26
+
27
+ const timeoutMs = useShortTimeout ? SHORT_TIMEOUT_MS : DEFAULT_TIMEOUT_MS;
28
+
29
+ let iD5TimedOut = false;
30
+
31
+ const id5ResolutionPromise = new Promise((resolve, reject) => {
32
+ if (!partnerId) {
33
+ logger.error("Missing partner ID");
34
+ reject(new Error("ID5 partner ID is required"));
35
+ return;
36
+ }
37
+
38
+ const handleId5 = () => {
39
+ try {
40
+ if (typeof window.ID5 === "undefined") {
41
+ reject(new Error("ID5 object not available after script load"));
42
+ return;
43
+ }
44
+
45
+ const id5Instance = window.ID5.init({ partnerId });
46
+ id5Id = id5Instance.getUserId();
47
+
48
+ const safeResolve = (val) => {
49
+ if (!iD5TimedOut) resolve(val);
50
+ };
51
+
52
+ if (!id5Id) {
53
+ window.ID5.init({ partnerId }).onAvailable(function firstRetry(
54
+ retryStatus,
55
+ ) {
56
+ id5Id = retryStatus.getUserId();
57
+ if (id5Id) {
58
+ safeResolve(id5Id);
59
+ } else {
60
+ window.ID5.init({ partnerId }).onAvailable(
61
+ function secondRetry(secondRetryStatus) {
62
+ id5Id = secondRetryStatus.getUserId();
63
+ if (id5Id) {
64
+ safeResolve(id5Id);
65
+ } else {
66
+ logger.error("Failed to get ID5 ID after all retries");
67
+ safeResolve(null);
68
+ }
69
+ },
70
+ );
71
+ }
72
+ }, 1000);
73
+ } else {
74
+ safeResolve(id5Id);
75
+ }
76
+ } catch (error) {
77
+ logger.error("Error during ID5 initialization", error);
78
+ reject(error);
79
+ }
80
+ };
81
+
82
+ if (typeof window.ID5 !== "undefined") {
83
+ handleId5();
84
+ } else {
85
+ loadScript(ID5_SCRIPT_URL, {
86
+ onLoad: handleId5,
87
+ onError: (error) => {
88
+ logger.error("Script loading failed", error);
89
+ reject(error);
90
+ },
91
+ });
92
+ }
93
+ });
94
+
95
+ const timeoutPromise = new Promise((resolve) => {
96
+ setTimeout(() => {
97
+ iD5TimedOut = true;
98
+ resolve(null);
99
+ }, timeoutMs);
100
+ });
101
+
102
+ inProgressId5Promise = Promise.race([
103
+ id5ResolutionPromise,
104
+ timeoutPromise,
105
+ ]).finally(() => {
106
+ inProgressId5Promise = null;
107
+ });
108
+
109
+ return inProgressId5Promise;
110
+ };
111
+
112
+ const getID5Id = function getID5Id(
113
+ logger,
114
+ partnerId,
115
+ resolveId5IfNotAvailable = true,
116
+ useShortTimeout = false,
117
+ ) {
118
+ if (id5Id && id5Id !== "") {
119
+ return Promise.resolve(id5Id);
120
+ }
121
+ if (!resolveId5IfNotAvailable) {
122
+ return Promise.resolve(null);
123
+ }
124
+
125
+ return initiateID5Call(partnerId, useShortTimeout, logger)
126
+ .then((resolvedId) => resolvedId)
127
+ .catch((error) => {
128
+ logger.error("Failed to get ID5 ID", error);
129
+ throw error;
130
+ });
131
+ };
132
+
133
+ export { getID5Id, initiateID5Call };