whatmore-react-assets 1.0.1776 → 1.0.1778

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.1776",
3
+ "version": "1.0.1778",
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([[199],{1019:function(e,t,n){n.d(t,{B:function(){return a}});var i=n(1348),o=n(964);function a(e){return`${(0,i.jpW)(e)?o.$$:o.MT}/v2/brand/${e}/product-events/recommendation/cdn`}},1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return p},DG:function(){return d}});var i=n(1348),o=n(3330),a=n(6157);function l(e,t,n={},i){var o;const l=s[e];if(!l)return;const r=l.isActionEnabled(),c=null===i||void 0===i||null===(o=i.meta_actions)||void 0===o?void 0:o[l.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===a.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",l.action,i),c&&setTimeout(()=>{null===c||void 0===c||c.forEach(e=>{fbq("trackCustom",e,i)})},500)})()}var r=n(7145);const s={[a.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[a.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[a.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[a.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[a.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[a.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:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[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===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[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===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}){var c,d,u;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}),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===a||void 0===a||null===(d=a[1])||void 0===d?void 0:d.title)&&void 0!==c?c:null===a||void 0===a||null===(u=a[0])||void 0===u?void 0:u.title})}function p({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a}){(0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var i=n(9950),o=n(964),a=n(140),l=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),p=n(2039),m=n(4833),h=n(2979),v=n(6157),g=n(8945),_=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(387),n.e(987),n.e(9),n.e(160),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(387),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(387),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(387),n.e(987),n.e(714),n.e(412)]).then(n.bind(n,7646))),T=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(387),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(387),n.e(491)]).then(n.bind(n,4295))),f=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(387),n.e(987),n.e(9),n.e(688),n.e(496),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(387),n.e(987),n.e(9),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(387),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(387),n.e(987),n.e(9),n.e(688),n.e(496),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(387),n.e(987),n.e(9),n.e(688),n.e(496),n.e(306)]).then(n.bind(n,9406))),b=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(387),n.e(987),n.e(9),n.e(497)]).then(n.bind(n,3795))),L=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(387),n.e(9),n.e(151)]).then(n.bind(n,9112))),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(340),n.e(387),n.e(987),n.e(9),n.e(688),n.e(160),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(387),n.e(987),n.e(9),n.e(688),n.e(806)]).then(n.bind(n,3278))),q=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(387),n.e(987),n.e(1)]).then(n.bind(n,4596))),W=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(387),n.e(987),n.e(9),n.e(688),n.e(906)]).then(n.bind(n,4688))),$=i.lazy(()=>n.e(374).then(n.bind(n,5100)));var k=function(e){var t,k;const[G]=(0,l.QN)("isInDesignMode"),[N]=(0,l.QN)("isDemoBrand"),[V]=(0,l.QN)("whatmoreTopBottomPadding"),[B]=(0,l.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:M}=(0,i.useContext)(u.B),[F]=(0,l.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:z}=(0,i.useContext)(u.B),R=(0,l.Xd)("isLandingSharedLink"),H=(0,l.Xd)("whatmoreShareTemplateId"),K=(0,l.Xd)("whatmoreShareStoryId"),U=(0,l.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:J,whatmoreUserInfo:Q}=(0,i.useContext)(u.B),X=R&&z===(0,m.Mm)(H),[Y,Z]=(0,i.useState)(X),[ee,te]=(0,i.useState)(-1),[ne,ie]=(0,i.useState)(null);let oe=e.events;const ae=e.allEvents;var le=null;M&&!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}(oe));const re=J.landingLocationType,se=J.templateType;function ce(e,t=!1,i=null){(0,c.MN)()&&(0,_._)()&&!t&&(0,d.bo)(),G||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=le[e].events[0],r=(0,m.Wd)(re)+(0,m.gf)(se)+(null!==l&&void 0!==l&&l.isRelatedEvent?"R":"E")+"_"+(null===l||void 0===l?void 0:l.event_id);(0,a.lB)(l),i(F,o.TB,o.OL),(0,s.Ch)(l.event_id,l.products,"homepage","stories",r,null===l||void 0===l?void 0:l.location,null===Q||void 0===Q?void 0:Q.userType)})();var l=0;null!=i&&le[e].events.map((e,t)=>{e.event_id==i&&(l=t)}),te(l),ie(e)}async function de(e,t=!1){(0,c.MN)()&&(0,_._)()&&!t&&await(0,d.bo)(),te(e.index),((0,p.ij)(e)||(0,p.Il)(e))&&(G||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=(0,m.Wd)(re)+(0,m.gf)(se)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,a.lB)(e),i(F,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",l)})())}function ue(e){return(0,y.jsx)(y.Fragment,{})}return(0,i.useEffect)(()=>{if(X)if((0,g.H)("whatmore-video-player",()=>{Z(!1)}),null!=K&&M){const e=le.find(e=>K==e.id);if(e)return void ce(le.indexOf(e),!0,U)}else if(null!=U){const e=oe.find(e=>U==e.event_id);if(e)return void de(e,!0)}},[]),(0,y.jsxs)(y.Fragment,{children:[Y&&(0,y.jsx)($,{}),-1==ee||-2==ee?(0,y.jsx)(ue,{}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.EVENT_VIEW,event:oe[ee],productList:null===(t=oe[ee])||void 0===t?void 0:t.products,cta:null===(k=oe[ee])||void 0===k?void 0:k.cta,triggerFlag:!G&&!N,children:(0,y.jsx)(W,{events:ae,index:ee,onBack:async function(){te(-1),Z(!1)},slideDirection:M||"horizontal"===(0,r.br0)(F)?"horizontal":"vertical",eventsStories:le,initialStoryIndex:ne,template:z})})}),(0,y.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(M?B:V)+"px",marginBottom:(M?B:V)+"px"},children:"template-b"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(S,{events:oe,onClick:de,heading:e.heading})})}):"template-a-1"===z||"template-collections-a-1"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(w,{events:oe,onClick:de,heading:e.heading})}):"template-feed-a"===z||"template-collections-feed-a"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(A,{events:oe,onClick:de,heading:e.heading})}):"template-collections-a"===z||"template-c"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(I,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-b"===z||"template-d"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(E,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-c"===z||"template-e"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(T,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-d"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(S,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-e"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(f,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-stories"===z||"template-stories"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(q,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-f"===z||"template-collections-f"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(O,{events:oe,onClick:de,heading:e.heading})})}):"template-g"===z||"template-collections-g"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(C,{events:oe,onClick:de,heading:e.heading})})}):"template-h"===z||"template-collections-h"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(j,{events:oe,onClick:de,heading:e.heading})})}):"template-i"===z||"template-collections-i"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(D,{index:ee,events:oe,onClick:de,heading:e.heading})})}):"template-j"===z||"template-collections-j"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(b,{events:oe,onClick:de,heading:e.heading})})}):"template-ai"===z||"template-collections-ai"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(L,{events:oe,onClick:de,heading:e.heading})})}):"template-banner-a"===z?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.BANNER_WIDGET_VIEW,event:oe[0],triggerFlag:!G&&!N,children:(0,y.jsx)(P,{events:oe})})}):M?(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.STORIES_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(x,{eventsStories:le,onClick:ce,template:z})})}):(0,y.jsx)(i.Suspense,{children:(0,y.jsx)(h.S,{userInteractionType:v.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,y.jsx)(f,{events:oe,onClick:de,heading:e.heading})})})})]})},G=n(7802),N=n(6641),V=n(1351),B=n(5873),M=n(1019);function F(e){return e.split(/[?#]/)[0]}function z(e){return e.split(/[?#]/)[0]}var R=function(e){const[t,a]=(0,i.useState)(),[p,h]=(0,i.useState)(),[g,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),[T]=(0,l.QN)("whatmoreShopId"),{whatmoreCollectionId:x}=(0,i.useContext)(u.B),f=(0,l.Xd)("whatmoreLandingLocationType"),O=(0,l.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:j,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),b=(0,l.Xd)("whatmoreCollectionUrl"),[L]=(0,l.QN)("isInDesignMode"),[A]=(0,l.QN)("isDemoBrand"),P="19506115"==T?"343270603":(0,r.mJ$)(T)?(0,r.jLA)(T)?b:F(window.location.href):x||F(window.location.href),[q,W]=(0,l.QN)("productRatings"),[$,R]=(0,i.useState)(!1);var H=(0,r.SOt)(T)?o.aD+"/v2/events/":o.$$+"/v2/events/",K=(0,r.SOt)(T)?o.aD+"/v3/events/":o.$$+"/v3/events/",U=(0,r.SOt)(T)?o.aD+"/v4/events/":o.$$+"/v4/events/",J=(0,r.SOt)(T)?o.aD+"/v5/events/":o.$$+"/v5/events/",Q=((0,r.SOt)(T)?o.aD:o.$$,(0,r.SOt)(T)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),X=(0,r.SOt)(T)?o.aD+"/v2/collection":o.$$+"/v2/collection",Y=(0,r.SOt)(T)?o.aD+"/v3/collection":o.$$+"/v3/collection",Z=(0,r.SOt)(T)?o.aD+"/v4/collection":o.$$+"/v4/collection",ee=((0,r.jpW)(T)?o.$$:o.MT)+"/v2/brand/"+T+"/product-events",te=e.shopId,ne="live,upcoming",ie="true";return(0,i.useEffect)(()=>{null!=t&&0!=t.length&&!g&&(0,c.MN)()&&!(0,l.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,_._)()&&(0,d.Pc)(d.F5)},[t]),(0,i.useEffect)(()=>{var e,t,i,o;if((0,s.wm)(),f.startsWith("product")){var c=(0,l.Xd)("whatmoreProductId");if(c=(0,r.BcY)(T)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e||"STRGZ9TGDEQ"==e||"STRJ2T2QPKI"==e?z(window.location.href).split("/").pop():z(window.location.href)}(T):c,"28575536"===T&&I)o=`${X.toString()}?store_id=${te.toString()}&client_collection_id=${F(window.location.href)}`;else if((0,r.vvU)(T))o=H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(T)){o=`${o=(0,M.B)(T)}?client_product_id=${c}&limit=10&recommended=${!(0,r.buK)(T)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else o=ee.toString()+"?client_product_id="+c.toString()+"&status="+ne.toString()+"&event_type=video"}else if(I||"invalid-url"!==b)o=(0,r.JwJ)(T)?`${Y.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:"78232846646"==T?`${Z.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:`${X.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&1==(0,r.FKG)(T).length?(0,r.FKG)(T)[0]:P}`;else if(E){const e=m.Jh,t=(0,m.t6)(f);o=Q.toString()+te.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+T}else{var d,u,p,v;if(("72201044272"==T||"2665447536"==T&&D)&&!w)o=K.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+"&latitude="+(null!==(d=null===(u=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===u?void 0:u.latitude)&&void 0!==d?d:"")+"&longitude="+(null!==(p=null===(v=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===v?void 0:v.longitude)&&void 0!==p?p:"")+"&user_type="+(null!==j&&void 0!==j&&j.userType?"olduser":"newuser");else o=(0,r.JwJ)(T)&&!w?U.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString():"78232846646"!=T||w?H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":""):J.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.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&&f.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(a(g),h(g),R(!0)):fetch(o).then(e=>e.json()).then(e=>{var t;if(E){const t=m.Jh;return(0,G.Po)(e,t)}return(0,r.JwJ)(T)&&(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)(T)?(0,G.d8)(i):(0,G.Zf)(i),h(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));a(w?t:E?i:e)};e()}else a(e);R(!0)}).catch(e=>{S(e.message),R(!0)})},[]),(0,i.useEffect)(()=>{"index"===f?t&&t.length>0&&(0,V.yP)({userInteractionType:v.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===f?(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,V.yP)({userInteractionType:v.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===f&&(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,V.yP)({userInteractionType:v.O.PDP_VISITED,widgetSourceDetails:C})},[t]),$&&(null==t||0==t.length||g)&&B.Sn.forEach(e=>{var t,n,i,o;const a=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"]'),l=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"]')||e.querySelector('.whatmore-template-type[data-wh="template-ai"]'))&&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"]')||e.querySelector('.whatmore-template-type[data="template-ai"]'),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||l||a)&&(l&&c||a&&c||s&&c||r&&c)&&(c.style.minHeight="0px")}),null==t||0==t.length||g?(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:p}))}},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],{1019:function(e,t,n){n.d(t,{B:function(){return a}});var i=n(1348),o=n(964);function a(e){return`${(0,i.jpW)(e)?o.$$:o.MT}/v2/brand/${e}/product-events/recommendation/cdn`}},1351:function(e,t,n){n.d(t,{PG:function(){return s},kz:function(){return c},UM:function(){return u},yP:function(){return p},DG:function(){return d}});var i=n(1348),o=n(3330),a=n(6157);function l(e,t,n={},i){var o;const l=s[e];if(!l)return;const r=l.isActionEnabled(),c=null===i||void 0===i||null===(o=i.meta_actions)||void 0===o?void 0:o[l.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===a.O.VIDEO_PLAYBACK&&{watch_time:n.watch_time,video_duration:n.video_duration}};fbq("trackCustom",l.action,i),c&&setTimeout(()=>{null===c||void 0===c||c.forEach(e=>{fbq("trackCustom",e,i)})},500)})()}var r=n(7145);const s={[a.O.EVENT_VIEW]:{isActionEnabled:i.NFF,action:"whatmore_video_click_event",customAction:"video_clicked"},[a.O.VIDEO_PLAYBACK]:{isActionEnabled:i.Eel,action:"whatmore_video_watch_event",customAction:"video_watched"},[a.O.VIDEO_LIKED]:{isActionEnabled:i.Mz3,action:"whatmore_video_like_event",customAction:"video_liked"},[a.O.VIDEO_SHARE_CTA_CLICKED]:{isActionEnabled:i.OLZ,action:"whatmore_video_share_event",customAction:"video_shared"},[a.O.SHOPNOW_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.PRODUCT_TILE_ATC_CLICKED]:{isActionEnabled:i.T9r,action:"whatmore_video_atc_event",customAction:"video_atc_clicked"},[a.O.SHOPNOW_CLICKED]:{isActionEnabled:i.nEf,action:"whatmore_product_tile_click_event",customAction:"video_product_tile_clicked"},[a.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:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[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===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function d({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}){var d,u,p,m;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:c}),e in s)&&(l(e,null!==(d=null===a||void 0===a?void 0:a[1])&&void 0!==d?d:null===a||void 0===a?void 0:a[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===a||void 0===a||null===(p=a[1])||void 0===p?void 0:p.title)&&void 0!==u?u:null===a||void 0===a||null===(m=a[0])||void 0===m?void 0:m.title}))}function u({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}){var c,d,u;((0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:a,ctaList:l}),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===a||void 0===a||null===(d=a[1])||void 0===d?void 0:d.title)&&void 0!==c?c:null===a||void 0===a||null===(u=a[0])||void 0===u?void 0:u.title})}function p({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a}){(0,r.B)({userInteractionType:e,userInteractionMetadata:t,widgetSourceDetails:n,event:i,productList:o,ctaList:a})}},3350:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var i=n(9950),o=n(964),a=n(140),l=n(5830),r=n(1348),s=n(4533),c=n(6613),d=n(1085),u=n(5551),p=n(2039),m=n(4833),v=n(2979),h=n(6157),g=n(8945),_=n(9821),S=n(4414);const y=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(340),n.e(387),n.e(987),n.e(9),n.e(160),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(387),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(387),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(387),n.e(987),n.e(714),n.e(412)]).then(n.bind(n,7646))),T=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(387),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(387),n.e(491)]).then(n.bind(n,4295))),f=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(387),n.e(987),n.e(9),n.e(688),n.e(496),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(387),n.e(987),n.e(9),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(387),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(387),n.e(987),n.e(9),n.e(688),n.e(496),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(387),n.e(987),n.e(9),n.e(688),n.e(496),n.e(306)]).then(n.bind(n,9406))),b=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(387),n.e(987),n.e(9),n.e(497)]).then(n.bind(n,3795))),L=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(946),n.e(387),n.e(9),n.e(151)]).then(n.bind(n,9112))),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(340),n.e(387),n.e(987),n.e(9),n.e(688),n.e(160),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(387),n.e(987),n.e(9),n.e(688),n.e(806)]).then(n.bind(n,3278))),q=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(257),n.e(387),n.e(987),n.e(1)]).then(n.bind(n,4596))),W=i.lazy(()=>Promise.all([n.e(283),n.e(304),n.e(59),n.e(946),n.e(607),n.e(187),n.e(387),n.e(987),n.e(9),n.e(688),n.e(906)]).then(n.bind(n,4688))),$=i.lazy(()=>n.e(374).then(n.bind(n,5100)));var k=function(e){var t,k;const[G]=(0,l.QN)("isInDesignMode"),[N]=(0,l.QN)("isDemoBrand"),[V]=(0,l.QN)("whatmoreTopBottomPadding"),[B]=(0,l.QN)("whatmoreStoriesTopBottomPadding"),{whatmoreIsStoriesTemplate:M}=(0,i.useContext)(u.B),[F]=(0,l.QN)("whatmoreShopId"),{whatmoreEventsBrowsingTemplate:z}=(0,i.useContext)(u.B),R=(0,l.Xd)("isLandingSharedLink"),H=(0,l.Xd)("whatmoreShareTemplateId"),K=(0,l.Xd)("whatmoreShareStoryId"),U=(0,l.Xd)("whatmoreShareEventId"),{whatmoreWidgetSourceDetails:J,whatmoreUserInfo:Q}=(0,i.useContext)(u.B),X=R&&z===(0,m.Mm)(H),[Y,Z]=(0,i.useState)(X),[ee,te]=(0,i.useState)(-1),[ne,ie]=(0,i.useState)(null);let oe=e.events;const ae=e.allEvents;var le=null;M&&!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}(oe));const re=J.landingLocationType,se=J.templateType;function ce(e,t=!1,i=null){(0,c.MN)()&&(0,_._)()&&!t&&(0,d.bo)(),G||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=le[e].events[0],r=(0,m.Wd)(re)+(0,m.gf)(se)+(null!==l&&void 0!==l&&l.isRelatedEvent?"R":"E")+"_"+(null===l||void 0===l?void 0:l.event_id);(0,a.lB)(l),i(F,o.TB,o.OL),(0,s.Ch)(l.event_id,l.products,"homepage","stories",r,null===l||void 0===l?void 0:l.location,null===Q||void 0===Q?void 0:Q.userType)})();var l=0;null!=i&&le[e].events.map((e,t)=>{e.event_id==i&&(l=t)}),te(l),ie(e)}async function de(e,t=!1){(0,c.MN)()&&(0,_._)()&&!t&&await(0,d.bo)(),te(e.index),((0,p.ij)(e)||(0,p.Il)(e))&&(G||N||(async()=>{const{initializeGA:t,sendVideoViewEventToGA:i}=await Promise.resolve().then(n.bind(n,3330));t();const l=(0,m.Wd)(re)+(0,m.gf)(se)+(null!==e&&void 0!==e&&e.isRelatedEvent?"R":"E")+"_"+(null===e||void 0===e?void 0:e.event_id);(0,a.lB)(e),i(F,o.TB,o.Dk),(0,s.Ch)(e.event_id,e.products,"homepage","carousel",l)})())}function ue(e){return(0,S.jsx)(S.Fragment,{})}return(0,i.useEffect)(()=>{if(X)if((0,g.H)("whatmore-video-player",()=>{Z(!1)}),null!=K&&M){const e=le.find(e=>K==e.id);if(e)return void ce(le.indexOf(e),!0,U)}else if(null!=U){const e=oe.find(e=>U==e.event_id);if(e)return void de(e,!0)}},[]),(0,S.jsxs)(S.Fragment,{children:[Y&&(0,S.jsx)($,{}),-1==ee||-2==ee?(0,S.jsx)(ue,{}):(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.EVENT_VIEW,event:oe[ee],productList:null===(t=oe[ee])||void 0===t?void 0:t.products,cta:null===(k=oe[ee])||void 0===k?void 0:k.cta,triggerFlag:!G&&!N,children:(0,S.jsx)(W,{events:ae,index:ee,onBack:async function(){te(-1),Z(!1)},slideDirection:M||"horizontal"===(0,r.br0)(F)?"horizontal":"vertical",eventsStories:le,initialStoryIndex:ne,template:z})})}),(0,S.jsx)("div",{className:"whatmore-widget-container",style:{height:"100%",marginTop:(M?B:V)+"px",marginBottom:(M?B:V)+"px"},children:"template-b"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(y,{events:oe,onClick:de,heading:e.heading})})}):"template-a-1"===z||"template-collections-a-1"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(w,{events:oe,onClick:de,heading:e.heading})}):"template-feed-a"===z||"template-collections-feed-a"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(A,{events:oe,onClick:de,heading:e.heading})}):"template-collections-a"===z||"template-c"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(I,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-b"===z||"template-d"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(E,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-c"===z||"template-e"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(T,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-d"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(y,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-e"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(f,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-collections-stories"===z||"template-stories"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.COLLECTION_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(q,{events:oe,index:ee,setScreen:te,onClick:de,heading:e.heading})})}):"template-f"===z||"template-collections-f"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(O,{events:oe,onClick:de,heading:e.heading})})}):"template-g"===z||"template-collections-g"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(C,{events:oe,onClick:de,heading:e.heading})})}):"template-h"===z||"template-collections-h"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(j,{events:oe,onClick:de,heading:e.heading})})}):"template-i"===z||"template-collections-i"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(D,{index:ee,events:oe,onClick:de,heading:e.heading})})}):"template-j"===z||"template-collections-j"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(b,{events:oe,onClick:de,heading:e.heading})})}):"template-ai"===z||"template-collections-ai"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(L,{events:oe,onClick:de,heading:e.heading})})}):"template-banner-a"===z?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.BANNER_WIDGET_VIEW,event:oe[0],triggerFlag:!G&&!N,children:(0,S.jsx)(P,{events:oe})})}):M?(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.STORIES_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(x,{eventsStories:le,onClick:ce,template:z})})}):(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(v.S,{userInteractionType:h.O.HOMEPAGE_CAROUSEL_WIDGET_VIEW,triggerFlag:!G&&!N,children:(0,S.jsx)(f,{events:oe,onClick:de,heading:e.heading})})})})]})},G=n(7802),N=n(6641),V=n(1351),B=n(5873),M=n(1019);function F(e){return e.split(/[?#]/)[0]}function z(e){return e.split(/[?#]/)[0]}var R=function(e){const[t,a]=(0,i.useState)(),[p,v]=(0,i.useState)(),[g,y]=(0,i.useState)(),{whatmoreIsStoriesTemplate:w}=(0,i.useContext)(u.B),{whatmoreIsCollectionsTemplate:I}=(0,i.useContext)(u.B),{whatmoreIsBannerTemplate:E}=(0,i.useContext)(u.B),[T]=(0,l.QN)("whatmoreShopId"),{whatmoreCollectionId:x}=(0,i.useContext)(u.B),f=(0,l.Xd)("whatmoreLandingLocationType"),O=(0,l.Xd)("whatmoreLoggingActive"),{whatmoreWidgetSourceDetails:C}=(0,i.useContext)(u.B),{whatmoreUserInfo:j,whatmoreIsPreviewMode:D}=(0,i.useContext)(u.B),b=(0,l.Xd)("whatmoreCollectionUrl"),[L]=(0,l.QN)("isInDesignMode"),[A]=(0,l.QN)("isDemoBrand"),P="19506115"==T?"343270603":(0,r.mJ$)(T)?(0,r.jLA)(T)?b:F(window.location.href):x||F(window.location.href),[q,W]=(0,l.QN)("productRatings"),[$,R]=(0,i.useState)(!1);var H=(0,r.SOt)(T)?o.aD+"/v2/events/":o.$$+"/v2/events/",K=(0,r.SOt)(T)?o.aD+"/v3/events/":o.$$+"/v3/events/",U=(0,r.SOt)(T)?o.aD+"/v4/events/":o.$$+"/v4/events/",J=(0,r.SOt)(T)?o.aD+"/v5/events/":o.$$+"/v5/events/",Q=((0,r.SOt)(T)?o.aD:o.$$,(0,r.SOt)(T)?o.aD+"/get_eventset/":o.$$+"/get_eventset/"),X=(0,r.SOt)(T)?o.aD+"/v2/collection":o.$$+"/v2/collection",Y=(0,r.SOt)(T)?o.aD+"/v3/collection":o.$$+"/v3/collection",Z=(0,r.SOt)(T)?o.aD+"/v4/collection":o.$$+"/v4/collection",ee=((0,r.jpW)(T)?o.$$:o.MT)+"/v2/brand/"+T+"/product-events",te=e.shopId,ne="live,upcoming",ie="true";return(0,i.useEffect)(()=>{null!=t&&0!=t.length&&!g&&(0,c.MN)()&&!(0,l.Xd)("whatmoreVideoPlayerPoolInitiated")&&(0,_._)()&&(0,d.Pc)(d.F5)},[t]),(0,i.useEffect)(()=>{var e,t,i,o;if((0,s.wm)(),f.startsWith("product")){var c=(0,l.Xd)("whatmoreProductId");if(c=(0,r.BcY)(T)?function(e){return"STRQMPNF7QK"==e?encodeURIComponent(window.location.href):"STR6HARJ3QY"==e||"STRI4V3OYCH"==e||"STRGZ9TGDEQ"==e||"STRJ2T2QPKI"==e?z(window.location.href).split("/").pop():z(window.location.href)}(T):c,"28575536"===T&&I)o=`${X.toString()}?store_id=${te.toString()}&client_collection_id=${F(window.location.href)}`;else if((0,r.vvU)(T))o=H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":"");else if((0,r.WH1)(T)){o=`${o=(0,M.B)(T)}?client_product_id=${c}&limit=10&recommended=${!(0,r.buK)(T)}&origin=${window.location.hostname}&status=live,upcoming&event_type=video`}else o=ee.toString()+"?client_product_id="+c.toString()+"&status="+ne.toString()+"&event_type=video"}else if(I||"invalid-url"!==b)o=(0,r.JwJ)(T)?`${Y.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:"78232846646"==T?`${Z.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&(0,r.FKG)(T).length>0?(0,r.FKG)(T)[0]:P}`:`${X.toString()}?store_id=${te.toString()}&client_collection_id=${"index"==f&&1==(0,r.FKG)(T).length?(0,r.FKG)(T)[0]:P}`;else if(E){const e=m.Jh,t=(0,m.t6)(f);o=Q.toString()+te.toString()+"?eventset_type="+e+"&source="+t+"&source_id="+T}else{var d,u,p,h;if(("72201044272"==T||"2665447536"==T&&D)&&!w)o=K.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+"&latitude="+(null!==(d=null===(u=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===u?void 0:u.latitude)&&void 0!==d?d:"")+"&longitude="+(null!==(p=null===(h=JSON.parse(localStorage.getItem("_user_wh_lc")))||void 0===h?void 0:h.longitude)&&void 0!==p?p:"")+"&user_type="+(null!==j&&void 0!==j&&j.userType?"olduser":"newuser");else o=(0,r.JwJ)(T)&&!w?U.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString():"78232846646"!=T||w?H.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.toString()+(w?"&template_type=stories":""):J.toString()+te.toString()+"?status="+ne.toString()+"&is_active="+ie.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&&f.startsWith("index")&&"object"==typeof g&&(null===g||void 0===g?void 0:g.length)>0?(a(g),v(g),R(!0)):fetch(o).then(e=>e.json()).then(e=>{var t;if(E){const t=m.Jh;return(0,G.Po)(e,t)}return(0,r.JwJ)(T)&&(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)(T)?(0,G.d8)(i):(0,G.Zf)(i),v(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));a(w?t:E?i:e)};e()}else a(e);R(!0)}).catch(e=>{y(e.message),R(!0)})},[]),(0,i.useEffect)(()=>{"index"===f?t&&t.length>0&&(0,V.yP)({userInteractionType:h.O.HOMEPAGE_VISITED,widgetSourceDetails:C}):"collection"===f?(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,V.yP)({userInteractionType:h.O.COLLECTION_PAGE_VISITED,widgetSourceDetails:C}):"product"===f&&(t&&t.length>0||"Scale"==(0,r.yt9)(T)||"Enterprise"==(0,r.yt9)(T)||"Premium"==(0,r.yt9)(T))&&(0,V.yP)({userInteractionType:h.O.PDP_VISITED,widgetSourceDetails:C})},[t]),$&&(null==t||0==t.length||g)&&B.Sn.forEach(e=>{var t,n,i,o;const a=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"]'),l=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||l||a)&&(l&&c||a&&c||s&&c||r&&c)&&(c.style.minHeight="0px")}),null==t||0==t.length||g?(0,S.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,S.jsx)(k,{heading:e.heading,events:t,allEvents:p}))}},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}})}}]);