@bikdotai/bik-component-library 0.0.721-beta.21 โ†’ 0.0.721-beta.22

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),o=require("react-joyride");require("./constants/animations.js");var s=require("./constants/selectors.js"),n=require("./hooks/useFeatureAnnouncements.js"),r=require("./MajorUpdatePopup.js"),a=require("./MinorUpdatePopup.js");require("../../constants/Theme.js");var i=require("./styles/joyride.styles.js"),l=require("./VideoModal.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=u(o);exports.default=u=>{let{children:c,fetchVisibleFeatures:f,getStoreFeatureProgress:g,fetchFeatureById:p,markFeatureAsViewedForStore:h,isFeatureApplicableToCurrentPage:m,module:x,router:S}=u;var y;const{majorUpdateFeatures:T,minorUpdateFeatures:b,isLoading:j,markFeatureAsViewed:C}=n.useFeatureAnnouncements({fetchVisibleFeatures:f,getStoreFeatureProgress:g,fetchFeatureById:p,markFeatureAsViewedForStore:h,isFeatureApplicableToCurrentPage:m,module:x,router:S}),[E,k]=t.useState(null),[v,F]=t.useState(null),[w,I]=t.useState(!1),[B,M]=t.useState([]),[q,N]=t.useState(!1),[P,O]=t.useState([]),[W,L]=t.useState(!1),[A,R]=t.useState(!1),[U,V]=t.useState([]),[_,J]=t.useState(!1),[$,D]=t.useState(!1),[H,Q]=t.useState(!1),[z,G]=t.useState(""),[K,X]=t.useState(!1),[Y,Z]=t.useState(!1),[ee,te]=t.useState(!1);t.useEffect((()=>{const e="minor-spotlight-cutout-style";let t=document.getElementById(e);return t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.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}\n\t\t",()=>{const t=document.getElementById(e);t&&t.remove()}}),[]),t.useEffect((()=>{console.log("๐Ÿ“‹ joyrideSteps changed:",{length:B.length,runJoyride:w})}),[B,w]),t.useEffect((()=>{console.log("๐ŸŽฏ currentMinorFeature changed:",{id:(null==v?void 0:v.id)||"null"})}),[v]),t.useEffect((()=>{if(!(T.length>0)||E||j||W||K)0!==T.length||j||D(!0);else{D(!1),J(!1),I(!1),M([]),F(null),V([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?oe(T[0]):setTimeout(e,1e3)};e()}}),[T,E,j,W,K]),t.useEffect((()=>{var e;const t=null===(e=null==S?void 0:S.query)||void 0===e?void 0:e.featureId;if(console.log("๐Ÿงช Test mode effect triggered:",{featureIdFromQuery:t,isLoading:j,minorUpdateFeaturesCount:b.length}),!t||j||0===b.length)return;const o=b.find((e=>e.id===t));if(!o||!o.featureTag)return;J(!0),R(!0);let s=0;const n=setInterval((()=>{s++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(e)){console.log("โœจ Test mode: Element found, showing joyride");const e=[o];V(e),de(o,e),clearInterval(n)}else s>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),R(!1),clearInterval(n))}),200);return()=>{clearInterval(n)}}),[b,null===(y=null==S?void 0:S.query)||void 0===y?void 0:y.featureId,j]),t.useEffect((()=>{var e;if(console.log("๐Ÿ” Main minor effect check:",{minorUpdateFeaturesCount:b.length,isLoading:j,runJoyride:w,isProcessingMinorUpdate:A,currentMinorFeature:(null==v?void 0:v.id)||"null",minorFeaturesSkipped:_,showMinorUpdates:$,blockPopups:K}),b.length>0&&!j&&!w&&!A&&!v&&!_&&$&&!K){let e=null,t=null,o=null,s=!1;const n=()=>{if(s||A||v||_||!$)return;const n=b.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));n.length>0&&(console.log("๐ŸŽ‰ Found available features:",n.length),V(n),de(n[0],n),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const s=o.addedNodes[e];if(s.nodeType===Node.ELEMENT_NODE){const e=s;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}w||s||A||v||_||!$||!t||(o&&clearTimeout(o),o=setTimeout((()=>{s||A||v||_||!$||n()}),200))})),t=()=>{w||s||A||v||_||!$||(o&&clearTimeout(o),o=setTimeout((()=>{s||A||v||_||!$||n()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),n(),setTimeout((()=>{s||A||v||_||!$||n()}),100),setTimeout((()=>{s||A||v||_||!$||n()}),1e3),setTimeout((()=>{s||A||v||_||!$||n()}),500),()=>{s=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}if(0===b.length||j){(null===(e=null==S?void 0:S.query)||void 0===e?void 0:e.featureId)&&v?console.log("๐Ÿšซ Skipping joyride clear - test mode with active feature"):(console.log("๐Ÿ—‘๏ธ Clearing joyride - no features or loading"),I(!1),M([]),F(null),V([]),J(!1))}}),[b,j,w,A,v,_,$,C,K]);const oe=t=>{k(t);const o=T.findIndex((e=>e.id===t.id)),n=T.length,a=[{target:s.SELECTORS.WHATS_NEW_BUTTON,content:e.jsxRuntimeExports.jsx(r.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ne(t),onPrevious:()=>re(t),onNext:()=>ae(t),setIsClosing:Z}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:i.getMajorJoyrideStyles(Y)}];O(a),N(!0)},se=t.useCallback((e=>{(e||E)&&(L(!0),T.forEach((e=>{C(e.id)})),N(!1),k(null),O([]),D(!0),setTimeout((()=>{L(!1)}),500))}),[E,T,C]),ne=t.useCallback((e=>{L(!0),C(e.id),e.productVideo&&(G(e.productVideo),Q(!0),X(!0)),N(!1),k(null),O([]);T.findIndex((t=>t.id===e.id))===T.length-1&&D(!0),setTimeout((()=>{L(!1)}),500)}),[T,C]),re=t.useCallback((t=>{const o=t||E;if(!o)return;const s=T.findIndex((e=>e.id===o.id));if(s>0){const t=T[s-1];k(t);const o=s-1,n=T.length,a=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(r.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ne(t),onPrevious:()=>re(t),onNext:()=>ae(t),setIsClosing:Z}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:i.majorStepStyles}];O(a)}}),[E,T]),ae=t.useCallback((t=>{const o=t||E;if(!o)return;const s=T.findIndex((e=>e.id===o.id));if(s<T.length-1){const t=T[s+1];k(t);const o=s+1,n=T.length,a=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(r.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ne(t),onPrevious:()=>re(t),onNext:()=>ae(t),setIsClosing:Z}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:i.majorStepStyles}];O(a)}else L(!0),C(o.id),N(!1),k(null),O([]),D(!0),setTimeout((()=>{L(!1)}),500)}),[E,T,C]),ie=()=>{if(T.length>0&&!E){document.querySelector('[data-testid="whats-new-button"]')&&oe(T[0])}};t.useEffect((()=>(window.showMajorUpdatePopup=ie,()=>{delete window.showMajorUpdatePopup})),[T,E]);const le=t.useCallback((e=>{const{action:t}=e;t===o.ACTIONS.CLOSE&&(E&&(L(!0),T.forEach((e=>{C(e.id)})),D(!0),setTimeout((()=>{L(!1)}),500)),N(!1),k(null),O([]))}),[E,T,C]),ue=t.useCallback((e=>{const{action:t,type:s,status:n,lifecycle:r,index:a}=e;console.log("๐Ÿ”” Minor Callback:",{action:t,type:s,status:n,lifecycle:r,index:a,hasSteps:B.length,runJoyride:w}),t===o.ACTIONS.CLOSE&&(console.log("โŒ CLOSE ACTION - Clearing joyride"),v&&(R(!0),J(!0),b.forEach((e=>{C(e.id)})),setTimeout((()=>{R(!1)}),500)),I(!1),F(null),M([]))}),[v,b,C]),de=(t,o)=>{F(t);const s=o||U,n=s.findIndex((e=>e.id===t.id)),r=s.length,l=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,u=[{target:l,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:n,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>ge(t),onNext:()=>pe(t),setIsClosing:te}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:i.getMinorJoyrideStyles(ee)}];console.log("โœ… Setting joyride:",{currentIndex:n,totalFeatures:r,hasFeatures:s.length,target:l}),M(u),I(!0)},ce=t.useCallback((e=>{(e||v)&&(R(!0),J(!0),b.forEach((e=>{C(e.id)})),I(!1),F(null),M([]),setTimeout((()=>{R(!1)}),500))}),[v,b,C]),fe=t.useCallback((e=>{R(!0),J(!0),C(e.id),e.productVideo&&(G(e.productVideo),Q(!0),X(!0)),I(!1),F(null),M([]),setTimeout((()=>{R(!1)}),500)}),[C]),ge=t.useCallback((t=>{const o=t||v;if(!o)return;const s=U.findIndex((e=>e.id===o.id));if(s>0){const t=U[s-1];F(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,n=s-1,r=U.length,l=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:n,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>ge(t),onNext:()=>pe(t),setIsClosing:te}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:i.minorStepStyles}];M(l)}}),[v,U]),pe=t.useCallback((t=>{const o=t||v;if(!o)return;const s=U.findIndex((e=>e.id===o.id));if(s<U.length-1){const t=U[s+1];F(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,n=s+1,r=U.length,l=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:n,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>ge(t),onNext:()=>pe(t),setIsClosing:te}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:i.minorStepStyles}];M(l)}else R(!0),J(!0),C(o.id),I(!1),F(null),M([]),setTimeout((()=>{R(!1)}),500)}),[v,U,C]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c,P.length>0&&e.jsxRuntimeExports.jsx(d.default,{steps:P,run:q,continuous:!1,showProgress:!1,showSkipButton:!1,callback:le,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:i.getMajorJoyrideStyles(Y),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),B.length>0&&e.jsxRuntimeExports.jsx(d.default,{steps:B,run:w,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ue,disableOverlayClose:!0,disableCloseOnEsc:!1,styles:i.getMinorJoyrideStyles(ee),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsxRuntimeExports.jsx(l.VideoModal,{isOpen:H,videoUrl:z,onClose:()=>{Q(!1),G(""),X(!1)}})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),o=require("react-joyride");require("./constants/animations.js");var s=require("./constants/selectors.js"),n=require("./hooks/useFeatureAnnouncements.js"),r=require("./MajorUpdatePopup.js"),a=require("./MinorUpdatePopup.js");require("../../constants/Theme.js");var i=require("./styles/joyride.styles.js"),u=require("./VideoModal.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(o);exports.default=l=>{let{children:c,fetchVisibleFeatures:f,getStoreFeatureProgress:g,fetchFeatureById:h,markFeatureAsViewedForStore:p,isFeatureApplicableToCurrentPage:m,module:x,router:S}=l;var y;const{majorUpdateFeatures:T,minorUpdateFeatures:j,isLoading:b,markFeatureAsViewed:C}=n.useFeatureAnnouncements({fetchVisibleFeatures:f,getStoreFeatureProgress:g,fetchFeatureById:h,markFeatureAsViewedForStore:p,isFeatureApplicableToCurrentPage:m,module:x,router:S}),[E,k]=t.useState(null),[v,F]=t.useState(null),[w,I]=t.useState(!1),[B,M]=t.useState([]),[q,N]=t.useState(!1),[P,O]=t.useState([]),[W,L]=t.useState(!1),[A,R]=t.useState(!1),[U,V]=t.useState([]),[_,J]=t.useState(!1),[$,D]=t.useState(!1),[H,Q]=t.useState(!1),[z,G]=t.useState(""),[K,X]=t.useState(!1),[Y,Z]=t.useState(!1),[ee,te]=t.useState(!1);t.useEffect((()=>{const e="minor-spotlight-cutout-style";let t=document.getElementById(e);return t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.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}\n\t\t",()=>{const t=document.getElementById(e);t&&t.remove()}}),[]),t.useEffect((()=>{console.log("๐Ÿ“‹ joyrideSteps changed:",{length:B.length,runJoyride:w})}),[B,w]),t.useEffect((()=>{console.log("๐ŸŽฏ currentMinorFeature changed:",{id:(null==v?void 0:v.id)||"null"})}),[v]),t.useEffect((()=>{if(!(T.length>0)||E||b||W||K)0!==T.length||b||D(!0);else{D(!1),J(!1),I(!1),M([]),F(null),V([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?oe(T[0]):setTimeout(e,1e3)};e()}}),[T,E,b,W,K]),t.useEffect((()=>{var e;const t=null===(e=null==S?void 0:S.query)||void 0===e?void 0:e.featureId;if(console.log("๐Ÿงช Test mode effect triggered:",{featureIdFromQuery:t,isLoading:b,minorUpdateFeaturesCount:j.length}),!t||b||0===j.length)return;const o=j.find((e=>e.id===t));if(!o||!o.featureTag)return;J(!0),R(!0);let s=0;const n=setInterval((()=>{s++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(e)){console.log("โœจ Test mode: Element found, showing joyride");const e=[o];V(e),de(o,e),clearInterval(n)}else s>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),R(!1),clearInterval(n))}),200);return()=>{clearInterval(n)}}),[j,null===(y=null==S?void 0:S.query)||void 0===y?void 0:y.featureId,b]),t.useEffect((()=>{var e;if(console.log("๐Ÿ” Main minor effect check:",{minorUpdateFeaturesCount:j.length,isLoading:b,runJoyride:w,isProcessingMinorUpdate:A,currentMinorFeature:(null==v?void 0:v.id)||"null",minorFeaturesSkipped:_,showMinorUpdates:$,blockPopups:K}),j.length>0&&!b&&!w&&!A&&!v&&!_&&$&&!K){let e=null,t=null,o=null,s=!1;const n=()=>{if(s||A||v||_||!$)return;const n=j.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));n.length>0&&(console.log("๐ŸŽ‰ Found available features:",n.length),V(n),de(n[0],n),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const s=o.addedNodes[e];if(s.nodeType===Node.ELEMENT_NODE){const e=s;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}w||s||A||v||_||!$||!t||(o&&clearTimeout(o),o=setTimeout((()=>{s||A||v||_||!$||n()}),200))})),t=()=>{w||s||A||v||_||!$||(o&&clearTimeout(o),o=setTimeout((()=>{s||A||v||_||!$||n()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),n(),setTimeout((()=>{s||A||v||_||!$||n()}),100),setTimeout((()=>{s||A||v||_||!$||n()}),1e3),setTimeout((()=>{s||A||v||_||!$||n()}),500),()=>{s=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}if(0===j.length||b){(null===(e=null==S?void 0:S.query)||void 0===e?void 0:e.featureId)&&v?console.log("๐Ÿšซ Skipping joyride clear - test mode with active feature"):(console.log("๐Ÿ—‘๏ธ Clearing joyride - no features or loading"),I(!1),M([]),F(null),V([]),J(!1))}}),[j,b,w,A,v,_,$,C,K]);const oe=t=>{k(t);const o=T.findIndex((e=>e.id===t.id)),n=T.length,a=[{target:s.SELECTORS.WHATS_NEW_BUTTON,content:e.jsxRuntimeExports.jsx(r.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ne(t),onPrevious:()=>re(t),onNext:()=>ae(t),setIsClosing:Z}),placement:"bottom",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:16,data:{feature:t,isMajor:!0},styles:i.getMajorJoyrideStyles(Y)}];O(a),N(!0)},se=t.useCallback((e=>{(e||E)&&(L(!0),T.forEach((e=>{C(e.id)})),N(!1),k(null),O([]),D(!0),setTimeout((()=>{L(!1)}),500))}),[E,T,C]),ne=t.useCallback((e=>{L(!0),C(e.id),e.productVideo&&(G(e.productVideo),Q(!0),X(!0)),N(!1),k(null),O([]);T.findIndex((t=>t.id===e.id))===T.length-1&&D(!0),setTimeout((()=>{L(!1)}),500)}),[T,C]),re=t.useCallback((t=>{const o=t||E;if(!o)return;const s=T.findIndex((e=>e.id===o.id));if(s>0){const t=T[s-1];k(t);const o=s-1,n=T.length,a=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(r.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ne(t),onPrevious:()=>re(t),onNext:()=>ae(t),setIsClosing:Z}),placement:"bottom",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:16,data:{feature:t,isMajor:!0},styles:i.majorStepStyles}];O(a)}}),[E,T]),ae=t.useCallback((t=>{const o=t||E;if(!o)return;const s=T.findIndex((e=>e.id===o.id));if(s<T.length-1){const t=T[s+1];k(t);const o=s+1,n=T.length,a=[{target:'[data-testid="whats-new-button"]',content:e.jsxRuntimeExports.jsx(r.default,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>se(t),onExplore:()=>ne(t),onPrevious:()=>re(t),onNext:()=>ae(t),setIsClosing:Z}),placement:"bottom",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:16,data:{feature:t,isMajor:!0},styles:i.majorStepStyles}];O(a)}else L(!0),C(o.id),N(!1),k(null),O([]),D(!0),setTimeout((()=>{L(!1)}),500)}),[E,T,C]),ie=()=>{if(T.length>0&&!E){document.querySelector('[data-testid="whats-new-button"]')&&oe(T[0])}};t.useEffect((()=>(window.showMajorUpdatePopup=ie,()=>{delete window.showMajorUpdatePopup})),[T,E]);const ue=t.useCallback((e=>{const{action:t}=e;t===o.ACTIONS.CLOSE&&(E&&(L(!0),T.forEach((e=>{C(e.id)})),D(!0),setTimeout((()=>{L(!1)}),500)),N(!1),k(null),O([]))}),[E,T,C]),le=t.useCallback((e=>{const{action:t,type:s,status:n,lifecycle:r,index:a}=e;console.log("๐Ÿ”” Minor Callback:",{action:t,type:s,status:n,lifecycle:r,index:a,hasSteps:B.length,runJoyride:w}),t===o.ACTIONS.CLOSE&&(console.log("โŒ CLOSE ACTION - Clearing joyride"),v&&(R(!0),J(!0),j.forEach((e=>{C(e.id)})),setTimeout((()=>{R(!1)}),500)),I(!1),F(null),M([]))}),[v,j,C]),de=(t,o)=>{F(t);const s=o||U,n=s.findIndex((e=>e.id===t.id)),r=s.length,u=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,l=[{target:u,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:n,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>ge(t),onNext:()=>he(t),setIsClosing:te}),placement:"auto",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:20,data:{feature:t,isMinor:!0},styles:i.getMinorJoyrideStyles(ee)}];console.log("โœ… Setting joyride:",{currentIndex:n,totalFeatures:r,hasFeatures:s.length,target:u}),M(l),I(!0)},ce=t.useCallback((e=>{(e||v)&&(R(!0),J(!0),j.forEach((e=>{C(e.id)})),I(!1),F(null),M([]),setTimeout((()=>{R(!1)}),500))}),[v,j,C]),fe=t.useCallback((e=>{R(!0),J(!0),C(e.id),e.productVideo&&(G(e.productVideo),Q(!0),X(!0)),I(!1),F(null),M([]),setTimeout((()=>{R(!1)}),500)}),[C]),ge=t.useCallback((t=>{const o=t||v;if(!o)return;const s=U.findIndex((e=>e.id===o.id));if(s>0){const t=U[s-1];F(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,n=s-1,r=U.length,u=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:n,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>ge(t),onNext:()=>he(t),setIsClosing:te}),placement:"auto",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:20,data:{feature:t,isMinor:!0},styles:i.minorStepStyles}];M(u)}}),[v,U]),he=t.useCallback((t=>{const o=t||v;if(!o)return;const s=U.findIndex((e=>e.id===o.id));if(s<U.length-1){const t=U[s+1];F(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,n=s+1,r=U.length,u=[{target:o,content:e.jsxRuntimeExports.jsx(a.default,{feature:t,currentIndex:n,totalFeatures:r,onSkip:()=>ce(t),onExplore:()=>fe(t),onPrevious:()=>ge(t),onNext:()=>he(t),setIsClosing:te}),placement:"auto",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:20,data:{feature:t,isMinor:!0},styles:i.minorStepStyles}];M(u)}else R(!0),J(!0),C(o.id),I(!1),F(null),M([]),setTimeout((()=>{R(!1)}),500)}),[v,U,C]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c,P.length>0&&e.jsxRuntimeExports.jsx(d.default,{steps:P,run:q,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ue,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:i.getMajorJoyrideStyles(Y),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),B.length>0&&e.jsxRuntimeExports.jsx(d.default,{steps:B,run:w,continuous:!1,showProgress:!1,showSkipButton:!1,callback:le,disableOverlayClose:!0,disableCloseOnEsc:!1,styles:i.getMinorJoyrideStyles(ee),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsxRuntimeExports.jsx(u.VideoModal,{isOpen:H,videoUrl:z,onClose:()=>{Q(!1),G(""),X(!1)}})]})};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useEffect as o,useCallback as n}from"react";import s,{ACTIONS as r}from"react-joyride";import"./constants/animations.js";import{SELECTORS as a}from"./constants/selectors.js";import{useFeatureAnnouncements as i}from"./hooks/useFeatureAnnouncements.js";import l from"./MajorUpdatePopup.js";import u from"./MinorUpdatePopup.js";import"../../constants/Theme.js";import{majorStepStyles as d,getMinorJoyrideStyles as c,minorStepStyles as f,getMajorJoyrideStyles as g}from"./styles/joyride.styles.js";import{VideoModal as m}from"./VideoModal.js";const h=h=>{let{children:p,fetchVisibleFeatures:T,getStoreFeatureProgress:y,fetchFeatureById:x,markFeatureAsViewedForStore:b,isFeatureApplicableToCurrentPage:v,module:F,router:j}=h;var k;const{majorUpdateFeatures:w,minorUpdateFeatures:C,isLoading:S,markFeatureAsViewed:B}=i({fetchVisibleFeatures:T,getStoreFeatureProgress:y,fetchFeatureById:x,markFeatureAsViewedForStore:b,isFeatureApplicableToCurrentPage:v,module:F,router:j}),[I,E]=t(null),[M,P]=t(null),[N,W]=t(!1),[O,L]=t([]),[U,V]=t(!1),[A,q]=t([]),[$,_]=t(!1),[J,D]=t(!1),[H,Q]=t([]),[z,G]=t(!1),[K,R]=t(!1),[X,Y]=t(!1),[Z,ee]=t(""),[te,oe]=t(!1),[ne,se]=t(!1),[re,ae]=t(!1);o((()=>{const e="minor-spotlight-cutout-style";let t=document.getElementById(e);return t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.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}\n\t\t",()=>{const t=document.getElementById(e);t&&t.remove()}}),[]),o((()=>{console.log("๐Ÿ“‹ joyrideSteps changed:",{length:O.length,runJoyride:N})}),[O,N]),o((()=>{console.log("๐ŸŽฏ currentMinorFeature changed:",{id:(null==M?void 0:M.id)||"null"})}),[M]),o((()=>{if(!(w.length>0)||I||S||$||te)0!==w.length||S||R(!0);else{R(!1),G(!1),W(!1),L([]),P(null),Q([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?ie(w[0]):setTimeout(e,1e3)};e()}}),[w,I,S,$,te]),o((()=>{var e;const t=null===(e=null==j?void 0:j.query)||void 0===e?void 0:e.featureId;if(console.log("๐Ÿงช Test mode effect triggered:",{featureIdFromQuery:t,isLoading:S,minorUpdateFeaturesCount:C.length}),!t||S||0===C.length)return;const o=C.find((e=>e.id===t));if(!o||!o.featureTag)return;G(!0),D(!0);let n=0;const s=setInterval((()=>{n++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(e)){console.log("โœจ Test mode: Element found, showing joyride");const e=[o];Q(e),he(o,e),clearInterval(s)}else n>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),D(!1),clearInterval(s))}),200);return()=>{clearInterval(s)}}),[C,null===(k=null==j?void 0:j.query)||void 0===k?void 0:k.featureId,S]),o((()=>{var e;if(console.log("๐Ÿ” Main minor effect check:",{minorUpdateFeaturesCount:C.length,isLoading:S,runJoyride:N,isProcessingMinorUpdate:J,currentMinorFeature:(null==M?void 0:M.id)||"null",minorFeaturesSkipped:z,showMinorUpdates:K,blockPopups:te}),C.length>0&&!S&&!N&&!J&&!M&&!z&&K&&!te){let e=null,t=null,o=null,n=!1;const s=()=>{if(n||J||M||z||!K)return;const s=C.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));s.length>0&&(console.log("๐ŸŽ‰ Found available features:",s.length),Q(s),he(s[0],s),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const n=o.addedNodes[e];if(n.nodeType===Node.ELEMENT_NODE){const e=n;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}N||n||J||M||z||!K||!t||(o&&clearTimeout(o),o=setTimeout((()=>{n||J||M||z||!K||s()}),200))})),t=()=>{N||n||J||M||z||!K||(o&&clearTimeout(o),o=setTimeout((()=>{n||J||M||z||!K||s()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),s(),setTimeout((()=>{n||J||M||z||!K||s()}),100),setTimeout((()=>{n||J||M||z||!K||s()}),1e3),setTimeout((()=>{n||J||M||z||!K||s()}),500),()=>{n=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}if(0===C.length||S){(null===(e=null==j?void 0:j.query)||void 0===e?void 0:e.featureId)&&M?console.log("๐Ÿšซ Skipping joyride clear - test mode with active feature"):(console.log("๐Ÿ—‘๏ธ Clearing joyride - no features or loading"),W(!1),L([]),P(null),Q([]),G(!1))}}),[C,S,N,J,M,z,K,B,te]);const ie=t=>{E(t);const o=w.findIndex((e=>e.id===t.id)),n=w.length,s=[{target:a.WHATS_NEW_BUTTON,content:e.jsx(l,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>le(t),onExplore:()=>ue(t),onPrevious:()=>de(t),onNext:()=>ce(t),setIsClosing:se}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:g(ne)}];q(s),V(!0)},le=n((e=>{(e||I)&&(_(!0),w.forEach((e=>{B(e.id)})),V(!1),E(null),q([]),R(!0),setTimeout((()=>{_(!1)}),500))}),[I,w,B]),ue=n((e=>{_(!0),B(e.id),e.productVideo&&(ee(e.productVideo),Y(!0),oe(!0)),V(!1),E(null),q([]);w.findIndex((t=>t.id===e.id))===w.length-1&&R(!0),setTimeout((()=>{_(!1)}),500)}),[w,B]),de=n((t=>{const o=t||I;if(!o)return;const n=w.findIndex((e=>e.id===o.id));if(n>0){const t=w[n-1];E(t);const o=n-1,s=w.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(l,{feature:t,currentIndex:o,totalFeatures:s,onSkip:()=>le(t),onExplore:()=>ue(t),onPrevious:()=>de(t),onNext:()=>ce(t),setIsClosing:se}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:d}];q(r)}}),[I,w]),ce=n((t=>{const o=t||I;if(!o)return;const n=w.findIndex((e=>e.id===o.id));if(n<w.length-1){const t=w[n+1];E(t);const o=n+1,s=w.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(l,{feature:t,currentIndex:o,totalFeatures:s,onSkip:()=>le(t),onExplore:()=>ue(t),onPrevious:()=>de(t),onNext:()=>ce(t),setIsClosing:se}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:d}];q(r)}else _(!0),B(o.id),V(!1),E(null),q([]),R(!0),setTimeout((()=>{_(!1)}),500)}),[I,w,B]),fe=()=>{if(w.length>0&&!I){document.querySelector('[data-testid="whats-new-button"]')&&ie(w[0])}};o((()=>(window.showMajorUpdatePopup=fe,()=>{delete window.showMajorUpdatePopup})),[w,I]);const ge=n((e=>{const{action:t}=e;t===r.CLOSE&&(I&&(_(!0),w.forEach((e=>{B(e.id)})),R(!0),setTimeout((()=>{_(!1)}),500)),V(!1),E(null),q([]))}),[I,w,B]),me=n((e=>{const{action:t,type:o,status:n,lifecycle:s,index:a}=e;console.log("๐Ÿ”” Minor Callback:",{action:t,type:o,status:n,lifecycle:s,index:a,hasSteps:O.length,runJoyride:N}),t===r.CLOSE&&(console.log("โŒ CLOSE ACTION - Clearing joyride"),M&&(D(!0),G(!0),C.forEach((e=>{B(e.id)})),setTimeout((()=>{D(!1)}),500)),W(!1),P(null),L([]))}),[M,C,B]),he=(t,o)=>{P(t);const n=o||H,s=n.findIndex((e=>e.id===t.id)),r=n.length,a=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,i=[{target:a,content:e.jsx(u,{feature:t,currentIndex:s,totalFeatures:r,onSkip:()=>pe(t),onExplore:()=>Te(t),onPrevious:()=>ye(t),onNext:()=>xe(t),setIsClosing:ae}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:c(re)}];console.log("โœ… Setting joyride:",{currentIndex:s,totalFeatures:r,hasFeatures:n.length,target:a}),L(i),W(!0)},pe=n((e=>{(e||M)&&(D(!0),G(!0),C.forEach((e=>{B(e.id)})),W(!1),P(null),L([]),setTimeout((()=>{D(!1)}),500))}),[M,C,B]),Te=n((e=>{D(!0),G(!0),B(e.id),e.productVideo&&(ee(e.productVideo),Y(!0),oe(!0)),W(!1),P(null),L([]),setTimeout((()=>{D(!1)}),500)}),[B]),ye=n((t=>{const o=t||M;if(!o)return;const n=H.findIndex((e=>e.id===o.id));if(n>0){const t=H[n-1];P(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,s=n-1,r=H.length,a=[{target:o,content:e.jsx(u,{feature:t,currentIndex:s,totalFeatures:r,onSkip:()=>pe(t),onExplore:()=>Te(t),onPrevious:()=>ye(t),onNext:()=>xe(t),setIsClosing:ae}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:f}];L(a)}}),[M,H]),xe=n((t=>{const o=t||M;if(!o)return;const n=H.findIndex((e=>e.id===o.id));if(n<H.length-1){const t=H[n+1];P(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,s=n+1,r=H.length,a=[{target:o,content:e.jsx(u,{feature:t,currentIndex:s,totalFeatures:r,onSkip:()=>pe(t),onExplore:()=>Te(t),onPrevious:()=>ye(t),onNext:()=>xe(t),setIsClosing:ae}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:f}];L(a)}else D(!0),G(!0),B(o.id),W(!1),P(null),L([]),setTimeout((()=>{D(!1)}),500)}),[M,H,B]);return e.jsxs(e.Fragment,{children:[p,A.length>0&&e.jsx(s,{steps:A,run:U,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ge,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:g(ne),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),O.length>0&&e.jsx(s,{steps:O,run:N,continuous:!1,showProgress:!1,showSkipButton:!1,callback:me,disableOverlayClose:!0,disableCloseOnEsc:!1,styles:c(re),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsx(m,{isOpen:X,videoUrl:Z,onClose:()=>{Y(!1),ee(""),oe(!1)}})]})};export{h as default};
1
+ import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useState as t,useEffect as o,useCallback as n}from"react";import s,{ACTIONS as r}from"react-joyride";import"./constants/animations.js";import{SELECTORS as a}from"./constants/selectors.js";import{useFeatureAnnouncements as i}from"./hooks/useFeatureAnnouncements.js";import l from"./MajorUpdatePopup.js";import u from"./MinorUpdatePopup.js";import"../../constants/Theme.js";import{majorStepStyles as d,getMinorJoyrideStyles as c,minorStepStyles as f,getMajorJoyrideStyles as g}from"./styles/joyride.styles.js";import{VideoModal as h}from"./VideoModal.js";const m=m=>{let{children:p,fetchVisibleFeatures:T,getStoreFeatureProgress:y,fetchFeatureById:x,markFeatureAsViewedForStore:v,isFeatureApplicableToCurrentPage:F,module:j,router:b}=m;var k;const{majorUpdateFeatures:w,minorUpdateFeatures:C,isLoading:S,markFeatureAsViewed:I}=i({fetchVisibleFeatures:T,getStoreFeatureProgress:y,fetchFeatureById:x,markFeatureAsViewedForStore:v,isFeatureApplicableToCurrentPage:F,module:j,router:b}),[B,E]=t(null),[M,P]=t(null),[N,W]=t(!1),[O,L]=t([]),[U,V]=t(!1),[A,q]=t([]),[$,_]=t(!1),[J,D]=t(!1),[H,Q]=t([]),[z,G]=t(!1),[K,R]=t(!1),[X,Y]=t(!1),[Z,ee]=t(""),[te,oe]=t(!1),[ne,se]=t(!1),[re,ae]=t(!1);o((()=>{const e="minor-spotlight-cutout-style";let t=document.getElementById(e);return t||(t=document.createElement("style"),t.id=e,document.head.appendChild(t)),t.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}\n\t\t",()=>{const t=document.getElementById(e);t&&t.remove()}}),[]),o((()=>{console.log("๐Ÿ“‹ joyrideSteps changed:",{length:O.length,runJoyride:N})}),[O,N]),o((()=>{console.log("๐ŸŽฏ currentMinorFeature changed:",{id:(null==M?void 0:M.id)||"null"})}),[M]),o((()=>{if(!(w.length>0)||B||S||$||te)0!==w.length||S||R(!0);else{R(!1),G(!1),W(!1),L([]),P(null),Q([]);const e=()=>{document.querySelector('[data-testid="whats-new-button"]')?ie(w[0]):setTimeout(e,1e3)};e()}}),[w,B,S,$,te]),o((()=>{var e;const t=null===(e=null==b?void 0:b.query)||void 0===e?void 0:e.featureId;if(console.log("๐Ÿงช Test mode effect triggered:",{featureIdFromQuery:t,isLoading:S,minorUpdateFeaturesCount:C.length}),!t||S||0===C.length)return;const o=C.find((e=>e.id===t));if(!o||!o.featureTag)return;G(!0),D(!0);let n=0;const s=setInterval((()=>{n++;const e=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(e)){console.log("โœจ Test mode: Element found, showing joyride");const e=[o];Q(e),me(o,e),clearInterval(s)}else n>=25&&(console.warn(`FeatureAnnouncements: Timed out waiting for element with selector: ${e}`),D(!1),clearInterval(s))}),200);return()=>{clearInterval(s)}}),[C,null===(k=null==b?void 0:b.query)||void 0===k?void 0:k.featureId,S]),o((()=>{var e;if(console.log("๐Ÿ” Main minor effect check:",{minorUpdateFeaturesCount:C.length,isLoading:S,runJoyride:N,isProcessingMinorUpdate:J,currentMinorFeature:(null==M?void 0:M.id)||"null",minorFeaturesSkipped:z,showMinorUpdates:K,blockPopups:te}),C.length>0&&!S&&!N&&!J&&!M&&!z&&K&&!te){let e=null,t=null,o=null,n=!1;const s=()=>{if(n||J||M||z||!K)return;const s=C.filter((e=>{if(!e.featureTag||""===e.featureTag.trim())return!1;const t=e.featureTag.startsWith("#")||e.featureTag.startsWith(".")||e.featureTag.startsWith("[")?e.featureTag:`#${e.featureTag}`;return null!==document.querySelector(t)}));s.length>0&&(console.log("๐ŸŽ‰ Found available features:",s.length),Q(s),me(s[0],s),e&&(e.disconnect(),e=null),t&&(window.removeEventListener("scroll",t),t=null),o&&(clearTimeout(o),o=null))};return e=new MutationObserver((e=>{let t=!1;for(const o of e){if("childList"===o.type&&o.addedNodes.length>0)for(let e=0;e<o.addedNodes.length;e++){const n=o.addedNodes[e];if(n.nodeType===Node.ELEMENT_NODE){const e=n;if(e.id||e.querySelector("[id]")){t=!0;break}}}if(t)break}N||n||J||M||z||!K||!t||(o&&clearTimeout(o),o=setTimeout((()=>{n||J||M||z||!K||s()}),200))})),t=()=>{N||n||J||M||z||!K||(o&&clearTimeout(o),o=setTimeout((()=>{n||J||M||z||!K||s()}),300))},e&&e.observe(document.body,{childList:!0,subtree:!0}),t&&window.addEventListener("scroll",t,{passive:!0}),s(),setTimeout((()=>{n||J||M||z||!K||s()}),100),setTimeout((()=>{n||J||M||z||!K||s()}),1e3),setTimeout((()=>{n||J||M||z||!K||s()}),500),()=>{n=!0,e&&e.disconnect(),t&&window.removeEventListener("scroll",t),o&&clearTimeout(o)}}if(0===C.length||S){(null===(e=null==b?void 0:b.query)||void 0===e?void 0:e.featureId)&&M?console.log("๐Ÿšซ Skipping joyride clear - test mode with active feature"):(console.log("๐Ÿ—‘๏ธ Clearing joyride - no features or loading"),W(!1),L([]),P(null),Q([]),G(!1))}}),[C,S,N,J,M,z,K,I,te]);const ie=t=>{E(t);const o=w.findIndex((e=>e.id===t.id)),n=w.length,s=[{target:a.WHATS_NEW_BUTTON,content:e.jsx(l,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>le(t),onExplore:()=>ue(t),onPrevious:()=>de(t),onNext:()=>ce(t),setIsClosing:se}),placement:"bottom",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:16,data:{feature:t,isMajor:!0},styles:g(ne)}];q(s),V(!0)},le=n((e=>{(e||B)&&(_(!0),w.forEach((e=>{I(e.id)})),V(!1),E(null),q([]),R(!0),setTimeout((()=>{_(!1)}),500))}),[B,w,I]),ue=n((e=>{_(!0),I(e.id),e.productVideo&&(ee(e.productVideo),Y(!0),oe(!0)),V(!1),E(null),q([]);w.findIndex((t=>t.id===e.id))===w.length-1&&R(!0),setTimeout((()=>{_(!1)}),500)}),[w,I]),de=n((t=>{const o=t||B;if(!o)return;const n=w.findIndex((e=>e.id===o.id));if(n>0){const t=w[n-1];E(t);const o=n-1,s=w.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(l,{feature:t,currentIndex:o,totalFeatures:s,onSkip:()=>le(t),onExplore:()=>ue(t),onPrevious:()=>de(t),onNext:()=>ce(t),setIsClosing:se}),placement:"bottom",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:16,data:{feature:t,isMajor:!0},styles:d}];q(r)}}),[B,w]),ce=n((t=>{const o=t||B;if(!o)return;const n=w.findIndex((e=>e.id===o.id));if(n<w.length-1){const t=w[n+1];E(t);const o=n+1,s=w.length,r=[{target:'[data-testid="whats-new-button"]',content:e.jsx(l,{feature:t,currentIndex:o,totalFeatures:s,onSkip:()=>le(t),onExplore:()=>ue(t),onPrevious:()=>de(t),onNext:()=>ce(t),setIsClosing:se}),placement:"bottom",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:16,data:{feature:t,isMajor:!0},styles:d}];q(r)}else _(!0),I(o.id),V(!1),E(null),q([]),R(!0),setTimeout((()=>{_(!1)}),500)}),[B,w,I]),fe=()=>{if(w.length>0&&!B){document.querySelector('[data-testid="whats-new-button"]')&&ie(w[0])}};o((()=>(window.showMajorUpdatePopup=fe,()=>{delete window.showMajorUpdatePopup})),[w,B]);const ge=n((e=>{const{action:t}=e;t===r.CLOSE&&(B&&(_(!0),w.forEach((e=>{I(e.id)})),R(!0),setTimeout((()=>{_(!1)}),500)),V(!1),E(null),q([]))}),[B,w,I]),he=n((e=>{const{action:t,type:o,status:n,lifecycle:s,index:a}=e;console.log("๐Ÿ”” Minor Callback:",{action:t,type:o,status:n,lifecycle:s,index:a,hasSteps:O.length,runJoyride:N}),t===r.CLOSE&&(console.log("โŒ CLOSE ACTION - Clearing joyride"),M&&(D(!0),G(!0),C.forEach((e=>{I(e.id)})),setTimeout((()=>{D(!1)}),500)),W(!1),P(null),L([]))}),[M,C,I]),me=(t,o)=>{P(t);const n=o||H,s=n.findIndex((e=>e.id===t.id)),r=n.length,a=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,i=[{target:a,content:e.jsx(u,{feature:t,currentIndex:s,totalFeatures:r,onSkip:()=>pe(t),onExplore:()=>Te(t),onPrevious:()=>ye(t),onNext:()=>xe(t),setIsClosing:ae}),placement:"auto",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:20,data:{feature:t,isMinor:!0},styles:c(re)}];console.log("โœ… Setting joyride:",{currentIndex:s,totalFeatures:r,hasFeatures:n.length,target:a}),L(i),W(!0)},pe=n((e=>{(e||M)&&(D(!0),G(!0),C.forEach((e=>{I(e.id)})),W(!1),P(null),L([]),setTimeout((()=>{D(!1)}),500))}),[M,C,I]),Te=n((e=>{D(!0),G(!0),I(e.id),e.productVideo&&(ee(e.productVideo),Y(!0),oe(!0)),W(!1),P(null),L([]),setTimeout((()=>{D(!1)}),500)}),[I]),ye=n((t=>{const o=t||M;if(!o)return;const n=H.findIndex((e=>e.id===o.id));if(n>0){const t=H[n-1];P(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,s=n-1,r=H.length,a=[{target:o,content:e.jsx(u,{feature:t,currentIndex:s,totalFeatures:r,onSkip:()=>pe(t),onExplore:()=>Te(t),onPrevious:()=>ye(t),onNext:()=>xe(t),setIsClosing:ae}),placement:"auto",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:20,data:{feature:t,isMinor:!0},styles:f}];L(a)}}),[M,H]),xe=n((t=>{const o=t||M;if(!o)return;const n=H.findIndex((e=>e.id===o.id));if(n<H.length-1){const t=H[n+1];P(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,s=n+1,r=H.length,a=[{target:o,content:e.jsx(u,{feature:t,currentIndex:s,totalFeatures:r,onSkip:()=>pe(t),onExplore:()=>Te(t),onPrevious:()=>ye(t),onNext:()=>xe(t),setIsClosing:ae}),placement:"auto",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:20,data:{feature:t,isMinor:!0},styles:f}];L(a)}else D(!0),G(!0),I(o.id),W(!1),P(null),L([]),setTimeout((()=>{D(!1)}),500)}),[M,H,I]);return e.jsxs(e.Fragment,{children:[p,A.length>0&&e.jsx(s,{steps:A,run:U,continuous:!1,showProgress:!1,showSkipButton:!1,callback:ge,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:g(ne),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),O.length>0&&e.jsx(s,{steps:O,run:N,continuous:!1,showProgress:!1,showSkipButton:!1,callback:he,disableOverlayClose:!0,disableCloseOnEsc:!1,styles:c(re),locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}}),e.jsx(h,{isOpen:X,videoUrl:Z,onClose:()=>{Y(!1),ee(""),oe(!1)}})]})};export{m as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.721-beta.21",
3
+ "version": "0.0.721-beta.22",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",