whatmore-react-assets 1.0.1706 → 1.0.1708

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatmore-react-assets",
3
- "version": "1.0.1706",
3
+ "version": "1.0.1708",
4
4
  "description": "public repo for all whatmore js and css assets",
5
5
  "main": "whatmore.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[262,774],{22:function(t,e,i){i.d(e,{$S:function(){return d},_:function(){return o},b4:function(){return r},dl:function(){return n},nN:function(){return l},tn:function(){return s},vF:function(){return a}});const o="device_type",n="device_mode",r="mobile",a="tablet",d="desktop",s="portrait",l="landscape"},69:function(t,e,i){i.d(e,{Ij:function(){return r},bi:function(){return a}});let o,n=!1;function r(){return o?o.play().then(()=>{n=!0,console.debug("iOS autoplay restrictions bypassed."),o.pause()}).catch(t=>{console.error("Failed to bless videos:",t.message)}):Promise.reject(new Error("Blessing video not initialized."))}function a(){o||(o=document.createElement("video"),o.src="https://whatmore-other-assets.b-cdn.net/whatmore/dummy_for_video_pool_3s_muted_11kb.mp4",o.muted=!0,o.playsInline=!0,o.style.display="none",document.body.appendChild(o));const t=()=>{n||r()};document.addEventListener("click",t,{once:!0}),document.addEventListener("touchstart",t,{once:!0})}},851:function(t,e,i){i.d(e,{A:function(){return g}});var o=i(1005),n=i(9950),r=i(9879),a=i(22),d=i(5830),s=i(932);var l=function(t){const[e,i,o,n,r]=(0,s.A)(),[l]=(0,d.QN)("whatmoreEmbedAppVideoPlayerSizePortrait"),[c]=(0,d.QN)("whatmoreEmbedAppVideoPlayerSizeLandscape"),u=r[a.dl]===a.nN?c/100:l/100*1.2;return[e*u,i*u,r]},c=i(1628),u=i.n(c),p=i(6702),v=(i(9733),i(4365),i(1348)),h=i(4414);var m=({size:t,color:e="rgba(255, 255, 255, 0.9)"})=>(0,h.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:{cursor:"pointer",transition:"all 0.3s ease",filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.3))"},className:"premium-close-icon",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"10",fill:"rgba(0, 0, 0, 0.4)",stroke:"rgba(255, 255, 255, 0.2)",strokeWidth:"1",style:{backdropFilter:"blur(8px)",transition:"all 0.3s ease"}}),(0,h.jsx)("path",{d:"M15 9l-6 6M9 9l6 6",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"all 0.3s ease"}}),(0,h.jsx)("style",{jsx:!0,children:"\n .premium-close-icon:hover circle { fill: rgba(255, 255, 255, 0.15); stroke: rgba(255, 255, 255, 0.4); }\n .premium-close-icon:hover path { stroke: white; }\n "})]});var f=({size:t,color:e="rgba(255, 255, 255, 0.95)"})=>(0,h.jsxs)("svg",{width:.7*t,height:.7*t,viewBox:"0 0 80 80",fill:"none",style:{filter:"drop-shadow(0 8px 24px rgba(0,0,0,0.5))",transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)",cursor:"pointer"},className:"premium-play-icon",children:[(0,h.jsx)("circle",{cx:"40",cy:"40",r:"28",fill:"url(#playGradient)",stroke:"rgba(255, 255, 255, 0.2)",strokeWidth:"1.5",style:{backdropFilter:"blur(20px)"}}),(0,h.jsx)("path",{d:"M32 26 L32 54 L56 40 Z",fill:e,stroke:"none",style:{filter:"drop-shadow(0 2px 8px rgba(0,0,0,0.3))"}}),(0,h.jsxs)("defs",{children:[(0,h.jsxs)("radialGradient",{id:"playGradient",cx:"0.3",cy:"0.3",r:"0.8",children:[(0,h.jsx)("stop",{offset:"0%",stopColor:"rgba(255, 255, 255, 0.25)"}),(0,h.jsx)("stop",{offset:"70%",stopColor:"rgba(255, 255, 255, 0.08)"}),(0,h.jsx)("stop",{offset:"100%",stopColor:"rgba(255, 255, 255, 0.02)"})]}),(0,h.jsxs)("radialGradient",{id:"playGradientHover",cx:"0.3",cy:"0.3",r:"0.8",children:[(0,h.jsx)("stop",{offset:"0%",stopColor:"rgba(255, 255, 255, 0.4)"}),(0,h.jsx)("stop",{offset:"70%",stopColor:"rgba(255, 255, 255, 0.15)"}),(0,h.jsx)("stop",{offset:"100%",stopColor:"rgba(255, 255, 255, 0.05)"})]})]}),(0,h.jsx)("style",{jsx:!0,children:"\n .premium-play-icon:hover { transform: scale(1.1); filter: drop-shadow(0 12px 32px rgba(0,0,0,0.6)); }\n .premium-play-icon:hover circle { fill: url(#playGradientHover); stroke: rgba(255, 255, 255, 0.4); transform: scale(1.05); }\n .premium-play-icon:hover path { fill: white; transform: translateX(1px); }\n .premium-play-icon:active { transform: scale(0.95); }\n "})]});var g=function(t){var e;const i=n.useRef(null);var[s,c,g]=l();(0,d.Xd)("whatmoreUITheme");const[w]=(0,d.QN)("whatmorePrimaryFont"),[x]=(0,d.QN)("whatmoreEmbedAppVideoTitle"),[y]=(0,d.QN)("whatmoreEmbedAppPositionPortrait"),[b]=(0,d.QN)("whatmoreEmbedAppHorizontalPaddingPortrait"),[_]=(0,d.QN)("whatmoreEmbedAppVerticalPaddingPortrait"),[S]=(0,d.QN)("whatmoreEmbedAppPositionLandscape"),[E]=(0,d.QN)("whatmoreEmbedAppHorizontalPaddingLandscape"),[j]=(0,d.QN)("whatmoreEmbedAppVerticalPaddingLandscape"),A=(0,d.Xd)("whatmoreShopId"),T=(0,d.Xd)("isWhatmorePreviewMode");var I=y,k=b,C=_;g[a.dl]===a.nN&&(I=S,k=E,C=j);const[L,P]=(0,n.useState)(["initial",window.pageYOffset]),[N,O]=(0,n.useState)(!1),D=null!==(e=t.isSpotlight)&&void 0!==e&&e,z=g[a.dl]===a.nN?.8*(0,v.O86)(A):1.2*(0,v.O86)(A),M=D?z:1.2;s*=M,c*=M;const R=D?(0,v.LrK)(A):I,V=D?(0,v._2D)(A):(0,v.GSq)(A),[Q,q]=(0,n.useState)(!D&&(0,v.n8Q)(A));function F(t,e){P(t),t[1]<=100?O(!1):e!=N&&(O(e),q(!1))}(0,n.useEffect)(()=>{let t=window.pageYOffset,e=!1;const i=()=>{const i=window.pageYOffset;Math.abs(i-t)<100||(F([i>t?"scrolled-down":"scrolled-up",i],!0),t=i>0?i:0),e=!1},o=()=>{e||(window.requestAnimationFrame(i),e=!0)};return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[L]),(0,o.j)({ref:i,handler:()=>{F(["scrolled-up",L[1]],!0)}});const $=t.event,B=t.inVideoClick,W=t.closeClick,H=.25*c,U=.5*c,G=.6*c,K="20px",X=(0,v.GvQ)(A);var Y=!1,J=0,Z=0;function tt(t){Y=t}return(0,h.jsx)("div",{className:"wht-popup",children:Q&&!V?(0,h.jsx)(h.Fragment,{}):N&&V?(0,h.jsx)("div",{style:"left"===R?{left:"16px",bottom:D?(0,v.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:X}:{right:"16px",bottom:D?(0,v.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:X},children:(0,h.jsxs)("div",{onClick:()=>{F(["initial",L[1]],!1)},style:{width:G+"px",height:G*(16/9)+"px",borderRadius:K,overflow:"hidden",backgroundColor:"transparent",boxShadow:"0 12px 24px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2)",backdropFilter:"blur(15px)",cursor:"pointer",transition:"all 0.3s ease",transformStyle:"preserve-3d"},className:"left"===R?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,h.jsx)("div",{style:{overflow:"hidden",borderRadius:K,background:"linear-gradient(145deg, rgba(0,0,0,0.1), rgba(0,0,0,0.2))"},children:(0,h.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:16/9},children:(0,h.jsx)(r.A,{url:$.thumbnail_image,isPlaying:!1,event:$})})}),(0,h.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,h.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,h.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content",padding:"2px",position:"absolute",top:"0",right:"0",zIndex:10},children:(0,h.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",onClick:t=>{t.stopPropagation(),W()},children:(0,h.jsx)(m,{size:.8*H})})}),(0,h.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,h.jsx)(p.A,{sx:{color:"white",fontSize:2*H+"px",filter:"drop-shadow(0 0 2px black);"}})})]})})]})}):(0,h.jsx)(u(),{nodeRef:i,cancel:".activate-button,.close-btn",bounds:T?"parent":"html",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",onStart:(t,e)=>{var i,o;i=e.x,o=e.y,J=i,Z=o},onDrag:(t,e)=>{tt(!0)},onStop:(t,e)=>{Y&&(Math.abs(e.x-J)>5||Math.abs(e.y-Z)>5)?tt(!1):B($)},children:(0,h.jsx)("div",{ref:i,style:"left"===R?{left:D?(0,v.D2A)(A)+"px":k+"px",bottom:D?(0,v.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:X}:{right:D?(0,v.D2A)(A)+"px":k+"px",bottom:D?(0,v.pUQ)(A)+"px":C+"px",position:"fixed",zIndex:X},children:(0,h.jsxs)("div",{style:{boxSizing:"border-box",width:t.isSpotlight&&"60122562760"==A?s+"px":c+"px",height:t.isSpotlight&&"60122562760"==A?c+"px":s+"px",borderRadius:K,overflow:"hidden",backgroundColor:"transparent",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2)",backdropFilter:"blur(20px)",transition:"all 0.3s ease"},className:"left"===R?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,h.jsx)("div",{style:{overflow:"hidden",position:"relative",borderRadius:K,background:"linear-gradient(145deg, rgba(0,0,0,0.1), rgba(0,0,0,0.3))"},children:(0,h.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:t.isSpotlight&&"60122562760"==A?16/9:9/16},children:(0,h.jsx)(r.A,{url:$.thumbnail_image,isMuted:!0,isPlaying:!0,event:$})})}),(0,h.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,h.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%",position:"relative"},children:[(0,h.jsx)("div",{style:{position:"absolute",top:"2px",right:"2px",zIndex:10},children:(0,h.jsx)("div",{className:"close-btn",onClick:W,children:(0,h.jsx)(m,{size:H})})}),(0,h.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto"},children:(0,h.jsx)(f,{size:U})}),(0,h.jsx)("div",{style:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px",borderBottomLeftRadius:K,borderBottomRightRadius:K,background:x?"linear-gradient(to bottom, transparent, rgba(0,0,0,0.8))":"transparent"},children:(0,h.jsx)("p",{style:{textAlign:"center",color:"white",fontFamily:w,fontWeight:"600",fontSize:.35*H+"px",margin:0,padding:0,lineHeight:"125%",letterSpacing:"0.3px",textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:x})})]})})]})})})})}},932:function(t,e,i){var o=i(5830),n=i(1941),r=i(22),a=i(1348);e.A=function(t){const[e,i,d]=(0,n.A)(),[s]=(0,o.QN)("whatmoreLandscapePadding"),[l]=(0,o.QN)("whatmoreShopId"),[c]=(0,o.QN)("whatmoreVideoTileSize"),[u]=(0,o.QN)("whatmoreVideoTileSizePortrait"),p=d>i,v="portrait"==e?u:c,h=!("portrait"!=e||!(d>=481)),m=v/100*1.3*.5,f=v/100;var g=Math.min(d,i),[w,x,y,b]=[.6*g*(16/9),.6*g,1.4,0];function _(t){return Math.round(10*t)/10}var S={DEVICE_TYPE:r.b4,DEVICE_MODE:r.tn};if(p){const t=x*m,e=w*m;[w,x,y,b]=[e,t,(d-2*s-2*(0,a.$du)(l))/(1.1*t),s],S[r._]=r.$S,S[r.dl]=r.nN}else if(h){var E=.8*x,j=.8*w;"portrait"==e?(E*=f,j*=f,[w,x,y,b]=[j,E,_(d/(1.2*E)),0],S[r._]=r.vF,S[r.dl]=r.tn):([w,x,y,b]=[j,E,(d-2*s)/(1.1*E),s],S[r._]=r.vF,S[r.dl]=r.nN)}else{E=x,j=w;"portrait"==e?(E=E*f*.9,j=j*f*.9,[w,x,y,b]=[j,E,_(d/(1.15*E)),0],S[r._]=r.b4,S[r.dl]=r.tn):(E=.7*x,j=.7*w,[w,x,y,b]=[j,E,(d-2*s)/(1.1*E),s],S[r._]=r.b4,S[r.dl]=r.nN)}return[w,x,y,b,S]}},1351:function(t,e,i){i.d(e,{PG:function(){return s},kz:function(){return l},UM:function(){return u},yP:function(){return p},DG:function(){return c}});var o=i(1348),n=i(3330),r=i(6157);function a(t,e,i={},o){var n;const a=s[t];if(!a)return;const d=a.isActionEnabled(),l=null===o||void 0===o||null===(n=o.meta_actions)||void 0===n?void 0:n[a.customAction];(d||l)&&"function"==typeof fbq&&(async()=>{const o={id:null===e||void 0===e?void 0:e.client_product_id,product_url:null===e||void 0===e?void 0:e.product_link,...t===r.O.VIDEO_PLAYBACK&&{watch_time:i.watch_time,video_duration:i.video_duration}};fbq("trackCustom",a.action,o),l&&setTimeout(()=>{null===l||void 0===l||l.forEach(t=>{fbq("trackCustom",t,o)})},500)})()}var d=i(7145);const s={[r.O.EVENT_VIEW]:{isActionEnabled:o.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[r.O.VIDEO_PLAYBACK]:{isActionEnabled:o.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[r.O.VIDEO_LIKED]:{isActionEnabled:o.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[r.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:o.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[r.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:o.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[r.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:o.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[r.O.SHOPNOW_CLICKED]:{isActionEnabled:o.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[r.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:o.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function l({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}){var c,u,p,v;((0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}),t in s)&&(a(t,null!==(c=null===r||void 0===r?void 0:r[1])&&void 0!==c?c:null===r||void 0===r?void 0:r[0],e,o),(0,n.n)({page_type:i.landingLocationType,selection_type:t,video_name:o.event_id,video_percentage:"NA",product_name:null!==(u=null===r||void 0===r||null===(p=r[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===r||void 0===r||null===(v=r[0])||void 0===v?void 0:v.title}))}function c({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}){var c,u,p,v;((0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}),t in s)&&(a(t,null!==(c=null===r||void 0===r?void 0:r[1])&&void 0!==c?c:null===r||void 0===r?void 0:r[0],e,o),(0,n.n)({page_type:i.landingLocationType,selection_type:t,video_name:o.event_id,video_percentage:e.video_duration>0?Math.ceil(e.watch_time/e.video_duration*100):"NA",product_name:null!==(u=null===r||void 0===r||null===(p=r[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===r||void 0===r||null===(v=r[0])||void 0===v?void 0:v.title}))}function u({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:a}){var l,c,u;((0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:a}),t in s)&&(0,n.n)({page_type:i.landingLocationType,selection_type:t,video_name:o.event_id,video_percentage:"NA",product_name:null!==(l=null===r||void 0===r||null===(c=r[1])||void 0===c?void 0:c.title)&&void 0!==l?l:null===r||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title})}function p({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:n,ctaList:r}){(0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:n,ctaList:r})}},3262:function(t,e,i){i.r(e),i.d(e,{initiateCartSliderEvent:function(){return r}});var o=i(5830),n=i(1745);const r=async function(t,e,i,r,a="",d="",s="",l="",c="",u=""){(0,o.Xd)("whatmoreLandingLocationType");if("STRNV8MHJTF"==t||"STR6HU283UZ"==t||"STR9T3LLEJB"==t||"STRWJMIOJNX"==t||"STRUDQ36YAC"==t||"STR1D5ONOZX"==t){console.log("Executing cart refresh script..");return void(document.getElementById("whatsmorecart").value=Math.random())}if("56444977250"===t){const t=document.querySelector('button[data-pf-type="ProductATC2"]');return t?(d&&t.setAttribute("data-product-id",d),t.click(),setTimeout(()=>{(0,n.js)().then(t=>t.json()).then(t=>{const e=t.items.find(t=>String(t.id)===String(a));if(e){const t=e.key,i=e.quantity,o=e.properties;(0,n.CP)(t,i,o,s,l,c,!0,!0,!0)}})},500),void setTimeout(e,i)):(fetch(null===u||void 0===u||null===(p=u.split("?"))||void 0===p?void 0:p[0]).then(t=>t.text()).then(t=>{const e=(new DOMParser).parseFromString(t,"text/html").querySelector('button[data-pf-type="ProductATC2"]');e&&d&&e.setAttribute("data-product-id",d)}),void setTimeout(e,i));var p}if("64379584700"===t)return fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,quantity:1})}).then(t=>t.json()).then(t=>fetch("/cart.js")).then(t=>t.json()).then(t=>{$(".paira-cart-item-count").text(t.item_count),$(".paira-cartEmpty").hide(),$(".paira-cartNotEmpty").show(),$(".paira-cart-total-price .money").text("Rs. "+t.total_price/100),$(".cart-drop").addClass("open"),$(".cart-icon").trigger("mouseenter"),setTimeout(()=>{f(a)},500)}).catch(t=>console.error("Add to cart error:",t)),void setTimeout(e,i);if("76767920441"===t)return fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,quantity:1})}).then(t=>t.json()).then(t=>{"function"===typeof window.openGokwikSideCart&&window.openGokwikSideCart(),setTimeout(()=>{f(a)},500)}).catch(t=>console.error("Add to cart error:",t)),void setTimeout(e,i);const v=e=>{if("61126934766"==t){let t=e.querySelector(".productView-buttons").querySelector('form[action*="/cart/add"]');if(t)return t}let i=Array.from(e.querySelectorAll("product-form")).find(t=>t.querySelector('form > input[name="id"]')&&t.querySelector('form button[type="submit"]'));return i||(i=Array.from(e.querySelectorAll('form[action*="/cart/add"]')).find(t=>t.querySelector('button[type="submit"]'))),i},h=(t,e,i)=>{const o=t.cloneNode(!0);if(o){o.hasAttribute("data-product-variant-id")&&o.setAttribute("data-product-variant-id",e),o.hasAttribute("data-product-id")&&o.setAttribute("data-product-id",i);let t=o.querySelector('input[name="id"]');if(t)t.setAttribute("value",e),t.hasAttribute("disabled")&&t.removeAttribute("disabled");else{const t=o.querySelector('select[name="id"]');if(t){const i=t.querySelector('option[selected="selected"]');i&&i.setAttribute("value",e)}}const n=o.querySelector('input[name="product-id"]');n&&n.setAttribute("value",i);const r=document.createElement("div");return r.className="whatmore-atc",r.appendChild(o),document.body.appendChild(r),console.log(r,"formElement"),r}},m=t=>{const e=null===t||void 0===t?void 0:t.querySelector('button[type="submit"]');e&&e.click()},f=t=>{(0,n.js)().then(t=>t.json()).then(e=>{const i=e.items.find(e=>e.id==t),o=i.key,r=i.quantity,a=i.properties;(0,n.CP)(o,r,a,s,l,c,!0,!0,!0)})},g=v(document);if(g||(null===g||void 0===g?void 0:g.length)>0){const t=h(g,a,d);m(t),setTimeout(()=>{f(a)},500),t.remove()}else{var w;fetch(null===u||void 0===u||null===(w=u.split("?"))||void 0===w?void 0:w[0]).then(t=>t.text()).then(t=>{const e=(new DOMParser).parseFromString(t,"text/html"),i=v(e);if(i||(null===i||void 0===i?void 0:i.length)>0){const t=h(i,a,d);m(t),setTimeout(()=>{f(a)},500),t.remove()}})}setTimeout(e,i)}},3389:function(t,e,i){i.r(e);var o=i(9950),n=i(1348),r=i(964),a=i(5830),d=i(140),s=i(4533),l=i(851),c=i(1085),u=i(6613),p=i(3330),v=(i(3262),i(572)),h=i(8603),m=i(2039),f=i(4833),g=i(5551),w=i(1351),x=i(6157),y=i(2979),b=i(6641),_=i(8945),S=i(9821),E=i(69),j=i(4414);const A=(0,h.A)({key:"whatmore-css-ppv"}),T=o.lazy(()=>Promise.all([i.e(304),i.e(946),i.e(607),i.e(187),i.e(987),i.e(411),i.e(688),i.e(592)]).then(i.bind(i,4688))),I=o.lazy(()=>i.e(374).then(i.bind(i,5100)));function k(t){return t.split(/[?#]/)[0]}e.default=function(t){const[e,i]=(0,o.useState)(),[h,C]=(0,o.useState)(),[L]=(0,a.QN)("isInDesignMode"),[P]=(0,a.QN)("isDemoBrand"),[N]=(0,a.QN)("whatmoreEmbedAppUseVariant"),[O,D]=(0,o.useState)(-2),[z]=(0,a.QN)("whatmoreVariantId"),[M]=(0,a.QN)("whatmoreShopId");var[R]=(0,a.QN)("whatmoreProductId");const V=(0,a.Xd)("isLandingSharedLink"),Q=(0,a.Xd)("whatmoreShareTemplateId"),q=(0,a.Xd)("whatmoreShareEventId"),F=V&&"template-embed"===(0,f.Mm)(Q),[$,B]=(0,o.useState)(F);R=(0,n.BcY)(M)?function(t){if("STRR72TX6AT"==t){var e;const t=null===(e=window.location.pathname)||void 0===e?void 0:e.split("/");return t[t.length-1]}return"STR6HARJ3QY"==t||"STRI4V3OYCH"==t?k(window.location.href).split("/").pop():k(window.location.href)}(M):R;const[W,H]=(0,o.useState)(()=>"true"===N?z:R);var U=r.$$+"/v2/brand/"+M+"/product-events";const{whatmoreWidgetSourceDetails:G}=(0,o.useContext)(g.B);(0,o.useEffect)(()=>{(0,p.initializeGA)(M),(0,b.Fk)("Video shopping powered by Whatmore!"),(0,s.wm)()},[]),(0,o.useEffect)(()=>{null==e||0==e.length||h||!(0,u.MN)()||(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")||((0,S._)()?(0,c.Pc)(c.F5):(0,E.bi)())},[e]),(0,o.useEffect)(()=>{if(D(-1),(0,n.WH1)(M)){const t=`${r.$$}/v2/brand/${M}/product-events/recommendation`,e=(0,n.buK)(M);fetch(`${t}?client_product_id=${W}&limit=10&recommended=${!e}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`).then(t=>t.json()).then(t=>{const o=null===t||void 0===t?void 0:t.events;if((null===o||void 0===o?void 0:o.length)>0){var n;const r=e?null===t||void 0===t?void 0:t.all_events:null===t||void 0===t||null===(n=t.related_events)||void 0===n?void 0:n.map(t=>({...t,isRelatedEvent:!0}));i([...o,...r])}else i([])}).catch(t=>C(t.message))}else fetch(U.toString()+"?client_product_id="+W.toString()+"&status="+"upcoming".toString()+"&event_type=video").then(t=>t.json()).then(t=>t.events).then(t=>(null!=t&&0!=t.length&&(0,n.vfi)(M)&&(0,n.YOR)(t),i(t),t)).then(t=>((0,n.Uht)(M)&&function(t,e){setTimeout(async()=>{const i=t.reduce((t,e)=>[...t,...e.products],[]).filter(t=>t.client_product_id==e)[0];if(!i||i.product_link==k(window.location.href))return;const o={product_id:i.product_id,product_link:k(window.location.href)};fetch(r.$$+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)})},500)}(t,W),t)).catch(t=>{C(t.message)})},[W]),(0,o.useEffect)(()=>{var t,i;D(-2),(e&&e.length>0||"Scale"==(0,n.yt9)(M)||"Enterprise"==(0,n.yt9)(M)||"Premium"==(0,n.yt9)(M))&&(0,w.yP)({userInteractionType:x.O.PDP_VISITED,widgetSourceDetails:G,event:null===e||void 0===e?void 0:e[0],productList:null===e||void 0===e||null===(t=e[0])||void 0===t?void 0:t.products,ctaList:null===e||void 0===e||null===(i=e[0])||void 0===i?void 0:i.cta})},[e]),(0,o.useEffect)(()=>{const t=k(window.location.href);"8111554613"===M&&setTimeout(()=>{const t=new Event("change",{bubbles:!0}),e=document.querySelector('[name="id"]')||document.querySelector("[data-variant-picker]")||document.querySelector(".variant-selector");e&&e.dispatchEvent(t)},100);let e=history.pushState;history.pushState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};let i=history.replaceState;history.replaceState=function(){let t=i.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))}),window.addEventListener("locationchange",function(){if("24950997070"==M&&window.location.origin+window.location.pathname!=t&&fetch(window.location.origin+window.location.pathname+".json").then(t=>t.json()).then(t=>{var e;return H(null===t||void 0===t||null===(e=t.product)||void 0===e?void 0:e.id)}),"true"===N){const t=function(t){for(var e=window.location.search.substring(1).split("&"),i=0;i<e.length;i++){var o=e[i].split("=");if(o[0]==t)return o[1]}return!1}("variant");t&&""!==t&&H(t)}})},[]),(0,o.useEffect)(()=>{if(null!=e&&0!==e.length&&!h&&F&&((0,_.H)("whatmore-video-player",()=>{B(!1)}),null!=q)){const t=e.find(t=>q==t.event_id);if(t)return void Y(t,!0,e.indexOf(t))}},[e]);const K=G.landingLocationType,X=G.templateType,Y=async(t,e=!1,i=0)=>{if((0,u.MN)()&&!e&&await((0,S._)()?(0,c.bo)():(0,E.bi)()),(0,m.ij)(t)||(0,m.Il)(t))return L||P||(async()=>{const e=(0,f.Wd)(K)+(0,f.gf)(X)+(null!==t&&void 0!==t&&t.isRelatedEvent?"R":"E")+"_"+(null===t||void 0===t?void 0:t.event_id);(0,d.lB)(t),(0,p.sendVideoViewEventToGA)(M,r.DK,r.K1),(0,s.Ch)(t.event_id,t.products,"product_page","video_popup",e)})(),void D(i)};function J(){return(0,j.jsx)(j.Fragment,{})}return null==e||0==e.length||h||(0,f.Ig)(G.templateType)||!(0,n.fDZ)(M)?(0,j.jsx)("div",{}):(0,j.jsxs)(v.C,{value:A,children:[$&&(0,j.jsx)(I,{}),"no-product"===W||-1===O||0===e.length?(0,j.jsx)(J,{}):-2===O&&e.length>0?(0,j.jsx)("div",{children:(0,j.jsx)(y.S,{userInteractionType:x.O.PDP_POPUP_WIDGET_VIEW,event:e[0],productList:e[0].products,cta:e[0].cta,triggerFlag:!L&&!P,children:(0,j.jsx)(l.A,{event:e[0],inVideoClick:Y,closeClick:t=>{var i;t.stopPropagation(),D(-1),(0,w.kz)({userInteractionType:x.O.PDP_POPUP_CLOSED,widgetSourceDetails:G,event:null===e||void 0===e?void 0:e[0],productList:null===e||void 0===e||null===(i=e[0])||void 0===i?void 0:i.products})}})})}):(0,j.jsx)("div",{children:(0,j.jsx)(o.Suspense,{children:(0,j.jsx)(y.S,{userInteractionType:x.O.EVENT_VIEW,event:e[0],productList:e[0].products,cta:e[0].cta,triggerFlag:!L&&!P,children:(0,j.jsx)(T,{events:e,index:O,onBack:function(){D(-2),B(!1)},template:"template-product-page"})})})})]})}},6649:function(t,e,i){var o=i(9950);e.A=({triggerOnce:t=!1,root:e=null,rootMargin:i="0px",threshold:n=0}={})=>{const[r,a]=(0,o.useState)(!1),[d,s]=(0,o.useState)(null),l=(0,o.useRef)(null);return(0,o.useEffect)(()=>{const o=new IntersectionObserver((e,i)=>{e.forEach(e=>{s(e),e.isIntersecting?(a(!0),t&&i.disconnect()):t||a(!1)})},{root:e,rootMargin:i,threshold:n});return l.current&&o.observe(l.current),()=>{o.disconnect()}},[t,e,i,n]),[l,r,d]}},8945:function(t,e,i){function o(t,e){let i=0;let o=new MutationObserver(function(){document.querySelector("."+t)?(e(),o.disconnect()):0==i&&(i=1,setTimeout(()=>{e(),o.disconnect()},8e3))});o.observe(document.body,{childList:!0,subtree:!0})}i.d(e,{H:function(){return o}})},9733:function(){}}]);
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[262,774],{22:function(t,e,i){i.d(e,{$S:function(){return d},_:function(){return o},b4:function(){return r},dl:function(){return n},nN:function(){return l},tn:function(){return s},vF:function(){return a}});const o="device_type",n="device_mode",r="mobile",a="tablet",d="desktop",s="portrait",l="landscape"},69:function(t,e,i){i.d(e,{Ij:function(){return r},bi:function(){return a}});let o,n=!1;function r(){return o?o.play().then(()=>{n=!0,console.debug("iOS autoplay restrictions bypassed."),o.pause()}).catch(t=>{console.error("Failed to bless videos:",t.message)}):Promise.reject(new Error("Blessing video not initialized."))}function a(){o||(o=document.createElement("video"),o.src="https://whatmore-other-assets.b-cdn.net/whatmore/dummy_for_video_pool_3s_muted_11kb.mp4",o.muted=!0,o.playsInline=!0,o.style.display="none",document.body.appendChild(o));const t=()=>{n||r()};document.addEventListener("click",t,{once:!0}),document.addEventListener("touchstart",t,{once:!0})}},851:function(t,e,i){i.d(e,{A:function(){return g}});var o=i(1005),n=i(9950),r=i(9879),a=i(22),d=i(5830),s=i(932);var l=function(t){const[e,i,o,n,r]=(0,s.A)(),[l]=(0,d.QN)("whatmoreEmbedAppVideoPlayerSizePortrait"),[c]=(0,d.QN)("whatmoreEmbedAppVideoPlayerSizeLandscape"),u=r[a.dl]===a.nN?c/100:l/100*1.2;return[e*u,i*u,r]},c=i(1628),u=i.n(c),p=i(6702),v=(i(9733),i(4365),i(1348)),h=i(4414);var m=({size:t,color:e="rgba(255, 255, 255, 0.9)"})=>(0,h.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",style:{cursor:"pointer",transition:"all 0.3s ease",filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.3))"},className:"premium-close-icon",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"10",fill:"rgba(0, 0, 0, 0.4)",stroke:"rgba(255, 255, 255, 0.2)",strokeWidth:"1",style:{backdropFilter:"blur(8px)",transition:"all 0.3s ease"}}),(0,h.jsx)("path",{d:"M15 9l-6 6M9 9l6 6",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"all 0.3s ease"}}),(0,h.jsx)("style",{jsx:!0,children:"\n .premium-close-icon:hover circle { fill: rgba(255, 255, 255, 0.15); stroke: rgba(255, 255, 255, 0.4); }\n .premium-close-icon:hover path { stroke: white; }\n "})]});var f=({size:t,color:e="rgba(255, 255, 255, 0.95)"})=>(0,h.jsxs)("svg",{width:.7*t,height:.7*t,viewBox:"0 0 80 80",fill:"none",style:{filter:"drop-shadow(0 8px 24px rgba(0,0,0,0.5))",transition:"all 0.4s cubic-bezier(0.4, 0, 0.2, 1)",cursor:"pointer"},className:"premium-play-icon",children:[(0,h.jsx)("circle",{cx:"40",cy:"40",r:"28",fill:"url(#playGradient)",stroke:"rgba(255, 255, 255, 0.2)",strokeWidth:"1.5",style:{backdropFilter:"blur(20px)"}}),(0,h.jsx)("path",{d:"M32 26 L32 54 L56 40 Z",fill:e,stroke:"none",style:{filter:"drop-shadow(0 2px 8px rgba(0,0,0,0.3))"}}),(0,h.jsxs)("defs",{children:[(0,h.jsxs)("radialGradient",{id:"playGradient",cx:"0.3",cy:"0.3",r:"0.8",children:[(0,h.jsx)("stop",{offset:"0%",stopColor:"rgba(255, 255, 255, 0.25)"}),(0,h.jsx)("stop",{offset:"70%",stopColor:"rgba(255, 255, 255, 0.08)"}),(0,h.jsx)("stop",{offset:"100%",stopColor:"rgba(255, 255, 255, 0.02)"})]}),(0,h.jsxs)("radialGradient",{id:"playGradientHover",cx:"0.3",cy:"0.3",r:"0.8",children:[(0,h.jsx)("stop",{offset:"0%",stopColor:"rgba(255, 255, 255, 0.4)"}),(0,h.jsx)("stop",{offset:"70%",stopColor:"rgba(255, 255, 255, 0.15)"}),(0,h.jsx)("stop",{offset:"100%",stopColor:"rgba(255, 255, 255, 0.05)"})]})]}),(0,h.jsx)("style",{jsx:!0,children:"\n .premium-play-icon:hover { transform: scale(1.1); filter: drop-shadow(0 12px 32px rgba(0,0,0,0.6)); }\n .premium-play-icon:hover circle { fill: url(#playGradientHover); stroke: rgba(255, 255, 255, 0.4); transform: scale(1.05); }\n .premium-play-icon:hover path { fill: white; transform: translateX(1px); }\n .premium-play-icon:active { transform: scale(0.95); }\n "})]});var g=function(t){var e;const i=n.useRef(null);var[s,c,g]=l();(0,d.Xd)("whatmoreUITheme");const[w]=(0,d.QN)("whatmorePrimaryFont"),[x]=(0,d.QN)("whatmoreEmbedAppVideoTitle"),[y]=(0,d.QN)("whatmoreEmbedAppPositionPortrait"),[b]=(0,d.QN)("whatmoreEmbedAppHorizontalPaddingPortrait"),[_]=(0,d.QN)("whatmoreEmbedAppVerticalPaddingPortrait"),[S]=(0,d.QN)("whatmoreEmbedAppPositionLandscape"),[E]=(0,d.QN)("whatmoreEmbedAppHorizontalPaddingLandscape"),[j]=(0,d.QN)("whatmoreEmbedAppVerticalPaddingLandscape"),T=(0,d.Xd)("whatmoreShopId"),A=(0,d.Xd)("isWhatmorePreviewMode");var I=y,k=b,C=_;g[a.dl]===a.nN&&(I=S,k=E,C=j);const[L,P]=(0,n.useState)(["initial",window.pageYOffset]),[N,O]=(0,n.useState)(!1),D=null!==(e=t.isSpotlight)&&void 0!==e&&e,z=g[a.dl]===a.nN?.8*(0,v.O86)(T):1.2*(0,v.O86)(T),R=D?z:1.2;s*=R,c*=R;const M=D?(0,v.LrK)(T):I,Q=D?(0,v._2D)(T):(0,v.GSq)(T),[V,q]=(0,n.useState)(!D&&(0,v.n8Q)(T));function F(t,e){P(t),t[1]<=100?O(!1):e!=N&&(O(e),q(!1))}(0,n.useEffect)(()=>{let t=window.pageYOffset,e=!1;const i=()=>{const i=window.pageYOffset;Math.abs(i-t)<100||(F([i>t?"scrolled-down":"scrolled-up",i],!0),t=i>0?i:0),e=!1},o=()=>{e||(window.requestAnimationFrame(i),e=!0)};return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[L]),(0,o.j)({ref:i,handler:()=>{F(["scrolled-up",L[1]],!0)}});const $=t.event,B=t.inVideoClick,G=t.closeClick,W=.25*c,H=.5*c,U=.6*c,K="20px",X=(0,v.GvQ)(T);var Y=!1,J=0,Z=0;function tt(t){Y=t}return(0,h.jsx)("div",{className:"wht-popup",children:V&&!Q?(0,h.jsx)(h.Fragment,{}):N&&Q?(0,h.jsx)("div",{style:"left"===M?{left:"16px",bottom:D?(0,v.pUQ)(T)+"px":C+"px",position:"fixed",zIndex:X}:{right:"16px",bottom:D?(0,v.pUQ)(T)+"px":C+"px",position:"fixed",zIndex:X},children:(0,h.jsxs)("div",{onClick:()=>{F(["initial",L[1]],!1)},style:{width:U+"px",height:U*(16/9)+"px",borderRadius:K,overflow:"hidden",backgroundColor:"transparent",boxShadow:"0 12px 24px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2)",backdropFilter:"blur(15px)",cursor:"pointer",transition:"all 0.3s ease",transformStyle:"preserve-3d"},className:"left"===M?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,h.jsx)("div",{style:{overflow:"hidden",borderRadius:K,background:"linear-gradient(145deg, rgba(0,0,0,0.1), rgba(0,0,0,0.2))"},children:(0,h.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:16/9},children:(0,h.jsx)(r.A,{url:$.thumbnail_image,isPlaying:!1,event:$})})}),(0,h.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,h.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,h.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content",padding:"2px",position:"absolute",top:"0",right:"0",zIndex:10},children:(0,h.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",onClick:t=>{t.stopPropagation(),G()},children:(0,h.jsx)(m,{size:.8*W})})}),(0,h.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,h.jsx)(p.A,{sx:{color:"white",fontSize:2*W+"px",filter:"drop-shadow(0 0 2px black);"}})})]})})]})}):(0,h.jsx)(u(),{nodeRef:i,cancel:".activate-button,.close-btn",bounds:A?"parent":"html",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",onStart:(t,e)=>{var i,o;i=e.x,o=e.y,J=i,Z=o},onDrag:(t,e)=>{tt(!0)},onStop:(t,e)=>{Y&&(Math.abs(e.x-J)>5||Math.abs(e.y-Z)>5)?tt(!1):B($)},children:(0,h.jsx)("div",{ref:i,style:"left"===M?{left:D?(0,v.D2A)(T)+"px":k+"px",bottom:D?(0,v.pUQ)(T)+"px":C+"px",position:"fixed",zIndex:X}:{right:D?(0,v.D2A)(T)+"px":k+"px",bottom:D?(0,v.pUQ)(T)+"px":C+"px",position:"fixed",zIndex:X},children:(0,h.jsxs)("div",{style:{boxSizing:"border-box",width:t.isSpotlight&&"60122562760"==T?s+"px":c+"px",height:t.isSpotlight&&"60122562760"==T?c+"px":s+"px",borderRadius:K,overflow:"hidden",backgroundColor:"transparent",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2)",backdropFilter:"blur(20px)",transition:"all 0.3s ease"},className:"left"===M?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,h.jsx)("div",{style:{overflow:"hidden",position:"relative",borderRadius:K,background:"linear-gradient(145deg, rgba(0,0,0,0.1), rgba(0,0,0,0.3))"},children:(0,h.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:t.isSpotlight&&"60122562760"==T?16/9:9/16},children:(0,h.jsx)(r.A,{url:$.thumbnail_image,isMuted:!0,isPlaying:!0,event:$})})}),(0,h.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,h.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%",position:"relative"},children:[(0,h.jsx)("div",{style:{position:"absolute",top:"2px",right:"2px",zIndex:10},children:(0,h.jsx)("div",{className:"close-btn",onClick:G,children:(0,h.jsx)(m,{size:W})})}),(0,h.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto"},children:(0,h.jsx)(f,{size:H})}),(0,h.jsx)("div",{style:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px",borderBottomLeftRadius:K,borderBottomRightRadius:K,background:x?"linear-gradient(to bottom, transparent, rgba(0,0,0,0.8))":"transparent"},children:(0,h.jsx)("p",{style:{textAlign:"center",color:"white",fontFamily:w,fontWeight:"600",fontSize:.35*W+"px",margin:0,padding:0,lineHeight:"125%",letterSpacing:"0.3px",textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:x})})]})})]})})})})}},932:function(t,e,i){var o=i(5830),n=i(1941),r=i(22),a=i(1348);e.A=function(t){const[e,i,d]=(0,n.A)(),[s]=(0,o.QN)("whatmoreLandscapePadding"),[l]=(0,o.QN)("whatmoreShopId"),[c]=(0,o.QN)("whatmoreVideoTileSize"),[u]=(0,o.QN)("whatmoreVideoTileSizePortrait"),p=d>i,v="portrait"==e?u:c,h=!("portrait"!=e||!(d>=481)),m=v/100*1.3*.5,f=v/100;var g=Math.min(d,i),[w,x,y,b]=[.6*g*(16/9),.6*g,1.4,0];function _(t){return Math.round(10*t)/10}var S={DEVICE_TYPE:r.b4,DEVICE_MODE:r.tn};if(p){const t=x*m,e=w*m;[w,x,y,b]=[e,t,(d-2*s-2*(0,a.$du)(l))/(1.1*t),s],S[r._]=r.$S,S[r.dl]=r.nN}else if(h){var E=.8*x,j=.8*w;"portrait"==e?(E*=f,j*=f,[w,x,y,b]=[j,E,_(d/(1.2*E)),0],S[r._]=r.vF,S[r.dl]=r.tn):([w,x,y,b]=[j,E,(d-2*s)/(1.1*E),s],S[r._]=r.vF,S[r.dl]=r.nN)}else{E=x,j=w;"portrait"==e?(E=E*f*.9,j=j*f*.9,[w,x,y,b]=[j,E,_(d/(1.15*E)),0],S[r._]=r.b4,S[r.dl]=r.tn):(E=.7*x,j=.7*w,[w,x,y,b]=[j,E,(d-2*s)/(1.1*E),s],S[r._]=r.b4,S[r.dl]=r.nN)}return[w,x,y,b,S]}},1351:function(t,e,i){i.d(e,{PG:function(){return s},kz:function(){return l},UM:function(){return u},yP:function(){return p},DG:function(){return c}});var o=i(1348),n=i(3330),r=i(6157);function a(t,e,i={},o){var n;const a=s[t];if(!a)return;const d=a.isActionEnabled(),l=null===o||void 0===o||null===(n=o.meta_actions)||void 0===n?void 0:n[a.customAction];(d||l)&&"function"==typeof fbq&&(async()=>{const o={id:null===e||void 0===e?void 0:e.client_product_id,product_url:null===e||void 0===e?void 0:e.product_link,...t===r.O.VIDEO_PLAYBACK&&{watch_time:i.watch_time,video_duration:i.video_duration}};fbq("trackCustom",a.action,o),l&&setTimeout(()=>{null===l||void 0===l||l.forEach(t=>{fbq("trackCustom",t,o)})},500)})()}var d=i(7145);const s={[r.O.EVENT_VIEW]:{isActionEnabled:o.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[r.O.VIDEO_PLAYBACK]:{isActionEnabled:o.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[r.O.VIDEO_LIKED]:{isActionEnabled:o.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[r.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:o.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[r.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:o.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[r.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:o.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[r.O.SHOPNOW_CLICKED]:{isActionEnabled:o.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[r.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:o.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function l({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}){var c,u,p,v;((0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}),t in s)&&(a(t,null!==(c=null===r||void 0===r?void 0:r[1])&&void 0!==c?c:null===r||void 0===r?void 0:r[0],e,o),(0,n.n)({page_type:i.landingLocationType,selection_type:t,video_name:o.event_id,video_percentage:"NA",product_name:null!==(u=null===r||void 0===r||null===(p=r[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===r||void 0===r||null===(v=r[0])||void 0===v?void 0:v.title}))}function c({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}){var c,u,p,v;((0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:l}),t in s)&&(a(t,null!==(c=null===r||void 0===r?void 0:r[1])&&void 0!==c?c:null===r||void 0===r?void 0:r[0],e,o),(0,n.n)({page_type:i.landingLocationType,selection_type:t,video_name:o.event_id,video_percentage:e.video_duration>0?Math.ceil(e.watch_time/e.video_duration*100):"NA",product_name:null!==(u=null===r||void 0===r||null===(p=r[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===r||void 0===r||null===(v=r[0])||void 0===v?void 0:v.title}))}function u({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:a}){var l,c,u;((0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:r,ctaList:a}),t in s)&&(0,n.n)({page_type:i.landingLocationType,selection_type:t,video_name:o.event_id,video_percentage:"NA",product_name:null!==(l=null===r||void 0===r||null===(c=r[1])||void 0===c?void 0:c.title)&&void 0!==l?l:null===r||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title})}function p({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:n,ctaList:r}){(0,d.B)({userInteractionType:t,userInteractionMetadata:e,widgetSourceDetails:i,event:o,productList:n,ctaList:r})}},3262:function(t,e,i){i.r(e),i.d(e,{initiateCartSliderEvent:function(){return r}});var o=i(5830),n=i(1745);const r=async function(t,e,i,r,a="",d="",s="",l="",c="",u=""){(0,o.Xd)("whatmoreLandingLocationType");if("STRNV8MHJTF"==t||"STR6HU283UZ"==t||"STR9T3LLEJB"==t||"STRWJMIOJNX"==t||"STRUDQ36YAC"==t||"STR1D5ONOZX"==t){console.log("Executing cart refresh script..");return void(document.getElementById("whatsmorecart").value=Math.random())}if("56444977250"===t){const t=document.querySelector('button[data-pf-type="ProductATC2"]');return t?(d&&t.setAttribute("data-product-id",d),t.click(),setTimeout(()=>{(0,n.js)().then(t=>t.json()).then(t=>{const e=t.items.find(t=>String(t.id)===String(a));if(e){const t=e.key,i=e.quantity,o=e.properties;(0,n.CP)(t,i,o,s,l,c,!0,!0,!0)}})},500),void setTimeout(e,i)):(fetch(null===u||void 0===u||null===(p=u.split("?"))||void 0===p?void 0:p[0]).then(t=>t.text()).then(t=>{const e=(new DOMParser).parseFromString(t,"text/html").querySelector('button[data-pf-type="ProductATC2"]');e&&d&&e.setAttribute("data-product-id",d)}),void setTimeout(e,i));var p}if("64379584700"===t)return fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,quantity:1})}).then(t=>t.json()).then(t=>fetch("/cart.js")).then(t=>t.json()).then(t=>{$(".paira-cart-item-count").text(t.item_count),$(".paira-cartEmpty").hide(),$(".paira-cartNotEmpty").show(),$(".paira-cart-total-price .money").text("Rs. "+t.total_price/100),$(".cart-drop").addClass("open"),$(".cart-icon").trigger("mouseenter"),setTimeout(()=>{f(a)},500)}).catch(t=>console.error("Add to cart error:",t)),void setTimeout(e,i);if("76767920441"===t)return fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a,quantity:1})}).then(t=>t.json()).then(t=>{"function"===typeof window.openGokwikSideCart&&window.openGokwikSideCart(),setTimeout(()=>{f(a)},500)}).catch(t=>console.error("Add to cart error:",t)),void setTimeout(e,i);const v=e=>{if("61126934766"==t){let t=e.querySelector(".productView-buttons").querySelector('form[action*="/cart/add"]');if(t)return t}let i=Array.from(e.querySelectorAll("product-form")).find(t=>t.querySelector('form > input[name="id"]')&&t.querySelector('form button[type="submit"]'));return i||(i=Array.from(e.querySelectorAll('form[action*="/cart/add"]')).find(t=>t.querySelector('button[type="submit"]'))),i},h=(t,e,i)=>{const o=t.cloneNode(!0);if(o){o.hasAttribute("data-product-variant-id")&&o.setAttribute("data-product-variant-id",e),o.hasAttribute("data-product-id")&&o.setAttribute("data-product-id",i);let t=o.querySelector('input[name="id"]');if(t)t.setAttribute("value",e),t.hasAttribute("disabled")&&t.removeAttribute("disabled");else{const t=o.querySelector('select[name="id"]');if(t){const i=t.querySelector('option[selected="selected"]');i&&i.setAttribute("value",e)}}const n=o.querySelector('input[name="product-id"]');n&&n.setAttribute("value",i);const r=document.createElement("div");return r.className="whatmore-atc",r.appendChild(o),document.body.appendChild(r),console.log(r,"formElement"),r}},m=t=>{const e=null===t||void 0===t?void 0:t.querySelector('button[type="submit"]');e&&e.click()},f=t=>{(0,n.js)().then(t=>t.json()).then(e=>{const i=e.items.find(e=>e.id==t),o=i.key,r=i.quantity,a=i.properties;(0,n.CP)(o,r,a,s,l,c,!0,!0,!0)})},g=v(document);if(g||(null===g||void 0===g?void 0:g.length)>0){const t=h(g,a,d);m(t),setTimeout(()=>{f(a)},500),t.remove()}else{var w;fetch(null===u||void 0===u||null===(w=u.split("?"))||void 0===w?void 0:w[0]).then(t=>t.text()).then(t=>{const e=(new DOMParser).parseFromString(t,"text/html"),i=v(e);if(i||(null===i||void 0===i?void 0:i.length)>0){const t=h(i,a,d);m(t),setTimeout(()=>{f(a)},500),t.remove()}})}setTimeout(e,i)}},3389:function(t,e,i){i.r(e);var o=i(9950),n=i(1348),r=i(964),a=i(5830),d=i(140),s=i(4533),l=i(851),c=i(1085),u=i(6613),p=i(3330),v=(i(3262),i(572)),h=i(8603),m=i(2039),f=i(4833),g=i(5551),w=i(1351),x=i(6157),y=i(2979),b=i(6641),_=i(8945),S=i(9821),E=i(69),j=i(4414);const T=(0,h.A)({key:"whatmore-css-ppv"}),A=o.lazy(()=>Promise.all([i.e(304),i.e(946),i.e(607),i.e(187),i.e(987),i.e(411),i.e(688),i.e(592)]).then(i.bind(i,4688))),I=o.lazy(()=>i.e(374).then(i.bind(i,5100)));function k(t){return t.split(/[?#]/)[0]}e.default=function(t){const[e,i]=(0,o.useState)(),[h,C]=(0,o.useState)(),[L]=(0,a.QN)("isInDesignMode"),[P]=(0,a.QN)("isDemoBrand"),[N]=(0,a.QN)("whatmoreEmbedAppUseVariant"),[O,D]=(0,o.useState)(-2),[z]=(0,a.QN)("whatmoreVariantId"),[R]=(0,a.QN)("whatmoreShopId");var[M]=(0,a.QN)("whatmoreProductId");const Q=(0,a.Xd)("isLandingSharedLink"),V=(0,a.Xd)("whatmoreShareTemplateId"),q=(0,a.Xd)("whatmoreShareEventId"),F=Q&&"template-embed"===(0,f.Mm)(V),[$,B]=(0,o.useState)(F);M=(0,n.BcY)(R)?function(t){if("STRR72TX6AT"==t){var e;const t=null===(e=window.location.pathname)||void 0===e?void 0:e.split("/");return t[t.length-1]}return"STR6HARJ3QY"==t||"STRI4V3OYCH"==t||"STRGZ9TGDEQ"==t||"STRJ2T2QPKI"==t?k(window.location.href).split("/").pop():k(window.location.href)}(R):M;const[G,W]=(0,o.useState)(()=>"true"===N?z:M);var H=r.$$+"/v2/brand/"+R+"/product-events";const{whatmoreWidgetSourceDetails:U}=(0,o.useContext)(g.B);(0,o.useEffect)(()=>{(0,p.initializeGA)(R),(0,b.Fk)("Video shopping powered by Whatmore!"),(0,s.wm)()},[]),(0,o.useEffect)(()=>{null==e||0==e.length||h||!(0,u.MN)()||(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")||((0,S._)()?(0,c.Pc)(c.F5):(0,E.bi)())},[e]),(0,o.useEffect)(()=>{if(D(-1),(0,n.WH1)(R)){const t=`${r.$$}/v2/brand/${R}/product-events/recommendation`,e=(0,n.buK)(R);fetch(`${t}?client_product_id=${G}&limit=10&recommended=${!e}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`).then(t=>t.json()).then(t=>{const o=null===t||void 0===t?void 0:t.events;if((null===o||void 0===o?void 0:o.length)>0){var n;const r=e?null===t||void 0===t?void 0:t.all_events:null===t||void 0===t||null===(n=t.related_events)||void 0===n?void 0:n.map(t=>({...t,isRelatedEvent:!0}));i([...o,...r])}else i([])}).catch(t=>C(t.message))}else fetch(H.toString()+"?client_product_id="+G.toString()+"&status="+"upcoming".toString()+"&event_type=video").then(t=>t.json()).then(t=>t.events).then(t=>(null!=t&&0!=t.length&&(0,n.vfi)(R)&&(0,n.YOR)(t),i(t),t)).then(t=>((0,n.Uht)(R)&&function(t,e){setTimeout(async()=>{const i=t.reduce((t,e)=>[...t,...e.products],[]).filter(t=>t.client_product_id==e)[0];if(!i||i.product_link==k(window.location.href))return;const o={product_id:i.product_id,product_link:k(window.location.href)};fetch(r.$$+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)})},500)}(t,G),t)).catch(t=>{C(t.message)})},[G]),(0,o.useEffect)(()=>{var t,i;D(-2),(e&&e.length>0||"Scale"==(0,n.yt9)(R)||"Enterprise"==(0,n.yt9)(R)||"Premium"==(0,n.yt9)(R))&&(0,w.yP)({userInteractionType:x.O.PDP_VISITED,widgetSourceDetails:U,event:null===e||void 0===e?void 0:e[0],productList:null===e||void 0===e||null===(t=e[0])||void 0===t?void 0:t.products,ctaList:null===e||void 0===e||null===(i=e[0])||void 0===i?void 0:i.cta})},[e]),(0,o.useEffect)(()=>{const t=k(window.location.href);"8111554613"===R&&setTimeout(()=>{const t=new Event("change",{bubbles:!0}),e=document.querySelector('[name="id"]')||document.querySelector("[data-variant-picker]")||document.querySelector(".variant-selector");e&&e.dispatchEvent(t)},100);let e=history.pushState;history.pushState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};let i=history.replaceState;history.replaceState=function(){let t=i.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))}),window.addEventListener("locationchange",function(){if("24950997070"==R&&window.location.origin+window.location.pathname!=t&&fetch(window.location.origin+window.location.pathname+".json").then(t=>t.json()).then(t=>{var e;return W(null===t||void 0===t||null===(e=t.product)||void 0===e?void 0:e.id)}),"true"===N){const t=function(t){for(var e=window.location.search.substring(1).split("&"),i=0;i<e.length;i++){var o=e[i].split("=");if(o[0]==t)return o[1]}return!1}("variant");t&&""!==t&&W(t)}})},[]),(0,o.useEffect)(()=>{if(null!=e&&0!==e.length&&!h&&F&&((0,_.H)("whatmore-video-player",()=>{B(!1)}),null!=q)){const t=e.find(t=>q==t.event_id);if(t)return void Y(t,!0,e.indexOf(t))}},[e]);const K=U.landingLocationType,X=U.templateType,Y=async(t,e=!1,i=0)=>{if((0,u.MN)()&&!e&&await((0,S._)()?(0,c.bo)():(0,E.bi)()),(0,m.ij)(t)||(0,m.Il)(t))return L||P||(async()=>{const e=(0,f.Wd)(K)+(0,f.gf)(X)+(null!==t&&void 0!==t&&t.isRelatedEvent?"R":"E")+"_"+(null===t||void 0===t?void 0:t.event_id);(0,d.lB)(t),(0,p.sendVideoViewEventToGA)(R,r.DK,r.K1),(0,s.Ch)(t.event_id,t.products,"product_page","video_popup",e)})(),void D(i)};function J(){return(0,j.jsx)(j.Fragment,{})}return null==e||0==e.length||h||(0,f.Ig)(U.templateType)||!(0,n.fDZ)(R)?(0,j.jsx)("div",{}):(0,j.jsxs)(v.C,{value:T,children:[$&&(0,j.jsx)(I,{}),"no-product"===G||-1===O||0===e.length?(0,j.jsx)(J,{}):-2===O&&e.length>0?(0,j.jsx)("div",{children:(0,j.jsx)(y.S,{userInteractionType:x.O.PDP_POPUP_WIDGET_VIEW,event:e[0],productList:e[0].products,cta:e[0].cta,triggerFlag:!L&&!P,children:(0,j.jsx)(l.A,{event:e[0],inVideoClick:Y,closeClick:t=>{var i;t.stopPropagation(),D(-1),(0,w.kz)({userInteractionType:x.O.PDP_POPUP_CLOSED,widgetSourceDetails:U,event:null===e||void 0===e?void 0:e[0],productList:null===e||void 0===e||null===(i=e[0])||void 0===i?void 0:i.products})}})})}):(0,j.jsx)("div",{children:(0,j.jsx)(o.Suspense,{children:(0,j.jsx)(y.S,{userInteractionType:x.O.EVENT_VIEW,event:e[0],productList:e[0].products,cta:e[0].cta,triggerFlag:!L&&!P,children:(0,j.jsx)(A,{events:e,index:O,onBack:function(){D(-2),B(!1)},template:"template-product-page"})})})})]})}},6649:function(t,e,i){var o=i(9950);e.A=({triggerOnce:t=!1,root:e=null,rootMargin:i="0px",threshold:n=0}={})=>{const[r,a]=(0,o.useState)(!1),[d,s]=(0,o.useState)(null),l=(0,o.useRef)(null);return(0,o.useEffect)(()=>{const o=new IntersectionObserver((e,i)=>{e.forEach(e=>{s(e),e.isIntersecting?(a(!0),t&&i.disconnect()):t||a(!1)})},{root:e,rootMargin:i,threshold:n});return l.current&&o.observe(l.current),()=>{o.disconnect()}},[t,e,i,n]),[l,r,d]}},8945:function(t,e,i){function o(t,e){let i=0;let o=new MutationObserver(function(){document.querySelector("."+t)?(e(),o.disconnect()):0==i&&(i=1,setTimeout(()=>{e(),o.disconnect()},8e3))});o.observe(document.body,{childList:!0,subtree:!0})}i.d(e,{H:function(){return o}})},9733:function(){}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return v},DG:function(){return d}});var i=n(1348),o=n(3330),l=n(6157);function a(e,t,n={},i){var o;const a=s[e];if(!a)return;const r=a.isActionEnabled(),c=null===i||void 0===i||null===(o=i.meta_actions)||void 0===o?void 0:o[a.customAction];(r||c)&&"function"==typeof fbq&&(async()=>{const i={id:null===t||void 0===t?void 0:t.client_product_id,product_url:null===t||void 0===t?void 0:t.product_link,...e===l.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",a.action,i),c&&setTimeout(()=>{null===c||void 0===c||c.forEach(e=>{fbq("trackCustom",e,i)})},500)})()}var r=n(7145);const s={[l.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[l.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[l.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[l.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[l.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[l.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}){var d,u,v,p;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}),e in s)&&(a(e,null!==(d=null===l||void 0===l?void 0:l[1])&&void 0!==d?d:null===l||void 0===l?void 0:l[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(u=null===l||void 0===l||null===(v=l[1])||void 0===v?void 0:v.title)&&void 0!==u?u:null===l||void 0===l||null===(p=l[0])||void 0===p?void 0:p.title}))}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}){var d,u,v,p;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}),e in s)&&(a(e,null!==(d=null===l||void 0===l?void 0:l[1])&&void 0!==d?d:null===l||void 0===l?void 0:l[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:t.video_duration>0?Math.ceil(t.watch_time/t.video_duration*100):"NA",product_name:null!==(u=null===l||void 0===l||null===(v=l[1])||void 0===v?void 0:v.title)&&void 0!==u?u:null===l||void 0===l||null===(p=l[0])||void 0===p?void 0:p.title}))}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:a}){var c,d,u;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:a}),e in s)&&(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(c=null===l||void 0===l||null===(d=l[1])||void 0===d?void 0:d.title)&&void 0!==c?c:null===l||void 0===l||null===(u=l[0])||void 0===u?void 0:u.title})}function v({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l}){(0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var i=n(9950),o=n(964),l=n(140),a=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),v=n(2039),p=n(4833),m=n(2979),h=n(6157),_=n(8945),g=n(9821),y=n(4414);const S=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(340),n.e(571),n.e(987),n.e(411),n.e(261),n.e(665)]).then(n.bind(n,5213))),w=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(607),n.e(571),n.e(620),n.e(116)]).then(n.bind(n,7144))),I=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(423)]).then(n.bind(n,517))),E=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(412)]).then(n.bind(n,7646))),f=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(221)]).then(n.bind(n,5451))),x=i.lazy(()=>Promise.all([n.e(283),n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295))),T=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(964),n.e(620),n.e(474)]).then(n.bind(n,6945))),O=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(184),n.e(571),n.e(987),n.e(411),n.e(688),n.e(485)]).then(n.bind(n,4431))),C=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369))),j=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(964),n.e(891)]).then(n.bind(n,7178))),b=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(964),n.e(306)]).then(n.bind(n,9406))),D=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(571),n.e(987),n.e(411),n.e(497)]).then(n.bind(n,3795))),L=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(340),n.e(571),n.e(987),n.e(411),n.e(688),n.e(261),n.e(933)]).then(n.bind(n,6989))),A=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(744),n.e(571),n.e(987),n.e(411),n.e(688),n.e(806)]).then(n.bind(n,3278))),P=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596))),q=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(571),n.e(987),n.e(411),n.e(688),n.e(906)]).then(n.bind(n,4688))),W=i.lazy(()=>n.e(374).then(n.bind(n,5100)));var k=function(e){var t,k;const[$]=(0,a.QN)("isInDesignMode"),[N]=(0,a.QN)("isDemoBrand"),[G]=(0,a.QN)("whatmoreTopBottomPadding"),[V]=(0,a.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:B}=(0,i.useContext)(u.B),[F]=(0,a.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:M}=(0,i.useContext)(u.B),z=(0,a.Xd)("isLandingSharedLink"),R=(0,a.Xd)("whatmoreShareTemplateId"),H=(0,a.Xd)("whatmoreShareStoryId"),K=(0,a.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:U,whatmoreUserInfo:J}=(0,i.useContext)(u.B),Q=z&&M===(0,p.Mm)(R),[X,Y]=(0,i.useState)(Q),[Z,ee]=(0,i.useState)(-1),[te,ne]=(0,i.useState)(null);let ie=e.events;const oe=e.allEvents;var le=null;B&&!le&&(le=function(e){var t=e.reduce((e,t,n)=>{var i,o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,storyset_dynamic_thumbnail:null!==(i=null===t||void 0===t?void 0:t.storyset_dynamic_thumbnail)&&void 0!==i&&i,events:[t]},e},{}),n=Object.values(t);return n.sort((e,t)=>e.start_event_index-t.start_event_index),n}(ie));const ae=U.landingLocationType,re=U.templateType;function se(e,t=!1,i=null){(0,c.MN)()&&(0,g._)()&&!t&&(0,d.bo)(),$||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=le[e].events[0],r=(0,p.Wd)(ae)+(0,p.gf)(re)+(null!==a&&void 0!==a&&a.isRelatedEvent?"R":"E")+"_"+(null===a||void 0===a?void 0:a.event_id);(0,l.lB)(a),i(F,o.TB,o.OL),(0,s.Ch)(a.event_id,a.products,"homepage","stories",r,null===a||void 0===a?void 0:a.location,null===J||void 0===J?void 0:J.userType)})();var a=0;null!=i&&le[e].events.map((e,t)=>{e.event_id==i&&(a=t)}),ee(a),ne(e)}async function ce(e,t=!1){(0,c.MN)()&&(0,g._)()&&!t&&await(0,d.bo)(),ee(e.index),((0,v.ij)(e)||(0,v.Il)(e))&&($||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=(0,p.Wd)(ae)+(0,p.gf)(re)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,l.lB)(e),i(F,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",a)})())}function de(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)(()=>{if(Q)if((0,_.H)("whatmore-video-player",()=>{Y(!1)}),null!=H&&B){const e=le.find(e=>H==e.id);if(e)return void se(le.indexOf(e),!0,K)}else if(null!=K){const e=ie.find(e=>K==e.event_id);if(e)return void ce(e,!0)}},[]),(0,y.jsxs)(y.Fragment,{children:[X&&(0,y.jsx)(W,{}),-1==Z||-2==Z?(0,y.jsx)(de,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.EVENT_VIEW,event:ie[Z],productList:null===(t=ie[Z])||void 0===t?void 0:t.products,cta:null===(k=ie[Z])||void 0===k?void 0:k.cta,triggerFlag:!$&&!N,children:(0,y.jsx)(q,{events:oe,index:Z,onBack:async function(){ee(-1),Y(!1)},slideDirection:B||"horizontal"===(0,r.br0)(F)?"horizontal":"vertical",eventsStories:le,initialStoryIndex:te,template:M})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(B?V:G)+"px",marginBottom:(B?V:G)+"px"},children:"template-b"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(S,{events:ie,onClick:ce,heading:e.heading})})}):"template-a-1"===M||"template-collections-a-1"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:ie,onClick:ce,heading:e.heading})}):"template-feed-a"===M||"template-collections-feed-a"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(L,{events:ie,onClick:ce,heading:e.heading})}):"template-collections-a"===M||"template-c"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(I,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-b"===M||"template-d"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(E,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-c"===M||"template-e"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(f,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-d"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(S,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-e"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(T,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-stories"===M||"template-stories"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(P,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-f"===M||"template-collections-f"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(O,{events:ie,onClick:ce,heading:e.heading})})}):"template-g"===M||"template-collections-g"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(C,{events:ie,onClick:ce,heading:e.heading})})}):"template-h"===M||"template-collections-h"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(j,{events:ie,onClick:ce,heading:e.heading})})}):"template-i"===M||"template-collections-i"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(b,{index:Z,events:ie,onClick:ce,heading:e.heading})})}):"template-j"===M||"template-collections-j"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(D,{events:ie,onClick:ce,heading:e.heading})})}):"template-banner-a"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ie[0],triggerFlag:!$&&!N,children:(0,y.jsx)(A,{events:ie})})}):B?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(x,{eventsStories:le,onClick:se,template:M})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!$&&!N,children:(0,y.jsx)(T,{events:ie,onClick:ce,heading:e.heading})})})})]})},$=n(7802),N=n(6641),G=n(1351),V=n(5873);function B(e){return e.split(/[?#]/)[0]}function F(e){return e.split(/[?#]/)[0]}var M=function(e){const[t,l]=(0,i.useState)(),[v,m]=(0,i.useState)(),[_,S]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:E}=(0,i.useContext)(u.B),[f]=(0,a.QN)("whatmoreShopId"),{whatmoreCollectionId:x}=(0,i.useContext)(u.B),T=(0,a.Xd)("whatmoreLandingLocationType"),O=(0,a.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:j,whatmoreIsPreviewMode:b}=(0,i.useContext)(u.B),D=(0,a.Xd)("whatmoreCollectionUrl"),[L]=(0,a.QN)("isInDesignMode"),[A]=(0,a.QN)("isDemoBrand"),P="19506115"==f?"343270603":(0,r.mJ$)(f)?(0,r.jLA)(f)?D:B(window.location.href):x||B(window.location.href),[q,W]=(0,a.QN)("productRatings"),[M,z]=(0,i.useState)(!1);var R=(0,r.SOt)(f)?o.aD+"/v2/events/":o.$$+"/v2/events/",H=(0,r.SOt)(f)?o.aD+"/v3/events/":o.$$+"/v3/events/",K=(0,r.SOt)(f)?o.aD+"/v4/events/":o.$$+"/v4/events/",U=(0,r.SOt)(f)?o.aD+"/v5/events/":o.$$+"/v5/events/",J=((0,r.SOt)(f)?o.aD:o.$$,(0,r.SOt)(f)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),Q=(0,r.SOt)(f)?o.aD+"/v2/collection":o.$$+"/v2/collection",X=(0,r.SOt)(f)?o.aD+"/v3/collection":o.$$+"/v3/collection",Y=(0,r.SOt)(f)?o.aD+"/v4/collection":o.$$+"/v4/collection",Z=(0,r.SOt)(f)?o.aD+"/v2/brand/"+f+"/product-events":o.$$+"/v2/brand/"+f+"/product-events",ee=e.shopId,te="live,upcoming",ne="true";return(0,i.useEffect)(()=>{null!=t&&0!=t.length&&!_&&(0,c.MN)()&&!(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,g._)()&&(0,d.Pc)(d.F5)},[t]),(0,i.useEffect)(()=>{var e,t,i,c;if((0,s.wm)(),T.startsWith("product")){var d=(0,a.Xd)("whatmoreProductId");if(d=(0,r.BcY)(f)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e?F(window.location.href).split("/").pop():F(window.location.href)}(f):d,(0,r.vvU)(f))c=R.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(f)){c=`${c=`${o.$$}/v2/brand/${f}/product-events/recommendation`}?client_product_id=${d}&limit=10&recommended=${!(0,r.buK)(f)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else c=Z.toString()+"?client_product_id="+d.toString()+"&status="+te.toString()+"&event_type=video"}else if(I||"invalid-url"!==D)c=(0,r.JwJ)(f)?`${X.toString()}?store_id=${ee.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(f).length>0?(0,r.FKG)(f)[0]:P}`:"78232846646"==f?`${Y.toString()}?store_id=${ee.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(f).length>0?(0,r.FKG)(f)[0]:P}`:`${Q.toString()}?store_id=${ee.toString()}&client_collection_id=${"index"==T&&1==(0,r.FKG)(f).length?(0,r.FKG)(f)[0]:P}`;else if(E){const e=p.Jh,t=(0,p.t6)(T);c=J.toString()+ee.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+f}else{var u,v,h,_;if(("72201044272"==f||"2665447536"==f&&b)&&!w)c=H.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()+"&latitude="+(null!==(u=null===(v=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===v?void 0:v.latitude)&&void 0!==u?u:"")+"&longitude="+(null!==(h=null===(_=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===_?void 0:_.longitude)&&void 0!==h?h:"")+"&user_type="+(null!==j&&void 0!==j&&j.userType?"olduser":"newuser");else c=(0,r.JwJ)(f)&&!w?K.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString():"78232846646"!=f||w?R.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()+(w?"&template_type=stories":""):U.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()}const g=null===(e=window)||void 0===e||null===(t=e.whatmore)||void 0===t||null===(i=t.storyEvents)||void 0===i?void 0:i.events;w&&T.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(l(g),m(g),z(!0)):fetch(c).then(e=>e.json()).then(e=>{var t;if(E){const t=p.Jh;return(0,$.Po)(e,t)}return(0,r.JwJ)(f)&&(null===e||void 0===e||null===(t=e.questions)||void 0===t?void 0:t.length)>0&&(null==localStorage.getItem("_whatmore_qview_index")&&localStorage.setItem("_whatmore_qview_index",0),(0,s.d3)(null===e||void 0===e?void 0:e.questions)),(0,$.Np)(e,I||"invalid-url"!==D)}).then(e=>{var t,n;O&&console.debug("initial received events size : "+e.length);let i=[...null===e||void 0===e?void 0:e.events,...null===e||void 0===e?void 0:e.all_events];i=(0,r.xku)(f)?(0,$.d8)(i):(0,$.Zf)(i),m(i);const o=null!==(t=null===e||void 0===e||null===(n=e.events)||void 0===n?void 0:n.length)&&void 0!==t?t:0;return i.slice(0,o)}).then(e=>{if((A||L)&&(null==e||e&&0==(null===e||void 0===e?void 0:e.length))){const e=async()=>{const{eventsData:e,storiesData:t,bannerData:i}=await n.e(365).then(n.bind(n,6018));l(w?t:E?i:e)};e()}else l(e);z(!0)}).catch(e=>{S(e.message),z(!0)})},[]),(0,i.useEffect)(()=>{"index"===T?t&&t.length>0&&(0,G.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===T?(t&&t.length>0||"Scale"==(0,r.yt9)(f)||"Enterprise"==(0,r.yt9)(f)||"Premium"==(0,r.yt9)(f))&&(0,G.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===T&&(t&&t.length>0||"Scale"==(0,r.yt9)(f)||"Enterprise"==(0,r.yt9)(f)||"Premium"==(0,r.yt9)(f))&&(0,G.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})},[t]),M&&(null==t||0==t.length||_)&&V.Sn.forEach(e=>{var t,n,i,o;const l=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-stories-a"]'),a=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-feed-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-a-1"]')||e.querySelector('.whatmore-template-type[data-wh="template-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-h"]')||e.querySelector('.whatmore-template-type[data-wh="template-j"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-b"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-stories"]')||e.querySelector('.whatmore-template-type[data="template-e"]')||e.querySelector('.whatmore-template-type[data="template-a-1"]')||e.querySelector('.whatmore-template-type[data="template-g"]')||e.querySelector('.whatmore-template-type[data="template-h"]')||e.querySelector('.whatmore-template-type[data="template-j"]'),r=null!==(i=e.querySelector('.whatmore-template-type[data-wh="template-collections-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-d"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-h"]'))&&void 0!==i?i:e.querySelector('.whatmore-template-type[data="template-collections-a"]')||e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-collections-c"]')||e.querySelector('.whatmore-template-type[data="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data="template-collections-e"]')||e.querySelector('.whatmore-template-type[data="template-collections-d"]')||e.querySelector('.whatmore-template-type[data="template-collections-f"]')||e.querySelector('.whatmore-template-type[data="template-collections-g"]')||e.querySelector('.whatmore-template-type[data="template-collections-h"]')||e.querySelector('.whatmore-template-type[data="template-collections-j"]'),s=null!==(o=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==o?o:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e;if(w){const t=e.querySelector(".whatmore-shimmer-stories");t&&(t.style.display="none")}else if(!I){const t=e.querySelector(".loading-skeleton-wrapper");t&&(t.style.display="none")}(s||r||a||l)&&(a&&c||l&&c||s&&c||r&&c)&&(c.style.minHeight="0px")}),null==t||0==t.length||_?(0,y.jsx)("div",{}):(O&&(0,N.xv)(t),O&&console.debug("final transformed events data : "+JSON.stringify(t)),O&&console.debug("valid events size : "+t.length),(0,y.jsx)(k,{heading:e.heading,events:t,allEvents:v}))}},7802:function(e,t,n){n.d(t,{Hl:function(){return o},Np:function(){return a},Po:function(){return r},Z_:function(){return i},Zf:function(){return c},d8:function(){return s},zJ:function(){return l}});const i=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},o=function(e,t){return!(void 0==e.products||0==e.products.length)},l=function(e){if(null!=e)return e.filter(e=>{var t;return null===(t=null===e||void 0===e?void 0:e.in_stock)||void 0===t||t})},a=function(e,t=!1){var n,i;if(null!=e)return t?{events:e.events[0].events,all_events:null!==(i=null===e||void 0===e?void 0:e.all_events)&&void 0!==i?i:[]}:{events:null===e||void 0===e?void 0:e.events,all_events:null!==(n=null===e||void 0===e?void 0:e.all_events)&&void 0!==n?n:[]}};const r=function(e,t){var n,i;let o=[];if(null==e)return[];if("eventsets"in e&&e.eventsets[t]){const n=function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach(e=>{t=t.concat(e.events)}),t}(e.eventsets[t]);o=[...n]}return{events:o,all_events:null!==(n=null===(i=o)||void 0===i?void 0:i.all_events)&&void 0!==n?n:[]}};function s(e){if(null!=e){var t=0;return e.forEach(e=>{e.index=t++}),e}}function c(e){if(null==e)return;let t=0;return e.reduce((e,n)=>{var i;return(null===(i=null===n||void 0===n?void 0:n.in_stock)||void 0===i||i)&&(n.index=t++,e.push(n)),e},[])}},8945:function(e,t,n){function i(e,t){let n=0;let i=new MutationObserver(function(){document.querySelector("."+e)?(t(),i.disconnect()):0==n&&(n=1,setTimeout(()=>{t(),i.disconnect()},8e3))});i.observe(document.body,{childList:!0,subtree:!0})}n.d(t,{H:function(){return i}})}}]);
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[199],{1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return v},DG:function(){return d}});var i=n(1348),o=n(3330),l=n(6157);function a(e,t,n={},i){var o;const a=s[e];if(!a)return;const r=a.isActionEnabled(),c=null===i||void 0===i||null===(o=i.meta_actions)||void 0===o?void 0:o[a.customAction];(r||c)&&"function"==typeof fbq&&(async()=>{const i={id:null===t||void 0===t?void 0:t.client_product_id,product_url:null===t||void 0===t?void 0:t.product_link,...e===l.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",a.action,i),c&&setTimeout(()=>{null===c||void 0===c||c.forEach(e=>{fbq("trackCustom",e,i)})},500)})()}var r=n(7145);const s={[l.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[l.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[l.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[l.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[l.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[l.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[l.O.PRODUCT_TILE_SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"}};function c({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}){var d,u,v,p;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}),e in s)&&(a(e,null!==(d=null===l||void 0===l?void 0:l[1])&&void 0!==d?d:null===l||void 0===l?void 0:l[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(u=null===l||void 0===l||null===(v=l[1])||void 0===v?void 0:v.title)&&void 0!==u?u:null===l||void 0===l||null===(p=l[0])||void 0===p?void 0:p.title}))}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}){var d,u,v,p;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:c}),e in s)&&(a(e,null!==(d=null===l||void 0===l?void 0:l[1])&&void 0!==d?d:null===l||void 0===l?void 0:l[0],t,i),(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:t.video_duration>0?Math.ceil(t.watch_time/t.video_duration*100):"NA",product_name:null!==(u=null===l||void 0===l||null===(v=l[1])||void 0===v?void 0:v.title)&&void 0!==u?u:null===l||void 0===l||null===(p=l[0])||void 0===p?void 0:p.title}))}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:a}){var c,d,u;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:l,ctaList:a}),e in s)&&(0,o.n)({page_type:n.landingLocationType,selection_type:e,video_name:i.event_id,video_percentage:"NA",product_name:null!==(c=null===l||void 0===l||null===(d=l[1])||void 0===d?void 0:d.title)&&void 0!==c?c:null===l||void 0===l||null===(u=l[0])||void 0===u?void 0:u.title})}function v({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l}){(0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:l})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var i=n(9950),o=n(964),l=n(140),a=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),v=n(2039),p=n(4833),m=n(2979),h=n(6157),_=n(8945),g=n(9821),y=n(4414);const S=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(340),n.e(571),n.e(987),n.e(411),n.e(261),n.e(665)]).then(n.bind(n,5213))),w=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(607),n.e(571),n.e(620),n.e(116)]).then(n.bind(n,7144))),I=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(423)]).then(n.bind(n,517))),E=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(412)]).then(n.bind(n,7646))),f=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(714),n.e(221)]).then(n.bind(n,5451))),x=i.lazy(()=>Promise.all([n.e(283),n.e(59),n.e(571),n.e(491)]).then(n.bind(n,4295))),T=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(964),n.e(620),n.e(474)]).then(n.bind(n,6945))),O=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(184),n.e(571),n.e(987),n.e(411),n.e(688),n.e(485)]).then(n.bind(n,4431))),C=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(571),n.e(987),n.e(676)]).then(n.bind(n,3369))),j=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(964),n.e(891)]).then(n.bind(n,7178))),D=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(534),n.e(571),n.e(987),n.e(411),n.e(688),n.e(964),n.e(306)]).then(n.bind(n,9406))),b=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(571),n.e(987),n.e(411),n.e(497)]).then(n.bind(n,3795))),L=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(340),n.e(571),n.e(987),n.e(411),n.e(688),n.e(261),n.e(933)]).then(n.bind(n,6989))),P=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(744),n.e(571),n.e(987),n.e(411),n.e(688),n.e(806)]).then(n.bind(n,3278))),A=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(571),n.e(987),n.e(1)]).then(n.bind(n,4596))),q=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(571),n.e(987),n.e(411),n.e(688),n.e(906)]).then(n.bind(n,4688))),W=i.lazy(()=>n.e(374).then(n.bind(n,5100)));var k=function(e){var t,k;const[G]=(0,a.QN)("isInDesignMode"),[$]=(0,a.QN)("isDemoBrand"),[N]=(0,a.QN)("whatmoreTopBottomPadding"),[V]=(0,a.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:B}=(0,i.useContext)(u.B),[F]=(0,a.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:M}=(0,i.useContext)(u.B),z=(0,a.Xd)("isLandingSharedLink"),R=(0,a.Xd)("whatmoreShareTemplateId"),H=(0,a.Xd)("whatmoreShareStoryId"),K=(0,a.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:J,whatmoreUserInfo:U}=(0,i.useContext)(u.B),Q=z&&M===(0,p.Mm)(R),[X,Y]=(0,i.useState)(Q),[Z,ee]=(0,i.useState)(-1),[te,ne]=(0,i.useState)(null);let ie=e.events;const oe=e.allEvents;var le=null;B&&!le&&(le=function(e){var t=e.reduce((e,t,n)=>{var i,o=t.storyset_id;return o in e?(e[o].total_events=e[o].total_events+1,e[o].events.push(t)):e[o]={id:t.storyset_id,title:t.storyset_name,thumbnail_image:t.storyset_thumbnail_image,total_events:1,start_event_index:n,storyset_dynamic_thumbnail:null!==(i=null===t||void 0===t?void 0:t.storyset_dynamic_thumbnail)&&void 0!==i&&i,events:[t]},e},{}),n=Object.values(t);return n.sort((e,t)=>e.start_event_index-t.start_event_index),n}(ie));const ae=J.landingLocationType,re=J.templateType;function se(e,t=!1,i=null){(0,c.MN)()&&(0,g._)()&&!t&&(0,d.bo)(),G||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=le[e].events[0],r=(0,p.Wd)(ae)+(0,p.gf)(re)+(null!==a&&void 0!==a&&a.isRelatedEvent?"R":"E")+"_"+(null===a||void 0===a?void 0:a.event_id);(0,l.lB)(a),i(F,o.TB,o.OL),(0,s.Ch)(a.event_id,a.products,"homepage","stories",r,null===a||void 0===a?void 0:a.location,null===U||void 0===U?void 0:U.userType)})();var a=0;null!=i&&le[e].events.map((e,t)=>{e.event_id==i&&(a=t)}),ee(a),ne(e)}async function ce(e,t=!1){(0,c.MN)()&&(0,g._)()&&!t&&await(0,d.bo)(),ee(e.index),((0,v.ij)(e)||(0,v.Il)(e))&&(G||$||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const a=(0,p.Wd)(ae)+(0,p.gf)(re)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,l.lB)(e),i(F,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",a)})())}function de(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)(()=>{if(Q)if((0,_.H)("whatmore-video-player",()=>{Y(!1)}),null!=H&&B){const e=le.find(e=>H==e.id);if(e)return void se(le.indexOf(e),!0,K)}else if(null!=K){const e=ie.find(e=>K==e.event_id);if(e)return void ce(e,!0)}},[]),(0,y.jsxs)(y.Fragment,{children:[X&&(0,y.jsx)(W,{}),-1==Z||-2==Z?(0,y.jsx)(de,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.EVENT_VIEW,event:ie[Z],productList:null===(t=ie[Z])||void 0===t?void 0:t.products,cta:null===(k=ie[Z])||void 0===k?void 0:k.cta,triggerFlag:!G&&!$,children:(0,y.jsx)(q,{events:oe,index:Z,onBack:async function(){ee(-1),Y(!1)},slideDirection:B||"horizontal"===(0,r.br0)(F)?"horizontal":"vertical",eventsStories:le,initialStoryIndex:te,template:M})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(B?V:N)+"px",marginBottom:(B?V:N)+"px"},children:"template-b"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(S,{events:ie,onClick:ce,heading:e.heading})})}):"template-a-1"===M||"template-collections-a-1"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:ie,onClick:ce,heading:e.heading})}):"template-feed-a"===M||"template-collections-feed-a"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(L,{events:ie,onClick:ce,heading:e.heading})}):"template-collections-a"===M||"template-c"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(I,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-b"===M||"template-d"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(E,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-c"===M||"template-e"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(f,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-d"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(S,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-e"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(T,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-collections-stories"===M||"template-stories"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(A,{events:ie,index:Z,setScreen:ee,onClick:ce,heading:e.heading})})}):"template-f"===M||"template-collections-f"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(O,{events:ie,onClick:ce,heading:e.heading})})}):"template-g"===M||"template-collections-g"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(C,{events:ie,onClick:ce,heading:e.heading})})}):"template-h"===M||"template-collections-h"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(j,{events:ie,onClick:ce,heading:e.heading})})}):"template-i"===M||"template-collections-i"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(D,{index:Z,events:ie,onClick:ce,heading:e.heading})})}):"template-j"===M||"template-collections-j"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(b,{events:ie,onClick:ce,heading:e.heading})})}):"template-banner-a"===M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:ie[0],triggerFlag:!G&&!$,children:(0,y.jsx)(P,{events:ie})})}):B?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(x,{eventsStories:le,onClick:se,template:M})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(m.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!$,children:(0,y.jsx)(T,{events:ie,onClick:ce,heading:e.heading})})})})]})},G=n(7802),$=n(6641),N=n(1351),V=n(5873);function B(e){return e.split(/[?#]/)[0]}function F(e){return e.split(/[?#]/)[0]}var M=function(e){const[t,l]=(0,i.useState)(),[v,m]=(0,i.useState)(),[_,S]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:E}=(0,i.useContext)(u.B),[f]=(0,a.QN)("whatmoreShopId"),{whatmoreCollectionId:x}=(0,i.useContext)(u.B),T=(0,a.Xd)("whatmoreLandingLocationType"),O=(0,a.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:j,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),b=(0,a.Xd)("whatmoreCollectionUrl"),[L]=(0,a.QN)("isInDesignMode"),[P]=(0,a.QN)("isDemoBrand"),A="19506115"==f?"343270603":(0,r.mJ$)(f)?(0,r.jLA)(f)?b:B(window.location.href):x||B(window.location.href),[q,W]=(0,a.QN)("productRatings"),[M,z]=(0,i.useState)(!1);var R=(0,r.SOt)(f)?o.aD+"/v2/events/":o.$$+"/v2/events/",H=(0,r.SOt)(f)?o.aD+"/v3/events/":o.$$+"/v3/events/",K=(0,r.SOt)(f)?o.aD+"/v4/events/":o.$$+"/v4/events/",J=(0,r.SOt)(f)?o.aD+"/v5/events/":o.$$+"/v5/events/",U=((0,r.SOt)(f)?o.aD:o.$$,(0,r.SOt)(f)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),Q=(0,r.SOt)(f)?o.aD+"/v2/collection":o.$$+"/v2/collection",X=(0,r.SOt)(f)?o.aD+"/v3/collection":o.$$+"/v3/collection",Y=(0,r.SOt)(f)?o.aD+"/v4/collection":o.$$+"/v4/collection",Z=(0,r.SOt)(f)?o.aD+"/v2/brand/"+f+"/product-events":o.$$+"/v2/brand/"+f+"/product-events",ee=e.shopId,te="live,upcoming",ne="true";return(0,i.useEffect)(()=>{null!=t&&0!=t.length&&!_&&(0,c.MN)()&&!(0,a.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,g._)()&&(0,d.Pc)(d.F5)},[t]),(0,i.useEffect)(()=>{var e,t,i,c;if((0,s.wm)(),T.startsWith("product")){var d=(0,a.Xd)("whatmoreProductId");if(d=(0,r.BcY)(f)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e||"STRGZ9TGDEQ"==e||"STRJ2T2QPKI"==e?F(window.location.href).split("/").pop():F(window.location.href)}(f):d,(0,r.vvU)(f))c=R.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(f)){c=`${c=`${o.$$}/v2/brand/${f}/product-events/recommendation`}?client_product_id=${d}&limit=10&recommended=${!(0,r.buK)(f)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else c=Z.toString()+"?client_product_id="+d.toString()+"&status="+te.toString()+"&event_type=video"}else if(I||"invalid-url"!==b)c=(0,r.JwJ)(f)?`${X.toString()}?store_id=${ee.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(f).length>0?(0,r.FKG)(f)[0]:A}`:"78232846646"==f?`${Y.toString()}?store_id=${ee.toString()}&client_collection_id=${"index"==T&&(0,r.FKG)(f).length>0?(0,r.FKG)(f)[0]:A}`:`${Q.toString()}?store_id=${ee.toString()}&client_collection_id=${"index"==T&&1==(0,r.FKG)(f).length?(0,r.FKG)(f)[0]:A}`;else if(E){const e=p.Jh,t=(0,p.t6)(T);c=U.toString()+ee.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+f}else{var u,v,h,_;if(("72201044272"==f||"2665447536"==f&&D)&&!w)c=H.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()+"&latitude="+(null!==(u=null===(v=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===v?void 0:v.latitude)&&void 0!==u?u:"")+"&longitude="+(null!==(h=null===(_=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===_?void 0:_.longitude)&&void 0!==h?h:"")+"&user_type="+(null!==j&&void 0!==j&&j.userType?"olduser":"newuser");else c=(0,r.JwJ)(f)&&!w?K.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString():"78232846646"!=f||w?R.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()+(w?"&template_type=stories":""):J.toString()+ee.toString()+"?status="+te.toString()+"&is_active="+ne.toString()}const g=null===(e=window)||void 0===e||null===(t=e.whatmore)||void 0===t||null===(i=t.storyEvents)||void 0===i?void 0:i.events;w&&T.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(l(g),m(g),z(!0)):fetch(c).then(e=>e.json()).then(e=>{var t;if(E){const t=p.Jh;return(0,G.Po)(e,t)}return(0,r.JwJ)(f)&&(null===e||void 0===e||null===(t=e.questions)||void 0===t?void 0:t.length)>0&&(null==localStorage.getItem("_whatmore_qview_index")&&localStorage.setItem("_whatmore_qview_index",0),(0,s.d3)(null===e||void 0===e?void 0:e.questions)),(0,G.Np)(e,I||"invalid-url"!==b)}).then(e=>{var t,n;O&&console.debug("initial received events size : "+e.length);let i=[...null===e||void 0===e?void 0:e.events,...null===e||void 0===e?void 0:e.all_events];i=(0,r.xku)(f)?(0,G.d8)(i):(0,G.Zf)(i),m(i);const o=null!==(t=null===e||void 0===e||null===(n=e.events)||void 0===n?void 0:n.length)&&void 0!==t?t:0;return i.slice(0,o)}).then(e=>{if((P||L)&&(null==e||e&&0==(null===e||void 0===e?void 0:e.length))){const e=async()=>{const{eventsData:e,storiesData:t,bannerData:i}=await n.e(365).then(n.bind(n,6018));l(w?t:E?i:e)};e()}else l(e);z(!0)}).catch(e=>{S(e.message),z(!0)})},[]),(0,i.useEffect)(()=>{"index"===T?t&&t.length>0&&(0,N.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===T?(t&&t.length>0||"Scale"==(0,r.yt9)(f)||"Enterprise"==(0,r.yt9)(f)||"Premium"==(0,r.yt9)(f))&&(0,N.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===T&&(t&&t.length>0||"Scale"==(0,r.yt9)(f)||"Enterprise"==(0,r.yt9)(f)||"Premium"==(0,r.yt9)(f))&&(0,N.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})},[t]),M&&(null==t||0==t.length||_)&&V.Sn.forEach(e=>{var t,n,i,o;const l=null!==(t=e.querySelector('.whatmore-template-type[data-wh="template-stories-a"]'))&&void 0!==t?t:e.querySelector('.whatmore-template-type[data="template-stories-a"]'),a=null!==(n=e.querySelector('.whatmore-template-type[data-wh="template-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-feed-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-a-1"]')||e.querySelector('.whatmore-template-type[data-wh="template-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-h"]')||e.querySelector('.whatmore-template-type[data-wh="template-j"]'))&&void 0!==n?n:e.querySelector('.whatmore-template-type[data="template-a"]')||e.querySelector('.whatmore-template-type[data="template-b"]')||e.querySelector('.whatmore-template-type[data="template-f"]')||e.querySelector('.whatmore-template-type[data="template-stories"]')||e.querySelector('.whatmore-template-type[data="template-e"]')||e.querySelector('.whatmore-template-type[data="template-a-1"]')||e.querySelector('.whatmore-template-type[data="template-g"]')||e.querySelector('.whatmore-template-type[data="template-h"]')||e.querySelector('.whatmore-template-type[data="template-j"]'),r=null!==(i=e.querySelector('.whatmore-template-type[data-wh="template-collections-a"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-b"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-c"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-d"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-e"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-f"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-g"]')||e.querySelector('.whatmore-template-type[data-wh="template-collections-h"]'))&&void 0!==i?i:e.querySelector('.whatmore-template-type[data="template-collections-a"]')||e.querySelector('.whatmore-template-type[data="template-collections-b"]')||e.querySelector('.whatmore-template-type[data="template-collections-c"]')||e.querySelector('.whatmore-template-type[data="template-collections-stories"]')||e.querySelector('.whatmore-template-type[data="template-collections-e"]')||e.querySelector('.whatmore-template-type[data="template-collections-d"]')||e.querySelector('.whatmore-template-type[data="template-collections-f"]')||e.querySelector('.whatmore-template-type[data="template-collections-g"]')||e.querySelector('.whatmore-template-type[data="template-collections-h"]')||e.querySelector('.whatmore-template-type[data="template-collections-j"]'),s=null!==(o=e.querySelector('.whatmore-template-type[data-wh="template-banner-a"]'))&&void 0!==o?o:e.querySelector('.whatmore-template-type[data="template-banner-a"]'),c=e;if(w){const t=e.querySelector(".whatmore-shimmer-stories");t&&(t.style.display="none")}else if(!I){const t=e.querySelector(".loading-skeleton-wrapper");t&&(t.style.display="none")}(s||r||a||l)&&(a&&c||l&&c||s&&c||r&&c)&&(c.style.minHeight="0px")}),null==t||0==t.length||_?(0,y.jsx)("div",{}):(O&&(0,$.xv)(t),O&&console.debug("final transformed events data : "+JSON.stringify(t)),O&&console.debug("valid events size : "+t.length),(0,y.jsx)(k,{heading:e.heading,events:t,allEvents:v}))}},7802:function(e,t,n){n.d(t,{Hl:function(){return o},Np:function(){return a},Po:function(){return r},Z_:function(){return i},Zf:function(){return c},d8:function(){return s},zJ:function(){return l}});const i=function(e,t){return!((void 0==e.products||0==e.products.length)&&(void 0==e.cta||0==e.cta.length))},o=function(e,t){return!(void 0==e.products||0==e.products.length)},l=function(e){if(null!=e)return e.filter(e=>{var t;return null===(t=null===e||void 0===e?void 0:e.in_stock)||void 0===t||t})},a=function(e,t=!1){var n,i;if(null!=e)return t?{events:e.events[0].events,all_events:null!==(i=null===e||void 0===e?void 0:e.all_events)&&void 0!==i?i:[]}:{events:null===e||void 0===e?void 0:e.events,all_events:null!==(n=null===e||void 0===e?void 0:e.all_events)&&void 0!==n?n:[]}};const r=function(e,t){var n,i;let o=[];if(null==e)return[];if("eventsets"in e&&e.eventsets[t]){const n=function(e){if(null==e||0==e.length)return[];let t=[];return e.forEach(e=>{t=t.concat(e.events)}),t}(e.eventsets[t]);o=[...n]}return{events:o,all_events:null!==(n=null===(i=o)||void 0===i?void 0:i.all_events)&&void 0!==n?n:[]}};function s(e){if(null!=e){var t=0;return e.forEach(e=>{e.index=t++}),e}}function c(e){if(null==e)return;let t=0;return e.reduce((e,n)=>{var i;return(null===(i=null===n||void 0===n?void 0:n.in_stock)||void 0===i||i)&&(n.index=t++,e.push(n)),e},[])}},8945:function(e,t,n){function i(e,t){let n=0;let i=new MutationObserver(function(){document.querySelector("."+e)?(t(),i.disconnect()):0==n&&(n=1,setTimeout(()=>{t(),i.disconnect()},8e3))});i.observe(document.body,{childList:!0,subtree:!0})}n.d(t,{H:function(){return i}})}}]);