whatmore-react-assets 1.0.1698 → 1.0.1700
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 +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&&(0,r.FKG)(f).length>0?(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))),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}})}}]);
|