whatmore-react-assets 1.0.749 → 1.0.751

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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[74],{5380:function(e,t,n){n.d(t,{Z:function(){return g}});var i=n(4959),o=n(7313),a=n(4892),r=n(6805),s=n(7753),d=n(9821);var l=function(e){const[t,n,i,o,a]=(0,d.Z)(),[l]=(0,s.j1)("whatmoreEmbedAppVideoPlayerSizePortrait"),[c]=(0,s.j1)("whatmoreEmbedAppVideoPlayerSizeLandscape"),p=a[r.YP]===r.$w?c/100:l/100*1.2;return[t*p,n*p,a]},c=n(9723),p=n(9461),u=n.n(p),h=n(1195),w=n(7108),v=(n(7244),n(123),n(9854)),x=n(9852),f=n(6417);var g=function(e){var t;const n=o.useRef(null);var[d,p,g]=l();const{whatmoreUITheme:m}=(0,o.useContext)(x.I),[y]=(0,s.j1)("whatmoreEmbedAppVideoTitle"),[b]=(0,s.j1)("whatmoreEmbedAppPositionPortrait"),[j]=(0,s.j1)("whatmoreEmbedAppHorizontalPaddingPortrait"),[I]=(0,s.j1)("whatmoreEmbedAppVerticalPaddingPortrait"),[S]=(0,s.j1)("whatmoreEmbedAppPositionLandscape"),[E]=(0,s.j1)("whatmoreEmbedAppHorizontalPaddingLandscape"),[L]=(0,s.j1)("whatmoreEmbedAppVerticalPaddingLandscape"),P=(0,s.MO)("whatmoreShopId");var _=b,z=j,T=I;g[r.YP]===r.$w&&(_=S,z=E,T=L);const[k,C]=(0,o.useState)(["initial",window.pageYOffset]),[D,M]=(0,o.useState)(!1),A=null!==(t=e.isSpotlight)&&void 0!==t&&t,V=g[r.YP]===r.$w?.7*(0,v.zGA)(P):(0,v.zGA)(P),O=A?V:1;d*=O,p*=O;const B=A?(0,v.G0o)(P):_,F=A?(0,v.X8j)(P):(0,v.lVn)(P),[Z,N]=(0,o.useState)(!A&&(0,v.eXi)(P));function R(e,t){C(e),e[1]<=100?M(!1):t!=D&&(M(t),N(!1))}(0,o.useEffect)((()=>{let e=window.pageYOffset,t=!1;const n=()=>{const n=window.pageYOffset;Math.abs(n-e)<100||(R([n>e?"scrolled-down":"scrolled-up",n],!0),e=n>0?n:0),t=!1},i=()=>{t||(window.requestAnimationFrame(n),t=!0)};return window.addEventListener("scroll",i),()=>window.removeEventListener("scroll",i)}),[k]),(0,i.O3)({ref:n,handler:()=>{R(["scrolled-up",k[1]],!0)}});const Y=e.event,G=e.inVideoClick,W=e.closeClick,K=.3*p,U=.6*p,$=.1*p,H=.1*(.5*p),J="round"==m?"10px":"0px",X=(0,v.Z$A)(P);var q=!1,Q=0,ee=0;function te(e){q=e}return(0,f.jsx)("div",{children:Z&&!F?(0,f.jsx)(f.Fragment,{}):D&&F?(0,f.jsx)("div",{style:"left"===B?{left:"1px",bottom:A?(0,v.vnu)(P)+"px":T+"px",position:"fixed",zIndex:X}:{right:"5px",bottom:A?(0,v.vnu)(P)+"px":T+"px",position:"fixed",zIndex:X},children:(0,f.jsxs)("div",{onClick:()=>{R(["initial",k[1]],!1)},style:{margin:"1px",width:p+"px",height:d+"px"},className:"left"===B?"whatmore-ultraminimized-video-view-left":"whatmore-ultraminimized-video-view-right",children:[(0,f.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:J,overflow:"hidden"},children:(0,f.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,f.jsx)(a.Z,{url:Y.thumbnail_image,isPlaying:!1,event:Y})})}),(0,f.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,f.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",height:"100%"},children:[(0,f.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,f.jsx)("div",{className:"whatmore-ultraminimized-content-scale-out",children:(0,f.jsx)(h.Z,{sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:K+"px"},style:{position:"relative",zIndex:1,left:H+"px",bottom:H+"px"},onClick:W})})}),(0,f.jsx)("div",{style:{height:"100%",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(w.Z,{sx:{color:"white",fontSize:2*K+"px",filter:"drop-shadow(0 0 15px black);"}})})]})})]})}):(0,f.jsx)(u(),{nodeRef:n,cancel:".activate-button,.close-btn",defaultClassName:"whatmore-react-draggable",defaultClassNameDragging:"whatmore-react-draggable-dragging",defaultClassNameDragged:"whatmore-react-draggable-dragged",bounds:"html",onStart:(e,t)=>{var n,i;n=t.x,i=t.y,Q=n,ee=i},onDrag:(e,t)=>{te(!0)},onStop:(e,t)=>{q&&(Math.abs(t.x-Q)>5||Math.abs(t.y-ee)>5)?te(!1):G(Y)},children:(0,f.jsx)("div",{ref:n,style:"left"===B?{left:A?(0,v.$II)(P)+"px":z+"px",bottom:A?(0,v.vnu)(P)+"px":T+"px",position:"fixed",zIndex:X}:{right:A?(0,v.$II)(P)+"px":z+"px",bottom:A?(0,v.vnu)(P)+"px":T+"px",position:"fixed",zIndex:X},children:(0,f.jsxs)("div",{style:Object.assign({},{boxSizing:"border-box",margin:"1px",width:p+"px",height:d+"px"}),className:"left"===B?"whatmore-minimized-video-view-left":"whatmore-minimized-video-view-right",children:[(0,f.jsx)("div",{style:{boxShadow:"0px 0px 10px 3px #B0B0B0",borderRadius:J,overflow:"hidden",position:"relative"},children:(0,f.jsx)("div",{style:{width:"100%",height:"100%",aspectRatio:9/16},children:(0,f.jsx)(a.Z,{url:Y.thumbnail_image,isMuted:!0,isPlaying:!0,event:Y})})}),(0,f.jsx)("div",{style:{position:"relative",zIndex:1,bottom:"100%",width:"100%",height:"100%"},children:(0,f.jsxs)("div",{style:{display:"flex",flexFlow:"column nowrap",justifyContent:"space-between",height:"100%"},children:[(0,f.jsx)("div",{style:{display:"flex",flexFlow:"row nowrap",justifyContent:"flex-end",width:"100%",height:"fit-content"},children:(0,f.jsx)(h.Z,{className:"close-btn",sx:{filter:"drop-shadow(0 0 15px black);",color:"white",fontSize:K+"px"},onClick:W,style:{position:"relative",zIndex:1,left:$+"px",bottom:$+"px"}})}),(0,f.jsx)("div",{style:{marginLeft:"auto",marginRight:"auto"},children:(0,f.jsx)(c.Z,{sx:{color:(0,v.Ya_)(P),fontSize:U+"px",filter:"drop-shadow(0 0 15px black);"}})}),(0,f.jsx)("div",{style:{paddingLeft:"2px",paddingRight:"2px",borderBottomLeftRadius:J,borderBottomRightRadius:J,backgroundImage:y?"linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2), rgba(0,0,0,0.6))":""},children:(0,f.jsxs)("p",{style:{textAlign:"center",color:"white",fontFamily:"Sans-serif",fontWeight:"semi-bold",fontSize:.4*K+"px",margin:0,padding:0,lineHeight:"110%"},children:["\xa0",y]})})]})})]})})})})}},4284:function(e,t,n){n.r(t);var i=n(7313),o=n(9854),a=n(2860),r=n(7753),s=n(5160),d=n(6967),l=n(5380),c=n(58),p=n(8984),u=n(4669),h=n(513),w=n(9302),v=n(2575),x=n(7300),f=n(6524),g=n(9852),m=n(7376),y=n(778),b=n(7643),j=n(7008),I=n(7381),S=n(6417);const E=(0,v.Z)({key:"whatmore-css-ppv"}),L=i.lazy((()=>Promise.all([n.e(819),n.e(576),n.e(351),n.e(955),n.e(926),n.e(303),n.e(218),n.e(903)]).then(n.bind(n,3218))));function P(e){return e.split(/[?#]/)[0]}t.default=function(e){const[t,n]=(0,i.useState)(),[v,_]=(0,i.useState)(),[z]=(0,r.j1)("isInDesignMode"),[T]=(0,r.j1)("isDemoBrand"),[k]=(0,r.j1)("whatmoreEmbedAppUseVariant"),[C,D]=(0,i.useState)(-2),[M]=(0,r.j1)("whatmoreVariantId"),[A]=(0,r.j1)("whatmoreShopId");var[V]=(0,r.j1)("whatmoreProductId");const O=(0,r.MO)("isLandingSharedLink"),B=(0,r.MO)("whatmoreShareTemplateId"),F=(0,r.MO)("whatmoreShareEventId");V=(0,o.iXA)(A)?P(window.location.href):V;const[Z,N]=(0,i.useState)((()=>"true"===k?M:V));var R=a.Gc+"/v2/brand/"+A+"/product-events";const{whatmoreWidgetSourceDetails:Y}=(0,i.useContext)(g.I);(0,i.useEffect)((()=>{(0,I.Oo)("Video shopping powered by Whatmore!"),(0,d.hb)();const e=()=>{const e="_whatmore_bulk_events",t=JSON.parse(localStorage.getItem(e))||[];t&&t.length>0&&((0,j.K)(t),localStorage.removeItem(e))};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[]),(0,i.useEffect)((()=>{(0,u.ll)(A)}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||v||!(0,p.KE)()||(0,r.MO)("whatmoreVideoPlayerPoolInitiated")||(0,c.b5)(c.UD)}),[t]),(0,i.useEffect)((()=>{D(-1),fetch(R.toString()+"?client_product_id="+Z.toString()+"&status="+"upcoming".toString()+"&event_type=video").then((e=>e.json())).then((e=>e.events)).then((e=>(null!=e&&0!=e.length&&"47837511839"==A&&(0,o.d0x)(e),n(e),e))).then((e=>((0,o.yoE)(A)&&function(e,t){setTimeout((async()=>{const n=e.reduce(((e,t)=>[...e,...t.products]),[]).filter((e=>e.client_product_id==t))[0];if(!n||n.product_link==P(window.location.href))return;const i={product_id:n.product_id,product_link:P(window.location.href)};fetch(a.Gc+"/product",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(i)})}),500)}(e,Z),e))).catch((e=>{_(e.message)}))}),[Z]),(0,i.useEffect)((()=>{var e,n;D(-2),(t&&t.length>0||(0,o.uO6)(A))&&(0,m.PB)({userInteractionType:y.K.PDP_VISITED,widgetSourceDetails:Y,event:null===t||void 0===t?void 0:t[0],productList:null===t||void 0===t||null===(e=t[0])||void 0===e?void 0:e.products,ctaList:null===t||void 0===t||null===(n=t[0])||void 0===n?void 0:n.cta})}),[t]),(0,i.useEffect)((()=>{let e=history.pushState;history.pushState=function(){let t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};let t=history.replaceState;history.replaceState=function(){let e=t.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),e},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))})),window.addEventListener("locationchange",(function(){if("true"===k){const e=function(e){for(var t=window.location.search.substring(1).split("&"),n=0;n<t.length;n++){var i=t[n].split("=");if(i[0]==e)return i[1]}return!1}("variant");e&&""!==e&&N(e)}}))}),[]),(0,i.useEffect)((()=>{null==t||0==t.length||v||O&&"template-embed"==(0,f.zv)(B)&&null!=F&&t.forEach(((e,t)=>{F==e.event_id&&K(e,!0,t)}))}),[t]);const G=Y.landingLocationType,W=Y.templateType,K=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if((0,p.KE)()&&!t&&(0,c.QV)(),(0,x.B6)(e)||(0,x.WJ)(e))return z||T||(async()=>{const t=(0,f.NY)(G)+(0,f.dS)(W)+"_"+(null===e||void 0===e?void 0:e.event_id);(0,s.wh)(e),(0,u.Tc)(A,a.h7,a.dU),(0,d.H4)(e.event_id,e.products,"product_page","video_popup",t)})(),void D(n)};function U(){return(0,S.jsx)(S.Fragment,{})}return null==t||0==t.length||v?(0,S.jsx)("div",{}):(0,S.jsx)(w.C,{value:E,children:"no-product"===Z||-1===C||0===t.length?(0,S.jsx)(U,{}):-2===C&&t.length>0?(0,S.jsx)("div",{children:(0,S.jsx)(b.u,{userInteractionType:y.K.PDP_POPUP_WIDGET_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!z&&!T,children:(0,S.jsx)(l.Z,{event:t[0],inVideoClick:K,closeClick:e=>{e.stopPropagation(),D(-1)}})})}):(0,S.jsx)("div",{children:(0,S.jsx)(i.Suspense,{children:(0,S.jsx)(b.u,{userInteractionType:y.K.EVENT_VIEW,event:t[0],productList:t[0].products,cta:t[0].cta,triggerFlag:!z&&!T,children:(0,S.jsx)(L,{events:t,index:C,onBack:function(){(0,o.n2L)(A)&&(0,r.MO)("whatmoreAddedToCart")&&(0,h.D)(A,(()=>{}),100,window.location.hostname),D(-2)},template:"template-product-page"})})})})})}},7376:function(e,t,n){n.d(t,{GF:function(){return o},PB:function(){return s},Z2:function(){return a},y4:function(){return r}});var i=n(733);function o(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function a(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function r(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}function s(e){let{userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s}=e;(0,i.s)({userInteractionType:t,userInteractionMetadata:n,widgetSourceDetails:o,event:a,productList:r,ctaList:s})}}}]);