!function(){"use strict";var e={9414:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EcommerceIntegration=t.PSEUDO_PAGE_EVENTS=t.TEST_PRODUCT_ADDED_TO_CART_SERVER_CHANGELOG=t.CHECKOUT_ONE_PAGE_VIEW=t.CHECKOUT_PAYMENT_STEP_STARTED=t.CHECKOUT_SHIPPING_INFO_SUBMITTED=t.CHECKOUT_SHIPPING_STEP_STARTED=t.CHECKOUT_ADDRESS_INFO_SUBMITTED=t.CHECKOUT_CONTACT_INFO_SUBMITTED=t.CHECKOUT_CONTACT_STEP_STARTED=t.ANALYTICS_ADDED_PAYMENT=t.ANALYTICS_PERFORMED_SEARCH=t.ANALYTICS_STARTED_ORDER_ONCE_PER_CHECKOUT=t.ANALYTICS_STARTED_ORDER=t.ANALYTICS_COMPLETED_ORDER=t.ANALYTICS_ADDED_PRODUCT_NEXT=t.ANALYTICS_ADDED_PRODUCT=t.ANALYTICS_VIEWED_PRODUCT_CATEGORY=t.ANALYTICS_VIEWED_PRODUCT=t.ANALYTICS_PAGE_VIEW=t.ANALYTICS_GENERIC_EVENT=t.analyticsEvents=void 0;var i=n(6573),a=n(9974),s=n(357),c=n(8416),u=n(1482);t.analyticsEvents={viewedProduct:/^[ _]?viewed[ _]?product[ _]?$/i,viewedProductCategory:/^[ _]?viewed[ _]?product[ _]?category[ _]?$/i,viewedProductVariant:/^[ _]?viewed[ _]?product[ _]?variant[ _]?$/i,addedProduct:/^[ _]?added[ _]?product[ _]?$/i,addedProductNext:/^[ _]?added[ _]?product[ _]?next[ _]?$/i,addedProductPermalinkTest:/^[ _]?added[ _]?product[ _]?permalink[ _]?test[ _]?$/i,completedOrder:/^[ _]?completed[ _]?order[ _]?$/i,startedOrder:/^[ _]?started[ _]?order[ _]?$/i,startedOrderRemote:/^[ _]?started[ _]?order[ _]?remote[ _]?$/i,startedOrderOncePerCheckout:/^[ _]?started[ _]?order[ _]?once[ _]?per[ _]?checkout[ _]?$/i,startedOrderOncePerCheckoutRemote:/^[ _]?started[ _]?order[ _]?once[ _]?per[ _]?checkout[ _]?remote[ _]?$/i,performedSearch:/^[ _]?performed[ _]?search[ _]?$/i,addedPayment:/^[ _]?added[ _]?payment[ _]?$/i,addedPaymentRemote:/^[ _]?added[ _]?payment[ _]?remote[ _]?$/i,checkoutContactStepStarted:/^[ _]?checkout[ _]?[ _]?contact[ _]?step[ _]?started[ _]?$/i,checkoutContactInfoSubmitted:/^[ _]?checkout[ _]?[ _]?contact[ _]?info[ _]?submitted[ _]?$/i,checkoutContactInfoSubmittedRemote:/^[ _]?checkout[ _]?[ _]?contact[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,checkoutAddressInfoSubmitted:/^[ _]?checkout[ _]?[ _]?address[ _]?info[ _]?submitted[ _]?$/i,checkoutAddressInfoSubmittedRemote:/^[ _]?checkout[ _]?[ _]?address[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,checkoutShippingStepStarted:/^[ _]?checkout[ _]?[ _]?shipping[ _]?step[ _]?started[ _]?$/i,checkoutShippingInfoSubmitted:/^[ _]?checkout[ _]?[ _]?shipping[ _]?info[ _]?submitted[ _]?$/i,checkoutShippingInfoSubmittedRemote:/^[ _]?checkout[ _]?[ _]?shipping[ _]?info[ _]?submitted[ _]?remote[ _]?$/i,checkoutPaymentStepStarted:/^[ _]?checkout[ _]?[ _]?payment[ _]?step[ _]?started[ _]?$/i,checkoutOnePageView:/^[ _]?checkout[ _]?[ _]?one[ _]?page[ _]?view[ _]?$/i,testProductAddedToCartServerChangelog:/^test[ _]?product[ _]?added[ _]?to[ _]?cart[ _]?server[ _]?changelog$/i},t.ANALYTICS_GENERIC_EVENT="genericEvent",t.ANALYTICS_PAGE_VIEW="pageView",t.ANALYTICS_VIEWED_PRODUCT="viewedProduct",t.ANALYTICS_VIEWED_PRODUCT_CATEGORY="viewedProductCategory",t.ANALYTICS_ADDED_PRODUCT="addedProduct",t.ANALYTICS_ADDED_PRODUCT_NEXT="addedProductNext",t.ANALYTICS_COMPLETED_ORDER="completedOrder",t.ANALYTICS_STARTED_ORDER="startedOrder",t.ANALYTICS_STARTED_ORDER_ONCE_PER_CHECKOUT="startedOrderOncePerCheckout",t.ANALYTICS_PERFORMED_SEARCH="performedSearch",t.ANALYTICS_ADDED_PAYMENT="addedPayment",t.CHECKOUT_CONTACT_STEP_STARTED="checkoutContactStepStarted",t.CHECKOUT_CONTACT_INFO_SUBMITTED="checkoutContactInfoSubmitted",t.CHECKOUT_ADDRESS_INFO_SUBMITTED="checkoutAddressInfoSubmitted",t.CHECKOUT_SHIPPING_STEP_STARTED="checkoutShippingStepStarted",t.CHECKOUT_SHIPPING_INFO_SUBMITTED="checkoutShippingInfoSubmitted",t.CHECKOUT_PAYMENT_STEP_STARTED="checkoutPaymentStepStarted",t.CHECKOUT_ONE_PAGE_VIEW="checkoutOnePageView",t.TEST_PRODUCT_ADDED_TO_CART_SERVER_CHANGELOG="testProductAddedToCartServerChangelog",t.PSEUDO_PAGE_EVENTS=[t.CHECKOUT_CONTACT_STEP_STARTED,t.CHECKOUT_SHIPPING_STEP_STARTED,t.CHECKOUT_PAYMENT_STEP_STARTED,t.CHECKOUT_ONE_PAGE_VIEW];var l=function(e){function n(t,n,o){var r=e.call(this,t,n,o)||this;return r.wrapTrack(),r.setPixelStub(),r}return r(n,e),n.prototype.wrapTrack=function(){var e=this.track;this.track=function(n){var o=n.event,r=!1;for(var i in t.analyticsEvents){var a=t.analyticsEvents[i];if(this[i]&&a.test(o)){this[i].apply(this,[n]),r=!0;break}}r||e.apply(this,Array.prototype.slice.call(arguments))}},n.prototype.addMonorailBatchEvent=function(e){if(s.default.appName&&s.default.appName in u.appNameToEcommerceEventSchemaId){var t=this.getEcommercePixelIds();i.addBatchEvent({schemaId:e.schemaId?e.schemaId:u.appNameToEcommerceEventSchemaId[s.default.appName],payload:a.objectAssignFilterUndefined({shop_id:s.default.shopId,partner_name:this.getEcommerceMetricsTag(),event_name:e.eventName,unique_token:s.default.uniqToken,visit_token:s.default.visitToken,integration_id:this.getIntegrationId()},{pixel_id:t&&t.length>0?t[0]:void 0,event_properties:e.eventProperties,checkout_token:s.default.checkoutToken,event_id:e.eventId})})}},n}(c.Integration);t.EcommerceIntegration=l},8416:function(e,t,n){var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&this.deferedEvents.forEach((function(e,n,r){var i=e[0],a=e[1];r.delete(n),t.callEvent(i,o(o({},a),{emittedAsync:!0}))})))},e.prototype.emitEventOrAwaitConsent=function(e,t){this.hasConsent()?this.callEvent(e,t):this.deferedEvents.add([e,t])},e.prototype.callEvent=function(e,t){switch(e){case"page":this.page(t);break;case"track":this.track(t)}},e.prototype.checkoutOnePageView=function(e){if(e.properties.hasOwnProperty("page")){var t=e.properties;this.page(t.page)}},e.flatten=function(e){var t=o({},e);return t.properties={},o(o({},t),e.properties)},e.isEqual=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0},e}();t.Integration=a},1482:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.extractSchemaIdFromEventName=t.buyWithPrimePresenceSchemaId=t.trekkieAssetContextSchemaId=t.customStorefrontAnalyticsSchemaId=t.storefrontAnalyticsSchemaIdValidation=t.storefrontAnalyticsSchemaIdV5=t.legacyStorefrontAnalyticsSchemaId=t.appNameToEcommerceEventSchemaId=t.appNameToPageViewSchemaId=void 0,t.appNameToPageViewSchemaId={admin:"trekkie_admin_page_view/1.0",appstore:"trekkie_appstore_page_view/1.2",blog:"trekkie_blog_page_view/1.2",brochure:"trekkie_brochure_page_view/1.3","collabs-merchants":"trekkie_collabs_merchants_page_view/1.0","compass-web":"trekkie_compass_web_page_view/1.2",creators:"trekkie_creators_page_view/2.0",delivery_app:"trekkie_delivery_app_page_view/1.0",docs:"trekkie_docs_page_view/1.2",development:"edge_test/1.0",exchange:"trekkie_exchange_page_view/1.2",experts:"trekkie_experts_page_view/1.0",handshake:"trekkie_handshake_page_view/1.0",fakestore:"trekkie_fakestore_page_view/1.0",identity:"trekkie_identity_page_view/1.2",linkpop:"trekkie_linkpop_page_view/2.0","marketing-misc":"trekkie_marketing_misc_page_view/1.2","oberlo-home":"trekkie_oberlo_home_page_view/1.3",opinions:"trekkie_opinions_page_view/1.2",partners:"trekkie_partners_page_view/1.2","shopify-ping-web":"trekkie_shopify_ping_web_page_view/1.0",portal:"trekkie_portal_page_view/1.0",testing:"edge_test/1.0",themestore:"trekkie_themestore_page_view/1.2","services-db":"trekkie_services_db_page_view/1.0"},t.appNameToEcommerceEventSchemaId={storefront:"trekkie_storefront_ecommerce_event_emit/4.0",checkout:"trekkie_checkout_ecommerce_event_emit/4.0",test:"edge_test_ecommerce_event_emit/1.0"},t.legacyStorefrontAnalyticsSchemaId="storefront_customer_tracking/4.30",t.storefrontAnalyticsSchemaIdV5="storefront_customer_tracking/5.11",t.storefrontAnalyticsSchemaIdValidation="storefront_customer_tracking_validation/1.0",t.customStorefrontAnalyticsSchemaId="custom_storefront_customer_tracking/1.8",t.trekkieAssetContextSchemaId="trekkie_asset_context/1.3",t.buyWithPrimePresenceSchemaId="storefront_buy_with_prime_presence/1.0",t.extractSchemaIdFromEventName=function(e){var t=e.toLowerCase();if(0===t.lastIndexOf("monorail://")&&t.length>11)return t.substr(11)}},9965:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ConsentValuesV2=t.IntegrationTypes=t.ConsentPurposes=void 0;var o=n(2271);Object.defineProperty(t,"ConsentPurposes",{enumerable:!0,get:function(){return o.ConsentKeys}});var r,i=n(4842);Object.defineProperty(t,"IntegrationTypes",{enumerable:!0,get:function(){return i.IntegrationTypes}}),(r=t.ConsentValuesV2||(t.ConsentValuesV2={})).NO_VALUE="",r.ACCEPTED="1",r.DECLINED="0"},4842:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationTypes=void 0,(n=t.IntegrationTypes||(t.IntegrationTypes={})).ECOMMERCE="EcommerceIntegration",n.INTEGRATION="Integration"},3988:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n2&&(c.line_number=d[1],c.column_number=d[2],parseInt(c.line_number,10)>1e5))return}this.sendObserveXhr(n,u,l,c,s,r,i,e.app_config,e.notes)}}},6573:function(e,t,n){var o=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t10?{stringValue:"[max depth exceeded]"}:null==e?{stringValue:String(e)}:"string"==typeof e?{stringValue:e}:"number"==typeof e?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"==typeof e?{boolValue:e}:Array.isArray(e)?{arrayValue:{values:e.map((function(e){return i(e,t+1)}))}}:"object"==typeof e?{kvlistValue:{values:Object.entries(e).map((function(e){return{key:e[0],value:i(e[1],t+1)}}))}}:{stringValue:String(e)}}var a=function(){function e(e){this.pendingMetrics=[],this.pendingLogs=[],this.exporter=e,this.boundFlush=this.flush.bind(this),this.setupPageUnloadHandler()}return e.prototype.setupPageUnloadHandler=function(){window.addEventListener("pagehide",this.boundFlush)},e.prototype.scheduleFlush=function(){void 0===this.flushTimeoutId&&(this.flushTimeoutId=setTimeout(this.boundFlush,500))},e.prototype.counter=function(e){var t=e.name,n=e.value,o=e.unit,i=e.attributes;this.pendingMetrics.length>=1e3&&this.flush();var a=1e6*(new Date).getTime();this.pendingMetrics.push({name:t,unit:o||"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:n,startTimeUnixNano:a,timeUnixNano:a,attributes:r(null!=i?i:{})}]}}),this.scheduleFlush()},e.prototype.log=function(e){var t=e.message,n=e.severity,a=e.severityText,s=e.attributes;this.pendingLogs.length>=1e3&&this.flush();var c=1e6*(new Date).getTime();this.pendingLogs.push({timeUnixNano:c,observedTimeUnixNano:c,severityNumber:null!=n?n:o.SeverityNumber.INFO,severityText:a,body:i(t),attributes:r(null!=s?s:{})}),this.scheduleFlush()},e.prototype.flush=function(){void 0!==this.flushTimeoutId&&(clearTimeout(this.flushTimeoutId),this.flushTimeoutId=void 0);var e=!0,t=!0;if(this.pendingMetrics.length>0){var n=this.pendingMetrics;this.pendingMetrics=[],e=this.exporter.exportMetrics(n)}if(this.pendingLogs.length>0){var o=this.pendingLogs;this.pendingLogs=[],t=this.exporter.exportLogs(o)}return e&&t},e.prototype.destroy=function(){window.removeEventListener("pagehide",this.boundFlush),void 0!==this.flushTimeoutId&&(clearTimeout(this.flushTimeoutId),this.flushTimeoutId=void 0)},e}();t.OTelClient=a},8218:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.OTelExporter=void 0;var o=n(9974),r="trekkie-otel",i="1.0.0",a=function(){function e(e,t){this.baseUrl=e.replace(/\/v1\/(metrics|logs)\/?$/,""),this.serviceName=t}return e.prototype.exportMetrics=function(e){var t={resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:r,version:i,attributes:[]},metrics:e}]}]},n=new Blob([JSON.stringify(t)],{type:"application/json"});return!!o.isSendBeaconSupported()&&navigator.sendBeacon(this.baseUrl+"/v1/metrics",n)},e.prototype.exportLogs=function(e){var t={resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeLogs:[{scope:{name:r,version:i,attributes:[]},logRecords:e}]}]},n=new Blob([JSON.stringify(t)],{type:"application/json"});return!!o.isSendBeaconSupported()&&navigator.sendBeacon(this.baseUrl+"/v1/logs",n)},e}();t.OTelExporter=a},4689:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createOtelClient=void 0;var o=n(4052),r=n(8218);t.createOtelClient=function(){var e=new r.OTelExporter("https://otlp-http-production.shopifysvc.com","trekkie");return new o.OTelClient(e)}},7179:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SeverityNumber=t.OTelExporter=t.OTelClient=t.otelClient=void 0;var o=n(4689);t.otelClient=o.createOtelClient();var r=n(4052);Object.defineProperty(t,"OTelClient",{enumerable:!0,get:function(){return r.OTelClient}});var i=n(8218);Object.defineProperty(t,"OTelExporter",{enumerable:!0,get:function(){return i.OTelExporter}});var a=n(6366);Object.defineProperty(t,"SeverityNumber",{enumerable:!0,get:function(){return a.SeverityNumber}})},6366:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SeverityNumber=void 0,(n=t.SeverityNumber||(t.SeverityNumber={}))[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TRACE=1]="TRACE",n[n.TRACE2=2]="TRACE2",n[n.TRACE3=3]="TRACE3",n[n.TRACE4=4]="TRACE4",n[n.DEBUG=5]="DEBUG",n[n.DEBUG2=6]="DEBUG2",n[n.DEBUG3=7]="DEBUG3",n[n.DEBUG4=8]="DEBUG4",n[n.INFO=9]="INFO",n[n.INFO2=10]="INFO2",n[n.INFO3=11]="INFO3",n[n.INFO4=12]="INFO4",n[n.WARN=13]="WARN",n[n.WARN2=14]="WARN2",n[n.WARN3=15]="WARN3",n[n.WARN4=16]="WARN4",n[n.ERROR=17]="ERROR",n[n.ERROR2=18]="ERROR2",n[n.ERROR3=19]="ERROR3",n[n.ERROR4=20]="ERROR4",n[n.FATAL=21]="FATAL",n[n.FATAL2=22]="FATAL2",n[n.FATAL3=23]="FATAL3",n[n.FATAL4=24]="FATAL4"},7956:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getRemoteEventName=t.isRemoteProduct=void 0;var o=n(5263);t.isRemoteProduct=function(e){var t;if(null==e||"object"!=typeof e)return!1;if("remote"in e&&"boolean"==typeof e.remote)return e.remote;if(null===(t=e)||void 0===t?void 0:t.variantId){var n=o.getProductFromMeta(e.variantId);if(n&&"remote"in n&&"boolean"==typeof n.remote)return n.remote}return!1},t.getRemoteEventName=function(e){return"remote_"+e}},6848:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestId=void 0;var o=n(2729),r={page_rendered:"z",product_page_rendered:"x",collection_page_rendered:"c",search_submitted:"b"};function i(e,t){if(r[t])return"ri-"+function(e){for(var t=e.replace(/-/g,""),n=[],o=0;o>>0},e.prototype.createKey=function(e,t,n){return e+":"+t+":"+this.hashString(n)},e.prototype.add=function(e){if(!r.some((function(t){return e.stack.includes(t)}))){var t=this.createKey(e.operation,e.property,e.stack);this.flushedKeys.has(t)||(this.queue.set(t,e),this.config.maxQueueSize&&this.queue.size>=this.config.maxQueueSize&&this.flush())}},e.prototype.limitFlushedKeysSize=function(){if(this.flushedKeys.size>this.config.maxFlushedKeysSize)for(var e=this.flushedKeys.size-this.config.maxFlushedKeysSize,t=this.flushedKeys.values(),n=0;n=100||100*Math.random()>>0;try{t=performance.now()>>>0}catch(e){t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}t.UniqueIdManager=u,t.buildToken=l,t.hexTime=d},161:function(e,t,n){var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;nv?{value:a,status:"expired",convention:o,expiration:v}:{value:a,status:p(a)?"valid":"invalid",convention:o,expiration:v}}function h(e){try{return i.read("y"===e?"_shopify_y":"_shopify_s",{raw:!0})}catch(e){return}}function y(e){return null==e?void 0:e.toLowerCase()}function m(e,t,n){if(!e)return"api_missing";var o=y(e),r=o===y(t),i=o===y(n);return r&&i?"meta_and_cookie":r?"meta":i?"cookie":"neither"}function g(e){return e<1e3?"lt_1s":e<1e4?"1_10s":e<6e4?"10_60s":e<3e5?"1_5m":e<9e5?"5_15m":e<18e5?"15_30m":e<36e5?"30_60m":"gte_60m"}function E(e,t,n,o,r,i,l,d){try{a.otelClient.counter({name:"trekkie_tracking_identifier_validation",value:1,attributes:{identifier:e,surface:t?"checkout":"storefront",authoritative_api_read_enabled:!0,tracking_allowed:n,metadata_status:o.status,cookie_status:v(r),api_status:(f=i,f?f===s?"disallowed":f===c?"placeholder":f===u?"disabled":p(f)?"valid":"invalid":"missing"),api_relationship:m(i,o.value,r),tracking_allowed_transition_observed:l,page_age:d,consent_api_version:"0.2.115"}})}catch(e){}var f}var T=function(){function e(){this.pageStartedAt=(new Date).getTime()}return e.prototype.observeTrackingAllowed=function(e){this.trackingAllowed=e},e.prototype.markTrackingAllowedTransition=function(e){void 0!==this.trackingAllowed&&this.trackingAllowed!==e&&(this.transitionAt=(new Date).getTime()),this.trackingAllowed=e},e.prototype.collect=function(e,t,n,r,i,a){if(!n)return function(e){try{var t=e?d("serialized-shopifyY"):l("shopify-y"),n=e?d("serialized-shopifyS"):l("shopify-s");return o(o({},t?{unique_token_from_consent_api:t}:{}),n?{deprecated_visit_token_from_consent_api:n}:{})}catch(e){return{}}}(e);var s=h("y"),c=h("s"),u=o(o({},i?{unique_token_from_consent_api:i}:{}),a?{deprecated_visit_token_from_consent_api:a}:{});if(!r)return u;var f=_("y",e),p=_("s",e),y=function(e){return e?d("serialized-trackingTokenRenderId"):l("tracking-token-render-id")}(e),m=(new Date).getTime(),T=g(m-this.pageStartedAt),S=void 0!==this.transitionAt;return E("y",e,t,f,s,i,S,T),E("s",e,t,p,c,a,S,T),o(o(o(o(o(o(o(o(o(o(o({},u),{ti_cv:"0.2.115"}),f.value?{ti_y_m:f.value}:{}),p.value?{ti_s_m:p.value}:{}),s?{ti_y_c:s}:{}),c?{ti_s_c:c}:{}),{ti_y_cs:v(s),ti_s_cs:v(c),ti_y_ms:f.status,ti_s_ms:p.status}),y?{ti_rid:y}:{}),{ti_t:S}),void 0!==this.transitionAt?{ti_t_age:g(m-this.transitionAt)}:{}),{ti_pa:T})},e}();t.TrackingIdentifierTelemetry=T},9974:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isSendBeaconSupported=t.isPseudoPageEvent=t.canonical=t.isUnstableBrowserVersion=t.UNSTABLE_BROWSER_VERSION_SET=t.objectAssignFilterUndefined=void 0;var o=n(2164),r=n(9414),i=n(8533),a=/^https?:\/\//;t.objectAssignFilterUndefined=function(e,t){for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e},t.UNSTABLE_BROWSER_VERSION_SET=new Set(["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134"]),t.isUnstableBrowserVersion=function(){return t.UNSTABLE_BROWSER_VERSION_SET.has(o.virtualWindow().userAgent())},t.canonical=function(){for(var e=i.virtualDocument().getElementsByTagName("link"),t=0;t0?null===(s=null==l?void 0:l.variants[0])||void 0===s?void 0:s.id:void 0,p=(null===(u=null===(c=window.ShopifyAnalytics)||void 0===c?void 0:c.meta)||void 0===u?void 0:u.selectedVariantId)||f,_={schemaId:d.buyWithPrimePresenceSchemaId,payload:o(o(o({shop_id:r},e.data&&{event_message:e.data}),l&&{product_id:l.id}),p&&{product_variant_id:Number(p)})};a.produce([_])}}catch(e){v.reportError("buyWithPrimeError",e)}}))},e.prototype.getNavigationType=function(){try{var e="PerformanceNavigationTiming",t=f.getNavigationTypeExperimental();return t||(t=f.getNavigationTypeLegacy(),e="performance.navigation"),t?{navigationType:t,navigationApi:e}:{navigationType:"unknown",navigationApi:"unknown"}}catch(e){s.reportError("navigation_api_error",e)}return{navigationType:"error",navigationApi:"error"}},e.prototype.initialize=function(e,t,n){this.loadIntegrations(e,t,n)},e.prototype.getS2SEventId=function(e,t,n){var o,r,i,a;void 0===e&&(e=void 0),void 0===t&&(t={});var s={navigationApi:this.navigationInfo.navigationApi,navigationType:this.navigationInfo.navigationType},c="Added Product Next"===e?"Added Product":e,u=h.WebPixelEventNameMap[c];try{if("product_added_to_cart"===u&&(null===(o=window.Shopify)||void 0===o?void 0:o.evids)){var d=function(e){if(e.productId&&e.variantId)return e.productId.toString()+"-"+e.variantId.toString()}(t),f=null!==(r=C[e])&&void 0!==r?r:C.default;a=window.Shopify.evids(u,{analyticsFramework:f,cacheKey:d})}else a="checkout_completed"===u&&n?n:(null===(i=window.Shopify)||void 0===i?void 0:i.evids)&&u?window.Shopify.evids(u,{analyticsFramework:"trekkie"}):l.buildToken()}catch(e){a=l.buildToken()}return{s2sMetadata:s,eventId:"string"==typeof a&&a.length>0?a:l.buildToken()}},e.prototype.loadIntegrations=function(e,t,n){var o=this,r=this.waitFor(e.length,(function(){try{n()}catch(e){s.reportError("readyCallback",e)}o.allIntegrationsHaveLoaded=!0,o.flushMonorailEventsIfLoaded()}));e.forEach((function(e){var n=e[0],i=e[1];try{if(t[n]&&"object"==typeof t[n]){var a=new i({},t[n],r);a.initializeOrAwaitConsent(),o.integrations.push(a),"Trekkie"===a.name()&&(o.trekkie=a,window.ShopifyAnalytics=window.ShopifyAnalytics||{},window.ShopifyAnalytics.lib=window.ShopifyAnalytics.lib||{},window.ShopifyAnalytics.lib.trekkie=o.trekkie)}else r()}catch(e){r(),s.reportError("loadIntegration",e)}})),this.addConsentCollectedListener()},e.prototype.lockIntegrationsObject=function(){try{Object.defineProperty(this,"integrations",o(o({},Object.getOwnPropertyDescriptor(this,"integrations")),{value:this.integrations,configurable:!1,writable:!1}))}catch(e){s.reportError("lockIntegrationsObject",e)}},e.prototype.handleConsentCollected=function(e){_.default.refreshVisitorTokens(),this.integrations.forEach((function(t){t.onConsentCollected(e)})),a.flushBatchEvents()},e.prototype.addConsentCollectedListener=function(){document.addEventListener(u.TrackingEvents.CONSENT_COLLECTED,this.handleConsentCollectedBinded)},e.prototype.removeConsentCollectedListener=function(){document.removeEventListener(u.TrackingEvents.CONSENT_COLLECTED,this.handleConsentCollectedBinded)},e.prototype.identify=function(e,t,n){void 0===e&&(e=""),void 0===t&&(t={});var o=this.getS2SEventId();e instanceof Object&&(t=e,e="");for(var r=0,i=this.integrations;r0?e:e+i.search();var t=i.href(),n=t.indexOf("#");return-1===n?t:t.slice(0,n)},e.prototype.constructTrackArgs=function(e,t,n){if(void 0===t&&(t={}),p.isPseudoPageEvent(e)){var r=t,i=r.name,a=r.path;if(i&&a){var s=this.generatePageObject(i,{path:a},n.eventId,n.s2sMetadata);return o(o({},t),{page:s})}}return t},e.prototype.destroy=function(){this.removeConsentCollectedListener(),E.otelClient.destroy(),T.removeShopifyAnalyticsProxy()},e}();t.Tricorder=A,t.replayAnalyticsQueue=function(e,t){g.markShimQueueReady(!0);for(var n=0,o=t;n"undefined"==typeof window,r=()=>"undefined"!=typeof __CtaTestEnv__&&"true"===__CtaTestEnv__;class i{}i.warn=e=>{r()||console.warn(e)},i.error=e=>{r()||console.error(e)},i.info=e=>{r()||console.info(e)},i.debug=e=>{r()||console.debug(e)},i.trace=e=>{r()||console.trace(e)};const a=i;function s(e,t){if(null===e)return"null";if(Array.isArray(e))return`[${e.map((e=>s(e,!0))).join(",")}]`;if("object"==typeof e){let n=[];for(const t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&""!==e[t]&&n.push(`${t}:${s(e[t],!0)}`);const o=n.join(",");return t?`{${o}}`:o}return"string"==typeof e?JSON.stringify(e):`${e}`}function c(e,...t){if(0===t.length)return e;const n=t[0];return e[n]||(e[n]={}),c(e[n],...t.slice(1))}function u(e){try{return decodeURIComponent(e)}catch(e){return""}}function l(e){if(!e)return;const t=Math.max(...Object.keys(e).map((e=>parseInt(e,10))))+1;let n="";for(let o=0;o{}));console.log("Monorail event from consent API:",o,n)}catch(e){}}}function D(){var e,t;return o()?{}:(null===(e=window.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.config)||{}}R.instance=void 0;const M=/^https?:\/\/([^/]+)(\/api\/(?:unstable|2\d{3}-\d{2})\/graphql\.json(?=$|\?))?/;function L(e,t){if("fetch"!==e.initiatorType)return!1;const n=e.name.match(M);if(!n)return!1;const[,o,r]=n;return o===t||!!r&&!(null==o||!o.endsWith(`.${t}`))}const x="_cmp",U="consentHeader";function V(e){if(!o()){try{e=decodeURIComponent(e)}catch{}try{sessionStorage.setItem(U,e)}catch{}}}function F(e=x){let t;if(t=G()&&j((()=>function(e=x){var t,n;if(o())return;const r=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n?void 0:n.call(t,"resource"),i=window.location.host;let a=K[e];for(let t=r.length-1;t>=0;t--){const n=r[t];if(!L(n,i))continue;const o=B(n,e);if(o){a=o;break}}return K[e]=a,a}(e)))||j((()=>function(e=x){var t,n;if(!q()&&!function(){try{const e=performance.getEntriesByType("navigation")[0].serverTiming;return!!e&&0!=e.length}catch{return!1}}()){const e=new R;let t="failed_to_fetch";try{t=navigator.userAgent}catch{}e.produce("navigationServerTiming",JSON.stringify({failed:!0,userAgent:t,apiSupported:h()})),q()||(c(f(),"Shopify","customerPrivacy").serverTimingSupportVerified=!0)}const o=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n?void 0:n.call(t,"navigation");if(!o)return;const r=o.map((t=>B(t,e))).find((e=>e));return r&&e===x&&V(r),r}(e))),!t){if(e!==x)return;let t;try{t=sessionStorage.getItem(U)}catch{}return t||void 0}try{t=decodeURIComponent(t)}catch{}return t}function j(e){try{return e()}catch{return}}const K={};function B(e,t=x){var n,o;if(e)return null===(n=e.serverTiming)||void 0===n||null===(o=n.find((e=>e.name==t)))||void 0===o?void 0:o.description}function H(){var e,t;const n=f();return!0===(null==n||null===(e=n.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.backendConsentEnabled)||!0===D().asyncVisitorState}function G(){return!o()&&(H()||!p()&&!v()&&!_())}function q(){var e,t;const n=f();return null==n||null===(e=n.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.serverTimingSupportVerified}const Y="_cs";let $;function W(){if(o())return $;{var e,t;const n=(null===(e=window.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.injectedConsent)||D().injectedConsent;return n?u(n):void 0}}function z(){var e;o()?$=void 0:null!==(e=window.Shopify)&&void 0!==e&&e.customerPrivacy&&(window.Shopify.customerPrivacy.injectedConsent=void 0)}function J(){var e;if(!o())return null===(e=window.Shopify)||void 0===e?void 0:e.customerPrivacy}function Q(){var e;return null===(e=J())||void 0===e?void 0:e.consentStatus}function X(e){const t=J();t&&(t.consentStatus=e)}function Z(){ee(m.CONSENT_TRACKING_API_LOADED)}function ee(e,t){if(!o())try{document.dispatchEvent(new CustomEvent(e,{detail:t||{}}))}catch(t){console.error(`[Shopify Customer Privacy] Error in event listener for "${e}":`,t)}}function te(e){X("loaded");const t=e[A.MARKETING],n=e[A.SALE_OF_DATA],o=e[A.ANALYTICS],r=e[A.PREFERENCES];!0===t?ee(m.MARKETING_ACCEPTED):!1===t&&ee(m.MARKETING_DECLINED),!0===n?ee(m.SALE_OF_DATA_ACCEPTED):!1===n&&ee(m.SALE_OF_DATA_DECLINED),!0===o?ee(m.ANALYTICS_ACCEPTED):!1===o&&ee(m.ANALYTICS_DECLINED),!0===r?ee(m.PREFERENCES_ACCEPTED):!1===r&&ee(m.PREFERENCES_DECLINED);const i=function(e){return{marketingAllowed:e[A.MARKETING],saleOfDataAllowed:e[A.SALE_OF_DATA],analyticsAllowed:e[A.ANALYTICS],preferencesAllowed:e[A.PREFERENCES],firstPartyMarketingAllowed:e[A.MARKETING],thirdPartyMarketingAllowed:e[A.SALE_OF_DATA]}}(e);ee(m.CONSENT_COLLECTED,i);const a=[o,r,t,n];a.every((e=>!0===e))&&ee(m.TRACKING_ACCEPTED),a.every((e=>!1===e))&&ee(m.TRACKING_DECLINED)}function ne(e){var t,n;!function(e){o()?$=e:c(window,"Shopify","customerPrivacy").injectedConsent=e}(e),o()||(null!==(t=window.Shopify)&&void 0!==t&&null!==(n=t.customerPrivacy)&&void 0!==n&&n.cachedConsent&&(window.Shopify.customerPrivacy.cachedConsent=void 0),te({[A.PREFERENCES]:fe(),[A.ANALYTICS]:pe(),[A.MARKETING]:ve(),[A.SALE_OF_DATA]:_e()}))}function oe(){try{let e=function(){let e;if(e=o()?W():function(){var e,t;const n=null===(e=window.Shopify)||void 0===e||null===(t=e.customerPrivacy)||void 0===t?void 0:t.cachedConsent;return n?u(n):void 0}()||W()||new URLSearchParams(window.location.search).get(Y)||b()||F(),void 0!==e)return se(e)}();if(!e)return;return e}catch{return}}function re(){return{m:le(C.MARKETING),a:le(C.ANALYTICS),p:le(C.PREFERENCES),s:le(C.SALE_OF_DATA)}}function ie(){return re()[C.SALE_OF_DATA]}function ae(e=null){return null===e&&(e=oe()),void 0===e}function se(e){if("%"==e.slice(0,1))try{e=decodeURIComponent(e)}catch{}const t=e.slice(0,1);return"{"==t?function(e){var t;let n;try{n=JSON.parse(e)}catch{return}if(n.v===g&&null!==(t=n.con)&&void 0!==t&&t.CMP)return n}(e):"3"==t?function(e){const t=e.slice(1).split("_"),[n,o,r,i,a]=t;let s,c;try{s=t[5]?JSON.parse(t.slice(5).join("_")):void 0}catch{}if(a){const e=a.replace(/\*/g,"/").replace(/-/g,"+"),t=atob(e);let n="";for(let e=0;ee.slice(0,t)+"-"+e.slice(t)),n)}function u(e){const t=n.split(".")[0];return t.includes(e.toLowerCase())?S.DECLINED:t.includes(e.toUpperCase())?S.ACCEPTED:S.NO_VALUE}function l(e){return n.includes(e.replace("t","s").toUpperCase())}return{v:E,con:{CMP:{[C.ANALYTICS]:u(C.ANALYTICS),[C.PREFERENCES]:u(C.PREFERENCES),[C.MARKETING]:u(C.MARKETING),[C.SALE_OF_DATA]:u(C.SALE_OF_DATA)}},region:o||"",cus:s,purposes:{[A.ANALYTICS]:l(A.ANALYTICS),[A.PREFERENCES]:l(A.PREFERENCES),[A.MARKETING]:l(A.MARKETING),[A.SALE_OF_DATA]:l(A.SALE_OF_DATA)},sale_of_data_region:"t"==i,display_banner:"t"==r,consent_id:c}}(e):void 0}function ce(e){switch(e){case S.ACCEPTED:return T.ACCEPTED;case S.DECLINED:return T.DECLINED;default:return T.NO_VALUE}}function ue(e){switch(e){case C.ANALYTICS:return k.ANALYTICS;case C.MARKETING:return k.MARKETING;case C.PREFERENCES:return k.PREFERENCES;case C.SALE_OF_DATA:return k.SALE_OF_DATA}}function le(e){const t=oe();if(!t)return S.NO_VALUE;const n=t.con.CMP;return n?n[e]:S.NO_VALUE}function de(e){const t=oe();if(!t||!t.purposes)return!0;const n=t.purposes[e];return"boolean"!=typeof n||n}function fe(){return de(A.PREFERENCES)}function pe(){return de(A.ANALYTICS)}function ve(){return de(A.MARKETING)}function _e(){return de(A.SALE_OF_DATA)}function he(){const e=oe();return!!e&&"boolean"==typeof e.display_banner&&e.display_banner}function ye(){const e=oe();return e&&e.sale_of_data_region||!1}const me="v0.2",ge=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/,Ee="00000000-0000-0000-0000-000000000000",Te="00000000-0000-0000-5000-000000000000";function Se(e){return!!e&&ge.test(e.trim().toLowerCase())}function Ae(e,t){if("string"!=typeof e)return;if(!Se(e))return;const n=e.trim();if(n===Ee)return;if(n===Te)return;const o=null==t||"string"==typeof t&&""===t.trim()?NaN:Number(t);return Number.isFinite(o)&&Date.now()>o?void 0:n}const Ce="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";function ke(e){return Ce.replace(/[xy]/g,(t=>{const n=e();return("x"===t?n:3&n|8).toString(16)}))}function we(){const e="undefined"!=typeof crypto?crypto:void 0;if("function"==typeof(null==e?void 0:e.randomUUID))return e.randomUUID();if("function"==typeof(null==e?void 0:e.getRandomValues)){const t=e.getRandomValues(new Uint8Array(Ce.length));let n=0;return ke((()=>t[n++]%16))}return ke((()=>16*Math.random()|0))}const Ie=31536e6,be=18e5;function Ne(e,t){if(!o())throw new Error("handleTrackingTokens is only supported in Node.js environments. ");if(!pe()&&!ve())return;const{shopifyY:n,shopifyS:r,shopifyYExpiry:i,shopifySExpiry:a}=e(),s=Date.now(),c=i<=s,u=a<=s;t({shopifyY:Se(n)&&!c?n:we(),shopifyS:Se(r)&&!u?r:we(),shopifyYExpiry:s+Ie,shopifySExpiry:s+be})}function Oe(e,t){const n=f();if(!n)return;const o=c(n,"Shopify","customerPrivacy","cachedToken");if(t){const n="_shopify_s"===e?be:Ie;o[e]=t,o[e+"_expires_at"]=Date.now()+n}else delete o[e],delete o[e+"_expires_at"]}function Pe(e){return`${e.origin}${t=e.pathname,t.replace(/\/$/,"")}`;var t}function Re(e){return e.startsWith("http://")||e.startsWith("https://")}const De="Shopify-Storefront-Consent-Management";function Me(e){const t=e.granular_consent;return{query:`query { consentManagement { cookies(${s({visitorConsent:{marketing:t.marketing,analytics:t.analytics,preferences:t.preferences,saleOfData:t.sale_of_data,...t.metafields&&{metafields:t.metafields}},...t.email&&{visitorEmail:t.email},origReferrer:e.referrer,landingPage:e.landing_page})}) { trackingConsentCookie cookieDomain landingPageCookie origReferrerCookie shopifyUnique shopifyVisit } customerAccountUrl } }`,variables:{}}}let Le;function xe(e,t,n,i={}){const s=D().consentDomain||t.granular_consent.checkoutRootDomain||window.location.host,l=()=>function(e,t,n,o){const i=t.granular_consent;let s="",c={};if(i.customerAccountRequestInfo)s=i.customerAccountRequestInfo.url,c=i.customerAccountRequestInfo.headers;else{const t=D(),o=i.storefrontAccessToken||t.storefrontAccessToken||function(){if(!0!==D().isHeadless)try{const e=document.documentElement.querySelector("#shopify-features"),t="Could not find liquid access token";if(!e)return void a.warn(t);const n=e.textContent;if(!n)return void a.warn(t);let o;try{o=JSON.parse(n).accessToken}catch{return void a.warn(t)}return o||void a.warn(t)}catch{return void a.warn("Could not find liquid access token")}}();s=`${/^(localhost|127\.0\.0\.1)(:|$)/.test(e)?"http:":"https:"}//${e}/api/unstable/graphql.json`;const r=i.isExtensionToken?"Shopify-Storefront-Extension-Token":"x-shopify-storefront-access-token";c=o?{[r]:o}:{},n&&(c={...c,...n()})}const u={headers:{"content-type":"application/json",...!0===D().asyncConsent&&new URL(s).origin===window.location.origin&&{[De]:"1"},...c,...r()?{"x-test-payload":JSON.stringify(t)}:{}},body:JSON.stringify(Me(t)),method:"POST"};let l;try{l=fetch(s,u)}catch(e){l=Promise.reject(e)}return l.then((e=>{try{null==o||o(e)}catch{}if(e.ok)return e.json();{const t=new Error("Server error");throw t.cause={status:e.status},t}}))}(s,t,i.getVisitorTokenHeaders,i.onResponse).then((e=>{var r,a;const s=null==e||null===(r=e.data)||void 0===r?void 0:r.consentManagement;if(!s){var l;const t=(null!==(l=null==e?void 0:e.errors)&&void 0!==l?l:[]).map((e=>null==e?void 0:e.message)).filter(Boolean).join("; ");throw new Error(t?`GraphQL error: ${t}`:"GraphQL response missing consentManagement")}const d=s.cookies.cookieDomain,f=s.cookies.trackingConsentCookie,p=s.cookies.shopifyUnique,v=s.cookies.shopifyVisit,_=null!==(a=s.customerAccountUrl)&&void 0!==a?a:"";if(!0===D().asyncConsent&&f&&!function(e){try{return void 0!==se(u(e))}catch{return!1}}(f))throw new Error("Consent response contains unreadable consent");var h,y,m,g;if(f&&(h=f,c(window,"Shopify","customerPrivacy").cachedConsent=h,!0!==D().asyncConsent&&V(f)),Oe("_shopify_y",p),Oe("_shopify_s",v),!0===D().asyncConsent)null!==(y=e.errors)&&void 0!==y&&y.length||!f||ae()||function(){if(o()||!function(){const e=I();return!!e&&e.split(";").some((e=>P.includes(e.split("=")[0].trim())))}())return;const e=window.location.hostname.split("."),t=["",...e.map(((t,n)=>e.slice(n).join(".")))];for(const e of P)for(const n of t)try{O(e,n,-1,"")}catch{}}();else if(t.granular_consent.headlessStorefront&&!H()){const e=31536e6,n=t.granular_consent,o=d||n.checkoutRootDomain||window.location.hostname,r=n.storefrontRootDomain||d||window.location.hostname;O(w,o,e,f),r!==o&&O(w,r,e,f)}return!1!==i.emitEvents&&(m=t,g={[A.PREFERENCES]:fe(),[A.ANALYTICS]:pe(),[A.MARKETING]:ve(),[A.SALE_OF_DATA]:_e()},void 0!==m.granular_consent&&te(g)),function(e,t){if(!e)return;const n=function(e){const t=new URL(e,window.location.origin),n=Re(e)?Pe(t):Pe(t).replace(window.location.origin,""),o=document.querySelectorAll(`a[href^="${n}"]`),r=document.querySelectorAll(`a[href*="${window.location.hostname}/customer_authentication"]`),i=new Set,a=[];for(let e=0;e{var t;const o="Error while setting storefront API consent: "+e.message,r=null===(t=e.cause)||void 0===t?void 0:t.status,i={error:o};if(void 0!==r&&(i.statusCode=r),void 0===n)throw i;n(i)}));if(!0!==D().asyncConsent)return l();const d=Le=Le?Le.then(l,l):l(),f=()=>{Le===d&&(Le=void 0)};return d.then(f,f),d}const Ue=[k.MARKETING,k.ANALYTICS,k.PREFERENCES,k.SALE_OF_DATA],Ve=[...Ue,k.EMAIL,"rootDomain","checkoutRootDomain","storefrontRootDomain","storefrontAccessToken","headlessStorefront","isExtensionToken","metafields","customerAccountRequestInfo"],Fe=Ue.map((e=>`"${e}"`)).join(", "),je="https://shopify.dev/docs/api/customer-privacy";function Ke(e,t){if(o())throw new Error("setTrackingConsent is not supported in Node.js environments. This function requires browser APIs (XHR, cookies, window) and can only be called client-side.");const n=new R;if(pe()&&n.produce("setTrackingConsent",me),function(e){if("boolean"!=typeof e&&"object"!=typeof e)throw new y(`setTrackingConsent received an invalid argument of type "${typeof e}". Expected an object with consent keys. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${je} for documentation.`);if("object"==typeof e){const t=Object.keys(e);if(0===t.length)throw new y(`The submitted consent object is empty. Expected at least one consent key: ${Fe}. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${je} for documentation.`);for(const e of t)if(!Ve.includes(e))throw new y(`The submitted consent object contains an invalid key: "${e}". Valid keys are: ${Fe}. Example: setTrackingConsent({ analytics: true, marketing: false }). See ${je} for documentation.`)}}(e),void 0!==t&&"function"!=typeof t)throw new y(`setTrackingConsent received an invalid callback of type "${typeof t}". The second argument must be a function if provided. Example: setTrackingConsent({ analytics: true }, (error, result) => { ... }). See ${je} for documentation.`);const r=function(e){if(!e)return null;try{return Ge()?document.referrer:""}catch{return""}}(e.analytics),i=function(e){if(!e)return null;if(!Ge())return"/";try{return window.location.pathname+window.location.search}catch{return"/"}}(e.analytics);return xe(0,{granular_consent:e,...null!==r&&{referrer:r},...null!==i&&{landing_page:i}},t)}function Be(){const e=new R;if(pe()&&e.produce("getTrackingConsent",me),ae())return T.NO_VALUE;const t=re();return t[C.MARKETING]===S.ACCEPTED&&t[C.ANALYTICS]===S.ACCEPTED?T.ACCEPTED:t[C.MARKETING]===S.DECLINED||t[C.ANALYTICS]===S.DECLINED?T.DECLINED:T.NO_INTERACTION}function He(){return function(){const e=oe();return ae(e)?"":e.region||""}()}function Ge(){try{if(""===document.referrer)return!0;const e=document.createElement("a");return e.href=document.referrer,window.location.hostname!=e.hostname}catch{return!0}}function qe(){return!!ae()||ve()&&pe()}function Ye(){return ye()?"string"==typeof navigator.globalPrivacyControl?"1"!==navigator.globalPrivacyControl:"boolean"==typeof navigator.globalPrivacyControl?!navigator.globalPrivacyControl:null:null}function $e(){return he()&&Be()===T.NO_INTERACTION}function We(){return!1===Ye()?T.DECLINED:(e=ie(),ae()?T.NO_VALUE:e===S.NO_VALUE?T.NO_INTERACTION:ce(e));var e}function ze(){return!0}function Je(e){return function(e){const t=oe();if(ae(t)||!t.cus)return;const n=t.cus[encodeURIComponent(e)];return n?decodeURIComponent(n):n}(e)}function Qe(){return function(){const e=oe();if(!ae(e)&&e.cus)return Object.entries(e.cus).map((([e,t])=>({key:decodeURIComponent(e),value:decodeURIComponent(t)})))}()}function Xe(){const e={},t=re();for(const n of Object.keys(t))e[ue(n)]=ce(t[n]);return e}function Ze(){return function(){const e=oe();return e&&e.consent_id||""}()}const et="shopify-y",tt="shopify-s",nt="serialized-shopifyY",ot="serialized-shopifyS",rt="serialized-shopifyYIsNewlyMinted",it="serialized-shopifySIsNewlyMinted";function at(e){if(!o())try{var t,n;return null===(t=document.querySelector(`meta[name="${e}"]`))||void 0===t||null===(n=t.getAttribute("content"))||void 0===n?void 0:n.trim()}catch{return}}function st(e){const t=at(e);if(t)try{const e=JSON.parse(t);return"string"==typeof e?e.trim():void 0}catch{return}}function ct(e){const t=at(e);if(t)try{const e=JSON.parse(t);return"boolean"==typeof e?e:void 0}catch{return}}function ut(e){if(!o())try{var t,n;const o=null===(t=document.querySelector(`meta[name="${e}"]`))||void 0===t||null===(n=t.getAttribute("data-expiration"))||void 0===n?void 0:n.trim();if(!o)return;const r=Number(o);return Number.isFinite(r)?r:void 0}catch{return}}function lt(e){const t=st(`${e}Expiration`);if(!t)return;const n=Number(t);return Number.isFinite(n)?n:void 0}function dt(e){return void 0!==e&&Date.now()>e}function ft(e,t){const n=Ae(st(t));if(n&&!dt(lt(t)))return n;const o=Ae(at(e));return o&&!dt(ut(e))?o:void 0}function pt(){return ft(et,nt)}function vt(){return ft(tt,ot)}function _t(){return ct(rt)}function ht(){return ct(it)}const yt={value:void 0,placeholder:!1,disallowed:!1,source:void 0,duplicated:!1,bothConventions:!1};function mt(e,t){if(e)return e===Ee?{value:void 0,placeholder:!0,disallowed:!1,source:t}:e===Te?{value:void 0,placeholder:!1,disallowed:!0,source:t}:{value:Se(e)?e:void 0,placeholder:!1,disallowed:!1,source:t}}function gt(e){if(o())return 0;try{return document.querySelectorAll(`meta[name="${e}"]`).length}catch{return 0}}function Et(e,t){var n,o;let r=null!==(n=null!==(o=mt(st(t),"c1"))&&void 0!==o?o:mt(at(e),"sfr"))&&void 0!==n?n:yt;return dt("c1"===r.source?lt(t):"sfr"===r.source?ut(e):void 0)&&(r=yt),{...r,duplicated:gt(e)>1||gt(t)>1,bothConventions:!!at(e)&&!!at(t)}}class Tt{constructor(){if(this.endpoint="https://otlp-http-production.shopifysvc.com/v1/metrics",this.serviceName="consent-tracking-api",this.scopeName="consent-tracking-api-opentelemetry",Tt.instance)return Tt.instance;Tt.instance=this}increment(e,t={}){if(!o()&&e)try{const n=this.buildMetricBody(e,t);if(window.location.host.endsWith("spin.dev"))return void console.log("OpenTelemetry metric from consent API:",n);if("function"!=typeof fetch)return;return fetch(this.endpoint,{headers:{accept:"*/*","content-type":"application/json; charset=utf-8"},body:JSON.stringify(n),method:"POST",mode:"cors",credentials:"omit"}).catch((()=>{}))}catch(e){}}buildMetricBody(e,t){const n=1e6*Date.now();return{resourceMetrics:[{resource:{attributes:[{key:"service.name",value:{stringValue:this.serviceName}}]},scopeMetrics:[{scope:{name:this.scopeName,version:"1.0.0",attributes:[]},metrics:[{name:e,unit:"1",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:[{asDouble:1,startTimeUnixNano:n,timeUnixNano:n,attributes:St(t)}]}}]}]}]}}}function St(e){return Object.keys(e).reduce(((t,n)=>{const o=e[n];return null==o||t.push({key:n,value:At(o)}),t}),[])}function At(e){return"string"==typeof e?{stringValue:e}:"boolean"==typeof e?{boolValue:e}:isFinite(e)?Math.floor(e)===e?{intValue:e}:{doubleValue:e}:{stringValue:String(e)}}Tt.instance=void 0;const Ct=new Tt,kt=.01,wt="debug_token_source_instrumentation_force";function It(e,t){try{const n=function(){try{return window.location.href.includes(wt)}catch{return!1}}();if(!n&&Math.random()>=kt)return;const o={token:"_shopify_y"===e?"unique":"visit",source:t,forced:n,sample_rate:kt};n&&console.log("consent_tracking_api_tracking_token_read",o),Ct.increment("consent_tracking_api_tracking_token_read",o)}catch{}}const bt="query { consentManagement { cookies(visitorConsent:{}) { cookieDomain } } }",Nt="unstable",Ot="X-Shopify-UniqueToken",Pt="X-Shopify-VisitToken",Rt=.01;async function Dt(e){try{var t;if(n=Rt,!(Math.random()0}catch{}!function(e,t,n){(new R).produce("persistOutcome",JSON.stringify({ok:e,status:t,graphqlErrors:n,sampleRate:Rt}))}(!(null==e||!e.ok),null!==(t=null==e?void 0:e.status)&&void 0!==t?t:null,o)}catch{}var n}function Mt(e,t){if(!o())try{const n=Ae(e),o=Ae(t);if(!n&&!o)return;const r=function(){const e=document.querySelector('[data-serialized-id="app-base-path"]');if(v()||e){var t;const n=document.querySelector('[data-serialized-id="preview-mode-data"]');if("/"!==JSON.parse((null==e?void 0:e.textContent)||"null")||!1!==(null===(t=JSON.parse((null==n?void 0:n.textContent)||"null"))||void 0===t?void 0:t.inPreviewMode))return;return new URL("/customer/api/unstable/graphql",window.location.origin).href}const{protocol:n,host:o}=function(){const e=D().consentDomain||window.location.host;return{protocol:/^(localhost|127\.0\.0\.1)(:|$)/.test(e)?"http:":"https:",host:e}}();return`${n}//${o}/api/${Nt}/graphql.json`}();if(!r)return;const i=new URLSearchParams,a={"content-type":"application/json"};n&&(i.set("_y",n),a[Ot]=n),o&&(i.set("_s",o),a[Pt]=o);const s=`${r}?${i.toString()}`;let c;try{c=fetch(s,{headers:a,body:JSON.stringify({query:bt,variables:{}}),method:"POST",mode:"cors",credentials:"include"})}catch(e){c=Promise.reject(e)}c.then((e=>Dt(e)),(()=>Dt(void 0)))}catch{}}const Lt={};function xt(e){try{var t,n;const i=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n?void 0:n.call(t,"resource");if(!i)return;const a=window.location.host;for(let t=i.length-1;t>=0;t--){var o,r;const n=i[t];if(!L(n,a))continue;const s=null===(o=n.serverTiming)||void 0===o||null===(r=o.find((t=>t.name===e)))||void 0===r?void 0:r.description;if(s)return s}return}catch{return}}function Ut(e){try{var t,n,o,r;return null===(t=document.cookie)||void 0===t||null===(n=t.split(";"))||void 0===n||null===(o=n.find((t=>t.trim().startsWith(`${e}=`))))||void 0===o||null===(r=o.split("=")[1])||void 0===r?void 0:r.trim()}catch{return}}function Vt(e){if(G()){const t=function(e){const t=xt(e);return t&&(Lt[e]=t),t}(e);if(t)return{value:t,source:"resource"};const n=Lt[e];if(n)return{value:n,source:"cache"}}const t=function(e){try{var t,n,o,r;return null===(t=performance)||void 0===t||null===(n=t.getEntriesByType("navigation")[0])||void 0===n||null===(o=n.serverTiming)||void 0===o||null===(r=o.find((t=>t.name==e)))||void 0===r?void 0:r.description}catch{return}}(e);return t?{value:t,source:"navigation"}:{value:void 0,source:null}}function Ft(e,t,{generateFallback:n=!1,tag:r="unknown"}={}){if(n&&o())throw new Error("Token generateFallback is not supported in Node.js environments, just browsers.");if(!pe()&&!ve())return;const i=function(e){var t,n,o,r,i,a;const s=f();if(!s)return;const c=null===(t=s.Shopify)||void 0===t||null===(n=t.customerPrivacy)||void 0===n||null===(o=n.cachedToken)||void 0===o?void 0:o[e],u=null===(r=s.Shopify)||void 0===r||null===(i=r.customerPrivacy)||void 0===i||null===(a=i.cachedToken)||void 0===a?void 0:a[e+"_expires_at"];return!c||!u||u<(new Date).getTime()?void 0:Ae(c)}(e);if(i)return It(e,"window_cache"),i;const a=f();if(function(e){if(!e)return!1;try{const t=Object(e);return Reflect.has(t,"trackingUnique")||Reflect.has(t,"trackingVisit")}catch{return!1}}(null==a?void 0:a.ShopPay)){const t=function(e){const t=f();if(!t||!t.ShopPay)return;const n={_shopify_y:"trackingUnique",_shopify_s:"trackingVisit"}[e];return n?Ae(t.ShopPay[n]):void 0}(e);return It(e,"shop_pay"),t}const s=t();if(s)return It(e,"meta"),s;const c=function(e){const t=e.replace("_shopify",""),n=Vt(t),o=Number(Vt(`${t}e`).value);if(!o||Date.now()/1e3{try{return e(...t)}catch(e){throw e instanceof y||function(e,t,n){try{var o;!function(e){const t=new XMLHttpRequest;t.open("POST","https://error-analytics-production.shopifysvc.com",!0),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Bugsnag-Api-Key","95ba910bcec4542ef2a0b64cd7ca666c"),t.setRequestHeader("Bugsnag-Payload-Version","5");const n=function(e){var t;const n=function(e){return e?e.stackTrace||e.stack||e.description||e.name:void 0}(e.error);let o,r;if(null!==(t=e.error)&&void 0!==t&&t.name){var i,a;o=e.error.name,r=null!==(i=null===(a=e.error)||void 0===a?void 0:a.message)&&void 0!==i?i:""}else{const t=(n||"unknown error").split("\n")[0],i=t.indexOf(":");var s,c,u;i>0?(o=t.substring(0,i).trim(),r=t.substring(i+1).trim()):(o=t.trim()||"unknown error",r=(null===(s=e.error)||void 0===s?void 0:s.message)||(null===(c=e.error)||void 0===c?void 0:c.error)||(null===(u=e.error)||void 0===u?void 0:u.toString())||"No error message available")}return JSON.stringify({payloadVersion:5,notifier:{name:"ConsentTrackingAPI",version:"latest",url:"-"},events:[{exceptions:[{errorClass:o,message:r,stacktrace:[{file:"consent-tracking-api.js",lineNumber:"1",method:n}],type:"browserjs"}],context:e.context||"general",app:{id:"ConsentTrackingAPI",version:"latest"},metaData:{request:{shopId:e.shopId,shopUrl:window.location.href},device:{userAgent:window.navigator.userAgent},"Additional Notes":e.notes},unhandled:!1}]})}(e);t.send(n)}({error:e,context:null!=t?t:"",shopId:Gt()||(null===(o=window.Shopify)||void 0===o?void 0:o.shop),notes:null!=n?n:""})}catch(e){}}(e),e}}}function Gt(){try{var e;const t=null===(e=document.getElementById("shopify-features"))||void 0===e?void 0:e.textContent;return t?JSON.parse(t).shopId:null}catch(e){return null}}function qt(){return ve()}function Yt(){return pe()}function $t(){return fe()}function Wt(){return _e()}const zt=({useBugsnagReporting:e})=>{ie()!=S.DECLINED&&!1===Ye()&&Ke({sale_of_data:!1},(()=>!1));const t={analyticsProcessingAllowed:pe,currentVisitorConsent:Xe,doesMerchantSupportGranularConsent:ze,firstPartyMarketingAllowed:qt,getCCPAConsent:We,getRegion:He,getTrackingConsent:Be,getTrackingConsentMetafield:Je,marketingAllowed:qt,preferencesProcessingAllowed:fe,saleOfDataAllowed:Wt,saleOfDataRegion:ye,setTrackingConsent:Ke,shouldShowBanner:he,shouldShowGDPRBanner:$e,thirdPartyMarketingAllowed:Wt,userCanBeTracked:qe,consentId:Ze,unstable:{},__internal:{uniqueToken:jt,visitToken:Kt},__metadata__:{name:"@shopify/consent-tracking-api",version:me,description:"Shopify Consent Tracking API"},config:D()};if(!e)return t;const n=t;for(const e in n)if(n.hasOwnProperty(e)){const t=n[e];"function"==typeof t&&(n[e]=Ht(t))}return t};function Jt(e={useBugsnagReporting:!1}){return zt(e)}function Qt(){return!(o()||p()||_()||v())}function Xt(){var e,t;if(!Qt())return;const n=null===(e=D().debug)||void 0===e||null===(t=e.hydrogen)||void 0===t?void 0:t.generation;return 2===n||3===n?n:void 0}function Zt(e=!1){var t,n;if(!Qt())return;const o=Xt();if(o)return 2===o?"classic":"new";const r=D();return void 0===(null===(t=r.debug)||void 0===t||null===(n=t.hydrogen)||void 0===n?void 0:n.generation)?!0===r.asyncConsent?"new":e?"classic":void 0:void 0}const en=.01,tn=.001;let nn=!1;function on(e,t){return!!e&&!!t}function rn(){try{return performance.now()}catch{return 0}}function an(){try{return window.__st.reqid}catch{return null}}function sn(){const e=function(){try{const e=an();if(!e)return null;const t=1e3*parseInt(e.split("-").slice(-1)[0],10);return Number.isFinite(t)?t:null}catch{return null}}();return e?(Date.now()-e)/1e3:null}function cn(){try{const e=navigator.userAgent;return!e||""===e.trim()||!0===navigator.webdriver||/bot|crawl|curl|email|feed|fetch|googleother|headless|index|link|monitoring|robot|rss|scan|search|spider/i.test(e)}catch{return null}}const un=/^https:\/\/shopify\.com\/\d+\/account\/?/i,ln=/^https:\/\/shopify\..*?\.shop\.dev\/\d+\/account\/?/i,dn=/^https:\/\/account\..*/i;function fn(e){return function(){try{var e;const t=window.location.href;return un.test(t)||ln.test(t)||dn.test(t)||(null===(e=window)||void 0===e?void 0:e.__CUSTOMER_ACCOUNT__)||null!==document.querySelector('[data-serialized-id="app-base-path"]')}catch{return!1}}()?"accounts":e.source||null}function pn(e,t,n){var r,i;const a=n.value,s=t.value,c=Ae(s);return{hasCookie:!!e,cookieValid:e?!!Ae(e):null,hasServerTiming:!!c,serverTimingDisallowed:(null==s?void 0:s.trim())===Te,serverTimingSource:t.source,hasMeta:!!a,metaDuplicated:n.duplicated,bothConventions:n.bothConventions,metaPlaceholder:n.placeholder,metaDisallowed:n.disallowed,metaSource:fn(n),cookieMatchesMeta:on(e,a)?e===a:null,cookieMatchesServerTiming:on(e,c)?e===c:null,metaMatchesServerTiming:on(a,c)?a===c:null,cookieValue:e,metaValue:a,serverTimingValue:c,performanceNow:o()?0:rn(),htmlAgeSeconds:o()?null:sn(),requestId:an(),consentWasCollected:!(null===(r=window.Shopify)||void 0===r||null===(i=r.customerPrivacy)||void 0===i||!i.cachedConsent),isBot:cn()}}function vn(e){return e.hasCookie||e.hasServerTiming||e.serverTimingDisallowed||null!==e.metaSource}function _n(e){return e.hasServerTiming||e.serverTimingDisallowed||null!==e.metaSource}function hn(){try{const e=new URLSearchParams(window.location.search);return e.has("_y")||e.has("_s")}catch{return!1}}function yn(){try{var e,t,n;return null!==(e=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType("navigation")[0])||void 0===n?void 0:n.type)&&void 0!==e?e:null}catch{return null}}function mn(){try{var e,t;const o=pn(Bt("y"),Vt("_y"),Et(et,nt)),r=pn(Bt("s"),Vt("_s"),Et(tt,ot));if(!vn(o)&&!vn(r))return;const i=_n(o)||_n(r),a=i?en:tn;if(n=a,!(Math.random()e()),{once:!0}):e()))}const En=.01,Tn=4,Sn="shopifyCustomerPrivacyApiLoaded",An="__shopifyClassicHydrogenVisitorStateInstrumentation";let Cn,kn=!1,wn=!1;function In(e,t){var n,o;const r=null==e?void 0:e.split(",").find((e=>e.trim().split(";",1)[0]===`_${t}`)),i=null==r?void 0:r.match(/;\s*desc\s*=\s*(?:"([^"]*)"|([^;,\s]*))/i),a=null===(n=null!==(o=null==i?void 0:i[1])&&void 0!==o?o:null==i?void 0:i[2])||void 0===n?void 0:n.trim(),s=void 0!==r,c=!!Ae(a),u=a===Te;return{present:s,available:c,disallowed:u,invalid:s&&!c&&!u}}function bn(e,t){var n,o;const r=Vt("y"===e?"_y":"_s"),i=null===(n=r.value)||void 0===n?void 0:n.trim(),a=!!Ae(i),s=i===Te;return{available:!!Ae("y"===e?jt():Kt()),serverTimingAvailable:a,serverTimingDisallowed:s,serverTimingInvalid:void 0!==i&&!a&&!s,serverTimingSource:r.source,responseHeader:null!==(o=null==t?void 0:t[e])&&void 0!==o?o:null}}function Nn(e=null){return{y:bn("y",e),s:bn("s",e)}}function On(e){const t=null==e?void 0:e.statusCode;return"number"==typeof t?t:null}function Pn(e){var t;const n=null===(t=xt(e))||void 0===t?void 0:t.trim(),o=!!Ae(n),r=n===Te;return{present:void 0!==n,available:o,disallowed:r,invalid:void 0!==n&&!o&&!r}}function Rn(){try{var e,t,n,o;return null!==(e=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n||null===(o=n.call(t,"resource"))||void 0===o?void 0:o.length)&&void 0!==e?e:null}catch{return null}}function Dn(e,t=null){try{var n,o,r;(new R).produce("hydrogenVisitorState",JSON.stringify({...e,asyncConsent:!0===D().asyncConsent,configuredServerTiming:null!==(n=null===(o=D().debug)||void 0===o||null===(r=o.hydrogen)||void 0===r?void 0:r.serverTiming)&&void 0!==n?n:null,after:Nn(t),isBot:cn(),serverTimingSupported:h(),requestId:an(),htmlAgeSeconds:sn(),resourceScanEnabled:G(),resourceUngated:{y:Pn("_y"),s:Pn("_s"),cmpPresent:void 0!==xt("_cmp")},navigationYPresent:Mn("_y"),navigationSPresent:Mn("_s"),navigationCmpPresent:Mn("_cmp"),resourceEntryCount:Rn(),schemaVersion:Tn,sampleRate:En}))}catch{}}function Mn(e){try{var t,n,o;const r=null===(t=performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n?void 0:n.call(t,"navigation")[0];return!(null==r||null===(o=r.serverTiming)||void 0===o||!o.some((t=>t.name===e)))}catch{return!1}}function Ln(){if(!wn){wn=!0;try{if(!0===D().asyncConsent)return;if(Math.random()>=En)return;if("classic"!==Zt(!0))return;Dn({generation:"classic",flow:Mn("_server_tracking")?"classic_server_forwarded":Mn("_sfapi_proxy")?"classic_browser_fetch":"classic_no_fetch",requestOk:null,status:null,before:null})}catch{return}}}function xn(){if(o()||kn)return;const e=window;if(!e[An])try{Object.defineProperty(e,An,{configurable:!0,value:!0}),document.addEventListener(Sn,Ln),kn=!0}catch{return}}function Un(){const e=jt(),t=Kt();return{...e?{"X-Shopify-UniqueToken":e}:{},...t?{"X-Shopify-VisitToken":t}:{}}}function Vn(){if(o())return;if(Cn)return Cn;const e=Q();if("loading"===e)return;if("loaded"===e)return;const t=!0===D().asyncConsent;if(!(ae()||t&&b()))return void X("loaded");if(!t)return;X("loading");const n=function(){const e=function(){try{if(!function(){const e=D();if(!0!==e.asyncConsent||!H())return!1;try{const t=e.consentDomain||window.location.host,n=/^(localhost|127\.0\.0\.1)(:|$)/.test(t)?"http:":"https:";return new URL(`${n}//${t}`).origin===window.location.origin}catch{return!1}}())return;const e=Zt();if(!e||Math.random()>=En)return;const t=Nn();let n=null,o=!1;return{observeResponse(e){n=function(e){try{const t=e.headers.get("server-timing");return{y:In(t,"y"),s:In(t,"s")}}catch{return null}}(e)},report(r,i){if(!o){o=!0;try{Dn({generation:e,flow:"cta_initialize",requestOk:r,status:On(i),before:t},n)}catch{}}}}}catch{return}}();return xe(0,{granular_consent:{}},void 0,{emitEvents:!1,getVisitorTokenHeaders:H()?Un:void 0,onResponse:t=>null==e?void 0:e.observeResponse(t)}).then((()=>{null==e||e.report(!0)}),(t=>{throw null==e||e.report(!1,t),t}))}().then((()=>{X("loaded")}));return Cn=n,n.then((()=>{Cn===n&&(Cn=void 0)}),(()=>{"loading"===Q()&&X(void 0),Cn===n&&(Cn=void 0)})),n}const Fn=.01,jn="debug_server_timing_instrumentation_hydrogen_force";function Kn(){try{return window.location.href.includes(jn)}catch{return!1}}const Bn="shopifyCustomerPrivacyApiLoaded",Hn=/^https:\/\/monorail-edge\.shopifysvc\.com\/(?:unstable|v1)\/produce_batch(?:$|\?)/,Gn=/^https?:\/\/[^/]+\/\.well-known\/shopify\/monorail\/(?:unstable|v1)\/produce_batch(?:$|\?)/,qn="__shopifyHydrogenAnalyticsTokenInstrumentation";let Yn,$n=!1,Wn=!1,zn=!1;function Jn(e){var t;const n=Bt(e),o=null===(t=F("y"===e?"_y":"_s"))||void 0===t?void 0:t.trim(),r=Ae(o),i=o===Te;return{hasCookie:!!n,cookieValid:n?!!Ae(n):null,hasServerTiming:!!r,serverTimingDisallowed:i,serverTimingInvalid:void 0!==o&&!r&&!i,cookieMatchesServerTiming:n&&r?n===r:null,cookieValue:n,serverTimingValue:r}}function Qn(e,t,n){if(!zn){zn=!0;try{var o,r,i,a,s;const c=f(),u=Kn(),l=JSON.stringify({generation:e,asyncConsent:!0===D().asyncConsent,configuredServerTiming:null!==(o=null===(r=D().debug)||void 0===r||null===(i=r.hydrogen)||void 0===i?void 0:i.serverTiming)&&void 0!==o?o:null,endpoint:t,analyticsFetchStart:n.startTime,analyticsFetchEnd:n.responseEnd,y:Jn("y"),s:Jn("s"),analyticsAllowed:pe(),consentStored:!ae(),serverTimingSupported:h(),isBot:cn(),requestId:an(),htmlAgeSeconds:sn(),isHeadless:null!==(a=D().isHeadless)&&void 0!==a?a:null,hasTheme:!(null==c||null===(s=c.Shopify)||void 0===s||!s.theme),hasTrekkie:!(null==c||!c.ShopifyAnalytics),forced:u,sampleRate:Fn});u&&console.log("hydrogenAnalyticsTokenState",l),(new R).produce("hydrogenAnalyticsTokenState",l)}catch{}}}function Xn(e){if(!Wn){Wn=!0;try{if("undefined"==typeof PerformanceObserver)return;Yn=new PerformanceObserver((t=>{try{for(const r of t.getEntries()){var n;const t=r;if("fetch"!==t.initiatorType)continue;const i=(o=t.name,Hn.test(o)?"monorail_edge":Gn.test(o)?"shop_domain":null);if(i)return null===(n=Yn)||void 0===n||n.disconnect(),void Qn(e,i,t)}}catch{return}var o})),Yn.observe({type:"resource",buffered:!0})}catch{return}}}function Zn(){const e=Zt(!0);!e||"classic"!==e&&!0!==D().asyncConsent||Xn(e)}function eo(){if(o()||$n)return;const e=window;if(!e[qn]){$n=!0;try{if(Object.defineProperty(e,qn,{configurable:!0,value:!0}),!Kn()&&Math.random()>=Fn)return;if(!0===D().asyncConsent){const e=Zt();return void(e&&Xn(e))}document.addEventListener(Bn,Zn,{once:!0})}catch{return}}}const to="p";function no(e){try{return l(e.version)===to}catch{return!1}}function oo(e){var t;if(!e)return;if("p"!==String.fromCharCode(null==e||null===(t=e.version)||void 0===t?void 0:t[0]))return;let n="",o="";const r=e.analyticsAllowed?"A":"a",i=e.preferencesAllowed?"P":"p",a=e.marketingAllowed?"M":"m",s=e.saleOfDataAllowed?"S":"s";function c(e){return!0===e?"t":!1===e?"f":""}0===e.analyticsConsent?n+=r:o+=r,0===e.marketingConsent?n+=a:o+=a,0===e.preferencesConsent?n+=i:o+=i,0===e.saleOfDataConsent?n+=s:o+=s;let u=`3${o}.${n}_${l(e.region)}_${c(e.shouldShowBanner)}_${c(e.saleOfDataRegion)}_${d(e.consentId)||""}_${0===Object.keys(e.metafields).length?"":JSON.stringify(e.metafields)}`;return u=u.replace(/_*$/,""),u}!function(){try{var e,t,n,r,i;if(o()||p())return;if("function"!=typeof(null===(e=performance)||void 0===e?void 0:e.setResourceTimingBufferSize))return;if((null!==(t=null===(n=(r=performance).getEntriesByType)||void 0===n||null===(i=n.call(r,"resource"))||void 0===i?void 0:i.length)&&void 0!==t?t:0)>=1e3)return;performance.setResourceTimingBufferSize(1e3)}catch{}}()},9671:function(e,t,n){n.r(t),n.d(t,{setupEventIdService:function(){return p}});const o="sh",r="shu",i=["page_viewed","collection_viewed","product_viewed","search_submitted","product_added_to_cart","product_added_to_cart_next","checkout_started","checkout_completed","payment_info_submitted","checkout_contact_step_started","checkout_contact_info_submitted","checkout_address_info_submitted","checkout_shipping_step_started","checkout_shipping_info_submitted","checkout_payment_step_started","session_started"],a="wpm",s="trekkie",c="trekkie-next",u="trekkie-parity";let l,d;function f(e){return`${e||o}-${function(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const n=window.crypto,o=new Uint16Array(31);n.getRandomValues(o);let r=0;t=e.replace(/[x]/g,(e=>{const t=o[r];if("number"!=typeof t)throw new Error(`Event ID service: Invalid random number at index "${r}".`);const n=t%16;return r++,("x"===e?n:3&n|8).toString(16)})).toUpperCase()}catch{t=e.replace(/[x]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})).toUpperCase()}return`${function(){let e=0,t=0;e=(new Date).getTime()>>>0;try{t=performance.now()>>>0}catch{t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${t}`}()}`}function p(){window.Shopify=window.Shopify||{},!window.Shopify.evids&&(l={},d={[a]:{},[s]:{},[c]:{},[u]:{}},window.Shopify.evids=(...e)=>function(e,t){if(!function(e){return i.includes(e)}(e)||(null==t?void 0:t.analyticsFramework)!==s&&(null==t?void 0:t.analyticsFramework)!==a&&(null==t?void 0:t.analyticsFramework)!==c&&(null==t?void 0:t.analyticsFramework)!==u)return f(r);const n=function(e){return"string"==typeof e&&e?e:"default"}(t.cacheKey),o=function(e,t,n){const o=d[t],r=o[e]??(o[e]={}),i=r[n];return r[n]="number"==typeof i?i+1:0}(e,t.analyticsFramework,n);return function(e,t,n){const o=l[e]??(l[e]={}),r=o[n]??[];let i=r[t];return i||(i=f(),r.push(i)),o[n]=r,i}(e,o,n)}(...e))}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e,t=n(1074),o=n(1037),r=n(357),i="trekkie",a=[],s=n(2319);a.push(["Trekkie",s.Trekkie]);var c=n(3988);a.push(["S2S",c.S2S]);try{var u=null===(e=window[i])||void 0===e?void 0:e.config;if(u){o.setGlobalSerializedAppConfig(JSON.stringify(u));var l=window[i],d=window.trekkie=new t.Tricorder(a,u,(function(){window[i]=d,window._visit={tag:function(){},multitrackToken:function(){r.default.uniqToken}},d.user=function(){return{traits:function(){return{uniqToken:r.default.uniqToken}}}},t.replayAnalyticsQueue(d,l)}))}}catch(e){o.reportError("index_storefront",e)}}()}();