var privacyBanner=function(n){"use strict";var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])},e(n,t)};function t(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var o=function(){return o=Object.assign||function(n){for(var e,t=1,o=arguments.length;t=0;c--)(r=n[c])&&(i=(a<3?r(i):a>3?r(e,t,i):r(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i}function i(n,e){return function(t,o){e(t,o,n)}}function c(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}function s(n,e,t,o){return new(t||(t=Promise))((function(r,a){function i(n){try{s(o.next(n))}catch(n){a(n)}}function c(n){try{s(o.throw(n))}catch(n){a(n)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(i,c)}s((o=o.apply(n,e||[])).next())}))}function l(n,e){var t,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(s){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(t=1,o&&(r=2&c[0]?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,o=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var o,r,a=t.call(n),i=[];try{for(;(void 0===e||e-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(n){r={error:n}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(r)throw r.error}}return i}function h(){for(var n=[],e=0;e1||c(n,e)}))})}function c(n,e){try{(t=r[n](e)).value instanceof g?Promise.resolve(t.value.v).then(s,l):u(a[0][2],t)}catch(n){u(a[0][3],n)}var t}function s(n){c("next",n)}function l(n){c("throw",n)}function u(n,e){n(e),a.shift(),a.length&&c(a[0][0],a[0][1])}}function v(n){var e,t;return e={},o("next"),o("throw",(function(n){throw n})),o("return"),e[Symbol.iterator]=function(){return this},e;function o(o,r){e[o]=n[o]?function(e){return(t=!t)?{value:g(n[o](e)),done:!1}:r?r(e):e}:r}}function b(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=n[Symbol.asyncIterator];return t?t.call(n):(n=p(n),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(t){e[t]=n[t]&&function(e){return new Promise((function(o,r){(function(n,e,t,o){Promise.resolve(o).then((function(e){n({value:e,done:t})}),e)})(o,r,(e=n[t](e)).done,e.value)}))}}}function _(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var E=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e};function w(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(e,n,t);return E(e,n),e}function A(n){return n&&n.__esModule?n:{default:n}}function D(n,e,t,o){if("a"===t&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?n!==e||!o:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?o:"a"===t?o.call(n):o?o.value:e.get(n)}function x(n,e,t,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(n,t):r?r.value=t:e.set(n,t),t}function I(n,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof n?e===n:n.has(e)}function T(n,e,t){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var o;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=e[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=e[Symbol.dispose]}if("function"!=typeof o)throw new TypeError("Object not disposable.");n.stack.push({value:e,dispose:o,async:t})}else t&&n.stack.push({async:!0});return e}var O="function"==typeof SuppressedError?SuppressedError:function(n,e,t){var o=new Error(t);return o.name="SuppressedError",o.error=n,o.suppressed=e,o};function P(n){function e(e){n.error=n.hasError?new O(e,n.error,"An error was suppressed during disposal."):e,n.hasError=!0}return function t(){for(;n.stack.length;){var o=n.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(t,(function(n){return e(n),t()}))}catch(n){e(n)}}if(n.hasError)throw n.error}()}var k={__extends:t,__assign:o,__rest:r,__decorate:a,__param:i,__metadata:c,__awaiter:s,__generator:l,__createBinding:u,__exportStar:d,__values:p,__read:f,__spread:h,__spreadArrays:y,__spreadArray:m,__await:g,__asyncGenerator:C,__asyncDelegator:v,__asyncValues:b,__makeTemplateObject:_,__importStar:w,__importDefault:A,__classPrivateFieldGet:D,__classPrivateFieldSet:x,__classPrivateFieldIn:I,__addDisposableResource:T,__disposeResources:P},S=Object.freeze({__proto__:null,__addDisposableResource:T,get __assign(){return o},__asyncDelegator:v,__asyncGenerator:C,__asyncValues:b,__await:g,__awaiter:s,__classPrivateFieldGet:D,__classPrivateFieldIn:I,__classPrivateFieldSet:x,__createBinding:u,__decorate:a,__disposeResources:P,__esDecorate:function(n,e,t,o,r,a){function i(n){if(void 0!==n&&"function"!=typeof n)throw new TypeError("Function expected");return n}for(var c,s=o.kind,l="getter"===s?"get":"setter"===s?"set":"value",u=!e&&n?o.static?n:n.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),p=!1,f=t.length-1;f>=0;f--){var h={};for(var y in o)h[y]="access"===y?{}:o[y];for(var y in o.access)h.access[y]=o.access[y];h.addInitializer=function(n){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(n||null))};var m=(0,t[f])("accessor"===s?{get:d.get,set:d.set}:d[l],h);if("accessor"===s){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(c=i(m.get))&&(d.get=c),(c=i(m.set))&&(d.set=c),(c=i(m.init))&&r.unshift(c)}else(c=i(m))&&("field"===s?r.unshift(c):d[l]=c)}u&&Object.defineProperty(u,o.name,d),p=!0},__exportStar:d,__extends:t,__generator:l,__importDefault:A,__importStar:w,__makeTemplateObject:_,__metadata:c,__param:i,__propKey:function(n){return"symbol"==typeof n?n:"".concat(n)},__read:f,__rest:r,__runInitializers:function(n,e,t){for(var o=arguments.length>2,r=0;r1&&void 0!==arguments[1]?arguments[1]:null;return n in W||function(n){const e=document.cookie?document.cookie.split("; "):[];W[n]=void 0;for(let t=0;tn.trim())).map((n=>n.split("=").map((n=>n.trim()))));if(o=Object.fromEntries(n),o.purposes){const n=o.purposes.split(/(true|false)/).filter(Boolean),e={};for(let t=0;tn===t[e]))}(Object.keys(n).filter((n=>"region"!==n)),K)}(n))return n}function $(){try{let n=Q();if(!n)return;return n}catch(n){return}}function nn(){return{m:an(H.MARKETING),a:an(H.ANALYTICS),p:an(H.PREFERENCES),s:an(H.SALE_OF_DATA)}}function en(){return nn()[H.SALE_OF_DATA]}function tn(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===n&&(n=$()),void 0===n}function on(n){switch(n){case L.ACCEPTED:return M.ACCEPTED;case L.DECLINED:return M.DECLINED;default:return M.NO_VALUE}}function rn(n){switch(n){case H.ANALYTICS:return F.ANALYTICS;case H.MARKETING:return F.MARKETING;case H.PREFERENCES:return F.PREFERENCES;case H.SALE_OF_DATA:return F.SALE_OF_DATA}}function an(n){const e=$();if(!e)return L.NO_VALUE;const t=e.con.CMP;return t?t[n]:L.NO_VALUE}const cn="_cmp_a",sn="shopify-cmp-metadata";function ln(){return V(cn,sn)}function un(n){const e=ln();if(!e)return!0;const t=e.purposes[n];return"boolean"!=typeof t||t}function dn(){return un(j.PREFERENCES)}function pn(){return un(j.ANALYTICS)}function fn(){return un(j.MARKETING)}function hn(){return un(j.SALE_OF_DATA)}const yn={"":[],GDPR:[U.GDPR,U.GDPR_BLOCK_ALL],CCPA:[U.CCPA]};function mn(n){void 0!==n.consent?Cn({[j.PREFERENCES]:n.consent,[j.ANALYTICS]:n.consent,[j.MARKETING]:n.consent,[j.SALE_OF_DATA]:n.consent}):void 0!==n.granular_consent&&Cn({[j.PREFERENCES]:dn(),[j.ANALYTICS]:pn(),[j.MARKETING]:fn(),[j.SALE_OF_DATA]:hn()})}function gn(n,e){document.dispatchEvent(new CustomEvent(n,{detail:e||{}}))}function Cn(n){const e=n[j.MARKETING],t=n[j.SALE_OF_DATA],o=n[j.ANALYTICS],r=n[j.PREFERENCES];!0===e?gn(R.MARKETING_ACCEPTED):!1===e&&gn(R.MARKETING_DECLINED),!0===t?gn(R.SALE_OF_DATA_ACCEPTED):!1===t&&gn(R.SALE_OF_DATA_DECLINED),!0===o?gn(R.ANALYTICS_ACCEPTED):!1===o&&gn(R.ANALYTICS_DECLINED),!0===r?gn(R.PREFERENCES_ACCEPTED):!1===r&&gn(R.PREFERENCES_DECLINED);const a=function(n){const e={marketingAllowed:n[j.MARKETING],saleOfDataAllowed:n[j.SALE_OF_DATA],analyticsAllowed:n[j.ANALYTICS],preferencesAllowed:n[j.PREFERENCES],firstPartyMarketingAllowed:n[j.MARKETING],thirdPartyMarketingAllowed:n[j.SALE_OF_DATA]};return e}(n);gn(R.CONSENT_COLLECTED,a);const i=[o,r,e,t];i.every((n=>!0===n))&&gn(R.TRACKING_ACCEPTED),i.every((n=>!1===n))&&gn(R.TRACKING_DECLINED)}const vn=4;function bn(n,e){const t=new XMLHttpRequest,o=JSON.stringify(n);t.open("POST","/set_tracking_consent.json",!0),t.setRequestHeader("Content-Type","application/json"),t.onreadystatechange=function(){if(t.readyState!==vn)return;W={};const o=function(n){try{return JSON.parse(n)}catch(n){return{error:"Unknown error"}}}(t.responseText);var r;0===(r=t.status)||200>=r&&r<400?(mn(n),e(null,o)):e(o)},t.send(o)}function _n(n){const e=JSON.stringify({marketing:n.marketing,analytics:n.analytics,preferences:n.preferences,saleOfData:n.sale_of_data}).replace(/"/g,"");return{query:"query { consentManagement { cookies(visitorConsent: ".concat(e,") { answersCookie trackingConsentCookie } } }"),variables:{}}}function En(n,e){const t=n.granular_consent,o={headers:{"content-type":"application/json","x-shopify-storefront-access-token":t.storefrontAccessToken},body:JSON.stringify(_n(t)),method:"POST"};fetch("https://".concat(t.checkoutRootDomain,"/api/unstable/graphql.json"),o).then((n=>{if(n.ok)return n.json();throw new Error("Server error")})).then((o=>{const r=31536e6,a="."+(t.checkoutRootDomain||window.location.hostname),i="."+(t.storefrontRootDomain||window.location.hostname),c=o.data.consentManagement.cookies.trackingConsentCookie,s=o.data.consentManagement.cookies.answersCookie;z(Z,a,r,c),z(cn,a,r,s),i!==a&&(z(Z,i,r,c),z(cn,i,r,s)),mn(n),e(null,o)})).catch((n=>{e({error:"Error while setting headless consent: "+n.message})}))}function wn(){if(tn())return M.NO_VALUE;const n=nn();return n[H.MARKETING]===L.ACCEPTED&&n[H.ANALYTICS]===L.ACCEPTED?M.ACCEPTED:n[H.MARKETING]===L.DECLINED||n[H.ANALYTICS]===L.DECLINED?M.DECLINED:M.NO_INTERACTION}function An(){const n=function(){const n=$();return tn(n)?B.NO_VALUE:n.reg}();return n in B?n:B.NO_VALUE}function Dn(){return function(){const n=$();return tn(n)?{limit:[]}:{limit:n.lim}}()}function xn(n){return Sn(U.GDPR_BLOCK_ALL)&&n?Tn()?document.referrer:"":null}function In(n){return Sn(U.GDPR_BLOCK_ALL)&&n?Tn()?window.location.pathname+window.location.search:"/":null}function Tn(){if(""===document.referrer)return!0;const n=document.createElement("a");return n.href=document.referrer,window.location.hostname!=n.hostname}function On(){if(!Sn(U.GDPR)&&!Sn(U.GDPR_BLOCK_ALL))return!0;const n=nn();if(n[H.MARKETING]===L.ACCEPTED&&n[H.ANALYTICS]===L.ACCEPTED)return!0;if(n[H.MARKETING]===L.DECLINED||n[H.ANALYTICS]===L.DECLINED)return!1;return An()!==B.GDPR}function Pn(){const n=An();if(n===B.NO_VALUE)return!1;const e=Dn();return 0!==e.limit.length&&e.limit.some((e=>function(n,e){return yn[n].includes(e)}(n,e)))}function kn(){return!!tn()||On()}function Sn(n){return Dn().limit.includes(n)}function Rn(){return An()!==B.CCPA?null:Sn(U.CCPA)?"string"==typeof navigator.globalPrivacyControl?"1"!==navigator.globalPrivacyControl:"boolean"==typeof navigator.globalPrivacyControl?!navigator.globalPrivacyControl:null:null}function Nn(){return!1===Rn()?M.DECLINED:(n=en(),tn()?M.NO_VALUE:n===L.NO_VALUE?M.NO_INTERACTION:on(n));var n}const Mn={getTrackingConsent:wn,setTrackingConsent:function(n,e){if(tn()&&console.warn("Shop is not configured to block privacy regulation in online store settings."),function(n){if("boolean"!=typeof n&&"object"!=typeof n)throw TypeError("setTrackingConsent must be called with a boolean or object consent value");if("object"==typeof n){const e=Object.keys(n);if(0===e.length)throw TypeError("The submitted consent object is empty.");const t=[F.MARKETING,F.ANALYTICS,F.PREFERENCES,F.SALE_OF_DATA,F.EMAIL,G.ROOT_DOMAIN,G.CHECKOUT_ROOT_DOMAIN,G.STOREFRONT_ROOT_DOMAIN,G.STOREFRONT_ACCESS_TOKEN,G.HEADLESS_STOREFRONT];for(const n of e)if(!t.includes(n))throw TypeError("The submitted consent object should only contain the following keys: ".concat(t.join(", "),". Extraneous key: ").concat(n,"."))}}(n),"function"!=typeof e)throw TypeError("setTrackingConsent must be called with a callback function");if("object"==typeof n){const t=xn(n.analytics),o=In(n.analytics);return(n.storefrontAccessToken?En:bn)(J(J({granular_consent:n},null!==t&&{referrer:t}),null!==o&&{landing_page:o}),e)}{const t=xn(n),o=In(n);return bn(J(J({consent:n},null!==t&&{referrer:t}),null!==o&&{landing_page:o}),e)}},userCanBeTracked:kn,getRegulation:An,isRegulationEnforced:Pn,getShopPrefs:Dn,shouldShowGDPRBanner:function(){return An()===B.GDPR&&Pn()&&wn()===M.NO_INTERACTION},userDataCanBeSold:function(){const n=Rn(),e=function(){if(Sn(U.CCPA))return en()!==L.DECLINED;return!0}();return null!==n&&!1!==e?n:!!tn()||!1!==kn()&&e},setCCPAConsent:function(n,e){if("boolean"!=typeof n)throw TypeError("setCCPAConsent must be called with a boolean consent value");if("function"!=typeof e)throw TypeError("setCCPAConsent must be called with a callback function");return bn({ccpa_consent:n},e)},getCCPAConsent:Nn,GPCSignal:Rn,shouldShowCCPABanner:function(){return An()===B.CCPA&&Dn().limit.includes(U.CCPA)&&Nn()===M.NO_INTERACTION},haveAnalyticsConsent:function(){return pn()},havePreferencesConsent:function(){return dn()},haveMarketingConsent:function(){return fn()},haveSaleOfDataConsent:function(){return hn()},getCCPAConsentValue:en,merchantEnforcingRegulationLimit:Sn,shouldShowBanner:function(){return function(){const n=ln();return!!n&&"boolean"==typeof n.display_banner&&n.display_banner}()&&an(H.ANALYTICS)===L.NO_VALUE&&an(H.MARKETING)===L.NO_VALUE&&an(H.PREFERENCES)===L.NO_VALUE},saleOfDataRegion:function(){return function(){const n=ln();return n&&n.sale_of_data_region||!1}()}},Ln="95ba910bcec4542ef2a0b64cd7ca666c";function Bn(n,e,t){try{var o;!function(n){const e=new XMLHttpRequest;e.open("POST","https://notify.bugsnag.com/",!0),e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("Bugsnag-Api-Key",Ln),e.setRequestHeader("Bugsnag-Payload-Version","5");const t=function(n){const e=function(n){return n.stackTrace||n.stack||n.description||n.name}(n.error),[t,o]=(e||"unknown error").split("\n")[0].split(":");return JSON.stringify({payloadVersion:5,notifier:{name:"ConsentTrackingAPI",version:"latest",url:"-"},events:[{exceptions:[{errorClass:(t||"").trim(),message:(o||"").trim(),stacktrace:[{file:"consent-tracking-api.js",lineNumber:"1",method:e}],type:"browserjs"}],context:n.context||"general",app:{id:"ConsentTrackingAPI",version:"latest"},metaData:{request:{shopId:n.shopId,shopUrl:window.location.href},device:{userAgent:window.navigator.userAgent},"Additional Notes":n.notes},unhandled:!1}]})}(n);e.send(t)}({error:n,context:e,shopId:Un()||(null===(o=window.Shopify)||void 0===o?void 0:o.shop),notes:t})}catch(n){}}function jn(n){return function(){try{return n(...arguments)}catch(n){throw Bn(n),n}}}function Un(){try{const n=document.getElementById("shopify-features").textContent;return JSON.parse(n).shopId}catch(n){return null}}function Hn(){return Mn.getTrackingConsent()}function Fn(n,e){return"object"==typeof n&&n.headlessStorefront&&!n.storefrontAccessToken?function(n,e){function t(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.NO_VALUE;return!0===n?L.ACCEPTED:!1===n?L.DECLINED:e}const o={[H.ANALYTICS]:t(n[F.ANALYTICS],L.DECLINED),[H.MARKETING]:t(n[F.MARKETING],L.DECLINED),[H.PREFERENCES]:t(n[F.PREFERENCES],L.DECLINED),[H.SALE_OF_DATA]:t(n[F.SALE_OF_DATA])},r={v:N,reg:B.NO_VALUE,lim:[U.GDPR_BLOCK_ALL,U.CCPA],con:{CMP:o}},a=encodeURIComponent(JSON.stringify(r));z(Z,n.rootDomain,31536e6,a),e(null)}(n,e):Mn.setTrackingConsent(n,e)}function Gn(){return Mn.userCanBeTracked()}function Kn(){return Mn.getRegulation()}function Wn(){return Mn.isRegulationEnforced()}function Vn(){return Mn.getShopPrefs()}function qn(){return Mn.shouldShowGDPRBanner()}function zn(){return Mn.userDataCanBeSold()}function Yn(n,e){return Mn.setCCPAConsent(n,e)}function Jn(){return Mn.getCCPAConsent()}function Xn(){return Mn.shouldShowCCPABanner()}function Zn(){return Mn.haveAnalyticsConsent()}function Qn(){return Mn.havePreferencesConsent()}function $n(){return Mn.haveMarketingConsent()}function ne(){return Mn.haveSaleOfDataConsent()}function ee(){return Mn.shouldShowBanner()}function te(){return Mn.saleOfDataRegion()}function oe(){return!0}function re(){const n={},e=nn();for(const t of Object.keys(e))n[rn(t)]=on(e[t]);return n}function ae(){Mn.getCCPAConsentValue()!=L.DECLINED&&!1===Mn.GPCSignal()&&Yn(!1,(()=>!1));return{getTrackingConsent:jn(Hn),setTrackingConsent:jn(Fn),userCanBeTracked:jn(Gn),getRegulation:jn(Kn),isRegulationEnforced:jn(Wn),getShopPrefs:jn(Vn),shouldShowGDPRBanner:jn(qn),userDataCanBeSold:jn(zn),setCCPAConsent:jn(Yn),getCCPAConsent:jn(Jn),shouldShowCCPABanner:jn(Xn),doesMerchantSupportGranularConsent:jn(oe),analyticsProcessingAllowed:jn(Zn),preferencesProcessingAllowed:jn(Qn),marketingAllowed:jn($n),firstPartyMarketingAllowed:jn($n),saleOfDataAllowed:jn(ne),thirdPartyMarketingAllowed:jn(ne),currentVisitorConsent:jn(re),shouldShowBanner:jn(ee),saleOfDataRegion:jn(te),unstable:{analyticsProcessingAllowed:Zn,preferencesProcessingAllowed:Qn,marketingAllowed:$n,saleOfDataAllowed:ne,currentVisitorConsent:re,shouldShowBanner:ee,saleOfDataRegion:te}}}var ie,ce,se,le,ue,de;!function(n){n.BottomCenter="bottom_center",n.BottomFullWidth="bottom_full_width",n.BottomLeft="bottom_left",n.BottomRight="bottom_right",n.Center="center"}(ie||(ie={})),function(n){n.Custom="custom",n.Dark="dark",n.Light="light"}(ce||(ce={})),function(n){n[n.Yes=1]="Yes",n[n.No=0]="No"}(se||(se={})),function(n){n.StylesContainerId="shopify-pc__banner__styles",n.DialogId="shopify-pc__banner",n.DialogClass="shopify-pc__banner__dialog",n.WrapperClass="shopify-pc__banner__wrapper",n.BodyClass="shopify-pc__banner__body",n.BodyTitleId="shopify-pc__banner__body-title",n.BodyCopyPolicyLinkId="shopify-pc__banner__body-policy-link",n.ButtonsClass="shopify-pc__banner__btns",n.ButtonsGranularClass="shopify-pc__banner__btns-granular",n.ButtonAcceptId="shopify-pc__banner__btn-accept",n.ButtonAcceptClass="shopify-pc__banner__btn-accept",n.ButtonDeclineId="shopify-pc__banner__btn-decline",n.ButtonDeclineClass="shopify-pc__banner__btn-decline",n.ButtonManagePrefsId="shopify-pc__banner__btn-manage-prefs",n.ButtonManagePrefsClass="shopify-pc__banner__btn-manage-prefs"}(le||(le={})),function(n){n.StylesContainerId="shopify-pc__prefs__styles",n.OverlayId="shopify-pc__prefs__overlay",n.OverlayClass="shopify-pc__prefs__overlay",n.WrapperId="shopify-pc__prefs",n.WrapperClass="shopify-pc__prefs",n.DialogId="shopify-pc__prefs__dialog",n.DialogClass="shopify-pc__prefs__dialog",n.DialogScrollableClass="shopify-pc__prefs__scrollable",n.HeaderTitleId="shopify-pc__prefs__header-title",n.HeaderActionsClass="shopify-pc__prefs__header-actions",n.HeaderSaveId="shopify-pc__prefs__header-save",n.HeaderAcceptId="shopify-pc__prefs__header-accept",n.HeaderDeclineId="shopify-pc__prefs__header-decline",n.HeaderCloseId="shopify-pc__prefs__header-close",n.HeaderCloseClass="shopify-pc__prefs__header-close",n.IntroClass="shopify-pc__prefs__intro",n.IntroMainClass="shopify-pc__prefs__intro-main",n.IntroExplainWrapperClass="shopify-pc__prefs__intro-explain",n.IntroExplainAcceptClass="shopify-pc__prefs__intro-explain-accept",n.IntroExplainDeclineClass="shopify-pc__prefs__intro-explain-decline",n.OptionWrapperClass="shopify-pc__prefs__options",n.OptionClass="shopify-pc__prefs__option",n.OptionEssentialId="shopify-pc__prefs__essential",n.OptionEssentialInputId="shopify-pc__prefs__essential-input",n.OptionMarketingId="shopify-pc__prefs__marketing",n.OptionMarketingInputId="shopify-pc__prefs__marketing-input",n.OptionAnalyticsId="shopify-pc__prefs__analytics",n.OptionAnalyticsInputId="shopify-pc__prefs__analytics-input",n.OptionPreferencesId="shopify-pc__prefs__preferences",n.OptionPreferencesInputId="shopify-pc__prefs__preferences-input"}(ue||(ue={})),function(n){n.Black="#333",n.White="#fff",n.Gray="#ccc",n.Green="#3AA83A",n.LightGray="#F7F8F9",n.DarkGray="#36454F",n.VeryDarkGray="#666",n.VeryLightGray="#e5e5e5"}(de||(de={}));var pe=function(n){return"\n border: none;\n color: ".concat(n.fontColor,";\n background: transparent;\n ")},fe=function(n){return"\n border: 1px solid ".concat(n.button.borderColor,";\n color: ").concat(n.button.fontColor,";\n background: ").concat(n.button.backgroundColor,";\n ")};function he(n,e,t,o){void 0===e&&(e="0,0,100,100"),void 0===t&&(t="0,0,0,100"),void 0===o&&(o="0,0,100,100");var r=n.split(","),a=r[0],i=r[1],c=r[2],s=r[3],l=e.split(","),u=l[0],d=l[1],p=l[2],f=l[3],h=t.split(","),y=h[0],m=h[1],g=h[2],C=h[3],v=o.split(","),b=v[0],_=v[1],E=v[2],w=v[3],A={hue:Number(a),saturation:Number(i),lightness:Number(c),alpha:Number(s)},D={hue:Number(u),saturation:Number(d),lightness:Number(p),alpha:Number(f)},x={hue:Number(y),saturation:Number(m),lightness:Number(g),alpha:Number(C)},I={hue:Number(b),saturation:Number(_),lightness:Number(E),alpha:Number(w)},T={hue:A.hue,saturation:A.saturation,lightness:A.lightness,alpha:A.alpha-10},O={hue:D.hue,saturation:D.saturation,lightness:D.lightness<50?D.lightness+14:D.lightness-12,alpha:D.alpha},P={hue:201,saturation:D.lightness<50?60:90,lightness:D.lightness<50?60:80,alpha:D.lightness<50?80:100};return{font:ye(A),fontSubdued:ye(T),buttonFont:ye(x),buttonBackground:ye(I),background:ye(D),divider:ye(O),focused:ye(P)}}function ye(n){return"hsl(".concat(n.hue,"deg, ").concat(n.saturation,"%, ").concat(n.lightness,"%, ").concat(n.alpha,"%)")}function me(n,e,t,o,r){var a="0,0,0,100",i="0,0,100,100",c=he("0,0,12,100","0,0,100,100","0,0,12,100","0,0,100,100"),s=he("0,0,100,87","0,0,12,100","0,0,100,87","0,0,12,100"),l=he(null!=e?e:a,null!=t?t:i,null!=o?o:a,null!=r?r:i),u=function(){switch(n){case ce.Light:return c;case ce.Dark:return s;case ce.Custom:return l;default:return c}}();return{backgroundColor:u.background,fontColor:u.font,fontSubduedColor:u.fontSubdued,sectionDivider:u.divider,iconColor:u.font,focused:u.focused,button:{borderColor:u.buttonFont,backgroundColor:u.buttonBackground,fontColor:u.buttonFont},primaryButton:{borderColor:u.buttonBackground,backgroundColor:u.buttonFont,fontColor:u.buttonBackground}}}function ge(n){var e=n.bannerData,t=n.selectorPrefix,o=t?"".concat(t," "):"",r=me(e.theme.theme,e.theme.fontColor,e.theme.backgroundColor,e.theme.buttonFontColor,e.theme.buttonBackgroundColor),a=function(n,e,t){var o="1280px",r="\n ".concat(t,".").concat(le.WrapperClass," {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: column;\n }\n "),a="\n position: fixed;\n z-index: 2000000;\n box-shadow: 0px 4px 10px rgb(63 63 68 / 40%);\n max-height: 90%;\n box-sizing: border-box;\n opacity: 1;\n padding: 32px;\n background-color: ".concat(e.backgroundColor,";\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n border: none;\n text-align: left;\n "),i=function(){var n="\n ".concat(t,".").concat(le.ButtonsClass," {\n flex-direction: column;\n }\n ").concat(t,".").concat(le.ButtonsGranularClass," :nth-child(1) {\n order: 3;\n }\n ").concat(t,".").concat(le.ButtonsGranularClass," :nth-child(2) {\n order: 1;\n }\n ").concat(t,".").concat(le.ButtonsGranularClass," :nth-child(3) {\n order: 2;\n }\n ");return"\n @media only screen and (max-width: 480px) {\n ".concat(n,"\n }\n ")},c="\n ".concat(t,".").concat(le.DialogClass," {\n ").concat(a,"\n bottom: 0%;\n width: 100%;\n }\n ").concat(t,".").concat(le.DialogClass," button {\n margin: 0 10px 0 0;\n }\n @media only screen and (max-width: ").concat(o,") {\n ").concat(t,".").concat(le.DialogClass," button {\n margin: 15px 10px 0 0;\n }\n }\n ").concat(r,"\n ").concat(t,".").concat(le.WrapperClass," {\n flex-direction: row;\n }\n @media only screen and (max-width: ").concat(o,") {\n ").concat(t,".").concat(le.WrapperClass," {\n flex-direction: column;\n }\n }\n ").concat(t,".").concat(le.BodyClass," {\n margin-right: 5%;\n margin-bottom: 0;\n }\n @media only screen and (max-width: ").concat(o,") {\n ").concat(t,".").concat(le.BodyClass," {\n margin-right: 0;\n margin-bottom: 10px;\n width: 100%;\n }\n }\n ").concat(t,".").concat(le.ButtonsClass," {\n display: flex;\n min-width: 580px;\n flex-direction: row;\n }\n @media only screen and (max-width: ").concat(o,") {\n ").concat(t,".").concat(le.ButtonsClass," {\n min-width: auto;\n width: 100%;\n justify-content: flex-end;\n }\n }\n ").concat(i(),"\n "),s="\n ".concat(t,".").concat(le.DialogClass," {\n ").concat(a,"\n top: 50%;\n left: 25%;\n width: 50%;\n transform: translate(0, -50%);\n min-width: 280px;\n border-radius: 3px;\n }\n ").concat(r,"\n @media only screen and (max-width: 1300px) {\n ").concat(t,".").concat(le.DialogClass," {\n left: 15%;\n width: 70%;\n }\n }\n @media only screen and (max-width: 900px) {\n ").concat(t,".").concat(le.DialogClass," {\n left: 5%;\n width: 90%;\n }\n }\n ").concat(t,".").concat(le.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(le.ButtonsClass," {\n display: flex;\n width: 100%;\n justify-content: flex-end;\n flex-direction: row;\n }\n ").concat(i(),"\n "),l="\n ".concat(t,".").concat(le.DialogClass," {\n ").concat(a,"\n bottom: 0;\n left: 0;\n max-width: 650px;\n border-top-right-radius: 3px;\n }\n ").concat(r,"\n ").concat(t,".").concat(le.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(le.ButtonsClass," {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n flex-direction: row;\n }\n ").concat(i(),"\n "),u="\n ".concat(t,".").concat(le.DialogClass," {\n ").concat(a,"\n bottom: 0;\n right: 0;\n max-width: 650px;\n border-top-left-radius: 3px;\n }\n ").concat(r,"\n ").concat(t,".").concat(le.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(le.ButtonsClass," {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n flex-direction: row;\n }\n ").concat(i(),"\n "),d="\n ".concat(t,".").concat(le.DialogClass," {\n ").concat(a,"\n bottom: 0;\n left: 25%;\n width: 50%;\n min-width: 280px;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n }\n ").concat(r,"\n @media only screen and (max-width: 1300px) {\n ").concat(t,".").concat(le.DialogClass," {\n left: 15%;\n width: 70%;\n }\n }\n @media only screen and (max-width: 900px) {\n ").concat(t,".").concat(le.DialogClass," {\n left: 5%;\n width: 90%;\n }\n }\n ").concat(t,".").concat(le.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(le.ButtonsClass," {\n display: flex;\n width: 100%;\n justify-content: flex-end;\n flex-direction: row;\n }\n ").concat(i(),"\n ");switch(n){case ie.BottomFullWidth:return c;case ie.Center:return s;case ie.BottomLeft:return l;case ie.BottomRight:return u;case ie.BottomCenter:return d;default:return c}}(e.position,r,o),i=function(n,e){if(n===ce.Custom)return{accept:fe(e),decline:fe(e),manage:pe(e)};var t=n===ce.Dark,o="\n background: ".concat(t?de.Black:de.White,";\n color: ").concat(t?de.White:de.Black,";\n ");return{accept:o,decline:o,manage:"\n background: transparent;\n border: none;\n color: ".concat(t?de.White:de.Black,";\n ")}}(e.theme.theme,r);return"\n ".concat(o,".").concat(le.DialogClass," h2 {\n color: ").concat(r.fontColor,";\n font-family: inherit;\n font-size: 120%;\n margin: 0 0 .5em 0;\n padding: 0;\n font-weight: bold;\n }\n ").concat(o,".").concat(le.DialogClass," p {\n color: ").concat(r.fontColor,";\n font-family: inherit;\n line-height: 1.3;\n margin: 0;\n padding: 0;\n }\n ").concat(o,".").concat(le.DialogClass," a {\n color: ").concat(r.fontColor,";\n text-decoration: underline;\n }\n ").concat(o,".").concat(le.DialogClass," button {\n border: none;\n text-decoration: none;\n font-family: inherit;\n padding: 8px 25px;\n margin: 15px 20px 0 0;\n font-size: 100%;\n flex-basis: 50%;\n border-radius: 2px;\n line-height: 120%;\n height: unset;\n text-align: center;\n }\n ").concat(o,".").concat(le.DialogClass," button:focus {\n outline: none;\n box-shadow: 0 0 0 4px ").concat(r.focused,";\n }\n ").concat(o,".").concat(le.DialogClass," button:hover {\n cursor: pointer;\n }\n ").concat(o,".").concat(le.DialogClass," button.").concat(le.ButtonAcceptClass," {\n border: 1px solid ").concat(r.button.borderColor,";\n ").concat(i.accept,"\n }\n ").concat(o,".").concat(le.DialogClass," button.").concat(le.ButtonManagePrefsClass," {\n text-decoration: underline;\n ").concat(i.manage,"\n }\n ").concat(o,".").concat(le.DialogClass," button.").concat(le.ButtonManagePrefsClass,":focus {\n box-shadow: none;\n }\n ").concat(o,".").concat(le.DialogClass," button.").concat(le.ButtonManagePrefsClass,":focus span {\n outline: 2px solid ").concat(r.focused,";\n }\n ").concat(o,".").concat(le.DialogClass," button.").concat(le.ButtonDeclineClass," {\n border: 1px solid ").concat(r.button.borderColor,";\n ").concat(i.decline,"\n }\n ").concat(o,".").concat(le.BodyClass," p a:focus {\n outline: 2px solid ").concat(r.focused,";\n box-shadow: none;\n }\n ").concat(a,"\n ")}function Ce(n){var e=window.location.search.substring(1);if(0===e.length)return null;var t=e.split("&").map((function(n){return n.split("=")})),o=t.filter((function(e){return e[0]===n}))[0];return(o?o[1]:null)||null}function ve(n){var e=window.Shopify.customerPrivacy,t={marketing:n.marketing,analytics:n.analytics,preferences:n.preferences,sale_of_data:n.sale_of_data};n.storefrontAccessToken&&(t.headlessStorefront=!0,t.checkoutRootDomain=n.checkoutRootDomain,t.storefrontRootDomain=n.storefrontRootDomain,t.storefrontAccessToken=n.storefrontAccessToken),e.setTrackingConsent(t,n.callback)}var be=function(){function n(){}return n.getServerData=function(n,e){var t;return s(this,void 0,void 0,(function(){var o;return l(this,(function(r){return this.domain=n,this.appUrl="https://privacy-banner.shopifyapps.com",this.accessToken=e||this.liquidAccessToken(),o=document.querySelector("[data-use-storefront-api]"),"true"===(null===(t=null==o?void 0:o.dataset)||void 0===t?void 0:t.useStorefrontApi)||"native"===Ce("preview_privacy_banner")?[2,this.getDataFromStorefrontApi()]:[2,this.getServerDataWithBackoff()]}))}))},n.getDataFromStorefrontApi=function(){return s(this,void 0,void 0,(function(){var n,e,t,r;return l(this,(function(a){switch(a.label){case 0:if(!this.accessToken)throw new Error("Missing access token");return n={headers:{"content-type":"application/json","x-shopify-storefront-access-token":this.accessToken},body:JSON.stringify({query:"\n query bannerQuery {\n consentManagement {\n banner {\n enabled\n position\n policyLinkText\n policyLinkUrl\n title\n text\n buttonPrefsOpenText\n buttonAcceptText\n buttonDeclineText\n theme {\n theme\n fontColor\n backgroundColor\n buttonFontColor\n buttonBackgroundColor\n }\n preferences {\n title\n introTitle\n introText\n buttonAcceptText\n buttonDeclineText\n buttonSaveText\n bulletPoints {\n enabled\n title\n firstText\n secondText\n thirdText\n }\n purposes {\n essentialName\n essentialDesc\n performanceName\n performanceDesc\n preferencesName\n preferencesDesc\n marketingName\n marketingDesc\n }\n }\n }\n }\n }"}),method:"POST"},e="".concat(this.domain?"https://".concat(this.domain):"","/api/unstable/graphql.json?fast_storefront_renderer=1").concat(Ce("preview_privacy_banner")?"&cache=walrus-no-cache-deep":""),[4,fetch(e,n)];case 1:return 200!==(t=a.sent()).status?[3,3]:[4,t.json()];case 2:if((r=a.sent()).errors)throw new Error(r.errors[0].message);return[2,o({},r.data.consentManagement.banner)];case 3:throw new Error("Could not reach the server")}}))}))},n.getServerDataWithBackoff=function(n){return void 0===n&&(n=1),s(this,void 0,void 0,(function(){var e,t,o,r;return l(this,(function(a){switch(a.label){case 0:return e="".concat(this.appUrl,"/customization?shopify_domain=").concat(this.domain||window.Shopify.shop),t="".concat(e,"&request_attempt=").concat(n),[4,fetch(t)];case 1:return[4,(o=a.sent()).json()];case 2:return r=a.sent(),200===o.status?void 0===r.visible?[2]:[2,this.convertToBannerData(r)]:n>>24,o[1]=t>>>16&255,o[2]=t>>>8&255,o[3]=255&t,o[4]=(t=parseInt(n.slice(9,13),16))>>>8,o[5]=255&t,o[6]=(t=parseInt(n.slice(14,18),16))>>>8,o[7]=255&t,o[8]=(t=parseInt(n.slice(19,23),16))>>>8,o[9]=255&t,o[10]=(t=parseInt(n.slice(24,36),16))/1099511627776&255,o[11]=t/4294967296&255,o[12]=t>>>24&255,o[13]=t>>>16&255,o[14]=t>>>8&255,o[15]=255&t,o};return Ze.default=t,Ze}function $e(){if(Ye)return Xe;Ye=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.URL=Xe.DNS=void 0,Xe.default=function(n,a,i){function c(n,o,r,c){var s;if("string"==typeof n&&(n=function(n){n=unescape(encodeURIComponent(n));const e=[];for(let t=0;t>>9<<4)+1}function e(n,e){const t=(65535&n)+(65535&e);return(n>>16)+(e>>16)+(t>>16)<<16|65535&t}function t(n,t,o,r,a,i){return e((c=e(e(t,n),e(r,i)))<<(s=a)|c>>>32-s,o);var c,s}function o(n,e,o,r,a,i,c){return t(e&o|~e&r,n,e,a,i,c)}function r(n,e,o,r,a,i,c){return t(e&r|o&~r,n,e,a,i,c)}function a(n,e,o,r,a,i,c){return t(e^o^r,n,e,a,i,c)}function i(n,e,o,r,a,i,c){return t(o^(e|~r),n,e,a,i,c)}nt=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var c=function(t){if("string"==typeof t){const n=unescape(encodeURIComponent(t));t=new Uint8Array(n.length);for(let e=0;e>5]>>>r%32&255,a=parseInt(o.charAt(t>>>4&15)+o.charAt(15&t),16);e.push(a)}return e}(function(t,c){t[c>>5]|=128<>5]|=(255&e[n/8])<>>32-e}lt=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.default=void 0;var t=function(t){const o=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const n=unescape(encodeURIComponent(t));t=[];for(let e=0;e>>0;d=u,u=l,l=e(s,30)>>>0,s=i,i=c}r[0]=r[0]+i>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+l>>>0,r[3]=r[3]+u>>>0,r[4]=r[4]+d>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};return pt.default=t,pt}());function t(n){return n&&n.__esModule?n:{default:n}}var o=(0,n.default)("v5",80,e.default);return dt.default=o,dt}var ht,yt={};var mt,gt,Ct={};function vt(){return gt||(gt=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return i.default}});var e=u(function(){if(Fe)return Me;Fe=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.default=void 0;var n,e=(n=Be())&&n.__esModule?n:{default:n},t=qe();let o,r,a=0,i=0;var c=function(n,c,s){let l=c&&s||0;const u=c||new Array(16);let d=(n=n||{}).node||o,p=void 0!==n.clockseq?n.clockseq:r;if(null==d||null==p){const t=n.random||(n.rng||e.default)();null==d&&(d=o=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==p&&(p=r=16383&(t[6]<<8|t[7]))}let f=void 0!==n.msecs?n.msecs:Date.now(),h=void 0!==n.nsecs?n.nsecs:i+1;const y=f-a+(h-i)/1e4;if(y<0&&void 0===n.clockseq&&(p=p+1&16383),(y<0||f>a)&&void 0===n.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,i=h,r=p,f+=122192928e5;const m=(1e4*(268435455&f)+h)%4294967296;u[l++]=m>>>24&255,u[l++]=m>>>16&255,u[l++]=m>>>8&255,u[l++]=255&m;const g=f/4294967296*1e4&268435455;u[l++]=g>>>8&255,u[l++]=255&g,u[l++]=g>>>24&15|16,u[l++]=g>>>16&255,u[l++]=p>>>8|128,u[l++]=255&p;for(let n=0;n<6;++n)u[l+n]=d[n];return c||(0,t.unsafeStringify)(u)};return Me.default=c,Me}()),t=u(function(){if(et)return Je;et=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var n=t($e()),e=t(ot());function t(n){return n&&n.__esModule?n:{default:n}}var o=(0,n.default)("v3",48,e.default);return Je.default=o,Je}()),o=u(st()),r=u(ft()),a=u((ht||(ht=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=void 0,yt.default="00000000-0000-0000-0000-000000000000"),yt)),i=u(function(){if(mt)return Ct;mt=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=void 0;var n,e=(n=Ve())&&n.__esModule?n:{default:n},t=function(n){if(!(0,e.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)};return Ct.default=t,Ct}()),c=u(Ve()),s=u(qe()),l=u(Qe());function u(n){return n&&n.__esModule?n:{default:n}}}(Ne)),Ne}Object.defineProperty(Re,"__esModule",{value:!0}),Re.v4=void 0,Re.v4=function(){return"object"==typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():vt().v4()};var bt={},_t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.toUnderscoreCase=_t.convertAllEventsToUnderscoreCase=_t.convertStringToUnderscoreCase=void 0;var Et=xe;function wt(n,e){return void 0===e&&(e=!0),n&&Object.keys(n).length&&e?Object.keys(n).map((function(e){var t;return(t={})[At(e)]=n[e],t})).reduce((function(n,e){return Et.__assign(Et.__assign({},n),e)})):n}function At(n){return n.split(/(?=[A-Z])/).join("_").toLowerCase()}_t.toUnderscoreCase=wt,_t.convertStringToUnderscoreCase=At,_t.convertAllEventsToUnderscoreCase=function(n){return n.events.map((function(n){var e=!0,t=!0;return n&&n.options&&Object.prototype.hasOwnProperty.call(n.options,"convertEventCase")&&(e=Boolean(n.options.convertEventCase)),n&&n.options&&Object.prototype.hasOwnProperty.call(n.options,"convertMetaDataCase")&&(t=Boolean(n.options.convertMetaDataCase)),{schema_id:n.schemaId,payload:wt(n.payload,e),metadata:wt(n.metadata,t)}}))};var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.MonorailRetriesExceededError=Dt.MonorailRequestError=Dt.MonorailBatchProduceError=Dt.MonorailUnableToProduceError=void 0;var xt=xe,It=function(n){function e(t){var o=n.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(t)))||this;return o.response=t,Object.setPrototypeOf(o,e.prototype),o}return xt.__extends(e,n),e}(Error);Dt.MonorailUnableToProduceError=It;var Tt=function(n){function e(t){var o=n.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(t)))||this;return Object.setPrototypeOf(o,e.prototype),o.response=t,o}return xt.__extends(e,n),e}(Error);Dt.MonorailBatchProduceError=Tt;var Ot=function(n){function e(t){var o=n.call(this,"Error completing request. A network failure may have prevented the request from completing. Error: ".concat(t))||this;return Object.setPrototypeOf(o,e.prototype),o}return xt.__extends(e,n),e}(Error);Dt.MonorailRequestError=Ot;var Pt=function(n){function e(t){var o=n.call(this,"".concat(t))||this;return Object.setPrototypeOf(o,e.prototype),o}return xt.__extends(e,n),e}(Error);Dt.MonorailRetriesExceededError=Pt,Object.defineProperty(bt,"__esModule",{value:!0}),bt.HttpProducer=void 0;var kt=xe,St=Ie,Rt=_t,Nt=Re,Mt=Dt,Lt=function(){function n(n,e){void 0===n&&(n=St.DEVELOPMENT_DOMAIN),void 0===e&&(e=!1),this.edgeDomain=n,this.keepalive=e}return n.withEndpoint=function(e){return new n(St.extractDomain(e))},n.getHeadersFromMetadata=function(n){var e={"Content-Type":"application/json; charset=utf-8","X-Monorail-Edge-Event-Created-At-Ms":(n&&n.eventCreatedAtMs||Date.now()).toString(),"X-Monorail-Edge-Event-Sent-At-Ms":Date.now().toString(),"X-Monorail-Edge-Client-Message-Id":(n&&n.clientMessageId||(0,Nt.v4)()).toString()};return n&&n.userAgent&&(e["User-Agent"]=n.userAgent),n&&n.remoteIp&&(e["X-Forwarded-For"]=n.remoteIp),e},n.prototype.produceBatch=function(e){return kt.__awaiter(this,void 0,void 0,(function(){var t,o,r,a,i,c;return kt.__generator(this,(function(s){switch(s.label){case 0:t={events:(0,Rt.convertAllEventsToUnderscoreCase)(e),metadata:(0,Rt.toUnderscoreCase)(e.metadata)},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,fetch(this.produceBatchEndpoint(),{method:"post",headers:n.getHeadersFromMetadata(e.metadata),body:JSON.stringify(t),keepalive:this.keepalive})];case 2:return o=s.sent(),[3,4];case 3:throw r=s.sent(),new Mt.MonorailRequestError(r);case 4:return 207!==o.status?[3,6]:[4,o.json()];case 5:throw a=s.sent(),new Mt.MonorailBatchProduceError(a);case 6:return o.ok?[3,8]:(i=Mt.MonorailUnableToProduceError.bind,c={status:o.status},[4,o.text()]);case 7:throw new(i.apply(Mt.MonorailUnableToProduceError,[void 0,(c.message=s.sent(),c)]));case 8:return[2,{status:o.status}]}}))}))},n.prototype.produce=function(e){return kt.__awaiter(this,void 0,void 0,(function(){var t,o,r,a,i,c;return kt.__generator(this,(function(s){switch(s.label){case 0:t=!0,e&&e.options&&Object.prototype.hasOwnProperty.call(e.options,"convertEventCase")&&(t=Boolean(e.options.convertEventCase)),o={schema_id:e.schemaId,payload:(0,Rt.toUnderscoreCase)(e.payload,t)},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,fetch(this.produceEndpoint(),{method:"post",headers:n.getHeadersFromMetadata(e.metadata),body:JSON.stringify(o),keepalive:this.keepalive})];case 2:return r=s.sent(),[3,4];case 3:throw a=s.sent(),new Mt.MonorailRequestError(a);case 4:if(!r)throw new Mt.MonorailUnableToProduceError({message:"No response from edge"});return r.ok?[3,6]:(i=Mt.MonorailUnableToProduceError.bind,c={status:r.status},[4,r.text()]);case 5:throw new(i.apply(Mt.MonorailUnableToProduceError,[void 0,(c.message=s.sent(),c)]));case 6:return[2,{status:r.status}]}}))}))},n.prototype.produceBatchEndpoint=function(){return this.edgeDomain+St.PRODUCE_BATCH_ENDPOINT},n.prototype.produceEndpoint=function(){return this.edgeDomain+St.PRODUCE_ENDPOINT},n}();bt.HttpProducer=Lt;var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.LogProducer=void 0;var jt=function(){function n(e){this.sendToConsole=e,e&&n.printWelcomeMessage(e)}return n.printWelcomeMessage=function(n){console.log("%c👋 from Monorail%c\n\n"+"We've noticed that you're".concat(n?"":" not"," ")+"running in debug mode. "+"As such, we will ".concat(n?"produce":"not produce"," ")+"Monorail events to the console. "+"\n\nIf you want Monorail events to ".concat(n?"stop":"start"," ")+"appearing here, %cset debugMode=".concat((!n).toString(),"%c, ")+"for the Monorail Log Producer in your code.","font-size: large;","font-size: normal;","font-weight: bold;","font-weight: normal;")},n.prototype.produce=function(n){return this.sendToConsole&&console.log("Monorail event produced",n),new Promise((function(e){e(n)}))},n.prototype.produceBatch=function(n){return this.sendToConsole&&console.log("Monorail Batch event produced",n),new Promise((function(e){e(n)}))},n}();Bt.LogProducer=jt,Object.defineProperty(De,"__esModule",{value:!0}),De.Monorail=void 0;var Ut=xe,Ht=Ie,Ft=Te,Gt=Re,Kt=bt,Wt=Bt,Vt=function(){function n(e,t){this.producer=e,this.middleware=t,this.executeChain=n.buildMiddlewareChain(this.middleware.concat(new Ft.ProducerMiddleware(e)))}return n.createLogProducer=function(e){return new n(new Wt.LogProducer(e.debugMode),e.middleware||[])},n.createHttpProducerWithEndpoint=function(e,t){return void 0===t&&(t=[]),new n(Kt.HttpProducer.withEndpoint(e),t)},n.createHttpProducer=function(e){var t=e.options&&e.options.keepalive;return new n(e.production?new Kt.HttpProducer(Ht.PRODUCTION_DOMAIN,t):new Kt.HttpProducer(Ht.DEVELOPMENT_DOMAIN,t),e.middleware||[])},n.buildMiddlewareChain=function(n,e){var t=this;return void 0===e&&(e=0),e===n.length?this.identityFn:function(o){return n[e].do(o,t.buildMiddlewareChain(n,e+1))}},n.prototype.produce=function(n){return n.metadata=Ut.__assign({eventCreatedAtMs:Date.now(),clientMessageId:(0,Gt.v4)()},n.metadata),this.executeChain(n)},n.prototype.produceBatch=function(n){return this.executeChain(n)},n}();De.Monorail=Vt;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.RetryMiddleware=void 0;var zt=xe,Yt=Dt,Jt=function(){function n(n,e){void 0===n&&(n=3),void 0===e&&(e=150),this.maxRetries=n,this.delayMs=e}return n.prototype.do=function(n,e){return zt.__awaiter(this,void 0,void 0,(function(){var t,o,r,a,i;return zt.__generator(this,(function(c){switch(c.label){case 0:t=0,c.label=1;case 1:if(!(t=400&&i<500)throw a;return[4,this.delay(this.delayMs*Math.pow(2,t))];case 5:return c.sent(),t++,[3,1];case 6:return[2,r];case 7:throw o?o.message="Retry count of ".concat(this.maxRetries," exceeded. Failed with error: \n").concat(o.message," Aborting request for ").concat(JSON.stringify(n)):o=new Error,new Yt.MonorailRetriesExceededError(o)}}))}))},n.prototype.delay=function(n){return new Promise((function(e){return setTimeout(e,n)}))},n}();qt.RetryMiddleware=Jt,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.RetryMiddleware=n.MonorailRetriesExceededError=n.MonorailUnableToProduceError=n.MonorailRequestError=n.Monorail=void 0;var e=De;Object.defineProperty(n,"Monorail",{enumerable:!0,get:function(){return e.Monorail}});var t=Dt;Object.defineProperty(n,"MonorailRequestError",{enumerable:!0,get:function(){return t.MonorailRequestError}}),Object.defineProperty(n,"MonorailUnableToProduceError",{enumerable:!0,get:function(){return t.MonorailUnableToProduceError}}),Object.defineProperty(n,"MonorailRetriesExceededError",{enumerable:!0,get:function(){return t.MonorailRetriesExceededError}});var o=qt;Object.defineProperty(n,"RetryMiddleware",{enumerable:!0,get:function(){return o.RetryMiddleware}})}(Ae);var Xt,Zt,Qt,$t=function(){function n(n){var e=void 0===n?{}:n,t=e.shopDomain,o=e.isHeadless;this.VISIT_TOKEN="_shopify_s",this.shopDomain=t,this.isHeadless=o,this.monorail=Ae.Monorail.createHttpProducer({production:!0})}return n.prototype.shouldEmit=function(){return!(this.isHeadless&&!0)},n.prototype.emitInteraction=function(n,e){if(void 0===e&&(e=""),this.shouldEmit()){var t=this.getCommonPayload();this.monorail.produce({schemaId:"privacy_banner_interact/1.1",payload:o(o(o({},t),e&&{interactionMetadata:e}),{interactionType:n})})}},n.prototype.emitRender=function(){if(this.shouldEmit()){var n=this.getCommonPayload();this.monorail.produce({schemaId:"privacy_banner_render/1.0",payload:o({},n)})}},n.prototype.visitorRegion=function(){var n=document.cookie.split(";").find((function(n){return n.includes("_tracking_consent=")}));if(!n)return null;var e={};try{e=JSON.parse(unescape(n.split("=")[1]))}catch(n){return null}return e.region||null},n.prototype.getCommonPayload=function(){var n,e=this.shopDomain||(null===(n=window.Shopify)||void 0===n?void 0:n.shop),t=function(n){for(var e=0,t=decodeURIComponent(document.cookie).split(";");e