whatmore-react-assets 1.0.1418 → 1.0.1420

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +0,0 @@
1
- (self.webpackChunkwhatmorelive_react=self.webpackChunkwhatmorelive_react||[]).push([[590],{7220:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return _}});var o=n(664),i=n(9950),r=n(1348),l=n(1745);const a=function(t){new PerformanceObserver((e=>{for(const n of e.getEntries()){[`${window.location.origin}/cart/add.js`,`${window.location.origin}/cart/add`].includes(n.name)&&(console.debug("Whatmore :: Fetch request detected to",n.name),(0,r.dnh)(whatmoreShopId)&&setTimeout((()=>{(0,l.sw)(t)}),1e3))}})).observe({entryTypes:["resource"]})};var c=n(7740),s=n(4737),u=n(4833);var d,f=n(5491),h=n.n(f),g=n(964),m=n(4414);const p=i.lazy((()=>Promise.all([n.e(286),n.e(461),n.e(760)]).then(n.bind(n,1746)))),v=i.lazy((()=>Promise.all([n.e(682),n.e(2),n.e(497),n.e(859),n.e(286),n.e(296),n.e(461),n.e(774)]).then(n.bind(n,3389)))),w=i.lazy((()=>Promise.all([n.e(682),n.e(2),n.e(497),n.e(859),n.e(286),n.e(296),n.e(461),n.e(717)]).then(n.bind(n,8154)))),S=null!==(d="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==d&&d;let y=h()((t=>{fetch(g.$$+"/customization/frontend/"+t).then((t=>t.json())).then((e=>{(0,r.Tzr)(e,t),(0,o.t2)("brandCustomizationsLoaded",!0)})).catch((t=>{console.error("Whatmore : Error while fetching brandCustomizations : "+t)}))}),100,{leading:!0,trailing:!1});var _=function(){var t;const[e]=(0,o.QN)("whatmoreLandingLocationType"),[d]=(0,o.QN)("whatmoreShopId"),f=(0,o.Xd)("isInDesignMode"),[h,g]=(0,o.QN)("brandCustomizationsLoaded"),[_]=(0,o.QN)("whatmoreEmbedAppUseVariant"),{whatmoreEventsBrowsingTemplate:b}=(0,i.useContext)(s.B),[j]=null===(t=performance)||void 0===t?void 0:t.getEntriesByType("navigation");if((0,i.useEffect)((()=>{if(!h){const t=3e5;(0,r.tVc)(t)&&"reload"!=(null===j||void 0===j?void 0:j.type)?g(!0):y(d)}null==localStorage.getItem("_user_wh_lc")&&"72201044272"==d&&n.e(259).then(n.bind(n,3446)).then((t=>{let{getLocationDetails:e}=t;return e()})).then((t=>(localStorage.setItem("_user_wh_lc",JSON.stringify(t)),{}))).catch((t=>{localStorage.setItem("_user_wh_lc",JSON.stringify({latitude:"",longitude:""})),console.error(`Error: ${t}`)}))}),[]),(0,i.useEffect)((()=>{a("true"===_),(0,r.WmJ)(d)&&function(t){let e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e)}((0,r.WmJ)(d))}),[h]),!h)return(0,m.jsx)(m.Fragment,{});if((0,c.U)()){if((0,u.Ig)(b))return(0,m.jsx)(m.Fragment,{});if("index"===e||"collection"===e||e.startsWith("collection")||e.startsWith("page")){if(!(0,u.io)(b))return S&&console.debug("Whatmore : Shopify, rendering index/collection page carousels : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(p,{})})});if(function(){var t,e,n,i,l,a,c,s,u,h,g,m;const p=(0,o.Xd)("whatmoreCollectionId");return f||(null===(t=window)||void 0===t||null===(e=t.Shopify)||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.role)&&"main"!==(null===(i=window)||void 0===i||null===(l=i.Shopify)||void 0===l||null===(a=l.theme)||void 0===a?void 0:a.role)||(0,r.hbj)(d)&&(null===(c=window)||void 0===c||null===(s=c.Shopify)||void 0===s||null===(u=s.theme)||void 0===u?void 0:u.role)&&"main"===(null===(h=window)||void 0===h||null===(g=h.Shopify)||void 0===g||null===(m=g.theme)||void 0===m?void 0:m.role)&&((0,r.R2w)(d)||p&&(0,r.Idi)(d).includes(p))}())return S&&console.debug("Whatmore : Shopify, rendering index/collection page spotlight : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(w,{})})})}var x,I,T,O,N,$,W,E,P,k,J,F;return e.startsWith("product")?(0,u.io)(b)?(null!==(x=window)&&void 0!==x&&null!==(I=x.Shopify)&&void 0!==I&&null!==(T=I.theme)&&void 0!==T&&T.role&&"main"===(null===(O=window)||void 0===O||null===(N=O.Shopify)||void 0===N||null===($=N.theme)||void 0===$?void 0:$.role)||window.location.href.includes("localhost:"))&&(0,r.fDZ)(d)?(S&&console.debug("Whatmore : Shopify, rendering PDP-page popup : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(v,{})})})):(null!==(W=window)&&void 0!==W&&null!==(E=W.Shopify)&&void 0!==E&&null!==(P=E.theme)&&void 0!==P&&P.role&&"main"!==(null===(k=window)||void 0===k||null===(J=k.Shopify)||void 0===J||null===(F=J.theme)||void 0===F?void 0:F.role)||f)&&(0,r.C1J)(d)?(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(v,{})})}):(S&&console.debug("Whatmore : Shopify, PDP-page popup disabled."),(0,m.jsx)(m.Fragment,{})):(S&&console.debug("Whatmore : Shopify, rendering PDP-page carousels : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(p,{})})})):((0,r.dnh)(d)&&(0,r.bQo)(d)&&"cart"===e&&(S&&console.debug("Whatmore : initiating whatmore attribution from cart page."),(0,l.sw)("true"===_)),(0,m.jsx)(m.Fragment,{}))}return"index"===e||"collection"===e?(0,u.io)(b)?(S&&console.debug("Whatmore : External, rendering index/collection page popup : "+b),(0,m.jsx)(m.Fragment,{})):(S&&console.debug("Whatmore : External, rendering index/collection page carousels : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(p,{})})})):e.startsWith("product")||"embed"===e?(0,u.Ig)(b)||(0,u.io)(b)?(0,r.fDZ)(d)?(S&&console.debug("Whatmore : External, rendering PDP-page popup : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(v,{})})})):(S&&console.debug("Whatmore : External, PDP-page popup disabled."),(0,m.jsx)(m.Fragment,{})):(S&&console.debug("Whatmore : External, rendering PDP-page carousels : "+b),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(i.Suspense,{children:(0,m.jsx)(p,{})})})):(0,m.jsx)(m.Fragment,{})}},7740:function(t,e,n){"use strict";function o(){return!(void 0==window.Shopify&&!window.location.href.includes("shopify")&&!window.location.href.includes("localhost:"))}n.d(e,{U:function(){return o}})},6641:function(t,e,n){"use strict";n.d(e,{Fk:function(){return s},gv:function(){return c},xv:function(){return a}});var o=n(664);const i="Whatmore : ",r=(0,o.Xd)("whatmoreShopId");function l(t){console.debug(i+t)}function a(t){var e;null!==(e="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==e&&e&&(l("total events received : "+(t&&t.length)),l("events data : "+JSON.stringify(t)))}function c(t){var e;null!==(e="true"==localStorage.getItem("whatmoreActivateLogs"))&&void 0!==e&&e&&l(t)}const s=t=>{"STR60LW4WMA"!=r&&console.log(`%c ${t}`,"background: #D53F8C; color: white; font-size: 19px; padding: 5px; font-weight: semibold;","\n\nFind us here -> https://www.whatmore.ai")}},1745:function(t,e,n){"use strict";n.d(e,{RX:function(){return d},sw:function(){return u},iL:function(){return h},oV:function(){return f},Lt:function(){return c},js:function(){return s},tN:function(){return g},_N:function(){return m}});var o=n(1348);const i="_whatmore-tracking-id";var r=n(2089),l=n(4533),a=n(664);function c(){const t="https://"+window.location.hostname+"/cart.json";return fetch(t,{method:"GET"})}async function s(){const t="https://"+window.location.hostname+"/cart.json";return await fetch(t,{method:"GET"})}async function u(t){var e;const n=(0,a.Xd)("whatmoreShopId");let o=(0,r.Ak)(),c=null,u=null,d={},f=null,h=null,g=null,m={},p=(0,l.CK)(),v=null===(e=localStorage)||void 0===e?void 0:e.wht_is_impression,w=p.length>0;p.forEach((t=>{m.hasOwnProperty(null===t||void 0===t?void 0:t.product_id)||(m[null===t||void 0===t?void 0:t.product_id]={widgetInfo:null===t||void 0===t?void 0:t.widget_info,location:null===t||void 0===t?void 0:t.location,userType:null===t||void 0===t?void 0:t.user_type})})),await s().then((t=>t.json())).then((e=>{o=e.token;let r=[];if(r=!0===t?e.items.map((t=>{const e=m[null===t||void 0===t?void 0:t.variant_id];return{...t,location:null===e||void 0===e?void 0:e.location,userType:null===e||void 0===e?void 0:e.userType,widget_info:null===e||void 0===e?void 0:e.widgetInfo}})):e.items.map((t=>{const e=m[null===t||void 0===t?void 0:t.product_id];return{...t,location:null===e||void 0===e?void 0:e.location,userType:null===e||void 0===e?void 0:e.userType,widget_info:null===e||void 0===e?void 0:e.widgetInfo}})),0==r.length)return console.debug("Whatmore :: no cart items available for view products"),null;console.log(e,"res"),"9238315068"!=n&&r.map((e=>{if(c=e.key,u=e.quantity,d=e.properties,f=e.widget_info,h=e.location,g=e.userType,null===d||!(i in d)){const n=async function(t,e,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",c=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0,d=arguments.length>8?arguments[8]:void 0;const f=(0,a.Xd)("whatmoreShopId"),h=s?(0,l.wm)()+("72201044272"==f?`#${o}#${r}#${c?"olduser":"newuser"}`:`#${o}`):d?"_wt_vs":u?"_wt_vi":"";let g={id:t,quantity:e,properties:{...h?{[i]:h}:{},...n}};const m=await fetch("https://"+window.location.hostname+"/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)}).then((t=>t.json())).catch((t=>{console.error("Whatmore :: Error while updating cart attribute.",t)}));return m}(c,u,d,f,h,g,m.hasOwnProperty(JSON.stringify(!0===t?e.variant_id:e.product_id)),v,w);return n}}))})).catch((t=>{console.error("Whatmore :: Error while fetching cart_token for cart attribute update.",t)}))}async function d(t,e,n,r){let a,c,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",u=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0;if((0,o.dnh)(n)){const o=(0,l.wm)()+("72201044272"==n?`#${r}#${s}#${u?"olduser":"newuser"}:direct`:`#${r}:direct`);if(a={items:[{id:t,quantity:e,properties:{[i]:o}}]},"77105758517"==n){c=new URLSearchParams,c.append("product-id",null===d||void 0===d?void 0:d.client_product_id),c.append("id",t),c.append("quantity",e);return await fetch("https://"+window.location.hostname+"/cart/add.js",{method:"POST",body:c})}}else a={items:[{id:t,quantity:e}]};return await fetch("https://"+window.location.hostname+"/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}function f(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default",l=arguments.length>5?arguments[5]:void 0;const a="https://"+window.location.hostname;var c;const s="72201044272"==n?`came-from-whatmore-live_${i}_${r}_${l?"olduser":"newuser"}`:`came-from-whatmore-live_${i}`;(0,o.BLb)(n)?(c=`${a}/cart/${t}:${e}?`+(0,o.VCz)(n)+"&"+(0,o.Spk)(n)+"&"+(0,o.KMo)(n),(0,o.dnh)(n)&&(c=`${c}&ref=`+s)):(c=`${a}/cart/${t}:${e}`,(0,o.dnh)(n)&&(c=`${c}?ref=`+s)),window.location.href=c}function h(t){const e="https://"+window.location.hostname+"/cart";(0,o.BLb)(t)?window.location.href=e+"?"+(0,o.VCz)(t)+"&"+(0,o.Spk)(t)+"&"+(0,o.yD5)(t):window.location.href=e}async function g(t){let e;if("27303477337"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")){var n,o;const i="https://"+window.location.hostname,r=window.location.pathname.split("/");e=i+"/"+(null!==r&&void 0!==r&&null!==(n=r[1])&&void 0!==n&&n.startsWith("en-")?(null===r||void 0===r?void 0:r[1])+"/":"")+(null===t||void 0===t||null===(o=t.product_link)||void 0===o?void 0:o.split(".co")[1])+".js"}else e=(null===t||void 0===t?void 0:t.product_link)+".js";const i=await fetch(e,{method:"GET"});if(!i.ok)throw new Error(`Error! status: ${i.status}`);return await i.json()}async function m(t){const e=t.product_link+".json",n=await fetch(e,{method:"GET"});if(!n.ok)throw new Error(`Error! status: ${n.status}`);return await n.json()}},4533:function(t,e,n){"use strict";n.d(e,{CK:function(){return j},Ch:function(){return b},Fu:function(){return _},Hm:function(){return x},d3:function(){return I},wm:function(){return S},zv:function(){return y}});var o=n(2089),i=n(664),r=n(4820);const l="_whatmore_user_id",a="_whatmore_session_id",c="_whatmore_viewed_products",s="_whatmore_add_to_cart_products",u="_whatmore_session_time",d="_whatmore_store_id",f="_whatmore_qview_index",h="_whatmore_brand_questions",g=(0,i.Xd)("whatmoreShopId"),m=18e5,p=2592e5,v=6e5,w="_whatmore_bulk_events";function S(){return localStorage.getItem(d)!=g&&localStorage.setItem(d,g),null==localStorage.getItem(l)&&function(){new Date;const t=(0,o.Ak)();localStorage.setItem(l,t)}(),localStorage.getItem(l)}function y(){const t=new Date,e=JSON.parse(localStorage.getItem(w))||[],n=localStorage.getItem(u);return(null==localStorage.getItem(a)||null==n||t.getTime()>n)&&(localStorage.removeItem(a),localStorage.removeItem(u),function(){const t=(0,o.Ak)(),e=(new Date).getTime()+m;localStorage.setItem(a,t),localStorage.setItem(u,e)}(),e&&e.length>0&&((0,r.u)(e),localStorage.removeItem(w))),localStorage.getItem(a)}function _(t,e,n,o,i){const r=(new Date).getTime(),l={event_id:t.event_id,product_id:e.client_product_id,product_title:e.title,price:e.price,timestamp:r,widget_info:n,location:o,user_type:i?"olduser":"newuser",variants:[]};if(null===localStorage.getItem(s))localStorage.setItem(s,JSON.stringify([l]));else{let t=JSON.parse(localStorage.getItem(s)).filter((t=>t.timestamp+p>r));localStorage.setItem(s,JSON.stringify([...t,l]))}}function b(t,e,n,o,i){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"default",l=arguments.length>6?arguments[6]:void 0;const a=[],s=(new Date).getTime();if(e.map((e=>{const c={event_id:t,product_id:e.client_product_id,product_title:e.title,price:e.price,timestamp:s,variants:[],page:n,widget_type:o,widget_info:i,location:r,user_type:l?"olduser":"newuser"};a.push(c)})),null===localStorage.getItem(c))console.debug("viewed Products",JSON.stringify(a)),localStorage.setItem(c,JSON.stringify(a));else{let e=JSON.parse(localStorage.getItem(c)),n=!1;e.map((e=>{let o=Object.assign({},e);return e.event_id===t&&(e.timestamp=s,n=!0),o})),n?localStorage.setItem(c,JSON.stringify(e)):localStorage.setItem(c,JSON.stringify([...e,...a]))}}function j(){const t=(new Date).getTime();let e=JSON.parse(localStorage.getItem(c));if(!e)return[];let n=e.filter((e=>e.timestamp+p>t));return localStorage.setItem(c,JSON.stringify(n)),n}function x(){if(null!=localStorage.getItem(f)){const t=parseInt(localStorage.getItem(f))+1;localStorage.setItem(f,t)}}function I(t){const e=(new Date).getTime();if(null==localStorage.getItem(h)){const n={questionList:null===t||void 0===t?void 0:t.filter((t=>1==(null===t||void 0===t?void 0:t.is_active))),timestamp:e};localStorage.setItem(h,JSON.stringify(n))}else{const n=JSON.parse(localStorage.getItem(h));if((null===n||void 0===n?void 0:n.timestamp)+v>e){const n={questionList:null===t||void 0===t?void 0:t.filter((t=>1==(null===t||void 0===t?void 0:t.is_active))),timestamp:e};localStorage.setItem(h,JSON.stringify(n))}}}},4820:function(t,e,n){"use strict";n.d(e,{u:function(){return r}});var o=n(964),i=n(6641);const r=function(t){let e={};const n=t.length<10;e.metric_event_list=t,(async()=>{!function(t,e){const n="ingesting analytis-event";(0,i.gv)(n);const r=t;fetch(o.qW+"/event_metrics/bulk",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r),keepalive:e}).then((t=>t.json())).then((t=>{})).catch((t=>{console.error("error "+n,t)}))}(e,n)})()}},4635:function(t,e,n){var o=n(4759).Symbol;t.exports=o},2022:function(t,e,n){var o=n(4635),i=n(1581),r=n(5336),l=o?o.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":l&&l in Object(t)?i(t):r(t)}},6914:function(t,e,n){var o=n(8798),i=/^\s+/;t.exports=function(t){return t?t.slice(0,o(t)+1).replace(i,""):t}},6658:function(t,e,n){var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=o},1581:function(t,e,n){var o=n(4635),i=Object.prototype,r=i.hasOwnProperty,l=i.toString,a=o?o.toStringTag:void 0;t.exports=function(t){var e=r.call(t,a),n=t[a];try{t[a]=void 0;var o=!0}catch(c){}var i=l.call(t);return o&&(e?t[a]=n:delete t[a]),i}},5336:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},4759:function(t,e,n){var o=n(6658),i="object"==typeof self&&self&&self.Object===Object&&self,r=o||i||Function("return this")();t.exports=r},8798:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},5491:function(t,e,n){var o=n(4567),i=n(4378),r=n(2588),l=Math.max,a=Math.min;t.exports=function(t,e,n){var c,s,u,d,f,h,g=0,m=!1,p=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function w(e){var n=c,o=s;return c=s=void 0,g=e,d=t.apply(o,n)}function S(t){var n=t-h;return void 0===h||n>=e||n<0||p&&t-g>=u}function y(){var t=i();if(S(t))return _(t);f=setTimeout(y,function(t){var n=e-(t-h);return p?a(n,u-(t-g)):n}(t))}function _(t){return f=void 0,v&&c?w(t):(c=s=void 0,d)}function b(){var t=i(),n=S(t);if(c=arguments,s=this,h=t,n){if(void 0===f)return function(t){return g=t,f=setTimeout(y,e),m?w(t):d}(h);if(p)return clearTimeout(f),f=setTimeout(y,e),w(h)}return void 0===f&&(f=setTimeout(y,e)),d}return e=r(e)||0,o(n)&&(m=!!n.leading,u=(p="maxWait"in n)?l(r(n.maxWait)||0,e):u,v="trailing"in n?!!n.trailing:v),b.cancel=function(){void 0!==f&&clearTimeout(f),g=0,c=h=s=f=void 0},b.flush=function(){return void 0===f?d:_(i())},b}},4567:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},9248:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},184:function(t,e,n){var o=n(2022),i=n(9248);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==o(t)}},4378:function(t,e,n){var o=n(4759);t.exports=function(){return o.Date.now()}},2588:function(t,e,n){var o=n(6914),i=n(4567),r=n(184),l=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(r(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=o(t);var n=a.test(t);return n||c.test(t)?s(t.slice(2),n?2:8):l.test(t)?NaN:+t}},2089:function(t,e,n){"use strict";n.d(e,{Ak:function(){return o}});let o=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"")}}}]);