(()=>{"use strict";var t={548:(t,i,e)=>{function o(t,i){if(!t||!i)return!1;let e;t.includes("://")||(t=`http://${t}`);try{e=new URL(t).hostname}catch(i){return console.error(`${i.message} (while parsing ${t})`),!1}return e===i||e.endsWith(`.${i}`)}function s(t){return"home_carousel"===t.pageType&&o(t.source,"equatorcoffees.com")}function r(){var t;return o(null===(t=window.location)||void 0===t?void 0:t.hostname,"dell.com")}function n(t){return!1}e.d(i,{L_:()=>n,PN:()=>r,dG:()=>s,e$:()=>o})},404:(t,i,e)=>{e.d(i,{E8:()=>h,Xi:()=>a,Ab:()=>n});var o=e(548);function s(t,i,e){return null!=e&&""!==e?`${t}&${i}=${e}`:t}const r={shopify:"shopify_json",wc:"wc",hospitality:"hospitality_json",ecommerce:"ecommerce"};function n(t){t.entryPoint=r[t.vertical]}function d(t){return"ecommerce"===t.vertical||(0,o.e$)(t.source,"siebert-realty.com")||(0,o.e$)(t.source,"grandcaymanvillas.com")||(0,o.dG)(t)}function a(){return"https://tr.aidaptive.com/"}function c(t){let i=`?host_name=${t.hostname}`;return i=s(i,"cid",t.cid),i}function l(t){let i=`?source=${encodeURIComponent(t.source)}`;return i=s(i,"cid",t.cid),i}class h{constructor(t){this.apiRoot=t}getRecoEndPoint(t){return function(t,i){let e;return d(t)&&!i?(e="https://miner-serving.aidaptive.com/api/v2/aidaptive_serving/recommend",e+=c(t),e=s(e,"full_url",t.fullUrl),(0,o.dG)(t)&&(e=s(e,"service","searchendising"))):e=`https://de.aidaptive.com/dynamic_experience/${r[t.vertical]}${l(t)}`,t.shopifyDomain&&(e=s(e,"shopify_domain",t.shopifyDomain)),e}(this.apiRoot.collectedIds,t)}isRecoEndPointOnMiner(){return d(this.apiRoot.collectedIds)}getSearchEndPoint(){return function(t){const i="https://search.aidaptive.com/";let e;return e="ecommerce"===t.vertical||"shopify"===t.vertical?`${i}dynamic_search/ecommerce/search${l(t)}`:"hospitality"===t.vertical?`${i}dynamic_search/hospitality/search${l(t)}`:`${i}dynamic_search/${r[t.vertical]}${l(t)}`,t.shopifyDomain&&(e=s(e,"shopify_domain",t.shopifyDomain)),e}(this.apiRoot.collectedIds)}getSearchPagesEndPoint(){return function(t){"ecommerce"!==t.vertical&&"shopify"!==t.vertical&&console.error("vertical:",t.vertical);const i="https://search.aidaptive.com/";let e;return e="shopify"===t.vertical?`${i}dynamic_search/shopify_doc_json${l(t)}`:`${i}dynamic_search/ecommerce/pages${l(t)}`,e=s(e,"shopify_domain",t.shopifyDomain),e}(this.apiRoot.collectedIds)}getSearchFiltersEndPoint(){return function(t){const i="https://search.aidaptive.com/";return"ecommerce"===t.vertical||"shopify"===t.vertical?`${i}dynamic_search/ecommerce/display_json${l(t)}`:`${i}dynamic_search/display_json${l(t)}`}(this.apiRoot.collectedIds)}getAutoSuggestEndPoint(){return`https://search.aidaptive.com/dynamic_search/ecommerce/autosuggest${l(this.apiRoot.collectedIds)}`}getHospitalityPricingEndPoint(){return"hospitality"!==(t=this.apiRoot.collectedIds).vertical&&console.error("vertical:",t.vertical),`https://api.aidaptive.com/hospitality_pricing/prices${l(t)}`;var t}getShopifyOptOutEndPoint(){return(t=this.apiRoot.collectedIds).source?`https://api.aidaptive.com/shopify_opt_out${l(t)}`:"";var t}getCollectionDataEndpoint(){return`https://miner.aidaptive.com/api/v2/categories/list${c(this.apiRoot.collectedIds)}`}getTrackingBaseUrl(){return"https://tr.aidaptive.com/"}getTrackingRecordEndPoint(t){return`https://tr.aidaptive.com/pixel/record${function(t,i){let e=`?type=${t}&source=${encodeURIComponent(i.source)}`;return e=s(e,"cid",i.cid),e}(t,this.apiRoot.collectedIds)}`}}},857:(t,i,e)=>{function o(t,i){t.source=i}function s(t,i){t.hostname=i.replace("www.","")}e.d(i,{R:()=>m});var r=e(404);function n(t,i="personalized_recommendations"){var e;console.error(t);const o=`${(0,r.Xi)()}status_check`,s={domain_name:(null===(e=window.location)||void 0===e?void 0:e.href)||"jarvisml.com",feature_type:i,message:t};fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}function d(t,i,e){return o=this,s=void 0,n=function*(){const o=void 0!==(null==e?void 0:e.maxRetries)?e.maxRetries:1,s={};(null==e?void 0:e.signal)&&(s.signal=e.signal);let r=0,n="";for(;;)try{n="network";const i=yield fetch(t,s);if(!i.ok)throw n=`${i.status} from ${t}`,new Error(n);return n="json",yield i.json()}catch(e){if(!(r{const n=setInterval((()=>{const o=i(),d=Boolean(o);!d&&Date.now()-rthis.fetchGoogleAnalyticsId(t,i+1)),e):t("")}}readGoogleDataStreamId(){const t=document.querySelectorAll("script");let i;for(const e of t)if(e.src.indexOf("googletagmanager.com/gtag")>-1){const t=new URL(e.src),o=new URLSearchParams(t.search);if(i=String(o.get("id")),i&&i.indexOf("G-")>-1){this.googleDataStreamId=i;break}}}callGoogleAnalyticsGetClientId(t){let i=!0;window.ga((()=>{var e;if(!i)return;i=!1;const o=window.ga.getAll();t(null===(e=null==o?void 0:o[0])||void 0===e?void 0:e.get("clientId"))})),i&&setTimeout((()=>{i&&(i=!1,t(""))}),100)}readIdDataFromCookies(){const t=document.cookie.split(";");for(const i of t)if(i.indexOf(" _ga=")>-1&&!this.googleAnalyticsId){const t=i.split(".");t.shift(),t.shift(),this.googleAnalyticsId=t.join(".")}else if(i.indexOf("_jarvis_cid=")>-1){const t=i.split("_jarvis_cid=");t.shift(),t.length>0&&(this.jarvisClientId=t[0],c(this.jarvisClientId))}else if(i.indexOf("__kla_id=")>-1){const t=i.split("__kla_id=");if(t.shift(),t.length>0){const i=atob(t[0]),e=JSON.parse(i);e&&e.$exchange_id&&(this.klaviyoExchangeId=e.$exchange_id)}}else if(i.indexOf("hubspotutk=")>-1){const t=i.split("hubspotutk=");t.shift(),t.length>0&&(this.hubspotUserToken=t[0])}else if(i.indexOf("s_ecid=")>-1){const t=i.split("s_ecid=");if(t.shift(),t.length>0){const i=decodeURI(t[0]).split("MCMID|");i.length>1&&(this.adobeVisitorId=i[1])}}}readOrderIdForWooCommerce(){if(!window.wpmDataLayer)return;const t=document.querySelector(".woocommerce-order-overview__order order strong");t&&t.innerHTML&&(this.orderId=t.innerHTML)}readOrderIdFromSource(){if(this.collectedIds.source.indexOf("microminimus.com/checkout/order-received")>-1){const t=this.collectedIds.source.split("/");t.pop();const i=t.pop();i&&!isNaN(parseInt(i))&&(this.orderId=i)}}readIdsForShopify(){var t,i,e,o,s,r;window.__st&&window.__st.cid&&(this.shopifyId=window.__st.cid),window.Shopify&&window.Shopify.shop&&(this.shopifyDomain=window.Shopify.shop),window.Shopify&&window.Shopify.Checkout&&window.Shopify.Checkout.apiHost&&!window.Shopify.shop&&(this.shopifyDomain=window.Shopify.Checkout.apiHost);let n=null===(i=null===(t=window.ShopifyAnalytics)||void 0===t?void 0:t.meta)||void 0===i?void 0:i.page;if(n&&!n.pageType){const t=null===(e=document.getElementById("shop-js-analytics"))||void 0===e?void 0:e.innerHTML;t&&(n=JSON.parse(t))}if(n&&(n.pageType?this.shopifyPageType=n.pageType:"cart_page"===(null===(o=window.Shopify)||void 0===o?void 0:o.CartType)?this.shopifyPageType="cart":"thank_you"===(null===(r=null===(s=window.Shopify)||void 0===s?void 0:s.Checkout)||void 0===r?void 0:r.page)&&(this.shopifyPageType="thankyou")),window.Shopify&&window.Shopify.checkout&&window.Shopify.checkout.order_id&&(this.shopifyOrderId=window.Shopify.checkout.order_id),window.ShopifyAnalytics&&window.ShopifyAnalytics.meta&&window.ShopifyAnalytics.meta.product){this.shopifyProductId=window.ShopifyAnalytics.meta.product.id,window.ShopifyAnalytics.meta.selectedVariantId&&(this.shopifyVariantId=window.ShopifyAnalytics.meta.selectedVariantId);const t=document.querySelectorAll("button[type=submit]");for(const i of t){const t=i.getAttribute("class")||"";(t.indexOf("add-to-cart")>-1||t.indexOf("addtocart")>-1||t.indexOf("product-form__cart-submit")>-1||t.indexOf("atc-button")>-1)&&i.addEventListener("click",(()=>{this.sendShopifyAddToCartEvent()}))}}}readIdsForWooCommerce(){var t,i,e,o,s,r;if("wc"===this.vertical||"ecommerce"===this.vertical&&window.wpmDataLayer){this.pageType=null===(i=null===(t=window.wpmDataLayer)||void 0===t?void 0:t.shop)||void 0===i?void 0:i.page_type,this.productId=Object.keys((null===(e=window.wpmDataLayer)||void 0===e?void 0:e.products)||{})[0]||"";const n=null===(r=null===(s=null===(o=window.wpmDataLayer)||void 0===o?void 0:o.user)||void 0===s?void 0:s.id)||void 0===r?void 0:r.raw;this.personId=n?String(n):""}else if("ecommerce"===this.vertical&&window.woocommerce_params&&!window.wpmDataLayer){const t=document.querySelector("link[rel='alternate'][type='application/json']");if(t){const i=t.href;if(i.indexOf("/product/")>-1){this.pageType="product";const t=i.split("/product/");t&&2==t.length&&(this.productId=t[1])}}}}readIdsForBigCommerce(){var t,i,e,o;if("ecommerce"===this.vertical&&(window.bcContext||window.BCData)){if(window.bcContext)this.productId=null===(i=null===(t=window.bcContext)||void 0===t?void 0:t.product)||void 0===i?void 0:i.id,this.customerId=null===(o=null===(e=window.bcContext)||void 0===e?void 0:e.customer)||void 0===o?void 0:o.id;else if(window.BCData){const t=document.querySelector('input[name="product_id"]');if(t){this.productId=t.getAttribute("value")||"";const i=document.getElementById("form-action-addToCart");i&&i.addEventListener("click",(()=>{this.sendBigCommerceAddToCartEvent(this.productId)}))}}if(window.aidaptiveOrderId)this.orderId=window.aidaptiveOrderId;else{const t=document.querySelector(".orderConfirmation-section strong");t&&t.innerHTML&&(this.orderId=t.innerHTML)}if(!this.pageType){const t=document.querySelector("[data-page-type]"),i=null==t?void 0:t.getAttribute("data-page-type");i&&(this.pageType=i)}}}readPageTypeForHospitality(){var t;if("hospitality"===this.vertical&&!this.pageType){const i=[],e=document.getElementsByClassName("jarvis-personalized-recommendations");for(const t of e)i.push(t);if(0===e.length){const t=document.getElementById("jarvis-personalized-recommendations");i.push(t)}for(const e of i){this.pageType=(null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.pageType)||"home";break}}}collectLocationData(){"geolocation"in navigator&&(0,l.L_)(this.collectedIds)&&navigator.geolocation.getCurrentPosition((t=>{this.collectedIds.latitude=String(t.coords.latitude),this.collectedIds.longitude=String(t.coords.longitude)}))}overwriteIdsForDebug(){const t=this.apiRoot.scriptParams,i=t.debugSource||"",e=t.debugShopifyDomain||"",r=t.debugExperimentId||"";i&&(o(this.collectedIds,i),s(this.collectedIds,i),this.fullUrl=i),e&&(this.shopifyDomain=e),r&&(this.experimentId=r)}readIdData(){const t=this.apiRoot.scriptParams;var i,e;this.sdkVersion="2024.11.23.9",this.sdkPlatform="web",this.os=this.getOsName(),s(this.collectedIds,window.location.hostname),o(this.collectedIds,`${this.collectedIds.hostname}${window.location.pathname||"/"}${window.location.search||""}`),this.origin=window.location.origin,window.location.search?this.fullUrl=`${this.collectedIds.source}${window.location.search}`:window.location.href&&!window.location.search&&(this.fullUrl=window.location.href),this.collectLocationData(),this.readIdDataFromCookies(),this.jarvisClientId||(this.jarvisClientId=`${i=1e15,e=Number.MAX_SAFE_INTEGER,Math.floor(Math.random()*(e-(i+1))+i)}.${function(){const t=new Date,i=t.getTime()+60*t.getTimezoneOffset()*1e3;return Math.round(i/1e3)}()}.1`,c(this.jarvisClientId)),t.customerId&&"hospitality"===this.vertical&&(this.customerId=t.customerId),this.readIdsForWooCommerce(),this.readIdsForBigCommerce(),this.readPageTypeForHospitality(),this.readIdsForShopify(),this.readOrderIdForWooCommerce(),this.readOrderIdFromSource(),this.readGoogleDataStreamId(),this.readTapCartData(),this.overwriteIdsForDebug(),this.collectedIds.googleAnalyticsId=this.googleAnalyticsId,this.collectedIds.googleDataStreamId=this.googleDataStreamId,this.collectedIds.personId=this.personId,this.collectedIds.shopifyId=this.shopifyId,this.collectedIds.jarvisClientId=this.jarvisClientId,this.collectedIds.hubspotUserToken=this.hubspotUserToken,this.collectedIds.klaviyoExchangeId=this.klaviyoExchangeId,this.collectedIds.customerId=this.customerId,this.collectedIds.adobeVisitorId=this.adobeVisitorId,this.collectedIds.cid=t.cid,this.collectedIds.vertical=this.vertical,this.collectedIds.origin=this.origin,this.collectedIds.fullUrl=this.fullUrl,this.collectedIds.pageType=this.pageType,this.collectedIds.productId=this.productId,this.collectedIds.shopifyDomain=this.shopifyDomain,this.collectedIds.shopifyPageType=this.shopifyPageType,this.collectedIds.shopifyProductId=this.shopifyProductId,this.collectedIds.shopifyOrderId=this.shopifyOrderId,this.collectedIds.orderId=this.orderId,this.collectedIds.shopifyVariantId=this.shopifyVariantId,this.collectedIds.sdkVersion=this.sdkVersion,this.collectedIds.sdkPlatform=this.sdkPlatform,this.collectedIds.jarvisConsentOpt=this.jarvisConsentOpt,this.collectedIds.cartProductsAsUrl=localStorage.getItem(u)||"",this.collectedIds.cartVariantsAsUrl=localStorage.getItem(f)||"",this.collectedIds.experimentId=this.experimentId,this.collectedIds.os=this.os,this.collectedIds.channel=this.channel}sendIdData(){const t=this.collectedIds;let i="";const e={source:t.source,type:"jarvis_id_collection"};return t.sdkVersion&&(e.sdk_version=t.sdkVersion),t.sdkPlatform&&(e.sdk_platform=t.sdkPlatform),t.hostname&&(e.hostname=t.hostname),t.fullUrl&&(e.full_url=t.fullUrl),t.pageType&&(e.page_type=t.pageType),t.latitude&&t.longitude&&(e.lat=t.latitude,e.lon=t.longitude),t.jarvisPixelId&&(i=`${i}&visit_id=${t.jarvisPixelId}`,e.visit_id=t.jarvisPixelId),t.googleAnalyticsId&&(i=`${i}&ga_id=${t.googleAnalyticsId}`,e.ga_id=t.googleAnalyticsId),t.adobeVisitorId&&(i=`${i}&adobe_mid=${t.adobeVisitorId}`,e.adobe_mid=t.adobeVisitorId),t.jarvisClientId&&(e.jarvis_cid=t.jarvisClientId),t.shopifyId&&(i=`${i}&shopify_cid=${t.shopifyId}`,e.shopify_cid=t.shopifyId),t.shopifyDomain&&(i=`${i}&shopify_domain=${t.shopifyDomain}`,e.shopify_domain=t.shopifyDomain),t.shopifyPageType&&(i=`${i}&shopify_page_type=${encodeURIComponent(t.shopifyPageType)}`,e.shopify_page_type=t.shopifyPageType),t.shopifyProductId&&(i=`${i}&shopify_product_id=${t.shopifyProductId}`,e.shopify_product_id=t.shopifyProductId),t.productId&&(i=`${i}&product_id=${t.productId}`,e.product_id=t.productId),t.shopifyOrderId&&(i=`${i}&shopify_order_id=${t.shopifyOrderId}`,e.shopify_order_id=t.shopifyOrderId),t.orderId&&(i=`${i}&order_id=${t.orderId}`,e.order_id=t.orderId),t.shopifyVariantId&&(i=`${i}&shopify_variant_id=${t.shopifyVariantId}`,e.shopify_variant_id=t.shopifyVariantId),t.customerId&&(i=`${i}&customer_id=${t.customerId}`,e.customer_id=t.customerId),t.hubspotUserToken&&(e.hubspot_user_token=t.hubspotUserToken),t.klaviyoExchangeId&&(e.klaviyo_exchange_id=t.klaviyoExchangeId),t.experimentId&&(e.experiment_id=t.experimentId),t.os&&(e.os=t.os),t.channel&&(e.channel=t.channel),this.sendDataToBackend("jarvis_id_collection",i,e)}sendCustomData(t){if(!t||!this.apiRoot.collectedIds)return;let i="";const e=this.apiRoot.collectedIds,o={type:"custom_data_collection"};e&&e.jarvisPixelId&&(i=`${i}&visit_id=${e.jarvisPixelId}`,o.visit_id=e.jarvisPixelId),e&&e.shopifyDomain&&(i=`${i}&shopify_domain=${e.shopifyDomain}`,o.shopify_domain=e.shopifyDomain);for(const[e,s]of Object.entries(t))i=`${i}&${e}=${s}`,o[e]=s;return this.sendDataToBackend("custom_data_collection",i,o)}sendShopifyAddToCartEvent(){var t;if(!window.Shopify||!this.apiRoot.collectedIds)return;let i="";const e=this.apiRoot.collectedIds,o={type:"add_to_cart_event"};e.jarvisPixelId&&(i=`${i}&visit_id=${e.jarvisPixelId}`,o.visit_id=e.jarvisPixelId),e.shopifyDomain&&(i=`${i}&shopify_domain=${e.shopifyDomain}`,o.shopify_domain=e.shopifyDomain);const s=null===(t=window.ShopifyAnalytics)||void 0===t?void 0:t.meta;if(null==s?void 0:s.product){const t=s.product.id;if(i=`${i}&shopify_product_id=${t}`,o.shopify_product_id=t,s.selectedVariantId){const t=s.selectedVariantId;i=`${i}&shopify_variant_id=${t}`,o.shopify_variant_id=t}this.addItemToCart(s.product.id,s.selectedVariantId)}return this.sendDataToBackend("add_to_cart_event",i,o)}sendBigCommerceAddToCartEvent(t){if(!window.BCData||!this.apiRoot.collectedIds||!t)return;const i=this.apiRoot.collectedIds,e=`&cart_item=${t}`,o=Object.assign({type:"add_to_cart_event",cart_item:t},i);return this.sendDataToBackend("add_to_cart_event",e,o)}sendUserEnquiryFormData(t){return h(this,void 0,void 0,(function*(){const i=this.apiRoot.collectedIds,e=Object.assign(Object.assign({},i),{type:"user_enquiry_event",email:t.email,form_type:t.formType});return yield this.sendDataToBackend("user_enquiry_event","",e)}))}sendDataToBackend(t,i,e){return h(this,void 0,void 0,(function*(){try{const o=`${this.apiRoot.endPointSolver.getTrackingRecordEndPoint(t)}${i}`,s=yield fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=yield s.json();this.processVisitIdResponse(r)}catch(i){n(`${t} error: ${i.message}`,t)}}))}processVisitIdResponse(t){(null==t?void 0:t.visit_id)?(this.jarvisPixelId!==t.visit_id&&(console.info("visit_id:",t.visit_id," previous:",this.jarvisPixelId),this.jarvisPixelId=t.visit_id),this.apiRoot.collectedIds&&this.jarvisPixelId!==this.apiRoot.collectedIds.jarvisPixelId&&(console.info("collected visit_id:",this.jarvisPixelId," previous:",this.apiRoot.collectedIds.jarvisPixelId),this.apiRoot.collectedIds.jarvisPixelId=this.jarvisPixelId)):console.error(`pixel/record: ${JSON.stringify(t)}`)}isShopify(){const t=this.apiRoot.scriptParams.vertical;if("shopify"===t)return!0;if(t&&"shopify"!==t)return!1;if(window.Shopify)return!0;for(let t=0;te.product_id===t&&e.variant_id===i)).length>0||(this.cartItems.push({product_id:t,variant_id:i,quantity:1,price:0}),this.cacheCartItems(this.cartItems))}cacheCartItems(t){var i;this.cartItems=t;const e=(null===(i=this.cartItems)||void 0===i?void 0:i.slice(0,5))||[];this.collectedIds.cartProductsAsUrl=this.idListAsUrl("cart_products",e.map((t=>t.product_id))),this.collectedIds.cartVariantsAsUrl=this.idListAsUrl("cart_variants",e.map((t=>t.variant_id))),localStorage.setItem(u,this.collectedIds.cartProductsAsUrl),localStorage.setItem(f,this.collectedIds.cartVariantsAsUrl)}idListAsUrl(t,i){return 0===i.length?"":i.map((t=>encodeURIComponent(t))).join(`&${t}=`)}getOsName(){const t=window.navigator.userAgent;return-1!==t.indexOf("Win")?"Windows":-1!==t.indexOf("Mac")?"MacOS":-1!==t.indexOf("X11")?"UNIX":-1!==t.indexOf("Linux")?"Linux":/Android/.test(t)?"Android":/iPhone|iPad|iPod/.test(t)?"iOS":""}fetchCartItems(){return h(this,void 0,void 0,(function*(){let t=[];switch(this.vertical){case"shopify":t=window.Tapcart?this.readTapCartItems():yield this.fetchShopifyCart();break;case"ecommerce":window.BCData?t=yield this.fetchBigCommerceCart():window.wpmDataLayer&&(t=yield this.fetchWooCommerceCart())}this.cacheCartItems(t)}))}readTapCartItems(){var t,i;if(!this.origin)return[];const e=null===(i=null===(t=window.Tapcart)||void 0===t?void 0:t.variables)||void 0===i?void 0:i.cart;if(!(null==e?void 0:e.items))return[];const o=[];for(const t of e.items)t.productId&&t.variantId&&t.quantity&&o.push({product_id:t.productId,variant_id:t.variantId,quantity:t.quantity,price:0});return o}fetchShopifyCart(){return h(this,void 0,void 0,(function*(){if(!this.origin)return[];const t=yield d(`${this.origin}/cart.js`,(t=>{n(`getShopifyCart: ${t.message}`,"id_collection")}));if(!(null==t?void 0:t.items))return[];const i=[];for(const e of t.items)e.product_id&&e.variant_id&&e.quantity&&e.final_price&&i.push({product_id:e.product_id,variant_id:e.variant_id,quantity:e.quantity,price:e.final_price});return i}))}fetchBigCommerceCart(){return h(this,void 0,void 0,(function*(){if(!this.origin)return[];const t=yield d(`${this.origin}/api/storefront/carts`,(t=>{n(`getBigCommerceCart: ${t.message}`,"id_collection")}));if(!(null==t?void 0:t.length))return[];const i=[];for(const e of t){if(!e.lineItems||!e.lineItems.physicalItems)continue;const t=e.lineItems.physicalItems;for(const e of t)e.productId&&e.variantId&&e.quantity&&e.listPrice&&i.push({product_id:e.productId,variant_id:e.variantId,quantity:e.quantity,price:e.listPrice})}return i}))}fetchWooCommerceCart(){return h(this,void 0,void 0,(function*(){if(!window.wpmDataLayer.cart)return[];try{const t=[];for(const i in window.wpmDataLayer.cart){const e=window.wpmDataLayer.cart[i];e.id&&e.quantity&&e.price&&t.push({product_id:e.id,variant_id:e.variantId||"",quantity:e.quantity,price:e.price})}return t}catch(t){return n(`getWooCommerceCart: ${t.message}`,"id_collection"),[]}}))}readTapCartData(){var t;const i=null===(t=null===window||void 0===window?void 0:window.Tapcart)||void 0===t?void 0:t.variables;i&&(this.shopifyPageType||(i.product?this.shopifyPageType="product":i.collection?this.shopifyPageType="collection":this.shopifyPageType="home"),!this.shopifyProductId&&i.product&&i.product.id&&(this.shopifyProductId=i.product.id),!this.shopifyVariantId&&i.product&&i.product.selectedVariant&&i.product.selectedVariant.id&&(this.shopifyVariantId=i.product.selectedVariant.id),this.channel="mobile_app")}collectIds(){return h(this,void 0,void 0,(function*(){const t=[];if(t.push(new Promise((t=>{this.fetchGoogleAnalyticsId((i=>{this.googleAnalyticsId=i,t()}))}))),this.isShopify()){if(this.vertical="shopify",!window.Shopify||!window.ShopifyAnalytics){const i=2e3;t.push(a("Shopify",(()=>window.Shopify&&window.ShopifyAnalytics),i))}}else if(this.isWooCommerce())this.vertical="wc",window.wpmDataLayer||t.push(a("WooCommerce",(()=>window.wpmDataLayer),1e4));else if(this.isECommerce()){this.vertical="ecommerce";const i=(0,l.PN)();window.wpmDataLayer&&window.bcContext&&window.BCData||i||t.push(a("WooCommerce or Big Commerce",(()=>window.wpmDataLayer||window.bcContext||window.BCData),2e3))}else this.vertical="hospitality";return yield Promise.all(t),this.readIdData(),this.fetchCartItems(),this.collectedIds}))}}},822:(t,i,e)=>{var o=e(404);var s=e(857),r=function(t,i,e,o){return new(e||(e=Promise))((function(s,r){function n(t){try{a(o.next(t))}catch(t){r(t)}}function d(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(n,d)}a((o=o.apply(t,i||[])).next())}))};let n=s.R;function d(t){return r(this,void 0,void 0,(function*(){const i=function(t,i){const e={scriptParams:t};return function(t,i){if(t.collectedIds)throw new Error("collectedIds already created");window.JarvisMlSdk=t,window.JarvisML=t,t.collectedIds={},t.endPointSolver=new o.E8(t),t.idCollection=new i(t),t.sendCustomData=i=>t.idCollection.sendCustomData(i),t.sendShopifyAddToCartEvent=()=>t.idCollection.sendShopifyAddToCartEvent()}(e,i),e}(t,n);yield i.idCollection.collectIds(),(0,o.Ab)(i.collectedIds),i.idCollection.sendIdData()}))}!function(){const t={},i=document.currentScript;if(null==i?void 0:i.src){const e=new URL(i.src);t.cid=e.searchParams.get("cid")||"",t.customerId=e.searchParams.get("customer_id")||"",t.debugSource=e.searchParams.get("debug_source")||"",t.vertical=e.searchParams.get("vertical")||"",t.debugShopifyDomain=e.searchParams.get("debug_shopify_domain")||"",t.debugExperimentId=e.searchParams.get("debug_experiment_id")||""}["complete","loaded","interactive"].indexOf(document.readyState)>=0?d(t):document.addEventListener("DOMContentLoaded",(()=>{d(t)}))}()}},i={};function e(o){var s=i[o];if(void 0!==s)return s.exports;var r=i[o]={exports:{}};return t[o](r,r.exports,e),r.exports}e.d=(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e(822),e(857)})();