@bikdotai/bik-component-library 0.0.806-beta.24 → 0.0.806-beta.4

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 (19) hide show
  1. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  2. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  3. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
  4. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  5. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
  6. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  7. package/dist/cjs/components/feature-announcements/utils/animationHelpers.js.map +1 -1
  8. package/dist/cjs/src/components/feature-announcements/types/props.types.d.ts +3 -3
  9. package/dist/cjs/src/components/feature-announcements/utils/animationHelpers.d.ts +1 -1
  10. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  11. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
  12. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
  13. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
  14. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +1 -1
  15. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
  16. package/dist/esm/components/feature-announcements/utils/animationHelpers.js.map +1 -1
  17. package/dist/esm/src/components/feature-announcements/types/props.types.d.ts +3 -3
  18. package/dist/esm/src/components/feature-announcements/utils/animationHelpers.d.ts +1 -1
  19. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),n=require("./constants/index.js");require("../../constants/Theme.js"),require("./constants/animations.js");var s=require("./styles/minorPopup.styles.js"),i=require("./utils/htmlHelpers.js"),o=require("./utils/animationHelpers.js"),a=require("./utils/elementHelpers.js");exports.default=l=>{let{feature:c,currentIndex:u,totalFeatures:d,onSkip:f,onExplore:y,onPrevious:g,onNext:j,setIsClosing:v}=l;var p,x;const[T,h]=r.useState(!1),[m,b]=r.useState(!1),[E,O]=r.useState(""),_=r.useRef(null);r.useEffect((()=>{T&&b(!0)}),[T]);const q=s.getMinorPopupStyles(m,E);return t.jsxs("div",Object.assign({ref:_,style:q.container},{children:[t.jsx("div",Object.assign({style:q.imageContainer},{children:c.displayImage?t.jsx("div",Object.assign({style:q.imageWrapper},{children:t.jsx("img",{src:c.displayImage,alt:c.title,style:q.image,onError:e=>{c.image&&(e.target.src=c.image)}})})):t.jsx("div",Object.assign({style:q.imagePlaceholder},{children:n.TEXT.FEATURE_PREVIEW_PLACEHOLDER}))})),t.jsxs("div",Object.assign({style:q.contentContainer},{children:[t.jsxs("div",{children:[t.jsx("h3",Object.assign({style:q.title},{children:c.title})),t.jsx("div",{style:q.content,dangerouslySetInnerHTML:{__html:i.decodeHTMLEntities(c.content||c.body||"")}})]}),t.jsxs("div",Object.assign({style:q.actionsContainer},{children:[(null===(p=c.secondaryButton)||void 0===p?void 0:p.text)&&t.jsx("span",Object.assign({onClick:()=>{var t,r;const n=null===(t=c.secondaryButton)||void 0===t?void 0:t.action,s=f;let i=null;if("Play Video"===n)y("Play Video");else if("Open link"===n){const e=null===(r=c.secondaryButton)||void 0===r?void 0:r.redirectionUrl;if(e){e.startsWith("http")?window.open(e,"_blank","noopener,noreferrer"):i=e}}if(o.hideJoyrideArrow(_.current),_.current&&c.featureTag){const e=a.findFeatureTagElement(c.featureTag);if(e){const t=o.calculateCloseTransform(_.current,e);O(t)}else O("scale(0)")}else O("scale(0)");null==v||v(!0),h(!0),o.executeAfterAnimation((()=>e.__awaiter(void 0,void 0,void 0,(function*(){yield s(),i&&(window.location.href=i)}))))},style:q.understoodText},{children:c.secondaryButton.text})),t.jsx("button",Object.assign({onClick:()=>{var e,t;const r=null===(e=c.primaryButton)||void 0===e?void 0:e.action;if("Open link"===r){const e=(null===(t=c.primaryButton)||void 0===t?void 0:t.redirectionUrl)||c.redirectUrl;if(e){e.startsWith("http")&&window.open(e,"_blank","noopener,noreferrer")}}if(y(r),o.hideJoyrideArrow(_.current),_.current&&c.featureTag){const e=c.featureTag.startsWith("#")||c.featureTag.startsWith(".")||c.featureTag.startsWith("[")?c.featureTag:`#${c.featureTag}`,t=document.querySelector(e);if(t){const e=o.calculateCloseTransform(_.current,t);O(e)}else O("scale(0)")}else O("scale(0)");null==v||v(!0),h(!0)},style:q.exploreButton},{children:(null===(x=c.primaryButton)||void 0===x?void 0:x.text)||c.buttonText||n.TEXT.DEFAULT_BUTTON_TEXT}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./constants/index.js");require("../../constants/Theme.js"),require("./constants/animations.js");var n=require("./styles/minorPopup.styles.js"),s=require("./utils/htmlHelpers.js"),i=require("./utils/animationHelpers.js"),o=require("./utils/elementHelpers.js");exports.default=l=>{let{feature:a,currentIndex:c,totalFeatures:u,onSkip:d,onExplore:f,onPrevious:p,onNext:y,setIsClosing:g}=l;var j,v;const[h,x]=t.useState(!1),[T,m]=t.useState(!1),[b,E]=t.useState(""),O=t.useRef(null);t.useEffect((()=>{h&&m(!0)}),[h]);const q=n.getMinorPopupStyles(T,b);return e.jsxs("div",Object.assign({ref:O,style:q.container},{children:[e.jsx("div",Object.assign({style:q.imageContainer},{children:a.displayImage?e.jsx("div",Object.assign({style:q.imageWrapper},{children:e.jsx("img",{src:a.displayImage,alt:a.title,style:q.image,onError:e=>{a.image&&(e.target.src=a.image)}})})):e.jsx("div",Object.assign({style:q.imagePlaceholder},{children:r.TEXT.FEATURE_PREVIEW_PLACEHOLDER}))})),e.jsxs("div",Object.assign({style:q.contentContainer},{children:[e.jsxs("div",{children:[e.jsx("h3",Object.assign({style:q.title},{children:a.title})),e.jsx("div",{style:q.content,dangerouslySetInnerHTML:{__html:s.decodeHTMLEntities(a.content||a.body||"")}})]}),e.jsxs("div",Object.assign({style:q.actionsContainer},{children:[(null===(j=a.secondaryButton)||void 0===j?void 0:j.text)&&e.jsx("span",Object.assign({onClick:()=>{var e,t,r;const n=null===(e=a.secondaryButton)||void 0===e?void 0:e.action,s=d;if("Play Video"===n)f();else if("Open link"===n){const e=null===(t=a.secondaryButton)||void 0===t?void 0:t.redirectionUrl;if(e){if(!e.startsWith("http"))return d(),void(window.location.href=e);window.open(e,"_blank","noopener,noreferrer")}}else"Close popup"!==n&&""!==n||null===(r=a.secondaryButton)||void 0===r||r.action;if(i.hideJoyrideArrow(O.current),O.current&&a.featureTag){const e=o.findFeatureTagElement(a.featureTag);if(e){const t=i.calculateCloseTransform(O.current,e);E(t)}else E("scale(0)")}else E("scale(0)");null==g||g(!0),x(!0),i.executeAfterAnimation(s)},style:q.understoodText},{children:a.secondaryButton.text})),e.jsx("button",Object.assign({onClick:()=>{var e,t;const r=null===(e=a.primaryButton)||void 0===e?void 0:e.action;if("Play Video"===r)f();else if("Open link"===r){f();const e=(null===(t=a.primaryButton)||void 0===t?void 0:t.redirectionUrl)||a.redirectUrl;if(e){if(!e.startsWith("http"))return void(window.location.href=e);window.open(e,"_blank","noopener,noreferrer")}}else f();if(i.hideJoyrideArrow(O.current),O.current&&a.featureTag){const e=a.featureTag.startsWith("#")||a.featureTag.startsWith(".")||a.featureTag.startsWith("[")?a.featureTag:`#${a.featureTag}`,t=document.querySelector(e);if(t){const e=i.calculateCloseTransform(O.current,t);E(e)}else E("scale(0)")}else E("scale(0)");null==g||g(!0),x(!0)},style:q.exploreButton},{children:(null===(v=a.primaryButton)||void 0===v?void 0:v.text)||a.buttonText||r.TEXT.DEFAULT_BUTTON_TEXT}))]}))]}))]}))};
2
2
  //# sourceMappingURL=MinorUpdatePopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MinorUpdatePopup.js","sources":["../../../../src/components/feature-announcements/MinorUpdatePopup.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { TEXT } from './constants';\nimport { getMinorPopupStyles } from './styles';\nimport { MinorUpdatePopupProps } from './types';\nimport {\n\tcalculateCloseTransform,\n\tdecodeHTMLEntities,\n\texecuteAfterAnimation,\n\tfindFeatureTagElement,\n\thideJoyrideArrow,\n} from './utils';\n\nconst MinorUpdatePopup: React.FC<MinorUpdatePopupProps> = ({\n\tfeature,\n\tcurrentIndex,\n\ttotalFeatures,\n\tonSkip,\n\tonExplore,\n\tonPrevious,\n\tonNext,\n\tsetIsClosing: setIsClosingParent,\n}) => {\n\tconst [isClosing, setIsClosing] = useState(false);\n\tconst [startAnimation, setStartAnimation] = useState(false);\n\tconst [transform, setTransform] = useState('');\n\tconst popupRef = useRef<HTMLDivElement>(null);\n\n\t// Hide Joyride arrow when closing starts, then trigger animation immediately\n\tuseEffect(() => {\n\t\tif (isClosing) {\n\t\t\t// Start the shrink animation immediately\n\t\t\tsetStartAnimation(true);\n\t\t}\n\t}, [isClosing]);\n\n\tconst handleExplore = (): void => {\n\t\tconst action = feature.primaryButton?.action;\n\n\t\tif (action === 'Open link') {\n\t\t\t// For external links open in new tab immediately.\n\t\t\t// For internal links the provider will navigate AFTER markFeatureAsViewed\n\t\t\t// completes, so we do NOT call window.location.href here.\n\t\t\tconst url = feature.primaryButton?.redirectionUrl || feature.redirectUrl;\n\t\t\tif (url) {\n\t\t\t\tconst isExternal = url.startsWith('http');\n\t\t\t\tif (isExternal) {\n\t\t\t\t\twindow.open(url, '_blank', 'noopener,noreferrer');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Pass the triggered action so the provider knows what to do\n\t\tonExplore(action);\n\n\t\t// Run closing animation in background\n\t\thideJoyrideArrow(popupRef.current);\n\t\tif (popupRef.current && feature.featureTag) {\n\t\t\tconst targetSelector =\n\t\t\t\tfeature.featureTag.startsWith('#') ||\n\t\t\t\tfeature.featureTag.startsWith('.') ||\n\t\t\t\tfeature.featureTag.startsWith('[')\n\t\t\t\t\t? feature.featureTag\n\t\t\t\t\t: `#${feature.featureTag}`;\n\t\t\tconst targetElement = document.querySelector(targetSelector);\n\t\t\tif (targetElement) {\n\t\t\t\tconst transformValue = calculateCloseTransform(\n\t\t\t\t\tpopupRef.current,\n\t\t\t\t\ttargetElement,\n\t\t\t\t);\n\t\t\t\tsetTransform(transformValue);\n\t\t\t} else {\n\t\t\t\tsetTransform('scale(0)');\n\t\t\t}\n\t\t} else {\n\t\t\tsetTransform('scale(0)');\n\t\t}\n\t\tsetIsClosingParent?.(true);\n\t\tsetIsClosing(true);\n\t};\n\n\tconst handleSecondaryAction = (): void => {\n\t\tconst action = feature.secondaryButton?.action;\n\t\tconst closeCallback = onSkip;\n\t\tlet internalUrl: string | null = null;\n\n\t\t// Handle based on action type\n\t\tif (action === 'Play Video') {\n\t\t\t// Pass 'Play Video' explicitly so provider opens video, not redirects\n\t\t\tonExplore('Play Video');\n\t\t} else if (action === 'Open link') {\n\t\t\t// For external links open in new tab immediately.\n\t\t\t// For internal links, navigate AFTER closeCallback fires (which marks as viewed)\n\t\t\tconst url = feature.secondaryButton?.redirectionUrl;\n\t\t\tif (url) {\n\t\t\t\tconst isExternal = url.startsWith('http');\n\t\t\t\tif (isExternal) {\n\t\t\t\t\twindow.open(url, '_blank', 'noopener,noreferrer');\n\t\t\t\t} else {\n\t\t\t\t\tinternalUrl = url;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (action === 'Close popup' || action === '') {\n\t\t\t// Just close the popup\n\t\t}\n\n\t\t// Always close popup after secondary action\n\t\thideJoyrideArrow(popupRef.current);\n\t\tif (popupRef.current && feature.featureTag) {\n\t\t\tconst targetElement = findFeatureTagElement(feature.featureTag);\n\t\t\tif (targetElement) {\n\t\t\t\tconst transformValue = calculateCloseTransform(\n\t\t\t\t\tpopupRef.current,\n\t\t\t\t\ttargetElement,\n\t\t\t\t);\n\t\t\t\tsetTransform(transformValue);\n\t\t\t} else {\n\t\t\t\tsetTransform('scale(0)');\n\t\t\t}\n\t\t} else {\n\t\t\tsetTransform('scale(0)');\n\t\t}\n\t\tsetIsClosingParent?.(true);\n\t\tsetIsClosing(true);\n\t\texecuteAfterAnimation(async () => {\n\t\t\tawait closeCallback();\n\t\t\t// For internal links: navigate after closeCallback awaits markFeatureAsViewed\n\t\t\tif (internalUrl) {\n\t\t\t\twindow.location.href = internalUrl;\n\t\t\t}\n\t\t});\n\t};\n\n\tconst styles = getMinorPopupStyles(startAnimation, transform);\n\n\treturn (\n\t\t<div ref={popupRef} style={styles.container}>\n\t\t\t{/* Image section */}\n\t\t\t<div style={styles.imageContainer}>\n\t\t\t\t{feature.displayImage ? (\n\t\t\t\t\t<div style={styles.imageWrapper}>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={feature.displayImage}\n\t\t\t\t\t\t\talt={feature.title}\n\t\t\t\t\t\t\tstyle={styles.image}\n\t\t\t\t\t\t\tonError={(e) => {\n\t\t\t\t\t\t\t\tif (feature.image) {\n\t\t\t\t\t\t\t\t\t(e.target as HTMLImageElement).src = feature.image;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div style={styles.imagePlaceholder}>\n\t\t\t\t\t\t{TEXT.FEATURE_PREVIEW_PLACEHOLDER}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Content section */}\n\t\t\t<div style={styles.contentContainer}>\n\t\t\t\t<div>\n\t\t\t\t\t<h3 style={styles.title}>{feature.title}</h3>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={styles.content}\n\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t__html: decodeHTMLEntities(feature.content || feature.body || ''),\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Action buttons */}\n\t\t\t\t<div style={styles.actionsContainer}>\n\t\t\t\t\t{/* Secondary Button (if configured, shows as text link on left) */}\n\t\t\t\t\t{feature.secondaryButton?.text && (\n\t\t\t\t\t\t<span onClick={handleSecondaryAction} style={styles.understoodText}>\n\t\t\t\t\t\t\t{feature.secondaryButton.text}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Primary Button (always shows) */}\n\t\t\t\t\t<button onClick={handleExplore} style={styles.exploreButton}>\n\t\t\t\t\t\t{feature.primaryButton?.text ||\n\t\t\t\t\t\t\tfeature.buttonText ||\n\t\t\t\t\t\t\tTEXT.DEFAULT_BUTTON_TEXT}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default MinorUpdatePopup;\n"],"names":["_ref","feature","currentIndex","totalFeatures","onSkip","onExplore","onPrevious","onNext","setIsClosing","setIsClosingParent","isClosing","useState","startAnimation","setStartAnimation","transform","setTransform","popupRef","useRef","useEffect","styles","getMinorPopupStyles","_jsxs","Object","assign","ref","style","container","children","_jsx","jsx","imageContainer","displayImage","imageWrapper","src","alt","title","image","onError","e","target","imagePlaceholder","TEXT","FEATURE_PREVIEW_PLACEHOLDER","jsxs","contentContainer","content","dangerouslySetInnerHTML","__html","decodeHTMLEntities","body","actionsContainer","_a","secondaryButton","text","onClick","handleSecondaryAction","action","closeCallback","internalUrl","url","_b","redirectionUrl","startsWith","window","open","hideJoyrideArrow","current","featureTag","targetElement","findFeatureTagElement","transformValue","calculateCloseTransform","executeAfterAnimation","__awaiter","location","href","understoodText","handleExplore","primaryButton","redirectUrl","targetSelector","document","querySelector","exploreButton","buttonText","DEFAULT_BUTTON_TEXT"],"mappings":"8bAY0DA,IASrD,IATsDC,QAC1DA,EAAOC,aACPA,EAAYC,cACZA,EAAaC,OACbA,EAAMC,UACNA,EAASC,WACTA,EAAUC,OACVA,EACAC,aAAcC,GACdT,UACA,MAAOU,EAAWF,GAAgBG,EAAQ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SAAU,sBAE5B,CACD,CAMD,GAJAtD,EAAUmD,GAGVS,mBAAiBjD,EAASkD,SACtBlD,EAASkD,SAAWjE,EAAQkE,WAAY,CAC3C,MAAMa,EACL/E,EAAQkE,WAAWL,WAAW,MAC9B7D,EAAQkE,WAAWL,WAAW,MAC9B7D,EAAQkE,WAAWL,WAAW,KAC3B7D,EAAQkE,WACJ,IAAAlE,EAAQkE,aACVC,EAAgBa,SAASC,cAAcF,GAC7C,GAAIZ,EAAe,CAClB,MAAME,EAAiBC,EAAuBA,wBAC7CvD,EAASkD,QACTE,GAEDrD,EAAauD,EACb,MACAvD,EAAa,WAEd,MACAA,EAAa,YAEdN,SAAAA,GAAqB,GACrBD,GAAa,EAAK,EAuGiBiB,MAAON,EAAOgE,eAAa,CAAAxD,UACpC,QAArBiC,EAAA3D,EAAQ6E,qBAAa,IAAAlB,OAAA,EAAAA,EAAEP,OACvBpD,EAAQmF,YACR3C,EAAAA,KAAK4C,kCAIJ"}
1
+ {"version":3,"file":"MinorUpdatePopup.js","sources":["../../../../src/components/feature-announcements/MinorUpdatePopup.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { TEXT } from './constants';\nimport { getMinorPopupStyles } from './styles';\nimport { MinorUpdatePopupProps } from './types';\nimport {\n\tcalculateCloseTransform,\n\tdecodeHTMLEntities,\n\texecuteAfterAnimation,\n\tfindFeatureTagElement,\n\thideJoyrideArrow,\n} from './utils';\n\nconst MinorUpdatePopup: React.FC<MinorUpdatePopupProps> = ({\n\tfeature,\n\tcurrentIndex,\n\ttotalFeatures,\n\tonSkip,\n\tonExplore,\n\tonPrevious,\n\tonNext,\n\tsetIsClosing: setIsClosingParent,\n}) => {\n\tconst [isClosing, setIsClosing] = useState(false);\n\tconst [startAnimation, setStartAnimation] = useState(false);\n\tconst [transform, setTransform] = useState('');\n\tconst popupRef = useRef<HTMLDivElement>(null);\n\n\t// Hide Joyride arrow when closing starts, then trigger animation immediately\n\tuseEffect(() => {\n\t\tif (isClosing) {\n\t\t\t// Start the shrink animation immediately\n\t\t\tsetStartAnimation(true);\n\t\t}\n\t}, [isClosing]);\n\n\tconst handleExplore = (): void => {\n\t\tconst action = feature.primaryButton?.action;\n\n\t\tif (action === 'Play Video') {\n\t\t\tonExplore();\n\t\t} else if (action === 'Open link') {\n\t\t\tonExplore();\n\t\t\tconst url = feature.primaryButton?.redirectionUrl || feature.redirectUrl;\n\t\t\tif (url) {\n\t\t\t\tconst isExternal = url.startsWith('http');\n\t\t\t\tif (isExternal) {\n\t\t\t\t\twindow.open(url, '_blank', 'noopener,noreferrer');\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.href = url;\n\t\t\t\t\treturn; // page reloads, skip animation\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Default action - call onExplore callback\n\t\t\tonExplore();\n\t\t}\n\n\t\t// Run closing animation in background\n\t\thideJoyrideArrow(popupRef.current);\n\t\tif (popupRef.current && feature.featureTag) {\n\t\t\tconst targetSelector =\n\t\t\t\tfeature.featureTag.startsWith('#') ||\n\t\t\t\tfeature.featureTag.startsWith('.') ||\n\t\t\t\tfeature.featureTag.startsWith('[')\n\t\t\t\t\t? feature.featureTag\n\t\t\t\t\t: `#${feature.featureTag}`;\n\t\t\tconst targetElement = document.querySelector(targetSelector);\n\t\t\tif (targetElement) {\n\t\t\t\tconst transformValue = calculateCloseTransform(\n\t\t\t\t\tpopupRef.current,\n\t\t\t\t\ttargetElement,\n\t\t\t\t);\n\t\t\t\tsetTransform(transformValue);\n\t\t\t} else {\n\t\t\t\tsetTransform('scale(0)');\n\t\t\t}\n\t\t} else {\n\t\t\tsetTransform('scale(0)');\n\t\t}\n\t\tsetIsClosingParent?.(true);\n\t\tsetIsClosing(true);\n\t};\n\n\tconst handleSecondaryAction = (): void => {\n\t\tconst action = feature.secondaryButton?.action;\n\t\tconst closeCallback = onSkip;\n\n\t\t// Handle based on action type\n\t\tif (action === 'Play Video') {\n\t\t\tonExplore();\n\t\t} else if (action === 'Open link') {\n\t\t\t// Open URL\n\t\t\tconst url = feature.secondaryButton?.redirectionUrl;\n\t\t\tif (url) {\n\t\t\t\tconst isExternal = url.startsWith('http');\n\t\t\t\tif (isExternal) {\n\t\t\t\t\twindow.open(url, '_blank', 'noopener,noreferrer');\n\t\t\t\t} else {\n\t\t\t\t\t// Mark as viewed before internal navigation (page will reload)\n\t\t\t\t\tonSkip();\n\t\t\t\t\twindow.location.href = url;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (action === 'Close popup' || action === '') {\n\t\t\t// Just close the popup\n\t\t\tif (feature.secondaryButton?.action) {\n\t\t\t\t// Call onSecondaryAction if needed\n\t\t\t}\n\t\t}\n\n\t\t// Always close popup after secondary action\n\t\thideJoyrideArrow(popupRef.current);\n\t\tif (popupRef.current && feature.featureTag) {\n\t\t\tconst targetElement = findFeatureTagElement(feature.featureTag);\n\t\t\tif (targetElement) {\n\t\t\t\tconst transformValue = calculateCloseTransform(\n\t\t\t\t\tpopupRef.current,\n\t\t\t\t\ttargetElement,\n\t\t\t\t);\n\t\t\t\tsetTransform(transformValue);\n\t\t\t} else {\n\t\t\t\tsetTransform('scale(0)');\n\t\t\t}\n\t\t} else {\n\t\t\tsetTransform('scale(0)');\n\t\t}\n\t\tsetIsClosingParent?.(true);\n\t\tsetIsClosing(true);\n\t\texecuteAfterAnimation(closeCallback);\n\t};\n\n\tconst styles = getMinorPopupStyles(startAnimation, transform);\n\n\treturn (\n\t\t<div ref={popupRef} style={styles.container}>\n\t\t\t{/* Image section */}\n\t\t\t<div style={styles.imageContainer}>\n\t\t\t\t{feature.displayImage ? (\n\t\t\t\t\t<div style={styles.imageWrapper}>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={feature.displayImage}\n\t\t\t\t\t\t\talt={feature.title}\n\t\t\t\t\t\t\tstyle={styles.image}\n\t\t\t\t\t\t\tonError={(e) => {\n\t\t\t\t\t\t\t\tif (feature.image) {\n\t\t\t\t\t\t\t\t\t(e.target as HTMLImageElement).src = feature.image;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div style={styles.imagePlaceholder}>\n\t\t\t\t\t\t{TEXT.FEATURE_PREVIEW_PLACEHOLDER}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Content section */}\n\t\t\t<div style={styles.contentContainer}>\n\t\t\t\t<div>\n\t\t\t\t\t<h3 style={styles.title}>{feature.title}</h3>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={styles.content}\n\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t__html: decodeHTMLEntities(feature.content || feature.body || ''),\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Action buttons */}\n\t\t\t\t<div style={styles.actionsContainer}>\n\t\t\t\t\t{/* Secondary Button (if configured, shows as text link on left) */}\n\t\t\t\t\t{feature.secondaryButton?.text && (\n\t\t\t\t\t\t<span onClick={handleSecondaryAction} style={styles.understoodText}>\n\t\t\t\t\t\t\t{feature.secondaryButton.text}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Primary Button (always shows) */}\n\t\t\t\t\t<button onClick={handleExplore} style={styles.exploreButton}>\n\t\t\t\t\t\t{feature.primaryButton?.text ||\n\t\t\t\t\t\t\tfeature.buttonText ||\n\t\t\t\t\t\t\tTEXT.DEFAULT_BUTTON_TEXT}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default MinorUpdatePopup;\n"],"names":["_ref","feature","currentIndex","totalFeatures","onSkip","onExplore","onPrevious","onNext","setIsClosing","setIsClosingParent","isClosing","useState","startAnimation","setStartAnimation","transform","setTransform","popupRef","useRef","useEffect","styles","getMinorPopupStyles","_jsxs","Object","assign","ref","style","container","children","_jsx","jsx","imageContainer","displayImage","imageWrapper","src","alt","title","image","onError","e","target","imagePlaceholder","TEXT","FEATURE_PREVIEW_PLACEHOLDER","jsxs","contentContainer","content","dangerouslySetInnerHTML","__html","decodeHTMLEntities","body","actionsContainer","_a","secondaryButton","text","onClick","handleSecondaryAction","action","closeCallback","url","_b","redirectionUrl","startsWith","window","location","href","open","_c","hideJoyrideArrow","current","featureTag","targetElement","findFeatureTagElement","transformValue","calculateCloseTransform","executeAfterAnimation","understoodText","handleExplore","primaryButton","redirectUrl","targetSelector","document","querySelector","exploreButton","buttonText","DEFAULT_BUTTON_TEXT"],"mappings":"wZAY0DA,IASrD,IATsDC,QAC1DA,EAAOC,aACPA,EAAYC,cACZA,EAAaC,OACbA,EAAMC,UACNA,EAASC,WACTA,EAAUC,OACVA,EACAC,aAAcC,GACdT,UACA,MAAOU,EAAWF,GAAgBG,EAAQA,UAAC,IACpCC,EAAgBC,GAAqBF,EAAQA,UAAC,IAC9CG,EAAWC,GAAgBJ,EAAQA,SAAC,IACrCK,EAAWC,SAAuB,MAGxCC,EAAAA,WAAU,KACLR,GAEHG,GAAkB,EAClB,GACC,CAACH,IAEJ,MAiGMS,EAASC,EAAAA,oBAAoBR,EAAgBE,GAEnD,OACCO,OAAK,MAAAC,OAAAC,OAAA,CAAAC,IAAKR,EAAUS,MAAON,EAAOO,WAEjC,CAAAC,SAAA,CAAAC,EAAAC,IAAA,MAAAP,OAAAC,OAAA,CAAKE,MAAON,EAAOW,gBACjB,CAAAH,SAAA1B,EAAQ8B,aACRH,EAAKC,IAAA,MAAAP,OAAAC,OAAA,CAAAE,MAAON,EAAOa,cAAY,CAAAL,SAC9BC,EACCC,IAAA,MAAA,CAAAI,IAAKhC,EAAQ8B,aACbG,IAAKjC,EAAQkC,MACbV,MAAON,EAAOiB,MACdC,QAAUC,IACLrC,EAAQmC,QACVE,EAAEC,OAA4BN,IAAMhC,EAAQmC,MAC7C,OAKJR,E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C,kCAIJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"animationHelpers.js","sources":["../../../../../src/components/feature-announcements/utils/animationHelpers.ts"],"sourcesContent":["import { ANIMATION_TIMING } from '../constants';\n\n/**\n * Calculate transform for closing animation\n * @param popupElement - Popup element reference\n * @param targetElement - Target element to animate towards\n * @returns Transform CSS string\n */\nexport const calculateCloseTransform = (\n\tpopupElement: HTMLElement,\n\ttargetElement: Element,\n): string => {\n\tconst popupRect = popupElement.getBoundingClientRect();\n\tconst targetRect = targetElement.getBoundingClientRect();\n\n\tconst translateX =\n\t\ttargetRect.left +\n\t\ttargetRect.width / 2 -\n\t\t(popupRect.left + popupRect.width / 2);\n\tconst translateY =\n\t\ttargetRect.top +\n\t\ttargetRect.height / 2 -\n\t\t(popupRect.top + popupRect.height / 2);\n\n\treturn `translate(${translateX}px, ${translateY}px) scale(0)`;\n};\n\n/**\n * Hide Joyride arrow element\n * @param popupRef - Reference to popup element\n */\nexport const hideJoyrideArrow = (popupRef: HTMLElement | null): void => {\n\tif (!popupRef) return;\n\n\tconst tooltip = popupRef.closest('[class*=\"react-joyride__tooltip\"]');\n\tif (!tooltip) return;\n\n\tconst arrow = tooltip.querySelector(\n\t\t'[class*=\"react-joyride__arrow\"]',\n\t) as HTMLElement;\n\tif (arrow) {\n\t\tarrow.style.display = 'none';\n\t\tarrow.style.visibility = 'hidden';\n\t\tarrow.style.opacity = '0';\n\t}\n};\n\n/**\n * Execute callback after animation completes\n * @param callback - Function to execute\n * @param delay - Optional delay override\n */\nexport const executeAfterAnimation = (\n\tcallback: () => void | Promise<void>,\n\tdelay: number = ANIMATION_TIMING.CLOSE_DURATION,\n): void => {\n\tsetTimeout(callback, delay);\n};\n"],"names":["calculateCloseTransform","popupElement","targetElement","popupRect","getBoundingClientRect","targetRect","left","width","top","height","callback","delay","arguments","length","undefined","ANIMATION_TIMING","CLOSE_DURATION","setTimeout","popupRef","tooltip","closest","arrow","querySelector","style","display","visibility","opacity"],"mappings":"gJAQuCA,CACtCC,EACAC,KAEA,MAAMC,EAAYF,EAAaG,wBACzBC,EAAaH,EAAcE,wBAWjC,MAAoB,aARnBC,EAAWC,KACXD,EAAWE,MAAQ,GAClBJ,EAAUG,KAAOH,EAAUI,MAAQ,SAEpCF,EAAWG,IACXH,EAAWI,OAAS,GACnBN,EAAUK,IAAML,EAAUM,OAAS,gBAEwB,gCA4BzB,SACpCC,GAES,IADTC,EAAAC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAgBG,GAAAA,EAAAA,iBAAiBC,eAEjCC,WAAWP,EAAUC,EACtB,2BA1BiCO,IAChC,IAAKA,EAAU,OAEf,MAAMC,EAAUD,EAASE,QAAQ,qCACjC,IAAKD,EAAS,OAEd,MAAME,EAAQF,EAAQG,cACrB,mCAEGD,IACHA,EAAME,MAAMC,QAAU,OACtBH,EAAME,MAAME,WAAa,SACzBJ,EAAME,MAAMG,QAAU,IACtB"}
1
+ {"version":3,"file":"animationHelpers.js","sources":["../../../../../src/components/feature-announcements/utils/animationHelpers.ts"],"sourcesContent":["import { ANIMATION_TIMING } from '../constants';\n\n/**\n * Calculate transform for closing animation\n * @param popupElement - Popup element reference\n * @param targetElement - Target element to animate towards\n * @returns Transform CSS string\n */\nexport const calculateCloseTransform = (\n\tpopupElement: HTMLElement,\n\ttargetElement: Element,\n): string => {\n\tconst popupRect = popupElement.getBoundingClientRect();\n\tconst targetRect = targetElement.getBoundingClientRect();\n\n\tconst translateX =\n\t\ttargetRect.left +\n\t\ttargetRect.width / 2 -\n\t\t(popupRect.left + popupRect.width / 2);\n\tconst translateY =\n\t\ttargetRect.top +\n\t\ttargetRect.height / 2 -\n\t\t(popupRect.top + popupRect.height / 2);\n\n\treturn `translate(${translateX}px, ${translateY}px) scale(0)`;\n};\n\n/**\n * Hide Joyride arrow element\n * @param popupRef - Reference to popup element\n */\nexport const hideJoyrideArrow = (popupRef: HTMLElement | null): void => {\n\tif (!popupRef) return;\n\n\tconst tooltip = popupRef.closest('[class*=\"react-joyride__tooltip\"]');\n\tif (!tooltip) return;\n\n\tconst arrow = tooltip.querySelector(\n\t\t'[class*=\"react-joyride__arrow\"]',\n\t) as HTMLElement;\n\tif (arrow) {\n\t\tarrow.style.display = 'none';\n\t\tarrow.style.visibility = 'hidden';\n\t\tarrow.style.opacity = '0';\n\t}\n};\n\n/**\n * Execute callback after animation completes\n * @param callback - Function to execute\n * @param delay - Optional delay override\n */\nexport const executeAfterAnimation = (\n\tcallback: () => void,\n\tdelay: number = ANIMATION_TIMING.CLOSE_DURATION,\n): void => {\n\tsetTimeout(callback, delay);\n};\n"],"names":["calculateCloseTransform","popupElement","targetElement","popupRect","getBoundingClientRect","targetRect","left","width","top","height","callback","delay","arguments","length","undefined","ANIMATION_TIMING","CLOSE_DURATION","setTimeout","popupRef","tooltip","closest","arrow","querySelector","style","display","visibility","opacity"],"mappings":"gJAQuCA,CACtCC,EACAC,KAEA,MAAMC,EAAYF,EAAaG,wBACzBC,EAAaH,EAAcE,wBAWjC,MAAoB,aARnBC,EAAWC,KACXD,EAAWE,MAAQ,GAClBJ,EAAUG,KAAOH,EAAUI,MAAQ,SAEpCF,EAAWG,IACXH,EAAWI,OAAS,GACnBN,EAAUK,IAAML,EAAUM,OAAS,gBAEwB,gCA4BzB,SACpCC,GAES,IADTC,EAAAC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAgBG,GAAAA,EAAAA,iBAAiBC,eAEjCC,WAAWP,EAAUC,EACtB,2BA1BiCO,IAChC,IAAKA,EAAU,OAEf,MAAMC,EAAUD,EAASE,QAAQ,qCACjC,IAAKD,EAAS,OAEd,MAAME,EAAQF,EAAQG,cACrB,mCAEGD,IACHA,EAAME,MAAMC,QAAU,OACtBH,EAAME,MAAME,WAAa,SACzBJ,EAAME,MAAMG,QAAU,IACtB"}
@@ -9,12 +9,12 @@ export interface PopupBaseProps {
9
9
  feature: FeatureAnnouncement;
10
10
  currentIndex: number;
11
11
  totalFeatures: number;
12
- onSkip: () => Promise<void> | void;
13
- onExplore: (triggeredAction?: string) => void;
12
+ onSkip: () => void;
13
+ onExplore: () => void;
14
14
  onPrevious: () => void;
15
15
  onNext: () => void;
16
16
  setIsClosing?: (isClosing: boolean) => void;
17
- onSecondaryAction?: () => Promise<void> | void;
17
+ onSecondaryAction?: () => void;
18
18
  }
19
19
  /**
20
20
  * Major update popup props
@@ -15,4 +15,4 @@ export declare const hideJoyrideArrow: (popupRef: HTMLElement | null) => void;
15
15
  * @param callback - Function to execute
16
16
  * @param delay - Optional delay override
17
17
  */
18
- export declare const executeAfterAnimation: (callback: () => void | Promise<void>, delay?: number) => void;
18
+ export declare const executeAfterAnimation: (callback: () => void, delay?: number) => void;
@@ -1,2 +1,2 @@
1
- import{__awaiter as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as i,useEffect as r,useCallback as a}from"react";import d,{ACTIONS as s}from"react-joyride";import"./constants/animations.js";import{SELECTORS as l}from"./constants/selectors.js";import{useFeatureAnnouncements as u}from"./hooks/useFeatureAnnouncements.js";import c from"./MajorUpdatePopup.js";import p from"./MinorUpdatePopup.js";import{VideoModal as f}from"./VideoModal.js";const m=m=>{let{children:b,fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:v,isFeatureApplicableToCurrentPage:x,module:k,router:S,storeId:C,onAnnouncementShown:T,onAnnouncementInteracted:w}=m;var B;const{majorUpdateFeatures:I,minorUpdateFeatures:F,isLoading:E,markFeatureAsViewed:N}=u({fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:v,isFeatureApplicableToCurrentPage:x,module:k,router:S}),[j,P]=i(null),[U,W]=i(null),[V,O]=i(!1),[M,q]=i([]),[_,A]=i(!1),[L,R]=i([]),[$,z]=i(!1),[H,Z]=i(!1),[D,G]=i([]),[J,K]=i(!1),[Q,X]=i(!1),[Y,tt]=i(!1),[et,ot]=i(""),[nt,it]=i(!1),[rt,at]=i(!1),[dt,st]=i(!1),[lt,ut]=i(0),[ct,pt]=i(0),[ft,mt]=i(new Set);r((()=>{const t="minor-spotlight-cutout-style";let e=document.getElementById(t);return e||(e=document.createElement("style"),e.id=t,document.head.appendChild(e)),e.textContent="\n\t\t\t.react-joyride__spotlight {\n\t\t\t\ttransition: box-shadow 0.3s ease-in-out !important;\n\t\t\t\twill-change: box-shadow, transform;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__tooltip {\n\t\t\t\twill-change: transform, opacity;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__floater {\n\t\t\t\tright: 12px !important;\n\t\t\t\tleft: auto !important;\n\t\t\t}\n\t\t",()=>{const e=document.getElementById(t);e&&e.remove()}}),[]),r((()=>{ut((t=>t+1)),pt((t=>t+1)),at(!1),st(!1),mt(new Set)}),[null==S?void 0:S.pathname]),r((()=>{if(!(I.length>0)||j||E||$||nt)0!==I.length||E||X(!0);else{X(!1),K(!1),O(!1),q([]),W(null),G([]);let t=0;const e=10,o=()=>{t++;document.querySelector('[data-testid="whats-new-button"]')?bt(I[0]):t<e?setTimeout(o,1e3):X(!0)};o()}}),[I,j,E,$,nt]),r((()=>{var t;const e=null===(t=null==S?void 0:S.query)||void 0===t?void 0:t.featureId;if(!e||E||0===F.length)return;const o=F.find((t=>t.id===e));if(!o||!o.featureTag)return;K(!0),Z(!0);let n=0;const i=setInterval((()=>{n++;const t=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(t)){const t=[o];G(t),Ct(o,t),clearInterval(i)}else n>=25&&(Z(!1),clearInterval(i))}),200);return()=>{clearInterval(i)}}),[F,null===(B=null==S?void 0:S.query)||void 0===B?void 0:B.featureId,E]),r((()=>{var t;if(F.length>0&&!E&&!V&&!H&&!U&&!J&&Q&&!nt){let t=null,e=null,o=null,n=!1;const i=()=>{if(n||H||U||J||!Q)return;const i=F.filter((t=>{if(!t.featureTag||""===t.featureTag.trim())return!1;if(ft.has(t.id))return!1;const e=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`;return null!==document.querySelector(e)}));i.length>0&&(G(i),Ct(i[0],i),t&&(t.disconnect(),t=null),e&&(window.removeEventListener("scroll",e),e=null),o&&(clearTimeout(o),o=null))};return t=new MutationObserver((t=>{let e=!1;for(const o of t){if("childList"===o.type&&o.addedNodes.length>0)for(let t=0;t<o.addedNodes.length;t++){const n=o.addedNodes[t];if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.id||t.querySelector("[id]")){e=!0;break}}}if(e)break}V||n||H||U||J||!Q||!e||(o&&clearTimeout(o),o=setTimeout((()=>{n||H||U||J||!Q||i()}),200))})),e=()=>{V||n||H||U||J||!Q||(o&&clearTimeout(o),requestAnimationFrame((()=>{o=setTimeout((()=>{n||H||U||J||!Q||i()}),300)})))},t&&t.observe(document.body,{childList:!0,subtree:!0}),e&&window.addEventListener("scroll",e,{passive:!0}),i(),setTimeout((()=>{n||H||U||J||!Q||i()}),100),setTimeout((()=>{n||H||U||J||!Q||i()}),1e3),setTimeout((()=>{n||H||U||J||!Q||i()}),500),()=>{n=!0,t&&t.disconnect(),e&&window.removeEventListener("scroll",e),o&&clearTimeout(o)}}if(0===F.length||E){(null===(t=null==S?void 0:S.query)||void 0===t?void 0:t.featureId)&&U||(O(!1),q([]),W(null),G([]),K(!1))}}),[F,E,V,H,U,J,Q,N,nt]);const bt=t=>{P(t);const o=I.findIndex((e=>e.id===t.id)),n=I.length,i=[{target:l.WHATS_NEW_BUTTON,content:e(c,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>gt(t),onExplore:e=>ht(t,e),onPrevious:()=>yt(t),onNext:()=>vt(t),setIsClosing:at}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(i),A(!0),T&&C&&T({storeId:C,announcementId:t.id,announcementTitle:t.title,imageUrl:t.displayImage||t.image,videoUrl:t.productVideo})},gt=a((e=>t(void 0,void 0,void 0,(function*(){const t=e||j;t&&(z(!0),yield Promise.all(I.map((t=>N(t.id)))),A(!1),P(null),R([]),X(!0),w&&C&&w({storeId:C,announcementId:t.id,announcementTitle:t.title,imageUrl:t.displayImage||t.image,videoUrl:t.productVideo,buttonClicked:"Skip",buttonName:"Skip",buttonUrl:void 0}),setTimeout((()=>{z(!1)}),500))}))),[j,I,N]),ht=a(((e,o)=>t(void 0,void 0,void 0,(function*(){var t,n;z(!0),yield N(e.id);const i=null!=o?o:null===(t=e.primaryButton)||void 0===t?void 0:t.action;if("Play Video"===i&&e.productVideo&&(ot(e.productVideo),tt(!0),it(!0)),"Open link"===i){const t=(null===(n=e.primaryButton)||void 0===n?void 0:n.redirectionUrl)||e.redirectUrl;t&&!t.startsWith("http")&&(window.location.href=t)}A(!1),P(null),R([]);I.findIndex((t=>t.id===e.id))===I.length-1&&X(!0),w&&C&&w({storeId:C,announcementId:e.id,announcementTitle:e.title,imageUrl:e.displayImage||e.image,videoUrl:e.productVideo,buttonClicked:"Primary",buttonName:e.buttonText||"Explore",buttonUrl:e.redirectUrl||e.productVideo}),setTimeout((()=>{z(!1)}),500)}))),[I,N]),yt=a((t=>{const o=t||j;if(!o)return;const n=I.findIndex((t=>t.id===o.id));if(n>0){const t=I[n-1];P(t);const o=n-1,i=I.length,r=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:i,onSkip:()=>gt(t),onExplore:e=>ht(t,e),onPrevious:()=>yt(t),onNext:()=>vt(t),setIsClosing:at}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(r)}}),[j,I]),vt=a((t=>{const o=t||j;if(!o)return;const n=I.findIndex((t=>t.id===o.id));if(n<I.length-1){const t=I[n+1];P(t);const o=n+1,i=I.length,r=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:i,onSkip:()=>gt(t),onExplore:e=>ht(t,e),onPrevious:()=>yt(t),onNext:()=>vt(t),setIsClosing:at}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(r)}else z(!0),N(o.id),A(!1),P(null),R([]),X(!0),setTimeout((()=>{z(!1)}),500)}),[j,I,N]),xt=()=>{if(I.length>0&&!j){document.querySelector('[data-testid="whats-new-button"]')&&bt(I[0])}};r((()=>(window.showMajorUpdatePopup=xt,()=>{delete window.showMajorUpdatePopup})),[I,j]);const kt=a((t=>{const{action:e}=t;e===s.CLOSE&&(j&&(z(!0),I.forEach((t=>{N(t.id)})),X(!0),setTimeout((()=>{z(!1)}),500)),A(!1),P(null),R([]))}),[j,I,N]),St=a((t=>{const{action:e}=t;if(e===s.CLOSE){if(U){Z(!0),N(U.id);D.findIndex((t=>t.id===U.id))===D.length-1&&K(!0),setTimeout((()=>{Z(!1)}),500)}O(!1),W(null),q([])}}),[U,D,N]),Ct=(o,n)=>t(void 0,void 0,void 0,(function*(){W(o);const t=n||D,i=t.findIndex((t=>t.id===o.id)),r=t.length,a=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`,d=document.querySelector(a);if(d)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(d,120)}catch(t){}const s=[{target:a,content:e(p,{feature:o,currentIndex:i,totalFeatures:r,onSkip:()=>Tt(o),onExplore:t=>wt(o,t),onPrevious:()=>Bt(o),onNext:()=>It(o),setIsClosing:st}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:o,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(s),O(!0)})),Tt=a((e=>t(void 0,void 0,void 0,(function*(){const t=e||U;if(t){Z(!0),yield N(t.id),mt((e=>new Set(e).add(t.id))),O(!1),W(null),q([]);const e=D.find((e=>e.id!==t.id&&!ft.has(e.id)));setTimeout((()=>{Z(!1),e?Ct(e,D):K(!0)}),500)}}))),[U,D,N,ft]),wt=a(((e,o)=>t(void 0,void 0,void 0,(function*(){var t,n;Z(!0),yield N(e.id),mt((t=>new Set(t).add(e.id)));const i=null!=o?o:null===(t=e.primaryButton)||void 0===t?void 0:t.action;if("Play Video"===i&&e.productVideo&&(ot(e.productVideo),tt(!0),it(!0)),"Open link"===i){const t=(null===(n=e.primaryButton)||void 0===n?void 0:n.redirectionUrl)||e.redirectUrl;t&&!t.startsWith("http")&&(window.location.href=t)}O(!1),W(null),q([]);const r=D.find((t=>t.id!==e.id&&!ft.has(t.id)));setTimeout((()=>{Z(!1),r&&"Play Video"!==i?Ct(r,D):r||K(!0)}),500)}))),[D,N,ft]),Bt=a((o=>t(void 0,void 0,void 0,(function*(){const t=o||U;if(!t)return;const n=D.findIndex((e=>e.id===t.id));if(n>0){const t=D[n-1];W(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,i=document.querySelector(o);if(i)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(i,120)}catch(t){}const r=n-1,a=D.length,d=[{target:o,content:e(p,{feature:t,currentIndex:r,totalFeatures:a,onSkip:()=>Tt(t),onExplore:e=>wt(t,e),onPrevious:()=>Bt(t),onNext:()=>It(t),setIsClosing:st}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(d)}}))),[U,D]),It=a((o=>t(void 0,void 0,void 0,(function*(){const t=o||U;if(!t)return;const n=D.findIndex((e=>e.id===t.id));if(n<D.length-1){const t=D[n+1];W(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,i=document.querySelector(o);if(i)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(i,120)}catch(t){}const r=n+1,a=D.length,d=[{target:o,content:e(p,{feature:t,currentIndex:r,totalFeatures:a,onSkip:()=>Tt(t),onExplore:e=>wt(t,e),onPrevious:()=>Bt(t),onNext:()=>It(t),setIsClosing:st}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(d)}else Z(!0),K(!0),N(t.id),O(!1),W(null),q([]),setTimeout((()=>{Z(!1)}),500)}))),[U,D,N]);return o(n,{children:[b,L.length>0&&e(d,{steps:L,run:_,continuous:!1,showProgress:!1,showSkipButton:!1,callback:kt,disableOverlayClose:!1,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:rt?"transparent":"#212121"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",border:"none",boxShadow:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`major-joyride-${lt}`),M.length>0&&e(d,{steps:M,run:V,continuous:!1,showProgress:!1,showSkipButton:!1,callback:St,disableOverlayClose:!1,disableCloseOnEsc:!1,disableOverlay:!1,scrollToFirstStep:!0,scrollOffset:120,disableScrolling:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:dt?"transparent":"#ffffff"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",borderRadius:"8px",boxShadow:dt?"none":"0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`minor-joyride-${ct}`),e(f,{isOpen:Y,videoUrl:et,onClose:()=>{tt(!1),ot(""),it(!1);const t=D.find((t=>!ft.has(t.id)));t?setTimeout((()=>{Ct(t,D)}),300):K(!0)}})]})};export{m as default};
1
+ import{__awaiter as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as r,useEffect as a,useCallback as i}from"react";import s,{ACTIONS as d}from"react-joyride";import"./constants/animations.js";import{SELECTORS as l}from"./constants/selectors.js";import{useFeatureAnnouncements as u}from"./hooks/useFeatureAnnouncements.js";import c from"./MajorUpdatePopup.js";import p from"./MinorUpdatePopup.js";import{VideoModal as f}from"./VideoModal.js";const m=m=>{let{children:b,fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:x,isFeatureApplicableToCurrentPage:k,module:S,router:C,storeId:T,onAnnouncementShown:v,onAnnouncementInteracted:w}=m;var I;const{majorUpdateFeatures:B,minorUpdateFeatures:F,isLoading:E,markFeatureAsViewed:N}=u({fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:x,isFeatureApplicableToCurrentPage:k,module:S,router:C}),[j,P]=r(null),[U,W]=r(null),[O,V]=r(!1),[M,q]=r([]),[_,A]=r(!1),[L,R]=r([]),[$,z]=r(!1),[H,Z]=r(!1),[D,G]=r([]),[J,K]=r(!1),[Q,X]=r(!1),[Y,tt]=r(!1),[et,ot]=r(""),[nt,rt]=r(!1),[at,it]=r(!1),[st,dt]=r(!1),[lt,ut]=r(0),[ct,pt]=r(0),[ft,mt]=r(new Set);a((()=>{const t="minor-spotlight-cutout-style";let e=document.getElementById(t);return e||(e=document.createElement("style"),e.id=t,document.head.appendChild(e)),e.textContent="\n\t\t\t.react-joyride__spotlight {\n\t\t\t\ttransition: box-shadow 0.3s ease-in-out !important;\n\t\t\t\twill-change: box-shadow, transform;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__tooltip {\n\t\t\t\twill-change: transform, opacity;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__floater {\n\t\t\t\tright: 12px !important;\n\t\t\t\tleft: auto !important;\n\t\t\t}\n\t\t",()=>{const e=document.getElementById(t);e&&e.remove()}}),[]),a((()=>{ut((t=>t+1)),pt((t=>t+1)),it(!1),dt(!1),mt(new Set)}),[null==C?void 0:C.pathname]),a((()=>{if(!(B.length>0)||j||E||$||nt)0!==B.length||E||X(!0);else{X(!1),K(!1),V(!1),q([]),W(null),G([]);let t=0;const e=10,o=()=>{t++;document.querySelector('[data-testid="whats-new-button"]')?bt(B[0]):t<e?setTimeout(o,1e3):X(!0)};o()}}),[B,j,E,$,nt]),a((()=>{var t;const e=null===(t=null==C?void 0:C.query)||void 0===t?void 0:t.featureId;if(!e||E||0===F.length)return;const o=F.find((t=>t.id===e));if(!o||!o.featureTag)return;K(!0),Z(!0);let n=0;const r=setInterval((()=>{n++;const t=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(t)){const t=[o];G(t),Tt(o,t),clearInterval(r)}else n>=25&&(Z(!1),clearInterval(r))}),200);return()=>{clearInterval(r)}}),[F,null===(I=null==C?void 0:C.query)||void 0===I?void 0:I.featureId,E]),a((()=>{var t;if(F.length>0&&!E&&!O&&!H&&!U&&!J&&Q&&!nt){let t=null,e=null,o=null,n=!1;const r=()=>{if(n||H||U||J||!Q)return;const r=F.filter((t=>{if(!t.featureTag||""===t.featureTag.trim())return!1;if(ft.has(t.id))return!1;const e=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`;return null!==document.querySelector(e)}));r.length>0&&(G(r),Tt(r[0],r),t&&(t.disconnect(),t=null),e&&(window.removeEventListener("scroll",e),e=null),o&&(clearTimeout(o),o=null))};return t=new MutationObserver((t=>{let e=!1;for(const o of t){if("childList"===o.type&&o.addedNodes.length>0)for(let t=0;t<o.addedNodes.length;t++){const n=o.addedNodes[t];if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.id||t.querySelector("[id]")){e=!0;break}}}if(e)break}O||n||H||U||J||!Q||!e||(o&&clearTimeout(o),o=setTimeout((()=>{n||H||U||J||!Q||r()}),200))})),e=()=>{O||n||H||U||J||!Q||(o&&clearTimeout(o),requestAnimationFrame((()=>{o=setTimeout((()=>{n||H||U||J||!Q||r()}),300)})))},t&&t.observe(document.body,{childList:!0,subtree:!0}),e&&window.addEventListener("scroll",e,{passive:!0}),r(),setTimeout((()=>{n||H||U||J||!Q||r()}),100),setTimeout((()=>{n||H||U||J||!Q||r()}),1e3),setTimeout((()=>{n||H||U||J||!Q||r()}),500),()=>{n=!0,t&&t.disconnect(),e&&window.removeEventListener("scroll",e),o&&clearTimeout(o)}}if(0===F.length||E){(null===(t=null==C?void 0:C.query)||void 0===t?void 0:t.featureId)&&U||(V(!1),q([]),W(null),G([]),K(!1))}}),[F,E,O,H,U,J,Q,N,nt]);const bt=t=>{P(t);const o=B.findIndex((e=>e.id===t.id)),n=B.length,r=[{target:l.WHATS_NEW_BUTTON,content:e(c,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>gt(t),onExplore:()=>ht(t),onPrevious:()=>yt(t),onNext:()=>xt(t),setIsClosing:it}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(r),A(!0),v&&T&&v({storeId:T,announcementId:t.id,announcementTitle:t.title,imageUrl:t.displayImage||t.image,videoUrl:t.productVideo})},gt=i((t=>{const e=t||j;e&&(z(!0),B.forEach((t=>{N(t.id)})),A(!1),P(null),R([]),X(!0),w&&T&&w({storeId:T,announcementId:e.id,announcementTitle:e.title,imageUrl:e.displayImage||e.image,videoUrl:e.productVideo,buttonClicked:"Skip",buttonName:"Skip",buttonUrl:void 0}),setTimeout((()=>{z(!1)}),500))}),[j,B,N]),ht=i((t=>{var e;z(!0),N(t.id),t.productVideo&&"Open link"!==(null===(e=t.primaryButton)||void 0===e?void 0:e.action)&&(ot(t.productVideo),tt(!0),rt(!0)),A(!1),P(null),R([]);B.findIndex((e=>e.id===t.id))===B.length-1&&X(!0),w&&T&&w({storeId:T,announcementId:t.id,announcementTitle:t.title,imageUrl:t.displayImage||t.image,videoUrl:t.productVideo,buttonClicked:"Primary",buttonName:t.buttonText||"Explore",buttonUrl:t.redirectUrl||t.productVideo}),setTimeout((()=>{z(!1)}),500)}),[B,N]),yt=i((t=>{const o=t||j;if(!o)return;const n=B.findIndex((t=>t.id===o.id));if(n>0){const t=B[n-1];P(t);const o=n-1,r=B.length,a=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>gt(t),onExplore:()=>ht(t),onPrevious:()=>yt(t),onNext:()=>xt(t),setIsClosing:it}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(a)}}),[j,B]),xt=i((t=>{const o=t||j;if(!o)return;const n=B.findIndex((t=>t.id===o.id));if(n<B.length-1){const t=B[n+1];P(t);const o=n+1,r=B.length,a=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>gt(t),onExplore:()=>ht(t),onPrevious:()=>yt(t),onNext:()=>xt(t),setIsClosing:it}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(a)}else z(!0),N(o.id),A(!1),P(null),R([]),X(!0),setTimeout((()=>{z(!1)}),500)}),[j,B,N]),kt=()=>{if(B.length>0&&!j){document.querySelector('[data-testid="whats-new-button"]')&&bt(B[0])}};a((()=>(window.showMajorUpdatePopup=kt,()=>{delete window.showMajorUpdatePopup})),[B,j]);const St=i((t=>{const{action:e}=t;e===d.CLOSE&&(j&&(z(!0),B.forEach((t=>{N(t.id)})),X(!0),setTimeout((()=>{z(!1)}),500)),A(!1),P(null),R([]))}),[j,B,N]),Ct=i((t=>{const{action:e}=t;if(e===d.CLOSE){if(U){Z(!0),N(U.id);D.findIndex((t=>t.id===U.id))===D.length-1&&K(!0),setTimeout((()=>{Z(!1)}),500)}V(!1),W(null),q([])}}),[U,D,N]),Tt=(o,n)=>t(void 0,void 0,void 0,(function*(){W(o);const t=n||D,r=t.findIndex((t=>t.id===o.id)),a=t.length,i=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`,s=document.querySelector(i);if(s)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(s,120)}catch(t){}const d=[{target:i,content:e(p,{feature:o,currentIndex:r,totalFeatures:a,onSkip:()=>vt(o),onExplore:()=>wt(o),onPrevious:()=>It(o),onNext:()=>Bt(o),setIsClosing:dt}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:o,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(d),V(!0)})),vt=i((t=>{const e=t||U;if(e){Z(!0),N(e.id),mt((t=>new Set(t).add(e.id))),V(!1),W(null),q([]);const t=D.find((t=>t.id!==e.id&&!ft.has(t.id)));setTimeout((()=>{Z(!1),t?Tt(t,D):K(!0)}),500)}}),[U,D,N,ft]),wt=i((t=>{var e;Z(!0),N(t.id),mt((e=>new Set(e).add(t.id)));const o=t.productVideo&&"Open link"!==(null===(e=t.primaryButton)||void 0===e?void 0:e.action);o&&(ot(t.productVideo),tt(!0),rt(!0)),V(!1),W(null),q([]);const n=D.find((e=>e.id!==t.id&&!ft.has(e.id)));setTimeout((()=>{Z(!1),n&&!o?Tt(n,D):n||K(!0)}),500)}),[D,N,ft]),It=i((o=>t(void 0,void 0,void 0,(function*(){const t=o||U;if(!t)return;const n=D.findIndex((e=>e.id===t.id));if(n>0){const t=D[n-1];W(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=document.querySelector(o);if(r)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(r,120)}catch(t){}const a=n-1,i=D.length,s=[{target:o,content:e(p,{feature:t,currentIndex:a,totalFeatures:i,onSkip:()=>vt(t),onExplore:()=>wt(t),onPrevious:()=>It(t),onNext:()=>Bt(t),setIsClosing:dt}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(s)}}))),[U,D]),Bt=i((o=>t(void 0,void 0,void 0,(function*(){const t=o||U;if(!t)return;const n=D.findIndex((e=>e.id===t.id));if(n<D.length-1){const t=D[n+1];W(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=document.querySelector(o);if(r)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(r,120)}catch(t){}const a=n+1,i=D.length,s=[{target:o,content:e(p,{feature:t,currentIndex:a,totalFeatures:i,onSkip:()=>vt(t),onExplore:()=>wt(t),onPrevious:()=>It(t),onNext:()=>Bt(t),setIsClosing:dt}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(s)}else Z(!0),K(!0),N(t.id),V(!1),W(null),q([]),setTimeout((()=>{Z(!1)}),500)}))),[U,D,N]);return o(n,{children:[b,L.length>0&&e(s,{steps:L,run:_,continuous:!1,showProgress:!1,showSkipButton:!1,callback:St,disableOverlayClose:!1,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:at?"transparent":"#212121"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",border:"none",boxShadow:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`major-joyride-${lt}`),M.length>0&&e(s,{steps:M,run:O,continuous:!1,showProgress:!1,showSkipButton:!1,callback:Ct,disableOverlayClose:!1,disableCloseOnEsc:!1,disableOverlay:!1,scrollToFirstStep:!0,scrollOffset:120,disableScrolling:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:st?"transparent":"#ffffff"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",borderRadius:"8px",boxShadow:st?"none":"0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`minor-joyride-${ct}`),e(f,{isOpen:Y,videoUrl:et,onClose:()=>{tt(!1),ot(""),rt(!1);const t=D.find((t=>!ft.has(t.id)));t?setTimeout((()=>{Tt(t,D)}),300):K(!0)}})]})};export{m as default};
2
2
  //# sourceMappingURL=FeatureAnnouncementProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureAnnouncementProvider.js","sources":["../../../../src/components/feature-announcements/FeatureAnnouncementProvider.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport Joyride, { ACTIONS } from 'react-joyride';\nimport { SELECTORS } from './constants';\nimport { useFeatureAnnouncements } from './hooks';\nimport MajorUpdatePopup from './MajorUpdatePopup';\nimport MinorUpdatePopup from './MinorUpdatePopup';\nimport { FeatureAnnouncement, FeatureAnnouncementProviderProps } from './types';\nimport { VideoModal } from './VideoModal';\n\nconst FeatureAnnouncementProvider: React.FC<\n\tFeatureAnnouncementProviderProps\n> = ({\n\tchildren,\n\tfetchVisibleFeatures,\n\tgetStoreFeatureProgress,\n\tfetchFeatureById,\n\tmarkFeatureAsViewedForStore,\n\tisFeatureApplicableToCurrentPage,\n\tmodule,\n\trouter,\n\tstoreId,\n\tonAnnouncementShown,\n\tonAnnouncementInteracted,\n}) => {\n\tconst {\n\t\tmajorUpdateFeatures,\n\t\tminorUpdateFeatures,\n\t\tisLoading,\n\t\tmarkFeatureAsViewed,\n\t} = useFeatureAnnouncements({\n\t\tfetchVisibleFeatures,\n\t\tgetStoreFeatureProgress,\n\t\tfetchFeatureById,\n\t\tmarkFeatureAsViewedForStore,\n\t\tisFeatureApplicableToCurrentPage,\n\t\tmodule,\n\t\trouter,\n\t});\n\n\tconst [currentMajorFeature, setCurrentMajorFeature] =\n\t\tuseState<FeatureAnnouncement | null>(null);\n\tconst [currentMinorFeature, setCurrentMinorFeature] =\n\t\tuseState<FeatureAnnouncement | null>(null);\n\tconst [runJoyride, setRunJoyride] = useState(false);\n\tconst [joyrideSteps, setJoyrideSteps] = useState<any[]>([]);\n\tconst [runMajorJoyride, setRunMajorJoyride] = useState(false);\n\tconst [majorJoyrideSteps, setMajorJoyrideSteps] = useState<any[]>([]);\n\tconst [isProcessingMajorUpdate, setIsProcessingMajorUpdate] = useState(false);\n\tconst [isProcessingMinorUpdate, setIsProcessingMinorUpdate] = useState(false);\n\tconst [availableMinorFeatures, setAvailableMinorFeatures] = useState<\n\t\tFeatureAnnouncement[]\n\t>([]);\n\tconst [minorFeaturesSkipped, setMinorFeaturesSkipped] = useState(false);\n\tconst [showMinorUpdates, setShowMinorUpdates] = useState(false);\n\tconst [isVideoModalOpen, setIsVideoModalOpen] = useState(false);\n\tconst [videoUrl, setVideoUrl] = useState('');\n\tconst [blockPopups, setBlockPopups] = useState(false);\n\tconst [isClosingMajor, setIsClosingMajor] = useState(false);\n\tconst [isClosingMinor, setIsClosingMinor] = useState(false);\n\tconst [majorJoyrideKey, setMajorJoyrideKey] = useState(0);\n\tconst [minorJoyrideKey, setMinorJoyrideKey] = useState(0);\n\tconst [shownMinorFeatureIds, setShownMinorFeatureIds] = useState<Set<string>>(\n\t\tnew Set(),\n\t);\n\n\t// Add custom style for spotlight cutout effect\n\tuseEffect(() => {\n\t\tconst styleId = 'minor-spotlight-cutout-style';\n\t\tlet styleElement = document.getElementById(styleId) as HTMLStyleElement;\n\n\t\tif (!styleElement) {\n\t\t\tstyleElement = document.createElement('style');\n\t\t\tstyleElement.id = styleId;\n\t\t\tdocument.head.appendChild(styleElement);\n\t\t}\n\n\t\tstyleElement.textContent = `\n\t\t\t.react-joyride__spotlight {\n\t\t\t\ttransition: box-shadow 0.3s ease-in-out !important;\n\t\t\t\twill-change: box-shadow, transform;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__tooltip {\n\t\t\t\twill-change: transform, opacity;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__floater {\n\t\t\t\tright: 12px !important;\n\t\t\t\tleft: auto !important;\n\t\t\t}\n\t\t`;\n\n\t\treturn () => {\n\t\t\tconst el = document.getElementById(styleId);\n\t\t\tif (el) {\n\t\t\t\tel.remove();\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Force Joyride remount on navigation to prevent stale state\n\tuseEffect(() => {\n\t\tsetMajorJoyrideKey((prev) => prev + 1);\n\t\tsetMinorJoyrideKey((prev) => prev + 1);\n\t\tsetIsClosingMajor(false);\n\t\tsetIsClosingMinor(false);\n\t\t// Reset session tracking on navigation to allow features to show on new pages\n\t\tsetShownMinorFeatureIds(new Set());\n\t}, [router?.pathname]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tmajorUpdateFeatures.length > 0 &&\n\t\t\t!currentMajorFeature &&\n\t\t\t!isLoading &&\n\t\t\t!isProcessingMajorUpdate &&\n\t\t\t!blockPopups\n\t\t) {\n\t\t\tsetShowMinorUpdates(false);\n\t\t\tsetMinorFeaturesSkipped(false);\n\t\t\tsetRunJoyride(false);\n\t\t\tsetJoyrideSteps([]);\n\t\t\tsetCurrentMinorFeature(null);\n\t\t\tsetAvailableMinorFeatures([]);\n\n\t\t\tlet attempts = 0;\n\t\t\tconst MAX_ATTEMPTS = 10;\n\n\t\t\tconst checkWhatsNewButton = () => {\n\t\t\t\tattempts++;\n\t\t\t\tconst whatsNewButton = document.querySelector(\n\t\t\t\t\t'[data-testid=\"whats-new-button\"]',\n\t\t\t\t);\n\n\t\t\t\tif (whatsNewButton) {\n\t\t\t\t\tshowMajorUpdateJoyride(majorUpdateFeatures[0]);\n\t\t\t\t} else if (attempts < MAX_ATTEMPTS) {\n\t\t\t\t\tsetTimeout(checkWhatsNewButton, 1000);\n\t\t\t\t} else {\n\t\t\t\t\tsetShowMinorUpdates(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tcheckWhatsNewButton();\n\t\t} else if (majorUpdateFeatures.length === 0 && !isLoading) {\n\t\t\tsetShowMinorUpdates(true);\n\t\t}\n\t}, [\n\t\tmajorUpdateFeatures,\n\t\tcurrentMajorFeature,\n\t\tisLoading,\n\t\tisProcessingMajorUpdate,\n\t\tblockPopups,\n\t]);\n\n\tuseEffect(() => {\n\t\t// Only run this special logic if a feature is being forced via URL\n\t\tconst featureIdFromQuery = router?.query?.['featureId'] as string;\n\n\t\tif (!featureIdFromQuery || isLoading || minorUpdateFeatures.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst forcedFeature = minorUpdateFeatures.find(\n\t\t\t(f) => f.id === featureIdFromQuery,\n\t\t);\n\n\t\tif (!forcedFeature || !forcedFeature.featureTag) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent the standard flow from interfering\n\t\tsetMinorFeaturesSkipped(true);\n\t\t// Mark that we're processing to prevent other effects from interfering\n\t\tsetIsProcessingMinorUpdate(true);\n\n\t\tlet attempts = 0;\n\t\tconst maxAttempts = 25; // 5 seconds\n\t\tconst interval = setInterval(() => {\n\t\t\tattempts++;\n\t\t\tconst targetSelector =\n\t\t\t\tforcedFeature.featureTag.startsWith('#') ||\n\t\t\t\tforcedFeature.featureTag.startsWith('.') ||\n\t\t\t\tforcedFeature.featureTag.startsWith('[')\n\t\t\t\t\t? forcedFeature.featureTag\n\t\t\t\t\t: `#${forcedFeature.featureTag}`;\n\n\t\t\tconst element = document.querySelector(targetSelector);\n\n\t\t\tif (element) {\n\t\t\t\t// In test mode, pass the feature array directly to avoid async state issues\n\t\t\t\tconst testModeFeatures = [forcedFeature];\n\t\t\t\tsetAvailableMinorFeatures(testModeFeatures);\n\t\t\t\tshowMinorUpdateJoyride(forcedFeature, testModeFeatures);\n\t\t\t\t// Don't reset processing flag here - let user interaction handle it\n\t\t\t\t// This prevents auto-closing when multiple popups exist or when scrolling\n\t\t\t\tclearInterval(interval);\n\t\t\t} else if (attempts >= maxAttempts) {\n\t\t\t\t// Fallback for safety, though user expects it to be there.\n\t\t\t\t// We could log an error here.\n\t\t\t\t// Only reset on timeout (element not found)\n\t\t\t\tsetIsProcessingMinorUpdate(false);\n\t\t\t\tclearInterval(interval);\n\t\t\t}\n\t\t}, 200);\n\n\t\treturn () => {\n\t\t\tclearInterval(interval);\n\t\t\t// Don't reset processing flag on cleanup - it causes premature popup closure\n\t\t\t// The flag will be managed by user interactions (skip/explore handlers)\n\t\t};\n\t}, [minorUpdateFeatures, router?.query?.['featureId'], isLoading]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tminorUpdateFeatures.length > 0 &&\n\t\t\t!isLoading &&\n\t\t\t!runJoyride &&\n\t\t\t!isProcessingMinorUpdate &&\n\t\t\t!currentMinorFeature &&\n\t\t\t!minorFeaturesSkipped &&\n\t\t\tshowMinorUpdates &&\n\t\t\t!blockPopups\n\t\t) {\n\t\t\tlet observer: MutationObserver | null = null;\n\t\t\tlet scrollListener: (() => void) | null = null;\n\t\t\tlet checkTimeout: ReturnType<typeof setTimeout> | null = null;\n\t\t\tlet isCleanedUp = false;\n\n\t\t\tconst checkElementsAndStartTour = () => {\n\t\t\t\tif (\n\t\t\t\t\tisCleanedUp ||\n\t\t\t\t\tisProcessingMinorUpdate ||\n\t\t\t\t\tcurrentMinorFeature ||\n\t\t\t\t\tminorFeaturesSkipped ||\n\t\t\t\t\t!showMinorUpdates\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tconst availableFeatures = minorUpdateFeatures.filter((feature) => {\n\t\t\t\t\tif (!feature.featureTag || feature.featureTag.trim() === '') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Skip features already shown in this session\n\t\t\t\t\tif (shownMinorFeatureIds.has(feature.id)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst targetSelector =\n\t\t\t\t\t\tfeature.featureTag.startsWith('#') ||\n\t\t\t\t\t\tfeature.featureTag.startsWith('.') ||\n\t\t\t\t\t\tfeature.featureTag.startsWith('[')\n\t\t\t\t\t\t\t? feature.featureTag\n\t\t\t\t\t\t\t: `#${feature.featureTag}`;\n\n\t\t\t\t\tconst element = document.querySelector(targetSelector);\n\t\t\t\t\treturn element !== null;\n\t\t\t\t});\n\n\t\t\t\tif (availableFeatures.length > 0) {\n\t\t\t\t\tsetAvailableMinorFeatures(availableFeatures);\n\t\t\t\t\t// Pass features directly to avoid async state issues\n\t\t\t\t\tshowMinorUpdateJoyride(availableFeatures[0], availableFeatures);\n\n\t\t\t\t\tif (observer) {\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\tobserver = null;\n\t\t\t\t\t}\n\t\t\t\t\tif (scrollListener) {\n\t\t\t\t\t\twindow.removeEventListener('scroll', scrollListener);\n\t\t\t\t\t\tscrollListener = null;\n\t\t\t\t\t}\n\t\t\t\t\tif (checkTimeout) {\n\t\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t\t\tcheckTimeout = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tobserver = new MutationObserver((mutations) => {\n\t\t\t\tlet shouldCheck = false;\n\t\t\t\tfor (const mutation of mutations) {\n\t\t\t\t\tif (mutation.type === 'childList' && mutation.addedNodes.length > 0) {\n\t\t\t\t\t\tfor (let i = 0; i < mutation.addedNodes.length; i++) {\n\t\t\t\t\t\t\tconst node = mutation.addedNodes[i];\n\t\t\t\t\t\t\tif (node.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tconst element = node as Element;\n\t\t\t\t\t\t\t\tif (element.id || element.querySelector('[id]')) {\n\t\t\t\t\t\t\t\t\tshouldCheck = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (shouldCheck) break;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!runJoyride &&\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates &&\n\t\t\t\t\tshouldCheck\n\t\t\t\t) {\n\t\t\t\t\tif (checkTimeout) {\n\t\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t\t}\n\t\t\t\t\tcheckTimeout = setTimeout(() => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\t\t\tshowMinorUpdates\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tscrollListener = () => {\n\t\t\t\tif (\n\t\t\t\t\t!runJoyride &&\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tif (checkTimeout) {\n\t\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t\t}\n\t\t\t\t\t// Use RAF for smoother performance synced with browser paint\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\tcheckTimeout = setTimeout(() => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\t\t\t\tshowMinorUpdates\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (observer) {\n\t\t\t\tobserver.observe(document.body, {\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tsubtree: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (scrollListener) {\n\t\t\t\twindow.addEventListener('scroll', scrollListener, { passive: true });\n\t\t\t}\n\n\t\t\tcheckElementsAndStartTour();\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t}\n\t\t\t}, 100);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t}\n\t\t\t}, 1000);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t}\n\t\t\t}, 500);\n\n\t\t\treturn () => {\n\t\t\t\tisCleanedUp = true;\n\t\t\t\tif (observer) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tif (scrollListener) {\n\t\t\t\t\twindow.removeEventListener('scroll', scrollListener);\n\t\t\t\t}\n\t\t\t\tif (checkTimeout) {\n\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t}\n\t\t\t};\n\t\t} else if (minorUpdateFeatures.length === 0 || isLoading) {\n\t\t\t// Don't clear joyride if we're in test mode with an active feature\n\t\t\tconst featureIdFromQuery = router?.query?.['featureId'] as string;\n\t\t\tconst isTestModeWithActiveFeature =\n\t\t\t\tfeatureIdFromQuery && currentMinorFeature;\n\n\t\t\tif (!isTestModeWithActiveFeature) {\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetJoyrideSteps([]);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetAvailableMinorFeatures([]);\n\t\t\t\tsetMinorFeaturesSkipped(false);\n\t\t\t}\n\t\t}\n\t}, [\n\t\tminorUpdateFeatures,\n\t\tisLoading,\n\t\trunJoyride,\n\t\tisProcessingMinorUpdate,\n\t\tcurrentMinorFeature,\n\t\tminorFeaturesSkipped,\n\t\tshowMinorUpdates,\n\t\tmarkFeatureAsViewed,\n\t\tblockPopups,\n\t]);\n\n\tconst showMajorUpdateJoyride = (feature) => {\n\t\tsetCurrentMajorFeature(feature);\n\n\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t(f) => f.id === feature.id,\n\t\t);\n\t\tconst totalFeatures = majorUpdateFeatures.length;\n\n\t\tconst majorSteps = [\n\t\t\t{\n\t\t\t\ttarget: SELECTORS.WHATS_NEW_BUTTON,\n\t\t\t\tcontent: (\n\t\t\t\t\t<MajorUpdatePopup\n\t\t\t\t\t\tfeature={feature}\n\t\t\t\t\t\tcurrentIndex={currentIndex}\n\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\tonSkip={() => handleSkipMajorUpdate(feature)}\n\t\t\t\t\t\tonExplore={(triggeredAction) => handleExploreFeature(feature, triggeredAction)}\n\t\t\t\t\t\tonPrevious={() => handlePreviousMajorUpdate(feature)}\n\t\t\t\t\t\tonNext={() => handleNextMajorUpdate(feature)}\n\t\t\t\t\t\tsetIsClosing={setIsClosingMajor}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tplacementBeacon: 'top-end',\n\t\t\t\tdisableBeacon: true,\n\t\t\t\thideCloseButton: true,\n\t\t\t\thideSkipButton: true,\n\t\t\t\thideFooter: true,\n\t\t\t\toffset: 0,\n\t\t\t\tdata: { feature, isMajor: true },\n\t\t\t\tstyles: {\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t},\n\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t},\n\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tsetMajorJoyrideSteps(majorSteps);\n\t\tsetRunMajorJoyride(true);\n\n\t\t// Fire announcement shown callback\n\t\tif (onAnnouncementShown && storeId) {\n\t\t\tonAnnouncementShown({\n\t\t\t\tstoreId,\n\t\t\t\tannouncementId: feature.id,\n\t\t\t\tannouncementTitle: feature.title,\n\t\t\t\timageUrl: feature.displayImage || feature.image,\n\t\t\t\tvideoUrl: feature.productVideo,\n\t\t\t});\n\t\t}\n\t};\n\n\tconst handleSkipMajorUpdate = useCallback(\n\t\tasync (feature) => {\n\t\t\tconst targetFeature = feature || currentMajorFeature;\n\n\t\t\tif (targetFeature) {\n\t\t\t\tsetIsProcessingMajorUpdate(true);\n\n\t\t\t\tawait Promise.all(\n\t\t\t\t\tmajorUpdateFeatures.map((majorFeature) =>\n\t\t\t\t\t\tmarkFeatureAsViewed(majorFeature.id),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tsetRunMajorJoyride(false);\n\t\t\t\tsetCurrentMajorFeature(null);\n\t\t\t\tsetMajorJoyrideSteps([]);\n\n\t\t\t\tsetShowMinorUpdates(true);\n\n\t\t\t\t// Fire announcement interacted callback for Skip\n\t\t\t\tif (onAnnouncementInteracted && storeId) {\n\t\t\t\t\tonAnnouncementInteracted({\n\t\t\t\t\t\tstoreId,\n\t\t\t\t\t\tannouncementId: targetFeature.id,\n\t\t\t\t\t\tannouncementTitle: targetFeature.title,\n\t\t\t\t\t\timageUrl: targetFeature.displayImage || targetFeature.image,\n\t\t\t\t\t\tvideoUrl: targetFeature.productVideo,\n\t\t\t\t\t\tbuttonClicked: 'Skip',\n\t\t\t\t\t\tbuttonName: 'Skip',\n\t\t\t\t\t\tbuttonUrl: undefined,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t\t}, 500);\n\t\t\t} else {\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst handleExploreFeature = useCallback(\n\t\tasync (feature, triggeredAction?: string) => {\n\t\t\tsetIsProcessingMajorUpdate(true);\n\t\t\t// Await so the feature is marked before any page navigation\n\t\t\tawait markFeatureAsViewed(feature.id);\n\n\t\t\t// Use the action passed from the popup (could be primary or secondary button action)\n\t\t\tconst action = triggeredAction ?? feature.primaryButton?.action;\n\n\t\t\t// Only open video modal when the action is explicitly \"Play Video\"\n\t\t\tif (action === 'Play Video' && feature.productVideo) {\n\t\t\t\tsetVideoUrl(feature.productVideo);\n\t\t\t\tsetIsVideoModalOpen(true);\n\t\t\t\tsetBlockPopups(true);\n\t\t\t}\n\n\t\t\t// For internal link navigation: navigate AFTER the feature is marked as viewed\n\t\t\tif (action === 'Open link') {\n\t\t\t\tconst url = feature.primaryButton?.redirectionUrl || feature.redirectUrl;\n\t\t\t\tif (url && !url.startsWith('http')) {\n\t\t\t\t\twindow.location.href = url;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsetRunMajorJoyride(false);\n\t\t\tsetCurrentMajorFeature(null);\n\t\t\tsetMajorJoyrideSteps([]);\n\t\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t\t(f) => f.id === feature.id,\n\t\t\t);\n\t\t\tconst isLastMajorUpdate = currentIndex === majorUpdateFeatures.length - 1;\n\t\t\tif (isLastMajorUpdate) {\n\t\t\t\tsetShowMinorUpdates(true);\n\t\t\t}\n\n\t\t\t// Fire announcement interacted callback for Primary button\n\t\t\tif (onAnnouncementInteracted && storeId) {\n\t\t\t\tonAnnouncementInteracted({\n\t\t\t\t\tstoreId,\n\t\t\t\t\tannouncementId: feature.id,\n\t\t\t\t\tannouncementTitle: feature.title,\n\t\t\t\t\timageUrl: feature.displayImage || feature.image,\n\t\t\t\t\tvideoUrl: feature.productVideo,\n\t\t\t\t\tbuttonClicked: 'Primary',\n\t\t\t\t\tbuttonName: feature.buttonText || 'Explore',\n\t\t\t\t\tbuttonUrl: feature.redirectUrl || feature.productVideo,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t}, 500);\n\t\t},\n\t\t[majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst handlePreviousMajorUpdate = useCallback(\n\t\t(feature) => {\n\t\t\tconst targetFeature = feature || currentMajorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\tconst prevFeature = majorUpdateFeatures[currentIndex - 1];\n\t\t\t\tsetCurrentMajorFeature(prevFeature);\n\n\t\t\t\tconst prevIndex = currentIndex - 1;\n\t\t\t\tconst totalFeatures = majorUpdateFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: '[data-testid=\"whats-new-button\"]',\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MajorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={prevFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={prevIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMajorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonExplore={(triggeredAction) => handleExploreFeature(prevFeature, triggeredAction)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMajorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMajorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMajor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\tplacementBeacon: 'top-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: prevFeature, isMajor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetMajorJoyrideSteps(updatedSteps);\n\t\t\t} else {\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures],\n\t);\n\n\tconst handleNextMajorUpdate = useCallback(\n\t\t(feature) => {\n\t\t\tconst targetFeature = feature || currentMajorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex < majorUpdateFeatures.length - 1) {\n\t\t\t\tconst nextFeature = majorUpdateFeatures[currentIndex + 1];\n\t\t\t\tsetCurrentMajorFeature(nextFeature);\n\n\t\t\t\tconst nextIndex = currentIndex + 1;\n\t\t\t\tconst totalFeatures = majorUpdateFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: '[data-testid=\"whats-new-button\"]',\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MajorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={nextFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={nextIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMajorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonExplore={(triggeredAction) => handleExploreFeature(nextFeature, triggeredAction)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMajorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMajorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMajor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\tplacementBeacon: 'top-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: nextFeature, isMajor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetMajorJoyrideSteps(updatedSteps);\n\t\t\t} else {\n\t\t\t\tsetIsProcessingMajorUpdate(true);\n\n\t\t\t\tmarkFeatureAsViewed(targetFeature.id);\n\t\t\t\tsetRunMajorJoyride(false);\n\t\t\t\tsetCurrentMajorFeature(null);\n\t\t\t\tsetMajorJoyrideSteps([]);\n\n\t\t\t\tsetShowMinorUpdates(true);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst showMajorUpdatePopup = () => {\n\t\tif (majorUpdateFeatures.length > 0 && !currentMajorFeature) {\n\t\t\tconst whatsNewButton = document.querySelector(\n\t\t\t\t'[data-testid=\"whats-new-button\"]',\n\t\t\t);\n\n\t\t\tif (whatsNewButton) {\n\t\t\t\tshowMajorUpdateJoyride(majorUpdateFeatures[0]);\n\t\t\t}\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\t(window as any).showMajorUpdatePopup = showMajorUpdatePopup;\n\t\treturn () => {\n\t\t\tdelete (window as any).showMajorUpdatePopup;\n\t\t};\n\t}, [majorUpdateFeatures, currentMajorFeature]);\n\tconst handleMajorJoyrideCallback = useCallback(\n\t\t(data) => {\n\t\t\tconst { action } = data;\n\n\t\t\tif (action === ACTIONS.CLOSE) {\n\t\t\t\tif (currentMajorFeature) {\n\t\t\t\t\tsetIsProcessingMajorUpdate(true);\n\n\t\t\t\t\tmajorUpdateFeatures.forEach((majorFeature) => {\n\t\t\t\t\t\tmarkFeatureAsViewed(majorFeature.id);\n\t\t\t\t\t});\n\n\t\t\t\t\tsetShowMinorUpdates(true);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\n\t\t\t\tsetRunMajorJoyride(false);\n\t\t\t\tsetCurrentMajorFeature(null);\n\t\t\t\tsetMajorJoyrideSteps([]);\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst handleMinorJoyrideCallback = useCallback(\n\t\t(data) => {\n\t\t\tconst { action } = data;\n\n\t\t\tif (action === ACTIONS.CLOSE) {\n\t\t\t\tif (currentMinorFeature) {\n\t\t\t\t\tsetIsProcessingMinorUpdate(true);\n\n\t\t\t\t\t// Only mark the current feature as viewed, not all features\n\t\t\t\t\tmarkFeatureAsViewed(currentMinorFeature.id);\n\n\t\t\t\t\t// Check if there are more features to show\n\t\t\t\t\tconst currentIndex = availableMinorFeatures.findIndex(\n\t\t\t\t\t\t(f) => f.id === currentMinorFeature.id,\n\t\t\t\t\t);\n\t\t\t\t\tconst isLastFeature =\n\t\t\t\t\t\tcurrentIndex === availableMinorFeatures.length - 1;\n\n\t\t\t\t\tif (isLastFeature) {\n\t\t\t\t\t\t// Only skip remaining features if this was the last one\n\t\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t\t}\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tsetIsProcessingMinorUpdate(false);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetJoyrideSteps([]);\n\t\t\t}\n\t\t},\n\t\t[currentMinorFeature, availableMinorFeatures, markFeatureAsViewed],\n\t);\n\tconst showMinorUpdateJoyride = async (feature, featuresToUse?) => {\n\t\tsetCurrentMinorFeature(feature);\n\n\t\t// Use provided features array or fall back to state (for test mode)\n\t\tconst features = featuresToUse || availableMinorFeatures;\n\t\tconst currentIndex = features.findIndex((f) => f.id === feature.id);\n\t\tconst totalFeatures = features.length;\n\n\t\tconst targetSelector =\n\t\t\tfeature.featureTag.startsWith('#') ||\n\t\t\tfeature.featureTag.startsWith('.') ||\n\t\t\tfeature.featureTag.startsWith('[')\n\t\t\t\t? feature.featureTag\n\t\t\t\t: `#${feature.featureTag}`;\n\n\t\t// Scroll to target element smoothly before showing popup\n\t\tconst targetElement = document.querySelector(targetSelector);\n\t\tif (targetElement) {\n\t\t\ttry {\n\t\t\t\t// Dynamically import to avoid circular dependencies\n\t\t\t\tconst { scrollToElementSmooth } = await import(\n\t\t\t\t\t'./utils/elementHelpers'\n\t\t\t\t);\n\t\t\t\tawait scrollToElementSmooth(targetElement, 120);\n\t\t\t} catch (error) {\n\t\t\t\t// Scroll failed silently\n\t\t\t}\n\t\t}\n\n\t\tconst minorSteps = [\n\t\t\t{\n\t\t\t\ttarget: targetSelector,\n\t\t\t\tcontent: (\n\t\t\t\t\t<MinorUpdatePopup\n\t\t\t\t\t\tfeature={feature}\n\t\t\t\t\t\tcurrentIndex={currentIndex}\n\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\tonSkip={() => handleSkipMinorUpdate(feature)}\n\t\t\t\t\t\tonExplore={(triggeredAction) => handleExploreMinorFeature(feature, triggeredAction)}\n\t\t\t\t\t\tonPrevious={() => handlePreviousMinorUpdate(feature)}\n\t\t\t\t\t\tonNext={() => handleNextMinorUpdate(feature)}\n\t\t\t\t\t\tsetIsClosing={setIsClosingMinor}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tplacement: 'bottom',\n\t\t\t\tplacementBeacon: 'bottom-end',\n\t\t\t\tdisableBeacon: true,\n\t\t\t\thideCloseButton: true,\n\t\t\t\thideSkipButton: true,\n\t\t\t\thideFooter: true,\n\t\t\t\toffset: 0,\n\t\t\t\tdata: { feature, isMinor: true },\n\t\t\t\tstyles: {\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t},\n\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t},\n\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t\tsetJoyrideSteps(minorSteps);\n\t\tsetRunJoyride(true);\n\t};\n\n\tconst handleSkipMinorUpdate = useCallback(\n\t\tasync (feature) => {\n\t\t\tconst targetFeature = feature || currentMinorFeature;\n\n\t\t\tif (targetFeature) {\n\t\t\t\tsetIsProcessingMinorUpdate(true);\n\n\t\t\t\t// Only mark the current feature as viewed, not all features\n\t\t\t\tawait markFeatureAsViewed(targetFeature.id);\n\n\t\t\t\t// Add to session tracker to prevent re-showing\n\t\t\t\tsetShownMinorFeatureIds((prev) => new Set(prev).add(targetFeature.id));\n\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetJoyrideSteps([]);\n\n\t\t\t\t// Find next unshown feature\n\t\t\t\tconst nextFeature = availableMinorFeatures.find(\n\t\t\t\t\t(f) => f.id !== targetFeature.id && !shownMinorFeatureIds.has(f.id),\n\t\t\t\t);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMinorUpdate(false);\n\n\t\t\t\t\tif (nextFeature) {\n\t\t\t\t\t\t// Auto-advance to next feature\n\t\t\t\t\t\tshowMinorUpdateJoyride(nextFeature, availableMinorFeatures);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// No more features to show\n\t\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t\t}\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tcurrentMinorFeature,\n\t\t\tavailableMinorFeatures,\n\t\t\tmarkFeatureAsViewed,\n\t\t\tshownMinorFeatureIds,\n\t\t],\n\t);\n\n\tconst handleExploreMinorFeature = useCallback(\n\t\tasync (feature, triggeredAction?: string) => {\n\t\t\tsetIsProcessingMinorUpdate(true);\n\n\t\t\t// Only mark the current feature as viewed\n\t\t\t// Await so the feature is marked before any page navigation\n\t\t\tawait markFeatureAsViewed(feature.id);\n\n\t\t\t// Add to session tracker to prevent re-showing\n\t\t\tsetShownMinorFeatureIds((prev) => new Set(prev).add(feature.id));\n\n\t\t\t// Use the action passed from the popup (could be primary or secondary button action)\n\t\t\tconst action = triggeredAction ?? feature.primaryButton?.action;\n\n\t\t\t// Only open video modal when the action is explicitly \"Play Video\"\n\t\t\tif (action === 'Play Video' && feature.productVideo) {\n\t\t\t\tsetVideoUrl(feature.productVideo);\n\t\t\t\tsetIsVideoModalOpen(true);\n\t\t\t\tsetBlockPopups(true);\n\t\t\t}\n\n\t\t\t// For internal link navigation: navigate AFTER the feature is marked as viewed\n\t\t\tif (action === 'Open link') {\n\t\t\t\tconst url = feature.primaryButton?.redirectionUrl || feature.redirectUrl;\n\t\t\t\tif (url && !url.startsWith('http')) {\n\t\t\t\t\twindow.location.href = url;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsetRunJoyride(false);\n\t\t\tsetCurrentMinorFeature(null);\n\t\t\tsetJoyrideSteps([]);\n\n\t\t\t// Find next unshown feature (only auto-advance if no video modal)\n\t\t\tconst nextFeature = availableMinorFeatures.find(\n\t\t\t\t(f) => f.id !== feature.id && !shownMinorFeatureIds.has(f.id),\n\t\t\t);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetIsProcessingMinorUpdate(false);\n\n\t\t\t\t// Only auto-advance if no video modal is opened\n\t\t\t\tif (nextFeature && action !== 'Play Video') {\n\t\t\t\t\t// Auto-advance to next feature\n\t\t\t\t\tshowMinorUpdateJoyride(nextFeature, availableMinorFeatures);\n\t\t\t\t} else if (!nextFeature) {\n\t\t\t\t\t// No more features to show\n\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t}\n\t\t\t\t// If video modal opened, wait for user to close it before advancing\n\t\t\t}, 500);\n\t\t},\n\t\t[availableMinorFeatures, markFeatureAsViewed, shownMinorFeatureIds],\n\t);\n\n\tconst handlePreviousMinorUpdate = useCallback(\n\t\tasync (feature) => {\n\t\t\tconst targetFeature = feature || currentMinorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = availableMinorFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\tconst prevFeature = availableMinorFeatures[currentIndex - 1];\n\t\t\t\tsetCurrentMinorFeature(prevFeature);\n\n\t\t\t\tconst targetSelector =\n\t\t\t\t\tprevFeature.featureTag.startsWith('#') ||\n\t\t\t\t\tprevFeature.featureTag.startsWith('.') ||\n\t\t\t\t\tprevFeature.featureTag.startsWith('[')\n\t\t\t\t\t\t? prevFeature.featureTag\n\t\t\t\t\t\t: `#${prevFeature.featureTag}`;\n\n\t\t\t\t// Scroll to the previous feature element\n\t\t\t\tconst targetElement = document.querySelector(targetSelector);\n\t\t\t\tif (targetElement) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst { scrollToElementSmooth } = await import(\n\t\t\t\t\t\t\t'./utils/elementHelpers'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait scrollToElementSmooth(targetElement, 120);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// Scroll failed silently\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst prevIndex = currentIndex - 1;\n\t\t\t\tconst totalFeatures = availableMinorFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: targetSelector,\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MinorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={prevFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={prevIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMinorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonExplore={(triggeredAction) => handleExploreMinorFeature(prevFeature, triggeredAction)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMinorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMinorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMinor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\tplacementBeacon: 'bottom-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: prevFeature, isMinor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetJoyrideSteps(updatedSteps);\n\t\t\t}\n\t\t},\n\t\t[currentMinorFeature, availableMinorFeatures],\n\t);\n\n\tconst handleNextMinorUpdate = useCallback(\n\t\tasync (feature) => {\n\t\t\tconst targetFeature = feature || currentMinorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = availableMinorFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex < availableMinorFeatures.length - 1) {\n\t\t\t\tconst nextFeature = availableMinorFeatures[currentIndex + 1];\n\t\t\t\tsetCurrentMinorFeature(nextFeature);\n\n\t\t\t\tconst targetSelector =\n\t\t\t\t\tnextFeature.featureTag.startsWith('#') ||\n\t\t\t\t\tnextFeature.featureTag.startsWith('.') ||\n\t\t\t\t\tnextFeature.featureTag.startsWith('[')\n\t\t\t\t\t\t? nextFeature.featureTag\n\t\t\t\t\t\t: `#${nextFeature.featureTag}`;\n\n\t\t\t\t// Scroll to the next feature element\n\t\t\t\tconst targetElement = document.querySelector(targetSelector);\n\t\t\t\tif (targetElement) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst { scrollToElementSmooth } = await import(\n\t\t\t\t\t\t\t'./utils/elementHelpers'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait scrollToElementSmooth(targetElement, 120);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// Scroll failed silently\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst nextIndex = currentIndex + 1;\n\t\t\t\tconst totalFeatures = availableMinorFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: targetSelector,\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MinorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={nextFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={nextIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMinorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonExplore={(triggeredAction) => handleExploreMinorFeature(nextFeature, triggeredAction)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMinorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMinorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMinor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\tplacementBeacon: 'bottom-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: nextFeature, isMinor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetJoyrideSteps(updatedSteps);\n\t\t\t} else {\n\t\t\t\tsetIsProcessingMinorUpdate(true);\n\t\t\t\tsetMinorFeaturesSkipped(true);\n\n\t\t\t\tmarkFeatureAsViewed(targetFeature.id);\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetJoyrideSteps([]);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMinorUpdate(false);\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t\t[currentMinorFeature, availableMinorFeatures, markFeatureAsViewed],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{children}\n\n\t\t\t{majorJoyrideSteps.length > 0 && (\n\t\t\t\t<Joyride\n\t\t\t\t\tkey={`major-joyride-${majorJoyrideKey}`}\n\t\t\t\t\tsteps={majorJoyrideSteps}\n\t\t\t\t\trun={runMajorJoyride}\n\t\t\t\t\tcontinuous={false}\n\t\t\t\t\tshowProgress={false}\n\t\t\t\t\tshowSkipButton={false}\n\t\t\t\t\tcallback={handleMajorJoyrideCallback}\n\t\t\t\t\tdisableOverlayClose={false}\n\t\t\t\t\tdisableCloseOnEsc={false}\n\t\t\t\t\tdisableOverlay={false}\n\t\t\t\t\tspotlightClicks={false}\n\t\t\t\t\tstyles={{\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tprimaryColor: '#007bff',\n\t\t\t\t\t\t\tzIndex: 10000,\n\t\t\t\t\t\t\twidth: 'auto',\n\t\t\t\t\t\t\tarrowColor: isClosingMajor ? 'transparent' : '#212121',\n\t\t\t\t\t\t},\n\t\t\t\t\t\toverlay: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tspotlight: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t}}\n\t\t\t\t\tlocale={{\n\t\t\t\t\t\tback: 'Back',\n\t\t\t\t\t\tclose: 'Close',\n\t\t\t\t\t\tlast: 'Close',\n\t\t\t\t\t\tnext: 'Next',\n\t\t\t\t\t\tskip: 'Skip',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{joyrideSteps.length > 0 && (\n\t\t\t\t<Joyride\n\t\t\t\t\tkey={`minor-joyride-${minorJoyrideKey}`}\n\t\t\t\t\tsteps={joyrideSteps}\n\t\t\t\t\trun={runJoyride}\n\t\t\t\t\tcontinuous={false}\n\t\t\t\t\tshowProgress={false}\n\t\t\t\t\tshowSkipButton={false}\n\t\t\t\t\tcallback={handleMinorJoyrideCallback}\n\t\t\t\t\tdisableOverlayClose={false}\n\t\t\t\t\tdisableCloseOnEsc={false}\n\t\t\t\t\tdisableOverlay={false}\n\t\t\t\t\tscrollToFirstStep={true}\n\t\t\t\t\tscrollOffset={120}\n\t\t\t\t\tdisableScrolling={false}\n\t\t\t\t\tstyles={{\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tprimaryColor: '#007bff',\n\t\t\t\t\t\t\tzIndex: 10000,\n\t\t\t\t\t\t\twidth: 'auto',\n\t\t\t\t\t\t\tarrowColor: isClosingMinor ? 'transparent' : '#ffffff',\n\t\t\t\t\t\t},\n\t\t\t\t\t\toverlay: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tspotlight: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborderRadius: '8px',\n\t\t\t\t\t\t\tboxShadow: isClosingMinor\n\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t: '0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t}}\n\t\t\t\t\tlocale={{\n\t\t\t\t\t\tback: 'Back',\n\t\t\t\t\t\tclose: 'Close',\n\t\t\t\t\t\tlast: 'Close',\n\t\t\t\t\t\tnext: 'Next',\n\t\t\t\t\t\tskip: 'Skip',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<VideoModal\n\t\t\t\tisOpen={isVideoModalOpen}\n\t\t\t\tvideoUrl={videoUrl}\n\t\t\t\tonClose={() => {\n\t\t\t\t\tsetIsVideoModalOpen(false);\n\t\t\t\t\tsetVideoUrl('');\n\t\t\t\t\tsetBlockPopups(false);\n\n\t\t\t\t\t// After video modal closes, check if there are more features to show\n\t\t\t\t\tconst nextFeature = availableMinorFeatures.find(\n\t\t\t\t\t\t(f) => !shownMinorFeatureIds.has(f.id),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (nextFeature) {\n\t\t\t\t\t\t// Auto-advance to next feature after video\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tshowMinorUpdateJoyride(nextFeature, availableMinorFeatures);\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// No more features to show\n\t\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n\n};\n\nexport default FeatureAnnouncementProvider;\n"],"names":["FeatureAnnouncementProvider","_ref","children","fetchVisibleFeatures","getStoreFeatureProgress","fetchFeatureById","markFeatureAsViewedForStore","isFeatureApplicableToCurrentPage","module","router","storeId","onAnnouncementShown","onAnnouncementInteracted","majorUpdateFeatures","minorUpdateFeatures","isLoading","markFeatureAsViewed","useFeatureAnnouncements","currentMajorFeature","setCurrentMajorFeature","useState","currentMinorFeature","setCurrentMinorFeature","runJoyride","setRunJoyride","joyrideSteps","setJoyrideSteps","runMajorJoyride","setRunMajorJoyride","majorJoyrideSteps","setMajorJoyrideSteps","isProcessingMajorUpdate","setIsProcessingMajorUpdate","isProcessingMinorUpdate","setIsProcessingMinorUpdate","availableMinorFeatures","setAvailableMinorFeatures","minorFeaturesSkipped","setMinorFeaturesSkipped","showMinorUpdates","setShowMinorUpdates","isVideoModalOpen","setIsVideoModalOpen","videoUrl","setVideoUrl","blockPopups","setBlockPopups","isClosingMajor","setIsClosingMajor","isClosingMinor","setIsClosingMinor","majorJoyrideKey","setMajorJoyrideKey","minorJoyrideKey","setMinorJoyrideKey","shownMinorFeatureIds","setShownMinorFeatureIds","Set","useEffect","styleId","styleElement","document","getElementById","createElement","id","head","appendChild","textContent","el","remove","prev","pathname","length","attempts","MAX_ATTEMPTS","checkWhatsNewButton","querySelector","showMajorUpdateJoyride","setTimeout","featureIdFromQuery","_a","query","forcedFeature","find","f","featureTag","interval","setInterval","targetSelector","startsWith","testModeFeatures","showMinorUpdateJoyride","clearInterval","observer","scrollListener","checkTimeout","isCleanedUp","checkElementsAndStartTour","availableFeatures","filter","feature","trim","has","disconnect","window","removeEventListener","clearTimeout","MutationObserver","mutations","shouldCheck","mutation","type","addedNodes","i","node","nodeType","Node","ELEMENT_NODE","element","requestAnimationFrame","observe","body","childList","subtree","addEventListener","passive","currentIndex","findIndex","totalFeatures","majorSteps","target","SELECTORS","WHATS_NEW_BUTTON","content","_jsx","MajorUpdatePopup","onSkip","handleSkipMajorUpdate","onExplore","triggeredAction","handleExploreFeature","onPrevious","handlePreviousMajorUpdate","onNext","handleNextMajorUpdate","setIsClosing","placement","placementBeacon","disableBeacon","hideCloseButton","hideSkipButton","hideFooter","offset","data","isMajor","styles","tooltip","padding","backgroundColor","borderRadius","border","boxShadow","tooltipContent","buttonNext","display","buttonBack","buttonClose","buttonSkip","announcementId","announcementTitle","title","imageUrl","displayImage","image","productVideo","useCallback","__awaiter","targetFeature","Promise","all","map","majorFeature","buttonClicked","buttonName","buttonUrl","undefined","action","_b","primaryButton","url","_c","redirectionUrl","redirectUrl","location","href","buttonText","prevFeature","prevIndex","updatedSteps","nextFeature","nextIndex","showMajorUpdatePopup","handleMajorJoyrideCallback","ACTIONS","CLOSE","forEach","handleMinorJoyrideCallback","featuresToUse","features","targetElement","scrollToElementSmooth","import","error","minorSteps","MinorUpdatePopup","handleSkipMinorUpdate","handleExploreMinorFeature","handlePreviousMinorUpdate","handleNextMinorUpdate","isMinor","add","_d","_e","_jsxs","_Fragment","Joyride","steps","run","continuous","showProgress","showSkipButton","callback","disableOverlayClose","disableCloseOnEsc","disableOverlay","spotlightClicks","options","primaryColor","zIndex","width","arrowColor","overlay","spotlight","fontSize","locale","back","close","last","next","skip","scrollToFirstStep","scrollOffset","disableScrolling","VideoModal","isOpen","onClose"],"mappings":"4fASMA,MAAAA,EAEFC,IAYC,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IAAIlB,EAAEpB,MAGhCuI,EAEHzH,YAAW,KACVa,GAAuB4G,EAAapK,EAAuB,GACzD,KAGHG,GAAwB,EACxB,MAGD"}
1
+ {"version":3,"file":"FeatureAnnouncementProvider.js","sources":["../../../../src/components/feature-announcements/FeatureAnnouncementProvider.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport Joyride, { ACTIONS } from 'react-joyride';\nimport { SELECTORS } from './constants';\nimport { useFeatureAnnouncements } from './hooks';\nimport MajorUpdatePopup from './MajorUpdatePopup';\nimport MinorUpdatePopup from './MinorUpdatePopup';\nimport { FeatureAnnouncement, FeatureAnnouncementProviderProps } from './types';\nimport { VideoModal } from './VideoModal';\n\nconst FeatureAnnouncementProvider: React.FC<\n\tFeatureAnnouncementProviderProps\n> = ({\n\tchildren,\n\tfetchVisibleFeatures,\n\tgetStoreFeatureProgress,\n\tfetchFeatureById,\n\tmarkFeatureAsViewedForStore,\n\tisFeatureApplicableToCurrentPage,\n\tmodule,\n\trouter,\n\tstoreId,\n\tonAnnouncementShown,\n\tonAnnouncementInteracted,\n}) => {\n\tconst {\n\t\tmajorUpdateFeatures,\n\t\tminorUpdateFeatures,\n\t\tisLoading,\n\t\tmarkFeatureAsViewed,\n\t} = useFeatureAnnouncements({\n\t\tfetchVisibleFeatures,\n\t\tgetStoreFeatureProgress,\n\t\tfetchFeatureById,\n\t\tmarkFeatureAsViewedForStore,\n\t\tisFeatureApplicableToCurrentPage,\n\t\tmodule,\n\t\trouter,\n\t});\n\n\tconst [currentMajorFeature, setCurrentMajorFeature] =\n\t\tuseState<FeatureAnnouncement | null>(null);\n\tconst [currentMinorFeature, setCurrentMinorFeature] =\n\t\tuseState<FeatureAnnouncement | null>(null);\n\tconst [runJoyride, setRunJoyride] = useState(false);\n\tconst [joyrideSteps, setJoyrideSteps] = useState<any[]>([]);\n\tconst [runMajorJoyride, setRunMajorJoyride] = useState(false);\n\tconst [majorJoyrideSteps, setMajorJoyrideSteps] = useState<any[]>([]);\n\tconst [isProcessingMajorUpdate, setIsProcessingMajorUpdate] = useState(false);\n\tconst [isProcessingMinorUpdate, setIsProcessingMinorUpdate] = useState(false);\n\tconst [availableMinorFeatures, setAvailableMinorFeatures] = useState<\n\t\tFeatureAnnouncement[]\n\t>([]);\n\tconst [minorFeaturesSkipped, setMinorFeaturesSkipped] = useState(false);\n\tconst [showMinorUpdates, setShowMinorUpdates] = useState(false);\n\tconst [isVideoModalOpen, setIsVideoModalOpen] = useState(false);\n\tconst [videoUrl, setVideoUrl] = useState('');\n\tconst [blockPopups, setBlockPopups] = useState(false);\n\tconst [isClosingMajor, setIsClosingMajor] = useState(false);\n\tconst [isClosingMinor, setIsClosingMinor] = useState(false);\n\tconst [majorJoyrideKey, setMajorJoyrideKey] = useState(0);\n\tconst [minorJoyrideKey, setMinorJoyrideKey] = useState(0);\n\tconst [shownMinorFeatureIds, setShownMinorFeatureIds] = useState<Set<string>>(\n\t\tnew Set(),\n\t);\n\n\t// Add custom style for spotlight cutout effect\n\tuseEffect(() => {\n\t\tconst styleId = 'minor-spotlight-cutout-style';\n\t\tlet styleElement = document.getElementById(styleId) as HTMLStyleElement;\n\n\t\tif (!styleElement) {\n\t\t\tstyleElement = document.createElement('style');\n\t\t\tstyleElement.id = styleId;\n\t\t\tdocument.head.appendChild(styleElement);\n\t\t}\n\n\t\tstyleElement.textContent = `\n\t\t\t.react-joyride__spotlight {\n\t\t\t\ttransition: box-shadow 0.3s ease-in-out !important;\n\t\t\t\twill-change: box-shadow, transform;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__tooltip {\n\t\t\t\twill-change: transform, opacity;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__floater {\n\t\t\t\tright: 12px !important;\n\t\t\t\tleft: auto !important;\n\t\t\t}\n\t\t`;\n\n\t\treturn () => {\n\t\t\tconst el = document.getElementById(styleId);\n\t\t\tif (el) {\n\t\t\t\tel.remove();\n\t\t\t}\n\t\t};\n\t}, []);\n\n\t// Force Joyride remount on navigation to prevent stale state\n\tuseEffect(() => {\n\t\tsetMajorJoyrideKey((prev) => prev + 1);\n\t\tsetMinorJoyrideKey((prev) => prev + 1);\n\t\tsetIsClosingMajor(false);\n\t\tsetIsClosingMinor(false);\n\t\t// Reset session tracking on navigation to allow features to show on new pages\n\t\tsetShownMinorFeatureIds(new Set());\n\t}, [router?.pathname]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tmajorUpdateFeatures.length > 0 &&\n\t\t\t!currentMajorFeature &&\n\t\t\t!isLoading &&\n\t\t\t!isProcessingMajorUpdate &&\n\t\t\t!blockPopups\n\t\t) {\n\t\t\tsetShowMinorUpdates(false);\n\t\t\tsetMinorFeaturesSkipped(false);\n\t\t\tsetRunJoyride(false);\n\t\t\tsetJoyrideSteps([]);\n\t\t\tsetCurrentMinorFeature(null);\n\t\t\tsetAvailableMinorFeatures([]);\n\n\t\t\tlet attempts = 0;\n\t\t\tconst MAX_ATTEMPTS = 10;\n\n\t\t\tconst checkWhatsNewButton = () => {\n\t\t\t\tattempts++;\n\t\t\t\tconst whatsNewButton = document.querySelector(\n\t\t\t\t\t'[data-testid=\"whats-new-button\"]',\n\t\t\t\t);\n\n\t\t\t\tif (whatsNewButton) {\n\t\t\t\t\tshowMajorUpdateJoyride(majorUpdateFeatures[0]);\n\t\t\t\t} else if (attempts < MAX_ATTEMPTS) {\n\t\t\t\t\tsetTimeout(checkWhatsNewButton, 1000);\n\t\t\t\t} else {\n\t\t\t\t\tsetShowMinorUpdates(true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tcheckWhatsNewButton();\n\t\t} else if (majorUpdateFeatures.length === 0 && !isLoading) {\n\t\t\tsetShowMinorUpdates(true);\n\t\t}\n\t}, [\n\t\tmajorUpdateFeatures,\n\t\tcurrentMajorFeature,\n\t\tisLoading,\n\t\tisProcessingMajorUpdate,\n\t\tblockPopups,\n\t]);\n\n\tuseEffect(() => {\n\t\t// Only run this special logic if a feature is being forced via URL\n\t\tconst featureIdFromQuery = router?.query?.['featureId'] as string;\n\n\t\tif (!featureIdFromQuery || isLoading || minorUpdateFeatures.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst forcedFeature = minorUpdateFeatures.find(\n\t\t\t(f) => f.id === featureIdFromQuery,\n\t\t);\n\n\t\tif (!forcedFeature || !forcedFeature.featureTag) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent the standard flow from interfering\n\t\tsetMinorFeaturesSkipped(true);\n\t\t// Mark that we're processing to prevent other effects from interfering\n\t\tsetIsProcessingMinorUpdate(true);\n\n\t\tlet attempts = 0;\n\t\tconst maxAttempts = 25; // 5 seconds\n\t\tconst interval = setInterval(() => {\n\t\t\tattempts++;\n\t\t\tconst targetSelector =\n\t\t\t\tforcedFeature.featureTag.startsWith('#') ||\n\t\t\t\tforcedFeature.featureTag.startsWith('.') ||\n\t\t\t\tforcedFeature.featureTag.startsWith('[')\n\t\t\t\t\t? forcedFeature.featureTag\n\t\t\t\t\t: `#${forcedFeature.featureTag}`;\n\n\t\t\tconst element = document.querySelector(targetSelector);\n\n\t\t\tif (element) {\n\t\t\t\t// In test mode, pass the feature array directly to avoid async state issues\n\t\t\t\tconst testModeFeatures = [forcedFeature];\n\t\t\t\tsetAvailableMinorFeatures(testModeFeatures);\n\t\t\t\tshowMinorUpdateJoyride(forcedFeature, testModeFeatures);\n\t\t\t\t// Don't reset processing flag here - let user interaction handle it\n\t\t\t\t// This prevents auto-closing when multiple popups exist or when scrolling\n\t\t\t\tclearInterval(interval);\n\t\t\t} else if (attempts >= maxAttempts) {\n\t\t\t\t// Fallback for safety, though user expects it to be there.\n\t\t\t\t// We could log an error here.\n\t\t\t\t// Only reset on timeout (element not found)\n\t\t\t\tsetIsProcessingMinorUpdate(false);\n\t\t\t\tclearInterval(interval);\n\t\t\t}\n\t\t}, 200);\n\n\t\treturn () => {\n\t\t\tclearInterval(interval);\n\t\t\t// Don't reset processing flag on cleanup - it causes premature popup closure\n\t\t\t// The flag will be managed by user interactions (skip/explore handlers)\n\t\t};\n\t}, [minorUpdateFeatures, router?.query?.['featureId'], isLoading]);\n\n\tuseEffect(() => {\n\t\tif (\n\t\t\tminorUpdateFeatures.length > 0 &&\n\t\t\t!isLoading &&\n\t\t\t!runJoyride &&\n\t\t\t!isProcessingMinorUpdate &&\n\t\t\t!currentMinorFeature &&\n\t\t\t!minorFeaturesSkipped &&\n\t\t\tshowMinorUpdates &&\n\t\t\t!blockPopups\n\t\t) {\n\t\t\tlet observer: MutationObserver | null = null;\n\t\t\tlet scrollListener: (() => void) | null = null;\n\t\t\tlet checkTimeout: ReturnType<typeof setTimeout> | null = null;\n\t\t\tlet isCleanedUp = false;\n\n\t\t\tconst checkElementsAndStartTour = () => {\n\t\t\t\tif (\n\t\t\t\t\tisCleanedUp ||\n\t\t\t\t\tisProcessingMinorUpdate ||\n\t\t\t\t\tcurrentMinorFeature ||\n\t\t\t\t\tminorFeaturesSkipped ||\n\t\t\t\t\t!showMinorUpdates\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tconst availableFeatures = minorUpdateFeatures.filter((feature) => {\n\t\t\t\t\tif (!feature.featureTag || feature.featureTag.trim() === '') {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Skip features already shown in this session\n\t\t\t\t\tif (shownMinorFeatureIds.has(feature.id)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst targetSelector =\n\t\t\t\t\t\tfeature.featureTag.startsWith('#') ||\n\t\t\t\t\t\tfeature.featureTag.startsWith('.') ||\n\t\t\t\t\t\tfeature.featureTag.startsWith('[')\n\t\t\t\t\t\t\t? feature.featureTag\n\t\t\t\t\t\t\t: `#${feature.featureTag}`;\n\n\t\t\t\t\tconst element = document.querySelector(targetSelector);\n\t\t\t\t\treturn element !== null;\n\t\t\t\t});\n\n\t\t\t\tif (availableFeatures.length > 0) {\n\t\t\t\t\tsetAvailableMinorFeatures(availableFeatures);\n\t\t\t\t\t// Pass features directly to avoid async state issues\n\t\t\t\t\tshowMinorUpdateJoyride(availableFeatures[0], availableFeatures);\n\n\t\t\t\t\tif (observer) {\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\tobserver = null;\n\t\t\t\t\t}\n\t\t\t\t\tif (scrollListener) {\n\t\t\t\t\t\twindow.removeEventListener('scroll', scrollListener);\n\t\t\t\t\t\tscrollListener = null;\n\t\t\t\t\t}\n\t\t\t\t\tif (checkTimeout) {\n\t\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t\t\tcheckTimeout = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tobserver = new MutationObserver((mutations) => {\n\t\t\t\tlet shouldCheck = false;\n\t\t\t\tfor (const mutation of mutations) {\n\t\t\t\t\tif (mutation.type === 'childList' && mutation.addedNodes.length > 0) {\n\t\t\t\t\t\tfor (let i = 0; i < mutation.addedNodes.length; i++) {\n\t\t\t\t\t\t\tconst node = mutation.addedNodes[i];\n\t\t\t\t\t\t\tif (node.nodeType === Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tconst element = node as Element;\n\t\t\t\t\t\t\t\tif (element.id || element.querySelector('[id]')) {\n\t\t\t\t\t\t\t\t\tshouldCheck = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (shouldCheck) break;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!runJoyride &&\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates &&\n\t\t\t\t\tshouldCheck\n\t\t\t\t) {\n\t\t\t\t\tif (checkTimeout) {\n\t\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t\t}\n\t\t\t\t\tcheckTimeout = setTimeout(() => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\t\t\tshowMinorUpdates\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tscrollListener = () => {\n\t\t\t\tif (\n\t\t\t\t\t!runJoyride &&\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tif (checkTimeout) {\n\t\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t\t}\n\t\t\t\t\t// Use RAF for smoother performance synced with browser paint\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\tcheckTimeout = setTimeout(() => {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\t\t\t\tshowMinorUpdates\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif (observer) {\n\t\t\t\tobserver.observe(document.body, {\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tsubtree: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (scrollListener) {\n\t\t\t\twindow.addEventListener('scroll', scrollListener, { passive: true });\n\t\t\t}\n\n\t\t\tcheckElementsAndStartTour();\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t}\n\t\t\t}, 100);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t}\n\t\t\t}, 1000);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (\n\t\t\t\t\t!isCleanedUp &&\n\t\t\t\t\t!isProcessingMinorUpdate &&\n\t\t\t\t\t!currentMinorFeature &&\n\t\t\t\t\t!minorFeaturesSkipped &&\n\t\t\t\t\tshowMinorUpdates\n\t\t\t\t) {\n\t\t\t\t\tcheckElementsAndStartTour();\n\t\t\t\t}\n\t\t\t}, 500);\n\n\t\t\treturn () => {\n\t\t\t\tisCleanedUp = true;\n\t\t\t\tif (observer) {\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t\tif (scrollListener) {\n\t\t\t\t\twindow.removeEventListener('scroll', scrollListener);\n\t\t\t\t}\n\t\t\t\tif (checkTimeout) {\n\t\t\t\t\tclearTimeout(checkTimeout);\n\t\t\t\t}\n\t\t\t};\n\t\t} else if (minorUpdateFeatures.length === 0 || isLoading) {\n\t\t\t// Don't clear joyride if we're in test mode with an active feature\n\t\t\tconst featureIdFromQuery = router?.query?.['featureId'] as string;\n\t\t\tconst isTestModeWithActiveFeature =\n\t\t\t\tfeatureIdFromQuery && currentMinorFeature;\n\n\t\t\tif (!isTestModeWithActiveFeature) {\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetJoyrideSteps([]);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetAvailableMinorFeatures([]);\n\t\t\t\tsetMinorFeaturesSkipped(false);\n\t\t\t}\n\t\t}\n\t}, [\n\t\tminorUpdateFeatures,\n\t\tisLoading,\n\t\trunJoyride,\n\t\tisProcessingMinorUpdate,\n\t\tcurrentMinorFeature,\n\t\tminorFeaturesSkipped,\n\t\tshowMinorUpdates,\n\t\tmarkFeatureAsViewed,\n\t\tblockPopups,\n\t]);\n\n\tconst showMajorUpdateJoyride = (feature) => {\n\t\tsetCurrentMajorFeature(feature);\n\n\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t(f) => f.id === feature.id,\n\t\t);\n\t\tconst totalFeatures = majorUpdateFeatures.length;\n\n\t\tconst majorSteps = [\n\t\t\t{\n\t\t\t\ttarget: SELECTORS.WHATS_NEW_BUTTON,\n\t\t\t\tcontent: (\n\t\t\t\t\t<MajorUpdatePopup\n\t\t\t\t\t\tfeature={feature}\n\t\t\t\t\t\tcurrentIndex={currentIndex}\n\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\tonSkip={() => handleSkipMajorUpdate(feature)}\n\t\t\t\t\t\tonExplore={() => handleExploreFeature(feature)}\n\t\t\t\t\t\tonPrevious={() => handlePreviousMajorUpdate(feature)}\n\t\t\t\t\t\tonNext={() => handleNextMajorUpdate(feature)}\n\t\t\t\t\t\tsetIsClosing={setIsClosingMajor}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tplacementBeacon: 'top-end',\n\t\t\t\tdisableBeacon: true,\n\t\t\t\thideCloseButton: true,\n\t\t\t\thideSkipButton: true,\n\t\t\t\thideFooter: true,\n\t\t\t\toffset: 0,\n\t\t\t\tdata: { feature, isMajor: true },\n\t\t\t\tstyles: {\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t},\n\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t},\n\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\n\t\tsetMajorJoyrideSteps(majorSteps);\n\t\tsetRunMajorJoyride(true);\n\n\t\t// Fire announcement shown callback\n\t\tif (onAnnouncementShown && storeId) {\n\t\t\tonAnnouncementShown({\n\t\t\t\tstoreId,\n\t\t\t\tannouncementId: feature.id,\n\t\t\t\tannouncementTitle: feature.title,\n\t\t\t\timageUrl: feature.displayImage || feature.image,\n\t\t\t\tvideoUrl: feature.productVideo,\n\t\t\t});\n\t\t}\n\t};\n\n\tconst handleSkipMajorUpdate = useCallback(\n\t\t(feature) => {\n\t\t\tconst targetFeature = feature || currentMajorFeature;\n\n\t\t\tif (targetFeature) {\n\t\t\t\tsetIsProcessingMajorUpdate(true);\n\n\t\t\t\tmajorUpdateFeatures.forEach((majorFeature) => {\n\t\t\t\t\tmarkFeatureAsViewed(majorFeature.id);\n\t\t\t\t});\n\n\t\t\t\tsetRunMajorJoyride(false);\n\t\t\t\tsetCurrentMajorFeature(null);\n\t\t\t\tsetMajorJoyrideSteps([]);\n\n\t\t\t\tsetShowMinorUpdates(true);\n\n\t\t\t\t// Fire announcement interacted callback for Skip\n\t\t\t\tif (onAnnouncementInteracted && storeId) {\n\t\t\t\t\tonAnnouncementInteracted({\n\t\t\t\t\t\tstoreId,\n\t\t\t\t\t\tannouncementId: targetFeature.id,\n\t\t\t\t\t\tannouncementTitle: targetFeature.title,\n\t\t\t\t\t\timageUrl: targetFeature.displayImage || targetFeature.image,\n\t\t\t\t\t\tvideoUrl: targetFeature.productVideo,\n\t\t\t\t\t\tbuttonClicked: 'Skip',\n\t\t\t\t\t\tbuttonName: 'Skip',\n\t\t\t\t\t\tbuttonUrl: undefined,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t\t}, 500);\n\t\t\t} else {\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst handleExploreFeature = useCallback(\n\t\t(feature) => {\n\t\t\tsetIsProcessingMajorUpdate(true);\n\t\t\tmarkFeatureAsViewed(feature.id);\n\t\t\tif (feature.productVideo && feature.primaryButton?.action !== 'Open link') {\n\t\t\t\tsetVideoUrl(feature.productVideo);\n\t\t\t\tsetIsVideoModalOpen(true);\n\t\t\t\tsetBlockPopups(true);\n\t\t\t}\n\t\t\tsetRunMajorJoyride(false);\n\t\t\tsetCurrentMajorFeature(null);\n\t\t\tsetMajorJoyrideSteps([]);\n\t\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t\t(f) => f.id === feature.id,\n\t\t\t);\n\t\t\tconst isLastMajorUpdate = currentIndex === majorUpdateFeatures.length - 1;\n\t\t\tif (isLastMajorUpdate) {\n\t\t\t\tsetShowMinorUpdates(true);\n\t\t\t}\n\n\t\t\t// Fire announcement interacted callback for Primary button\n\t\t\tif (onAnnouncementInteracted && storeId) {\n\t\t\t\tonAnnouncementInteracted({\n\t\t\t\t\tstoreId,\n\t\t\t\t\tannouncementId: feature.id,\n\t\t\t\t\tannouncementTitle: feature.title,\n\t\t\t\t\timageUrl: feature.displayImage || feature.image,\n\t\t\t\t\tvideoUrl: feature.productVideo,\n\t\t\t\t\tbuttonClicked: 'Primary',\n\t\t\t\t\tbuttonName: feature.buttonText || 'Explore',\n\t\t\t\t\tbuttonUrl: feature.redirectUrl || feature.productVideo,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t}, 500);\n\t\t},\n\t\t[majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst handlePreviousMajorUpdate = useCallback(\n\t\t(feature) => {\n\t\t\tconst targetFeature = feature || currentMajorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\tconst prevFeature = majorUpdateFeatures[currentIndex - 1];\n\t\t\t\tsetCurrentMajorFeature(prevFeature);\n\n\t\t\t\tconst prevIndex = currentIndex - 1;\n\t\t\t\tconst totalFeatures = majorUpdateFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: '[data-testid=\"whats-new-button\"]',\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MajorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={prevFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={prevIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMajorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonExplore={() => handleExploreFeature(prevFeature)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMajorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMajorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMajor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\tplacementBeacon: 'top-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: prevFeature, isMajor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetMajorJoyrideSteps(updatedSteps);\n\t\t\t} else {\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures],\n\t);\n\n\tconst handleNextMajorUpdate = useCallback(\n\t\t(feature) => {\n\t\t\tconst targetFeature = feature || currentMajorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = majorUpdateFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex < majorUpdateFeatures.length - 1) {\n\t\t\t\tconst nextFeature = majorUpdateFeatures[currentIndex + 1];\n\t\t\t\tsetCurrentMajorFeature(nextFeature);\n\n\t\t\t\tconst nextIndex = currentIndex + 1;\n\t\t\t\tconst totalFeatures = majorUpdateFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: '[data-testid=\"whats-new-button\"]',\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MajorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={nextFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={nextIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMajorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonExplore={() => handleExploreFeature(nextFeature)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMajorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMajorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMajor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom-start',\n\t\t\t\t\t\tplacementBeacon: 'top-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: nextFeature, isMajor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetMajorJoyrideSteps(updatedSteps);\n\t\t\t} else {\n\t\t\t\tsetIsProcessingMajorUpdate(true);\n\n\t\t\t\tmarkFeatureAsViewed(targetFeature.id);\n\t\t\t\tsetRunMajorJoyride(false);\n\t\t\t\tsetCurrentMajorFeature(null);\n\t\t\t\tsetMajorJoyrideSteps([]);\n\n\t\t\t\tsetShowMinorUpdates(true);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst showMajorUpdatePopup = () => {\n\t\tif (majorUpdateFeatures.length > 0 && !currentMajorFeature) {\n\t\t\tconst whatsNewButton = document.querySelector(\n\t\t\t\t'[data-testid=\"whats-new-button\"]',\n\t\t\t);\n\n\t\t\tif (whatsNewButton) {\n\t\t\t\tshowMajorUpdateJoyride(majorUpdateFeatures[0]);\n\t\t\t}\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\t(window as any).showMajorUpdatePopup = showMajorUpdatePopup;\n\t\treturn () => {\n\t\t\tdelete (window as any).showMajorUpdatePopup;\n\t\t};\n\t}, [majorUpdateFeatures, currentMajorFeature]);\n\tconst handleMajorJoyrideCallback = useCallback(\n\t\t(data) => {\n\t\t\tconst { action } = data;\n\n\t\t\tif (action === ACTIONS.CLOSE) {\n\t\t\t\tif (currentMajorFeature) {\n\t\t\t\t\tsetIsProcessingMajorUpdate(true);\n\n\t\t\t\t\tmajorUpdateFeatures.forEach((majorFeature) => {\n\t\t\t\t\t\tmarkFeatureAsViewed(majorFeature.id);\n\t\t\t\t\t});\n\n\t\t\t\t\tsetShowMinorUpdates(true);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tsetIsProcessingMajorUpdate(false);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\n\t\t\t\tsetRunMajorJoyride(false);\n\t\t\t\tsetCurrentMajorFeature(null);\n\t\t\t\tsetMajorJoyrideSteps([]);\n\t\t\t}\n\t\t},\n\t\t[currentMajorFeature, majorUpdateFeatures, markFeatureAsViewed],\n\t);\n\n\tconst handleMinorJoyrideCallback = useCallback(\n\t\t(data) => {\n\t\t\tconst { action } = data;\n\n\t\t\tif (action === ACTIONS.CLOSE) {\n\t\t\t\tif (currentMinorFeature) {\n\t\t\t\t\tsetIsProcessingMinorUpdate(true);\n\n\t\t\t\t\t// Only mark the current feature as viewed, not all features\n\t\t\t\t\tmarkFeatureAsViewed(currentMinorFeature.id);\n\n\t\t\t\t\t// Check if there are more features to show\n\t\t\t\t\tconst currentIndex = availableMinorFeatures.findIndex(\n\t\t\t\t\t\t(f) => f.id === currentMinorFeature.id,\n\t\t\t\t\t);\n\t\t\t\t\tconst isLastFeature =\n\t\t\t\t\t\tcurrentIndex === availableMinorFeatures.length - 1;\n\n\t\t\t\t\tif (isLastFeature) {\n\t\t\t\t\t\t// Only skip remaining features if this was the last one\n\t\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t\t}\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tsetIsProcessingMinorUpdate(false);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetJoyrideSteps([]);\n\t\t\t}\n\t\t},\n\t\t[currentMinorFeature, availableMinorFeatures, markFeatureAsViewed],\n\t);\n\tconst showMinorUpdateJoyride = async (feature, featuresToUse?) => {\n\t\tsetCurrentMinorFeature(feature);\n\n\t\t// Use provided features array or fall back to state (for test mode)\n\t\tconst features = featuresToUse || availableMinorFeatures;\n\t\tconst currentIndex = features.findIndex((f) => f.id === feature.id);\n\t\tconst totalFeatures = features.length;\n\n\t\tconst targetSelector =\n\t\t\tfeature.featureTag.startsWith('#') ||\n\t\t\tfeature.featureTag.startsWith('.') ||\n\t\t\tfeature.featureTag.startsWith('[')\n\t\t\t\t? feature.featureTag\n\t\t\t\t: `#${feature.featureTag}`;\n\n\t\t// Scroll to target element smoothly before showing popup\n\t\tconst targetElement = document.querySelector(targetSelector);\n\t\tif (targetElement) {\n\t\t\ttry {\n\t\t\t\t// Dynamically import to avoid circular dependencies\n\t\t\t\tconst { scrollToElementSmooth } = await import(\n\t\t\t\t\t'./utils/elementHelpers'\n\t\t\t\t);\n\t\t\t\tawait scrollToElementSmooth(targetElement, 120);\n\t\t\t} catch (error) {\n\t\t\t\t// Scroll failed silently\n\t\t\t}\n\t\t}\n\n\t\tconst minorSteps = [\n\t\t\t{\n\t\t\t\ttarget: targetSelector,\n\t\t\t\tcontent: (\n\t\t\t\t\t<MinorUpdatePopup\n\t\t\t\t\t\tfeature={feature}\n\t\t\t\t\t\tcurrentIndex={currentIndex}\n\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\tonSkip={() => handleSkipMinorUpdate(feature)}\n\t\t\t\t\t\tonExplore={() => handleExploreMinorFeature(feature)}\n\t\t\t\t\t\tonPrevious={() => handlePreviousMinorUpdate(feature)}\n\t\t\t\t\t\tonNext={() => handleNextMinorUpdate(feature)}\n\t\t\t\t\t\tsetIsClosing={setIsClosingMinor}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tplacement: 'bottom',\n\t\t\t\tplacementBeacon: 'bottom-end',\n\t\t\t\tdisableBeacon: true,\n\t\t\t\thideCloseButton: true,\n\t\t\t\thideSkipButton: true,\n\t\t\t\thideFooter: true,\n\t\t\t\toffset: 0,\n\t\t\t\tdata: { feature, isMinor: true },\n\t\t\t\tstyles: {\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t},\n\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t},\n\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t\tsetJoyrideSteps(minorSteps);\n\t\tsetRunJoyride(true);\n\t};\n\n\tconst handleSkipMinorUpdate = useCallback(\n\t\t(feature) => {\n\t\t\tconst targetFeature = feature || currentMinorFeature;\n\n\t\t\tif (targetFeature) {\n\t\t\t\tsetIsProcessingMinorUpdate(true);\n\n\t\t\t\t// Only mark the current feature as viewed, not all features\n\t\t\t\tmarkFeatureAsViewed(targetFeature.id);\n\n\t\t\t\t// Add to session tracker to prevent re-showing\n\t\t\t\tsetShownMinorFeatureIds((prev) => new Set(prev).add(targetFeature.id));\n\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetJoyrideSteps([]);\n\n\t\t\t\t// Find next unshown feature\n\t\t\t\tconst nextFeature = availableMinorFeatures.find(\n\t\t\t\t\t(f) => f.id !== targetFeature.id && !shownMinorFeatureIds.has(f.id),\n\t\t\t\t);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMinorUpdate(false);\n\n\t\t\t\t\tif (nextFeature) {\n\t\t\t\t\t\t// Auto-advance to next feature\n\t\t\t\t\t\tshowMinorUpdateJoyride(nextFeature, availableMinorFeatures);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// No more features to show\n\t\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t\t}\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tcurrentMinorFeature,\n\t\t\tavailableMinorFeatures,\n\t\t\tmarkFeatureAsViewed,\n\t\t\tshownMinorFeatureIds,\n\t\t],\n\t);\n\n\tconst handleExploreMinorFeature = useCallback(\n\t\t(feature) => {\n\t\t\tsetIsProcessingMinorUpdate(true);\n\n\t\t\t// Only mark the current feature as viewed\n\t\t\tmarkFeatureAsViewed(feature.id);\n\n\t\t\t// Add to session tracker to prevent re-showing\n\t\t\tsetShownMinorFeatureIds((prev) => new Set(prev).add(feature.id));\n\n\t\t\tconst opensVideo = feature.productVideo && feature.primaryButton?.action !== 'Open link';\n\t\t\tif (opensVideo) {\n\t\t\t\tsetVideoUrl(feature.productVideo);\n\t\t\t\tsetIsVideoModalOpen(true);\n\t\t\t\tsetBlockPopups(true);\n\t\t\t}\n\n\t\t\tsetRunJoyride(false);\n\t\t\tsetCurrentMinorFeature(null);\n\t\t\tsetJoyrideSteps([]);\n\n\t\t\t// Find next unshown feature (only auto-advance if no video modal)\n\t\t\tconst nextFeature = availableMinorFeatures.find(\n\t\t\t\t(f) => f.id !== feature.id && !shownMinorFeatureIds.has(f.id),\n\t\t\t);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetIsProcessingMinorUpdate(false);\n\n\t\t\t\t// Only auto-advance if no video modal is opened\n\t\t\t\tif (nextFeature && !opensVideo) {\n\t\t\t\t\t// Auto-advance to next feature\n\t\t\t\t\tshowMinorUpdateJoyride(nextFeature, availableMinorFeatures);\n\t\t\t\t} else if (!nextFeature) {\n\t\t\t\t\t// No more features to show\n\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t}\n\t\t\t\t// If video modal opened, wait for user to close it before advancing\n\t\t\t}, 500);\n\t\t},\n\t\t[availableMinorFeatures, markFeatureAsViewed, shownMinorFeatureIds],\n\t);\n\n\tconst handlePreviousMinorUpdate = useCallback(\n\t\tasync (feature) => {\n\t\t\tconst targetFeature = feature || currentMinorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = availableMinorFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\tconst prevFeature = availableMinorFeatures[currentIndex - 1];\n\t\t\t\tsetCurrentMinorFeature(prevFeature);\n\n\t\t\t\tconst targetSelector =\n\t\t\t\t\tprevFeature.featureTag.startsWith('#') ||\n\t\t\t\t\tprevFeature.featureTag.startsWith('.') ||\n\t\t\t\t\tprevFeature.featureTag.startsWith('[')\n\t\t\t\t\t\t? prevFeature.featureTag\n\t\t\t\t\t\t: `#${prevFeature.featureTag}`;\n\n\t\t\t\t// Scroll to the previous feature element\n\t\t\t\tconst targetElement = document.querySelector(targetSelector);\n\t\t\t\tif (targetElement) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst { scrollToElementSmooth } = await import(\n\t\t\t\t\t\t\t'./utils/elementHelpers'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait scrollToElementSmooth(targetElement, 120);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// Scroll failed silently\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst prevIndex = currentIndex - 1;\n\t\t\t\tconst totalFeatures = availableMinorFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: targetSelector,\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MinorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={prevFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={prevIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMinorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonExplore={() => handleExploreMinorFeature(prevFeature)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMinorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMinorUpdate(prevFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMinor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\tplacementBeacon: 'bottom-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: prevFeature, isMinor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetJoyrideSteps(updatedSteps);\n\t\t\t}\n\t\t},\n\t\t[currentMinorFeature, availableMinorFeatures],\n\t);\n\n\tconst handleNextMinorUpdate = useCallback(\n\t\tasync (feature) => {\n\t\t\tconst targetFeature = feature || currentMinorFeature;\n\n\t\t\tif (!targetFeature) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst currentIndex = availableMinorFeatures.findIndex(\n\t\t\t\t(f) => f.id === targetFeature.id,\n\t\t\t);\n\n\t\t\tif (currentIndex < availableMinorFeatures.length - 1) {\n\t\t\t\tconst nextFeature = availableMinorFeatures[currentIndex + 1];\n\t\t\t\tsetCurrentMinorFeature(nextFeature);\n\n\t\t\t\tconst targetSelector =\n\t\t\t\t\tnextFeature.featureTag.startsWith('#') ||\n\t\t\t\t\tnextFeature.featureTag.startsWith('.') ||\n\t\t\t\t\tnextFeature.featureTag.startsWith('[')\n\t\t\t\t\t\t? nextFeature.featureTag\n\t\t\t\t\t\t: `#${nextFeature.featureTag}`;\n\n\t\t\t\t// Scroll to the next feature element\n\t\t\t\tconst targetElement = document.querySelector(targetSelector);\n\t\t\t\tif (targetElement) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst { scrollToElementSmooth } = await import(\n\t\t\t\t\t\t\t'./utils/elementHelpers'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait scrollToElementSmooth(targetElement, 120);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// Scroll failed silently\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst nextIndex = currentIndex + 1;\n\t\t\t\tconst totalFeatures = availableMinorFeatures.length;\n\n\t\t\t\tconst updatedSteps = [\n\t\t\t\t\t{\n\t\t\t\t\t\ttarget: targetSelector,\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<MinorUpdatePopup\n\t\t\t\t\t\t\t\tfeature={nextFeature}\n\t\t\t\t\t\t\t\tcurrentIndex={nextIndex}\n\t\t\t\t\t\t\t\ttotalFeatures={totalFeatures}\n\t\t\t\t\t\t\t\tonSkip={() => handleSkipMinorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonExplore={() => handleExploreMinorFeature(nextFeature)}\n\t\t\t\t\t\t\t\tonPrevious={() => handlePreviousMinorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tonNext={() => handleNextMinorUpdate(nextFeature)}\n\t\t\t\t\t\t\t\tsetIsClosing={setIsClosingMinor}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t\tplacement: 'bottom',\n\t\t\t\t\t\tplacementBeacon: 'bottom-end',\n\t\t\t\t\t\tdisableBeacon: true,\n\t\t\t\t\t\thideCloseButton: true,\n\t\t\t\t\t\thideSkipButton: true,\n\t\t\t\t\t\thideFooter: true,\n\t\t\t\t\t\toffset: 0,\n\t\t\t\t\t\tdata: { feature: nextFeature, isMinor: true },\n\t\t\t\t\t\tstyles: {\n\t\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t];\n\n\t\t\t\tsetJoyrideSteps(updatedSteps);\n\t\t\t} else {\n\t\t\t\tsetIsProcessingMinorUpdate(true);\n\t\t\t\tsetMinorFeaturesSkipped(true);\n\n\t\t\t\tmarkFeatureAsViewed(targetFeature.id);\n\t\t\t\tsetRunJoyride(false);\n\t\t\t\tsetCurrentMinorFeature(null);\n\t\t\t\tsetJoyrideSteps([]);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetIsProcessingMinorUpdate(false);\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t},\n\t\t[currentMinorFeature, availableMinorFeatures, markFeatureAsViewed],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{children}\n\n\t\t\t{majorJoyrideSteps.length > 0 && (\n\t\t\t\t<Joyride\n\t\t\t\t\tkey={`major-joyride-${majorJoyrideKey}`}\n\t\t\t\t\tsteps={majorJoyrideSteps}\n\t\t\t\t\trun={runMajorJoyride}\n\t\t\t\t\tcontinuous={false}\n\t\t\t\t\tshowProgress={false}\n\t\t\t\t\tshowSkipButton={false}\n\t\t\t\t\tcallback={handleMajorJoyrideCallback}\n\t\t\t\t\tdisableOverlayClose={false}\n\t\t\t\t\tdisableCloseOnEsc={false}\n\t\t\t\t\tdisableOverlay={false}\n\t\t\t\t\tspotlightClicks={false}\n\t\t\t\t\tstyles={{\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tprimaryColor: '#007bff',\n\t\t\t\t\t\t\tzIndex: 10000,\n\t\t\t\t\t\t\twidth: 'auto',\n\t\t\t\t\t\t\tarrowColor: isClosingMajor ? 'transparent' : '#212121',\n\t\t\t\t\t\t},\n\t\t\t\t\t\toverlay: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tspotlight: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t}}\n\t\t\t\t\tlocale={{\n\t\t\t\t\t\tback: 'Back',\n\t\t\t\t\t\tclose: 'Close',\n\t\t\t\t\t\tlast: 'Close',\n\t\t\t\t\t\tnext: 'Next',\n\t\t\t\t\t\tskip: 'Skip',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{joyrideSteps.length > 0 && (\n\t\t\t\t<Joyride\n\t\t\t\t\tkey={`minor-joyride-${minorJoyrideKey}`}\n\t\t\t\t\tsteps={joyrideSteps}\n\t\t\t\t\trun={runJoyride}\n\t\t\t\t\tcontinuous={false}\n\t\t\t\t\tshowProgress={false}\n\t\t\t\t\tshowSkipButton={false}\n\t\t\t\t\tcallback={handleMinorJoyrideCallback}\n\t\t\t\t\tdisableOverlayClose={false}\n\t\t\t\t\tdisableCloseOnEsc={false}\n\t\t\t\t\tdisableOverlay={false}\n\t\t\t\t\tscrollToFirstStep={true}\n\t\t\t\t\tscrollOffset={120}\n\t\t\t\t\tdisableScrolling={false}\n\t\t\t\t\tstyles={{\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tprimaryColor: '#007bff',\n\t\t\t\t\t\t\tzIndex: 10000,\n\t\t\t\t\t\t\twidth: 'auto',\n\t\t\t\t\t\t\tarrowColor: isClosingMinor ? 'transparent' : '#ffffff',\n\t\t\t\t\t\t},\n\t\t\t\t\t\toverlay: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tspotlight: {\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborderRadius: '8px',\n\t\t\t\t\t\t\tboxShadow: isClosingMinor\n\t\t\t\t\t\t\t\t? 'none'\n\t\t\t\t\t\t\t\t: '0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltip: {\n\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\tbackgroundColor: 'transparent',\n\t\t\t\t\t\t\tborder: 'none',\n\t\t\t\t\t\t\tfilter: 'none',\n\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttooltipContent: {\n\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonNext: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonBack: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonSkip: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuttonClose: {\n\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t},\n\t\t\t\t\t}}\n\t\t\t\t\tlocale={{\n\t\t\t\t\t\tback: 'Back',\n\t\t\t\t\t\tclose: 'Close',\n\t\t\t\t\t\tlast: 'Close',\n\t\t\t\t\t\tnext: 'Next',\n\t\t\t\t\t\tskip: 'Skip',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<VideoModal\n\t\t\t\tisOpen={isVideoModalOpen}\n\t\t\t\tvideoUrl={videoUrl}\n\t\t\t\tonClose={() => {\n\t\t\t\t\tsetIsVideoModalOpen(false);\n\t\t\t\t\tsetVideoUrl('');\n\t\t\t\t\tsetBlockPopups(false);\n\n\t\t\t\t\t// After video modal closes, check if there are more features to show\n\t\t\t\t\tconst nextFeature = availableMinorFeatures.find(\n\t\t\t\t\t\t(f) => !shownMinorFeatureIds.has(f.id),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (nextFeature) {\n\t\t\t\t\t\t// Auto-advance to next feature after video\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tshowMinorUpdateJoyride(nextFeature, availableMinorFeatures);\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// No more features to show\n\t\t\t\t\t\tsetMinorFeaturesSkipped(true);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n\n};\n\nexport default FeatureAnnouncementProvider;\n"],"names":["FeatureAnnouncementProvider","_ref","children","fetchVisibleFeatures","getStoreFeatureProgress","fetchFeatureById","markFeatureAsViewedForStore","isFeatureApplicableToCurrentPage","module","router","storeId","onAnnouncementShown","onAnnouncementInteracted","majorUpdateFeatures","minorUpdateFeatures","isLoading","markFeatureAsViewed","useFeatureAnnouncements","currentMajorFeature","setCurrentMajorFeature","useState","currentMinorFeature","setCurrentMinorFeature","runJoyride","setRunJoyride","joyrideSteps","setJoyrideSteps","runMajorJoyride","setRunMajorJoyride","majorJoyrideSteps","setMajorJoyrideSteps","isProcessingMajorUpdate","setIsProcessingMajorUpdate","isProcessingMinorUpdate","setIsProcessingMinorUpdate","availableMinorFeatures","setAvailableMinorFeatures","minorFeaturesSkipped","setMinorFeaturesSkipped","showMinorUpdates","setShowMinorUpdates","isVideoModalOpen","setIsVideoModalOpen","videoUrl","setVideoUrl","blockPopups","setBlockPopups","isClosingMajor","setIsClosingMajor","isClosingMinor","setIsClosingMinor","majorJoyrideKey","setMajorJoyrideKey","minorJoyrideKey","setMinorJoyrideKey","shownMinorFeatureIds","setShownMinorFeatureIds","Set","useEffect","styleId","styleElement","document","getElementById","createElement","id","head","appendChild","textContent","el","remove","prev","pathname","length","attempts","MAX_ATTEMPTS","checkWhatsNewButton","querySelector","showMajorUpdateJoyride","setTimeout","featureIdFromQuery","_a","query","forcedFeature","find","f","featureTag","interval","setInterval","targetSelector","startsWith","testModeFeatures","showMinorUpdateJoyride","clearInterval","observer","scrollListener","checkTimeout","isCleanedUp","checkElementsAndStartTour","availableFeatures","filter","feature","trim","has","disconnect","window","removeEventListener","clearTimeout","MutationObserver","mutations","shouldCheck","mutation","type","addedNodes","i","node","nodeType","Node","ELEMENT_NODE","element","requestAnimationFrame","observe","body","childList","subtree","addEventListener","passive","currentIndex","findIndex","totalFeatures","majorSteps","target","SELECTORS","WHATS_NEW_BUTTON","content","_jsx","MajorUpdatePopup","onSkip","handleSkipMajorUpdate","onExplore","handleExploreFeature","onPrevious","handlePreviousMajorUpdate","onNext","handleNextMajorUpdate","setIsClosing","placement","placementBeacon","disableBeacon","hideCloseButton","hideSkipButton","hideFooter","offset","data","isMajor","styles","tooltip","padding","backgroundColor","borderRadius","border","boxShadow","tooltipContent","buttonNext","display","buttonBack","buttonClose","buttonSkip","announcementId","announcementTitle","title","imageUrl","displayImage","image","productVideo","useCallback","targetFeature","forEach","majorFeature","buttonClicked","buttonName","buttonUrl","undefined","primaryButton","action","buttonText","redirectUrl","prevFeature","prevIndex","updatedSteps","nextFeature","nextIndex","showMajorUpdatePopup","handleMajorJoyrideCallback","ACTIONS","CLOSE","handleMinorJoyrideCallback","featuresToUse","__awaiter","features","targetElement","scrollToElementSmooth","import","error","minorSteps","MinorUpdatePopup","handleSkipMinorUpdate","handleExploreMinorFeature","handlePreviousMinorUpdate","handleNextMinorUpdate","isMinor","add","opensVideo","_jsxs","_Fragment","Joyride","steps","run","continuous","showProgress","showSkipButton","callback","disableOverlayClose","disableCloseOnEsc","disableOverlay","spotlightClicks","options","primaryColor","zIndex","width","arrowColor","overlay","spotlight","fontSize","locale","back","close","last","next","skip","scrollToFirstStep","scrollOffset","disableScrolling","VideoModal","isOpen","onClose"],"mappings":"4fASMA,MAAAA,EAEFC,IAYC,IAZAC,SACJA,EAAQC,qBACRA,EAAoBC,wBACpBA,EAAuBC,iBACvBA,EAAgBC,4BAChBA,EAA2BC,iCAC3BA,EAAgCC,OAChCA,EAAMC,OACNA,EAAMC,QACNA,EAAOC,oBACPA,EAAmBC,yBACnBA,GACAX,QACA,MAAMY,oBACLA,EAAmBC,oBACnBA,EAAmBC,UACnBA,EAASC,oBACTA,GACGC,EAAwB,CAC3Bd,uBACAC,0BACAC,mBACAC,8BACAC,mCACAC,S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,QAAS,SAGXsE,OAAQ,CACPC,KAAM,OACNC,MAAO,QACPC,KAAM,QACNC,KAAM,OACNC,KAAM,SA5DF,iBAAiBzL,MAiExBiF,EAAC4G,EACA,CAAAC,OAAQ1M,EACRE,SAAUA,GACVyM,QAASA,KACR1M,IAAoB,GACpBE,GAAY,IACZE,IAAe,GAGf,MAAM+I,EAAc1J,EAAuBgD,MACzCC,IAAO7B,GAAqB+C,IAAIlB,EAAEpB,MAGhC6H,EAEH/G,YAAW,KACVa,GAAuBkG,EAAa1J,EAAuB,GACzD,KAGHG,GAAwB,EACxB,MAGD"}
@@ -1,2 +1,2 @@
1
- import{__awaiter as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as n,Fragment as o}from"react/jsx-runtime";import{useState as r,useRef as s,useEffect as a}from"react";import i from"../../assets/icons/chevronRight2.svg.js";import l from"../../assets/icons/play.svg.js";import{TEXT as c}from"./constants/index.js";import{getMajorPopupStyles as u}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as d}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as p,calculateCloseTransform as g,executeAfterAnimation as y}from"./utils/animationHelpers.js";import{findWhatsNewButton as v}from"./utils/elementHelpers.js";const b=b=>{let{feature:h,currentIndex:m,totalFeatures:f,onSkip:j,onExplore:O,onPrevious:B,onNext:T,setIsClosing:k,onSecondaryAction:x,ratio:M="16:9",padding:P}=b;var E,C,L,_,U,W;const[I,w]=r(!1),[D,H]=r(!1),[V,S]=r(""),A=s(null),[R,F]=r(!1),[N,z]=r(!0),G=s(null),[K,X]=r(M),$=s(null);a((()=>{I&&H(!0)}),[I]);const q=e=>{var n,o;e.preventDefault(),e.stopPropagation();const r=null===(n=h.secondaryButton)||void 0===n?void 0:n.action,s=x||j;let a=null;if("Play Video"===r)O("Play Video");else if("Open link"===r){const t=null===(o=h.secondaryButton)||void 0===o?void 0:o.redirectionUrl;if(t){t.startsWith("http")?window.open(t,"_blank","noopener,noreferrer"):a=t}}p(A.current);const i=v();if(i&&A.current){const t=g(A.current,i);S(t)}else S("scale(0)");null==k||k(!0),w(!0),y((()=>t(void 0,void 0,void 0,(function*(){yield s(),a&&(window.location.href=a)}))))},J=u(D,V,K,P||h.padding,null===(E=h.primaryButton)||void 0===E?void 0:E.style,null===(C=h.secondaryButton)||void 0===C?void 0:C.style);return e("div",Object.assign({style:J.outerWrapper},{children:n("div",Object.assign({ref:A,style:Object.assign(Object.assign({},J.container),{opacity:D?0:1,transition:"opacity 0.2s ease-in-out, transform 0.3s ease"})},{children:[e("style",{children:"\n\t\t\t\t[data-popup-content] ul {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\tlist-style-type: disc;\n\t\t\t\t}\n\t\t\t\t[data-popup-content] ul li {\n\t\t\t\t\tmargin-bottom: 8px;\n\t\t\t\t\tcolor: rgba(255, 255, 255, 0.8);\n\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\tline-height: 16px;\n\t\t\t\t\tfont-family: Inter, sans-serif;\n\t\t\t\t}\n\t\t\t"}),n("div",Object.assign({style:J.contentWrapper},{children:[e("div",Object.assign({style:J.imageContainer},{children:h.productVideo?n(o,{children:[e("video",{ref:G,src:h.productVideo,style:J.image,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!0,"aria-label":`Product video for ${h.title}`,onLoadedMetadata:t=>{const e=t.currentTarget,n=e.videoWidth,o=e.videoHeight;if(n&&o){const t=n/o;Math.abs(t-16/9)<.1?X("16:9"):Math.abs(t-1)<.1?X("1:1"):Math.abs(t-4/3)<.1?X("4:3"):X(t>1.5?"16:9":t<.9?"4:3":"1:1")}}}),(R||N)&&e("div",Object.assign({style:J.videoOverlay,onClick:t=>{t.stopPropagation(),G.current&&(G.current.paused?(G.current.play(),F(!1),z(!1)):(G.current.pause(),F(!0),z(!0)))},role:"button",tabIndex:0,"aria-label":R?"Play video":"Pause video",onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),G.current&&(G.current.paused?(G.current.play(),F(!1),z(!1)):(G.current.pause(),F(!0),z(!0))))}},{children:e(l,{width:20,height:20})}))]}):h.displayImage?e("img",{ref:$,src:h.displayImage,alt:h.title,style:J.image,onLoad:t=>{const e=t.currentTarget,n=e.naturalWidth,o=e.naturalHeight;if(n&&o){const t=n/o;Math.abs(t-16/9)<.1?X("16:9"):Math.abs(t-1)<.1?X("1:1"):Math.abs(t-4/3)<.1?X("4:3"):X(t>1.5?"16:9":t<.9?"4:3":"1:1")}},onError:t=>{h.image&&(t.target.src=h.image)}}):e("div",Object.assign({style:J.imagePlaceholder},{children:c.FEATURE_PREVIEW_PLACEHOLDER}))})),n("div",Object.assign({style:J.contentContainer},{children:[e("div",Object.assign({style:J.skipButtonContainer},{children:e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),(t=>{p(A.current);const e=v();if(e&&A.current){const t=g(A.current,e);S(t)}else S("scale(0)");null==k||k(!0),w(!0),y(t)})(j)},style:J.skipButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,J.skipButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,J.skipButton.base),"aria-label":"Skip feature announcement"},{children:"Skip"}))})),e("h3",Object.assign({style:J.title},{children:h.title})),e("div",{"data-popup-content":!0,style:J.content,dangerouslySetInnerHTML:{__html:d(h.content||h.body||"")}}),n("div",Object.assign({style:J.actionsWrapper},{children:[n("div",Object.assign({style:J.buttonsGroup},{children:[e("button",Object.assign({onClick:()=>{var t,e;const n=null===(t=h.primaryButton)||void 0===t?void 0:t.action;if("Open link"===n){const t=(null===(e=h.primaryButton)||void 0===e?void 0:e.redirectionUrl)||h.redirectUrl;if(t){t.startsWith("http")&&window.open(t,"_blank","noopener,noreferrer")}}O(n),p(A.current);const o=v();if(o&&A.current){const t=g(A.current,o);S(t)}else S("scale(0)");null==k||k(!0),w(!0)},style:J.exploreButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,J.exploreButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,J.exploreButton.base)},{children:(null===(L=h.primaryButton)||void 0===L?void 0:L.text)||h.buttonText||c.DEFAULT_BUTTON_TEXT})),(null===(_=h.secondaryButton)||void 0===_?void 0:_.text)&&((null===(U=h.secondaryButton)||void 0===U?void 0:U.redirectionUrl)&&"Play Video"!==(null===(W=h.secondaryButton)||void 0===W?void 0:W.action)?e("a",Object.assign({href:h.secondaryButton.redirectionUrl,target:h.secondaryButton.redirectionUrl.startsWith("http")?"_blank":"_self",rel:h.secondaryButton.redirectionUrl.startsWith("http")?"noopener noreferrer":void 0,onClick:q,style:J.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,J.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,J.secondaryButton.base)},{children:h.secondaryButton.text})):e("button",Object.assign({onClick:q,style:J.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,J.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,J.secondaryButton.base)},{children:h.secondaryButton.text})))]})),f>1&&n("div",Object.assign({style:J.navigationContainer},{children:[e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),B()},disabled:0===m,style:J.navigationButton(0===m).base,onMouseEnter:t=>{0!==m&&Object.assign(t.currentTarget.style,J.navigationButton(!1).hover)},onMouseLeave:t=>{0!==m&&Object.assign(t.currentTarget.style,J.navigationButton(!1).base)},"aria-label":"Previous feature"},{children:e(i,{style:{transform:"rotate(180deg)"}})})),e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),T()},disabled:m===f-1,style:J.navigationButton(m===f-1).base,onMouseEnter:t=>{m!==f-1&&Object.assign(t.currentTarget.style,J.navigationButton(!1).hover)},onMouseLeave:t=>{m!==f-1&&Object.assign(t.currentTarget.style,J.navigationButton(m===f-1).base)},"aria-label":"Next feature"},{children:e(i,{})}))]}))]}))]}))]}))]}))}))};export{b as default};
1
+ import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{useState as o,useRef as r,useEffect as s}from"react";import a from"../../assets/icons/chevronRight2.svg.js";import i from"../../assets/icons/play.svg.js";import{TEXT as l}from"./constants/index.js";import{getMajorPopupStyles as c}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as u}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as d,calculateCloseTransform as p,executeAfterAnimation as g}from"./utils/animationHelpers.js";import{findWhatsNewButton as y}from"./utils/elementHelpers.js";const v=v=>{let{feature:b,currentIndex:h,totalFeatures:f,onSkip:m,onExplore:j,onPrevious:O,onNext:B,setIsClosing:T,onSecondaryAction:k,ratio:x="16:9",padding:M}=v;var P,E,C,L,w;const[U,W]=o(!1),[_,I]=o(!1),[D,H]=o(""),S=r(null),[V,A]=o(!1),[R,F]=o(!0),N=r(null),[z,G]=o(x),K=r(null);s((()=>{U&&I(!0)}),[U]);const X=t=>{var e,n;t.preventDefault(),t.stopPropagation();const o=null===(e=b.secondaryButton)||void 0===e?void 0:e.action,r=k||m;if("Play Video"===o)j();else if("Open link"===o){const t=null===(n=b.secondaryButton)||void 0===n?void 0:n.redirectionUrl;if(t){if(!t.startsWith("http"))return r(),void(window.location.href=t);window.open(t,"_blank","noopener,noreferrer")}}d(S.current);const s=y();if(s&&S.current){const t=p(S.current,s);H(t)}else H("scale(0)");null==T||T(!0),W(!0),g(r)},$=c(_,D,z,M||b.padding,null===(P=b.primaryButton)||void 0===P?void 0:P.style,null===(E=b.secondaryButton)||void 0===E?void 0:E.style);return t("div",Object.assign({style:$.outerWrapper},{children:e("div",Object.assign({ref:S,style:Object.assign(Object.assign({},$.container),{opacity:_?0:1,transition:"opacity 0.2s ease-in-out, transform 0.3s ease"})},{children:[t("style",{children:"\n\t\t\t\t[data-popup-content] ul {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\tlist-style-type: disc;\n\t\t\t\t}\n\t\t\t\t[data-popup-content] ul li {\n\t\t\t\t\tmargin-bottom: 8px;\n\t\t\t\t\tcolor: rgba(255, 255, 255, 0.8);\n\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\tline-height: 16px;\n\t\t\t\t\tfont-family: Inter, sans-serif;\n\t\t\t\t}\n\t\t\t"}),e("div",Object.assign({style:$.contentWrapper},{children:[t("div",Object.assign({style:$.imageContainer},{children:b.productVideo?e(n,{children:[t("video",{ref:N,src:b.productVideo,style:$.image,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,controls:!0,"aria-label":`Product video for ${b.title}`,onLoadedMetadata:t=>{const e=t.currentTarget,n=e.videoWidth,o=e.videoHeight;if(n&&o){const t=n/o;Math.abs(t-16/9)<.1?G("16:9"):Math.abs(t-1)<.1?G("1:1"):Math.abs(t-4/3)<.1?G("4:3"):G(t>1.5?"16:9":t<.9?"4:3":"1:1")}}}),(V||R)&&t("div",Object.assign({style:$.videoOverlay,onClick:t=>{t.stopPropagation(),N.current&&(N.current.paused?(N.current.play(),A(!1),F(!1)):(N.current.pause(),A(!0),F(!0)))},role:"button",tabIndex:0,"aria-label":V?"Play video":"Pause video",onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),N.current&&(N.current.paused?(N.current.play(),A(!1),F(!1)):(N.current.pause(),A(!0),F(!0))))}},{children:t(i,{width:20,height:20})}))]}):b.displayImage?t("img",{ref:K,src:b.displayImage,alt:b.title,style:$.image,onLoad:t=>{const e=t.currentTarget,n=e.naturalWidth,o=e.naturalHeight;if(n&&o){const t=n/o;Math.abs(t-16/9)<.1?G("16:9"):Math.abs(t-1)<.1?G("1:1"):Math.abs(t-4/3)<.1?G("4:3"):G(t>1.5?"16:9":t<.9?"4:3":"1:1")}},onError:t=>{b.image&&(t.target.src=b.image)}}):t("div",Object.assign({style:$.imagePlaceholder},{children:l.FEATURE_PREVIEW_PLACEHOLDER}))})),e("div",Object.assign({style:$.contentContainer},{children:[t("div",Object.assign({style:$.skipButtonContainer},{children:t("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),(t=>{d(S.current);const e=y();if(e&&S.current){const t=p(S.current,e);H(t)}else H("scale(0)");null==T||T(!0),W(!0),g(t)})(m)},style:$.skipButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.skipButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.skipButton.base),"aria-label":"Skip feature announcement"},{children:"Skip"}))})),t("h3",Object.assign({style:$.title},{children:b.title})),t("div",{"data-popup-content":!0,style:$.content,dangerouslySetInnerHTML:{__html:u(b.content||b.body||"")}}),e("div",Object.assign({style:$.actionsWrapper},{children:[e("div",Object.assign({style:$.buttonsGroup},{children:[t("button",Object.assign({onClick:()=>{var t,e;const n=null===(t=b.primaryButton)||void 0===t?void 0:t.action;if("Play Video"===n)j();else if("Open link"===n){j();const t=(null===(e=b.primaryButton)||void 0===e?void 0:e.redirectionUrl)||b.redirectUrl;if(t){if(!t.startsWith("http"))return void(window.location.href=t);window.open(t,"_blank","noopener,noreferrer")}}else j();d(S.current);const o=y();if(o&&S.current){const t=p(S.current,o);H(t)}else H("scale(0)");null==T||T(!0),W(!0)},style:$.exploreButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.exploreButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.exploreButton.base)},{children:(null===(C=b.primaryButton)||void 0===C?void 0:C.text)||b.buttonText||l.DEFAULT_BUTTON_TEXT})),(null===(L=b.secondaryButton)||void 0===L?void 0:L.text)&&((null===(w=b.secondaryButton)||void 0===w?void 0:w.redirectionUrl)?t("a",Object.assign({href:b.secondaryButton.redirectionUrl,target:b.secondaryButton.redirectionUrl.startsWith("http")?"_blank":"_self",rel:b.secondaryButton.redirectionUrl.startsWith("http")?"noopener noreferrer":void 0,onClick:X,style:$.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.secondaryButton.base)},{children:b.secondaryButton.text})):t("button",Object.assign({onClick:X,style:$.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,$.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,$.secondaryButton.base)},{children:b.secondaryButton.text})))]})),f>1&&e("div",Object.assign({style:$.navigationContainer},{children:[t("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),O()},disabled:0===h,style:$.navigationButton(0===h).base,onMouseEnter:t=>{0!==h&&Object.assign(t.currentTarget.style,$.navigationButton(!1).hover)},onMouseLeave:t=>{0!==h&&Object.assign(t.currentTarget.style,$.navigationButton(!1).base)},"aria-label":"Previous feature"},{children:t(a,{style:{transform:"rotate(180deg)"}})})),t("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),B()},disabled:h===f-1,style:$.navigationButton(h===f-1).base,onMouseEnter:t=>{h!==f-1&&Object.assign(t.currentTarget.style,$.navigationButton(!1).hover)},onMouseLeave:t=>{h!==f-1&&Object.assign(t.currentTarget.style,$.navigationButton(h===f-1).base)},"aria-label":"Next feature"},{children:t(a,{})}))]}))]}))]}))]}))]}))}))};export{v as default};
2
2
  //# sourceMappingURL=MajorUpdatePopup.js.map