var privacyBanner=function(e){"use strict";var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},n(e,t)};function t(e,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=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var o=function(){return o=Object.assign||function(e){for(var n,t=1,o=arguments.length;t=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(n,t,i):r(n,t))||i);return a>3&&i&&Object.defineProperty(n,t,i),i}function i(e,n){return function(t,o){n(t,o,e)}}function s(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}function c(e,n,t,o){return new(t||(t=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,s)}c((o=o.apply(e,n||[])).next())}))}function l(e,n){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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(t=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var o,r,a=t.call(e),i=[];try{for(;(void 0===n||n-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(r)throw r.error}}return i}function h(){for(var e=[],n=0;n1||s(e,n)}))})}function s(e,n){try{(t=r[e](n)).value instanceof y?Promise.resolve(t.value.v).then(c,l):u(a[0][2],t)}catch(e){u(a[0][3],e)}var t}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,n){e(n),a.shift(),a.length&&s(a[0][0],a[0][1])}}function _(e){var n,t;return n={},o("next"),o("throw",(function(e){throw e})),o("return"),n[Symbol.iterator]=function(){return this},n;function o(o,r){n[o]=e[o]?function(n){return(t=!t)?{value:y(e[o](n)),done:!1}:r?r(n):n}:r}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,t=e[Symbol.asyncIterator];return t?t.call(e):(e=p(e),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(t){n[t]=e[t]&&function(n){return new Promise((function(o,r){(function(e,n,t,o){Promise.resolve(o).then((function(n){e({value:n,done:t})}),n)})(o,r,(n=e[t](n)).done,n.value)}))}}}function C(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e}var w=Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n};function E(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&u(n,e,t);return w(n,e),n}function x(e){return e&&e.__esModule?e:{default:e}}function A(e,n,t,o){if("a"===t&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof n?e!==n||!o:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?o:"a"===t?o.call(e):o?o.value:n.get(e)}function I(e,n,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 n?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,t):r?r.value=t:n.set(e,t),t}function k(e,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?n===e:e.has(n)}function T(e,n,t){if(null!=n){if("object"!=typeof n&&"function"!=typeof n)throw new TypeError("Object expected.");var o;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=n[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=n[Symbol.dispose]}if("function"!=typeof o)throw new TypeError("Object not disposable.");e.stack.push({value:n,dispose:o,async:t})}else t&&e.stack.push({async:!0});return n}var D="function"==typeof SuppressedError?SuppressedError:function(e,n,t){var o=new Error(t);return o.name="SuppressedError",o.error=e,o.suppressed=n,o};function O(e){function n(n){e.error=e.hasError?new D(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}return function t(){for(;e.stack.length;){var o=e.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(t,(function(e){return n(e),t()}))}catch(e){n(e)}}if(e.hasError)throw e.error}()}var S={__extends:t,__assign:o,__rest:r,__decorate:a,__param:i,__metadata:s,__awaiter:c,__generator:l,__createBinding:u,__exportStar:d,__values:p,__read:f,__spread:h,__spreadArrays:g,__spreadArray:m,__await:y,__asyncGenerator:v,__asyncDelegator:_,__asyncValues:b,__makeTemplateObject:C,__importStar:E,__importDefault:x,__classPrivateFieldGet:A,__classPrivateFieldSet:I,__classPrivateFieldIn:k,__addDisposableResource:T,__disposeResources:O},P=Object.freeze({__proto__:null,__addDisposableResource:T,get __assign(){return o},__asyncDelegator:_,__asyncGenerator:v,__asyncValues:b,__await:y,__awaiter:c,__classPrivateFieldGet:A,__classPrivateFieldIn:k,__classPrivateFieldSet:I,__createBinding:u,__decorate:a,__disposeResources:O,__esDecorate:function(e,n,t,o,r,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!n&&e?o.static?e:e.prototype:null,d=n||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),p=!1,f=t.length-1;f>=0;f--){var h={};for(var g in o)h[g]="access"===g?{}:o[g];for(var g in o.access)h.access[g]=o.access[g];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var m=(0,t[f])("accessor"===c?{get:d.get,set:d.set}:d[l],h);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(d.get=s),(s=i(m.set))&&(d.set=s),(s=i(m.init))&&r.unshift(s)}else(s=i(m))&&("field"===c?r.unshift(s):d[l]=s)}u&&Object.defineProperty(u,o.name,d),p=!0},__exportStar:d,__extends:t,__generator:l,__importDefault:x,__importStar:E,__makeTemplateObject:C,__metadata:s,__param:i,__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__read:f,__rest:r,__runInitializers:function(e,n,t){for(var o=arguments.length>2,r=0;r!0===e))&&le(R.TRACKING_ACCEPTED);i.every((e=>!1===e))&&le(R.TRACKING_DECLINED)}({[B.PREFERENCES]:te(),[B.ANALYTICS]:oe(),[B.MARKETING]:re(),[B.SALE_OF_DATA]:ae()})}function le(e,n){document.dispatchEvent(new CustomEvent(e,{detail:n||{}}))}function ue(e,n){if(null===e)return"null";if(Array.isArray(e)){return`[${e.map((e=>ue(e,!0))).join(",")}]`}if("object"==typeof e){let t=[];for(const n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&t.push(`${n}:${ue(e[n],!0)}`);const o=t.join(",");return n?`{${o}}`:o}return"string"==typeof e?`"${e}"`:`${e}`}const de="_landing_page",pe="_orig_referrer";function fe(e){const n=e.granular_consent;return{query:`query { consentManagement { cookies(${ue(Object.assign(Object.assign({visitorConsent:Object.assign({marketing:n.marketing,analytics:n.analytics,preferences:n.preferences,saleOfData:n.sale_of_data},n.metafields&&{metafields:n.metafields})},n.email&&{visitorEmail:n.email}),{},{origReferrer:e.referrer,landingPage:e.landing_page}))}) { trackingConsentCookie cookieDomain landingPageCookie origReferrerCookie } } }`,variables:{}}}function he(e,n){const t=e.granular_consent,o=t.storefrontAccessToken||function(){const e=document.documentElement.querySelector("#shopify-features"),n="Could not find liquid access token";if(!e)return void console.warn(n);const t=JSON.parse(e.textContent||"").accessToken;if(!t)return void console.warn(n);return t}(),r=t.checkoutRootDomain||window.location.host,a={headers:{"content-type":"application/json",[t.isExtensionToken?"Shopify-Storefront-Extension-Token":"x-shopify-storefront-access-token"]:o},body:JSON.stringify(fe(e)),method:"POST"};return fetch(`https://${r}/api/unstable/graphql.json`,a).then((e=>{if(e.ok)return e.json();throw new Error("Server error")})).then((o=>{const r=31536e6,a=12096e5,i=o.data.consentManagement.cookies.cookieDomain,s=i||t.checkoutRootDomain||window.location.hostname,c=t.storefrontRootDomain||i||window.location.hostname,l=o.data.consentManagement.cookies.trackingConsentCookie,u=o.data.consentManagement.cookies.landingPageCookie,d=o.data.consentManagement.cookies.origReferrerCookie;return V(z,s,r,l),u&&d&&(V(de,s,a,u),V(pe,s,a,d)),c!==s&&(V(z,c,r,l),u&&d&&(V(de,c,a,u),V(pe,c,a,d))),ce(e),void 0!==n&&n(null,o),o})).catch((e=>{const t="Error while setting storefront API consent: "+e.message;if(void 0===n)throw{error:t};n({error:t})}))}function ge(e,n){if(function(e){if("boolean"!=typeof e&&"object"!=typeof e)throw TypeError("setTrackingConsent must be called with a boolean or object consent value");if("object"==typeof e){const n=Object.keys(e);if(0===n.length)throw TypeError("The submitted consent object is empty.");const t=[H.MARKETING,H.ANALYTICS,H.PREFERENCES,H.SALE_OF_DATA,H.EMAIL,F.ROOT_DOMAIN,F.CHECKOUT_ROOT_DOMAIN,F.STOREFRONT_ROOT_DOMAIN,F.STOREFRONT_ACCESS_TOKEN,F.HEADLESS_STOREFRONT,F.IS_EXTENSION_TOKEN,F.METAFIELDS];for(const e of n)if(!t.includes(e))throw TypeError(`The submitted consent object should only contain the following keys: ${t.join(", ")}. Extraneous key: ${e}.`)}}(e),void 0!==n&&"function"!=typeof n)throw TypeError("setTrackingConsent must be called with a callback function if the callback argument is provided");let t;if(!0===e||!1===e){console.warn("Binary consent is deprecated. Please update to granular consent (shopify.dev/docs/api/consent-tracking)");t={analytics:e,preferences:e,marketing:e}}else t=e;const o=function(e){if(!e)return null;return Ce()?document.referrer:""}(t.analytics),r=function(e){if(!e)return null;return Ce()?window.location.pathname+window.location.search:"/"}(t.analytics);return he(Object.assign(Object.assign({granular_consent:t},null!==o&&{referrer:o}),null!==r&&{landing_page:r}),n)}function me(e,n){if(console.warn("This method is deprecated. Please read shopify.dev/docs/api/customer-privacy for the latest information."),"boolean"!=typeof e)throw TypeError("setCCPAConsent must be called with a boolean consent value");if("function"!=typeof n)throw TypeError("setCCPAConsent must be called with a callback function");return he({granular_consent:{sale_of_data:e}},n)}function ye(){if(Y())return N.NO_VALUE;const e=$();return e[L.MARKETING]===j.ACCEPTED&&e[L.ANALYTICS]===j.ACCEPTED?N.ACCEPTED:e[L.MARKETING]===j.DECLINED||e[L.ANALYTICS]===j.DECLINED?N.DECLINED:N.NO_INTERACTION}function ve(){console.warn("getRegulation is deprecated and will be removed.");const e=ee();return""===e?"":["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IS","IE","IT","LV","LI","LT","LU","MT","NL","NO","PL","PT","RO","SI","SK","ES","SE","GB"].includes(e.slice(0,2))?"GDPR":"US"===e.slice(0,2)&&["CA","VA"].includes(e.slice(2,4))?"CCPA":""}function _e(){return console.warn("getShopPrefs is deprecated and will be removed."),{limit:[]}}function be(){return ee()}function Ce(){if(""===document.referrer)return!0;const e=document.createElement("a");return e.href=document.referrer,window.location.hostname!=e.hostname}function we(){return console.warn("isRegulationEnforced is deprecated and will be removed."),!0}function Ee(){return!!Y()||re()&&oe()}function xe(){return se()?"string"==typeof navigator.globalPrivacyControl?"1"!==navigator.globalPrivacyControl:"boolean"==typeof navigator.globalPrivacyControl?!navigator.globalPrivacyControl:null:null}function Ae(){return console.warn("userDataCanBeSold is deprecated and will be replaced with saleOfDataAllowed."),ae()}function Ie(){return ie()&&ye()===N.NO_INTERACTION}function ke(){return!1===xe()?N.DECLINED:(e=Q(),Y()?N.NO_VALUE:e===j.NO_VALUE?N.NO_INTERACTION:J(e));var e}function Te(){return console.warn("shouldShowCCPABanner is deprecated and will be removed."),se()&&ke()===N.NO_INTERACTION}function De(){return!0}function Oe(e){return function(e){const n=K();if(Y(n)||!n.cus)return;const t=n.cus[encodeURIComponent(e)];return t?decodeURIComponent(t):t}(e)}const Se="95ba910bcec4542ef2a0b64cd7ca666c";function Pe(e,n,t){try{var o;!function(e){const n=new XMLHttpRequest;n.open("POST","https://notify.bugsnag.com/",!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Bugsnag-Api-Key",Se),n.setRequestHeader("Bugsnag-Payload-Version","5");const t=function(e){const n=function(e){return e.stackTrace||e.stack||e.description||e.name}(e.error),[t,o]=(n||"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:n}],type:"browserjs"}],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);n.send(t)}({error:e,context:n,shopId:Me()||(null===(o=window.Shopify)||void 0===o?void 0:o.shop),notes:t})}catch(e){}}function Re(e){return(...n)=>{try{return e(...n)}catch(e){throw Pe(e),e}}}function Me(){try{const e=document.getElementById("shopify-features").textContent;return JSON.parse(e).shopId}catch(e){return null}}function Ne(){return re()}function je(){return oe()}function Be(){return te()}function Le(){return ae()}function He(){const e={},n=$();for(const t of Object.keys(n))e[X(t)]=J(n[t]);return e}function Fe(e,n){return"object"==typeof e&&e.headlessStorefront&&!e.storefrontAccessToken?(console.warn("Headless consent has been updated. Please read shopify.dev/docs/api/customer-privacy to integrate."),function(e,n){function t(e,n=j.NO_VALUE){return!0===e?j.ACCEPTED:!1===e?j.DECLINED:n}const o={[L.ANALYTICS]:t(e[H.ANALYTICS],j.DECLINED),[L.MARKETING]:t(e[H.MARKETING],j.DECLINED),[L.PREFERENCES]:t(e[H.PREFERENCES],j.DECLINED),[L.SALE_OF_DATA]:t(e[H.SALE_OF_DATA])},r={v:M,reg:"",con:{CMP:o}},a=encodeURIComponent(JSON.stringify(r));return V(z,e.rootDomain,W,a),n(null),new Promise(((e,n)=>{}))}(e,n||(()=>{}))):ge(e,n)}const Ue=({useBugsnagReporting:e})=>{Q()!=j.DECLINED&&!1===xe()&&me(!1,(()=>!1));const n={getTrackingConsent:ye,setTrackingConsent:Fe,userCanBeTracked:Ee,getRegulation:ve,isRegulationEnforced:we,getShopPrefs:_e,shouldShowGDPRBanner:Ie,userDataCanBeSold:Ae,setCCPAConsent:me,getCCPAConsent:ke,shouldShowCCPABanner:Te,doesMerchantSupportGranularConsent:De,analyticsProcessingAllowed:oe,preferencesProcessingAllowed:te,marketingAllowed:Ne,firstPartyMarketingAllowed:Ne,saleOfDataAllowed:Le,thirdPartyMarketingAllowed:Le,currentVisitorConsent:He,shouldShowBanner:ie,saleOfDataRegion:se,getRegion:be,getTrackingConsentMetafield:Oe,unstable:{analyticsProcessingAllowed:oe,preferencesProcessingAllowed:te,marketingAllowed:Ne,saleOfDataAllowed:Le,currentVisitorConsent:He,shouldShowBanner:ie,saleOfDataRegion:se}};if(!e)return n;const t=["unstable"];for(const e in n)n.hasOwnProperty(e)&&(n[e]=t.includes(e)?n[e]:Re(n[e]));return n};function qe(e={useBugsnagReporting:!1}){return Ue(e)}var Ve,ze,We,Ge,Ke,$e,Qe;!function(e){e.BottomCenter="bottom_center",e.BottomFullWidth="bottom_full_width",e.BottomLeft="bottom_left",e.BottomRight="bottom_right",e.Center="center"}(Ve||(Ve={})),function(e){e.Custom="custom",e.Dark="dark",e.Light="light"}(ze||(ze={})),function(e){e[e.Yes=1]="Yes",e[e.No=0]="No"}(We||(We={})),function(e){e.ConsolidatedText="consolidated_text",e.PositionBottomLeft="position_bottom_left",e.PositionCentered="position_centered",e.MinimalWhitespace="minimal_whitespace",e.HighlightedAccept="highlighted_accept",e.BestHypothesis="best_hypothesis",e.SwapButtonOrder="swap_button_order"}(Ge||(Ge={})),function(e){e.StylesContainerId="shopify-pc__banner__styles",e.DialogId="shopify-pc__banner",e.DialogClass="shopify-pc__banner__dialog",e.WrapperClass="shopify-pc__banner__wrapper",e.BodyClass="shopify-pc__banner__body",e.BodyTitleId="shopify-pc__banner__body-title",e.BodyCopyPolicyLinkId="shopify-pc__banner__body-policy-link",e.ButtonsClass="shopify-pc__banner__btns",e.ButtonsGranularClass="shopify-pc__banner__btns-granular",e.ButtonAcceptId="shopify-pc__banner__btn-accept",e.ButtonAcceptClass="shopify-pc__banner__btn-accept",e.ButtonDeclineId="shopify-pc__banner__btn-decline",e.ButtonDeclineClass="shopify-pc__banner__btn-decline",e.ButtonManagePrefsId="shopify-pc__banner__btn-manage-prefs",e.ButtonManagePrefsClass="shopify-pc__banner__btn-manage-prefs"}(Ke||(Ke={})),function(e){e.StylesContainerId="shopify-pc__prefs__styles",e.OverlayId="shopify-pc__prefs__overlay",e.OverlayClass="shopify-pc__prefs__overlay",e.WrapperId="shopify-pc__prefs",e.WrapperClass="shopify-pc__prefs",e.DialogId="shopify-pc__prefs__dialog",e.DialogClass="shopify-pc__prefs__dialog",e.DialogScrollableClass="shopify-pc__prefs__scrollable",e.HeaderTitleId="shopify-pc__prefs__header-title",e.HeaderActionsClass="shopify-pc__prefs__header-actions",e.HeaderSaveId="shopify-pc__prefs__header-save",e.HeaderAcceptId="shopify-pc__prefs__header-accept",e.HeaderDeclineId="shopify-pc__prefs__header-decline",e.HeaderCloseId="shopify-pc__prefs__header-close",e.HeaderCloseClass="shopify-pc__prefs__header-close",e.IntroClass="shopify-pc__prefs__intro",e.IntroMainClass="shopify-pc__prefs__intro-main",e.IntroExplainWrapperClass="shopify-pc__prefs__intro-explain",e.IntroExplainAcceptClass="shopify-pc__prefs__intro-explain-accept",e.IntroExplainDeclineClass="shopify-pc__prefs__intro-explain-decline",e.OptionWrapperClass="shopify-pc__prefs__options",e.OptionClass="shopify-pc__prefs__option",e.OptionEssentialId="shopify-pc__prefs__essential",e.OptionEssentialInputId="shopify-pc__prefs__essential-input",e.OptionMarketingId="shopify-pc__prefs__marketing",e.OptionMarketingInputId="shopify-pc__prefs__marketing-input",e.OptionAnalyticsId="shopify-pc__prefs__analytics",e.OptionAnalyticsInputId="shopify-pc__prefs__analytics-input",e.OptionPreferencesId="shopify-pc__prefs__preferences",e.OptionPreferencesInputId="shopify-pc__prefs__preferences-input"}($e||($e={})),function(e){e.Black="#333",e.White="#fff",e.Gray="#ccc",e.Green="#3AA83A",e.LightGray="#F7F8F9",e.DarkGray="#36454F",e.VeryDarkGray="#666",e.VeryLightGray="#e5e5e5"}(Qe||(Qe={}));var Ye=function(e){return"\n border: none;\n color: ".concat(e.fontColor,";\n background: transparent;\n ")},Je=function(e){return"\n border: 1px solid ".concat(e.button.borderColor,";\n color: ").concat(e.button.fontColor,";\n background: ").concat(e.button.backgroundColor,";\n ")};function Xe(e,n,t,o){void 0===n&&(n="0,0,100,100"),void 0===t&&(t="0,0,0,100"),void 0===o&&(o="0,0,100,100");var r=e.split(","),a=r[0],i=r[1],s=r[2],c=r[3],l=n.split(","),u=l[0],d=l[1],p=l[2],f=l[3],h=t.split(","),g=h[0],m=h[1],y=h[2],v=h[3],_=o.split(","),b=_[0],C=_[1],w=_[2],E=_[3],x={hue:Number(a),saturation:Number(i),lightness:Number(s),alpha:Number(c)},A={hue:Number(u),saturation:Number(d),lightness:Number(p),alpha:Number(f)},I={hue:Number(g),saturation:Number(m),lightness:Number(y),alpha:Number(v)},k={hue:Number(b),saturation:Number(C),lightness:Number(w),alpha:Number(E)},T={hue:x.hue,saturation:x.saturation,lightness:x.lightness,alpha:x.alpha-10},D={hue:A.hue,saturation:A.saturation,lightness:A.lightness<50?A.lightness+14:A.lightness-12,alpha:A.alpha},O={hue:201,saturation:A.lightness<50?60:90,lightness:A.lightness<50?60:80,alpha:A.lightness<50?80:100};return{font:Ze(x),fontSubdued:Ze(T),buttonFont:Ze(I),buttonBackground:Ze(k),background:Ze(A),divider:Ze(D),focused:Ze(O)}}function Ze(e){return"hsl(".concat(e.hue,"deg, ").concat(e.saturation,"%, ").concat(e.lightness,"%, ").concat(e.alpha,"%)")}function en(e,n,t,o,r){var a="0,0,0,100",i="0,0,100,100",s=Xe("0,0,12,100","0,0,100,100","0,0,12,100","0,0,100,100"),c=Xe("0,0,100,87","0,0,12,100","0,0,100,87","0,0,12,100"),l=Xe(null!=n?n:a,null!=t?t:i,null!=o?o:a,null!=r?r:i),u=function(){switch(e){case ze.Light:return s;case ze.Dark:return c;case ze.Custom:return l;default:return s}}();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 nn(e){var n=e.bannerData,t=e.selectorPrefix,o=n.experimentVariant===Ge.PositionBottomLeft,r=n.experimentVariant===Ge.PositionCentered,a=n.experimentVariant===Ge.HighlightedAccept,i=n.experimentVariant===Ge.MinimalWhitespace,s=n.experimentVariant===Ge.BestHypothesis,c=t?"".concat(t," "):"",l=en(n.theme.theme,n.theme.fontColor,n.theme.backgroundColor,n.theme.buttonFontColor,n.theme.buttonBackgroundColor),u=n.position;o?u=Ve.BottomLeft:r&&(u=Ve.Center);var d=i,p=function(e,n,t,o){void 0===o&&(o=!1);var r="1280px",a="\n ".concat(t,".").concat(Ke.WrapperClass," {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: column;\n }\n "),i="\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: ".concat(o?"20px":"32px",";\n background-color: ").concat(n.backgroundColor,";\n overflow: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n border: none;\n text-align: left;\n "),s=function(){var e="\n ".concat(t,".").concat(Ke.ButtonsClass," {\n flex-direction: column;\n gap: 3px;\n }\n ").concat(t,".").concat(Ke.ButtonsGranularClass," :nth-child(1) {\n order: 3;\n }\n ").concat(t,".").concat(Ke.ButtonsGranularClass," :nth-child(2) {\n order: 1;\n }\n ").concat(t,".").concat(Ke.ButtonsGranularClass," :nth-child(3) {\n order: 2;\n }\n ");return"\n @media only screen and (max-width: 480px) {\n ".concat(e,"\n }\n ")},c="\n ".concat(t,".").concat(Ke.DialogClass," {\n ").concat(i,"\n bottom: 0%;\n width: 100%;\n }\n ").concat(t,".").concat(Ke.DialogClass," button {\n margin: 0 10px 0 0;\n }\n @media only screen and (max-width: ").concat(r,") {\n ").concat(t,".").concat(Ke.DialogClass," button {\n margin: 15px 10px 0 0;\n }\n }\n ").concat(a,"\n ").concat(t,".").concat(Ke.WrapperClass," {\n flex-direction: row;\n }\n @media only screen and (max-width: ").concat(r,") {\n ").concat(t,".").concat(Ke.WrapperClass," {\n flex-direction: column;\n }\n }\n ").concat(t,".").concat(Ke.BodyClass," {\n margin-right: 5%;\n margin-bottom: 0;\n }\n @media only screen and (max-width: ").concat(r,") {\n ").concat(t,".").concat(Ke.BodyClass," {\n margin-right: 0;\n margin-bottom: 10px;\n width: 100%;\n }\n }\n ").concat(t,".").concat(Ke.ButtonsClass," {\n display: flex;\n min-width: 580px;\n flex-direction: row;\n gap: 20px;\n }\n @media only screen and (max-width: ").concat(r,") {\n ").concat(t,".").concat(Ke.ButtonsClass," {\n min-width: auto;\n width: 100%;\n justify-content: flex-end;\n }\n }\n ").concat(s(),"\n "),l="\n ".concat(t,".").concat(Ke.DialogClass," {\n ").concat(i,"\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(a,"\n @media only screen and (max-width: 1300px) {\n ").concat(t,".").concat(Ke.DialogClass," {\n left: 15%;\n width: 70%;\n }\n }\n @media only screen and (max-width: 900px) {\n ").concat(t,".").concat(Ke.DialogClass," {\n left: 5%;\n width: 90%;\n }\n }\n ").concat(t,".").concat(Ke.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(Ke.ButtonsClass," {\n display: flex;\n width: 100%;\n justify-content: flex-end;\n flex-direction: row;\n gap: 20px;\n }\n ").concat(s(),"\n "),u="\n ".concat(t,".").concat(Ke.DialogClass," {\n ").concat(i,"\n bottom: 0;\n left: 0;\n max-width: 650px;\n border-top-right-radius: 3px;\n }\n ").concat(a,"\n ").concat(t,".").concat(Ke.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(Ke.ButtonsClass," {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n flex-direction: row;\n gap: 20px;\n }\n ").concat(s(),"\n "),d="\n ".concat(t,".").concat(Ke.DialogClass," {\n ").concat(i,"\n bottom: 0;\n right: 0;\n max-width: 650px;\n border-top-left-radius: 3px;\n }\n ").concat(a,"\n ").concat(t,".").concat(Ke.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(Ke.ButtonsClass," {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n flex-direction: row;\n gap: 20px;\n }\n ").concat(s(),"\n "),p="\n ".concat(t,".").concat(Ke.DialogClass," {\n ").concat(i,"\n bottom: 0;\n left: ").concat(o?"32%":"25%",";\n width: ").concat(o?"36%":"50%",";\n min-width: 280px;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n }\n ").concat(a,"\n @media only screen and (max-width: 1300px) {\n ").concat(t,".").concat(Ke.DialogClass," {\n left: ").concat(o?"22%":"15%",";\n width: ").concat(o?"56%":"70%",";\n }\n }\n @media only screen and (max-width: 900px) {\n ").concat(t,".").concat(Ke.DialogClass," {\n left: ").concat(o?"10%":"5%",";\n width: ").concat(o?"80%":"90%",";\n }\n }\n ").concat(t,".").concat(Ke.BodyClass," {\n width: 100%;\n margin-bottom: 10px;\n }\n ").concat(t,".").concat(Ke.ButtonsClass," {\n display: flex;\n width: 100%;\n justify-content: flex-end;\n flex-direction: row;\n gap: 20px;\n }\n ").concat(t,".").concat(Ke.DialogClass," h2 {\n line-height: ").concat(o?"1":"initial",";\n }\n ").concat(s(),"\n ");switch(e){case Ve.BottomFullWidth:return c;case Ve.Center:return l;case Ve.BottomLeft:return u;case Ve.BottomRight:return d;case Ve.BottomCenter:return p;default:return c}}(u,l,c,d),f=a||s,h=function(e,n,t){if(void 0===t&&(t=!1),e===ze.Custom)return{accept:Je(n),decline:Je(n),manage:Ye(n)};var o=e===ze.Dark,r=t?Qe.Black:Qe.White,a=t?Qe.White:Qe.Black;return{accept:"\n background: ".concat(o?Qe.Black:r,";\n color: ").concat(o?Qe.White:a,";\n "),decline:"\n background: ".concat(o?Qe.Black:Qe.White,";\n color: ").concat(o?Qe.White:Qe.Black,";\n "),manage:"\n background: transparent;\n border: none;\n color: ".concat(o?Qe.White:Qe.Black,";\n ")}}(n.theme.theme,l,f);return"\n ".concat(c,".").concat(Ke.DialogClass," h2 {\n color: ").concat(l.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(c,".").concat(Ke.DialogClass," p {\n color: ").concat(l.fontColor,";\n font-family: inherit;\n line-height: 1.3;\n margin: 0;\n padding: 0;\n }\n ").concat(c,".").concat(Ke.DialogClass," a {\n color: ").concat(l.fontColor,";\n text-decoration: underline;\n }\n ").concat(c,".").concat(Ke.DialogClass," button {\n border: none;\n text-decoration: none;\n font-family: inherit;\n padding: ").concat(d?"8px 25px":"10px 25px",";\n margin-top: ").concat(d?"7px":"15px",";\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(c,".").concat(Ke.DialogClass," button:focus {\n outline: none;\n box-shadow: 0 0 0 4px ").concat(l.focused,";\n }\n ").concat(c,".").concat(Ke.DialogClass," button:hover {\n cursor: pointer;\n }\n ").concat(c,".").concat(Ke.DialogClass," button.").concat(Ke.ButtonAcceptClass," {\n border: 1px solid ").concat(l.button.borderColor,";\n ").concat(h.accept,"\n }\n ").concat(c,".").concat(Ke.DialogClass," button.").concat(Ke.ButtonManagePrefsClass," {\n text-decoration: underline;\n padding: 0;\n ").concat(h.manage,"\n }\n ").concat(c,".").concat(Ke.DialogClass," button.").concat(Ke.ButtonManagePrefsClass,":focus {\n box-shadow: none;\n }\n ").concat(c,".").concat(Ke.DialogClass," button.").concat(Ke.ButtonManagePrefsClass,":focus span {\n outline: 2px solid ").concat(l.focused,";\n }\n ").concat(c,".").concat(Ke.DialogClass," button.").concat(Ke.ButtonDeclineClass," {\n border: 1px solid ").concat(l.button.borderColor,";\n ").concat(h.decline,"\n }\n ").concat(c,".").concat(Ke.BodyClass," p a:focus {\n outline: 2px solid ").concat(l.focused,";\n box-shadow: none;\n }\n ").concat(p,"\n ")}var tn="8e9cb600c40a8849ba2b6151bb05805c";function on(e,n,t){var o;try{!function(e){var n=new XMLHttpRequest;n.open("POST","https://notify.bugsnag.com/",!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Bugsnag-Api-Key",tn),n.setRequestHeader("Bugsnag-Payload-Version","5");var t=function(e){var n=function(e){return e.stackTrace||e.stack||e.description||e.name}(e.error),t=(n||"unknown error").split("\n")[0].split(":"),o=t[0],r=t[1];return JSON.stringify({payloadVersion:5,notifier:{name:"privacyBanner",version:"latest",url:"-"},events:[{exceptions:[{errorClass:(o||"").trim(),message:(r||"").trim(),stacktrace:[{file:"storefront-banner.js",lineNumber:"1",method:n}],type:"browserjs"}],context:e.context||"general",app:{id:"privacyBanner",version:"latest"},metaData:{request:{shopId:e.shopId,shopUrl:window.location.href},device:{userAgent:window.navigator.userAgent},"Additional Notes":e.notes},unhandled:!1}]})}(e);n.send(t)}({error:e,context:n,shopId:rn()||(null===(o=window.Shopify)||void 0===o?void 0:o.shop),notes:t})}catch(e){}}function rn(){var e;try{var n=null===(e=null===document||void 0===document?void 0:document.getElementById("shopify-features"))||void 0===e?void 0:e.textContent;return n?JSON.parse(n).shopId:null}catch(e){return null}}function an(e){for(var n=0,t=decodeURIComponent(document.cookie).split(";");n>>24,o[1]=t>>>16&255,o[2]=t>>>8&255,o[3]=255&t,o[4]=(t=parseInt(e.slice(9,13),16))>>>8,o[5]=255&t,o[6]=(t=parseInt(e.slice(14,18),16))>>>8,o[7]=255&t,o[8]=(t=parseInt(e.slice(19,23),16))>>>8,o[9]=255&t,o[10]=(t=parseInt(e.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 Vn.default=t,Vn}function Wn(){if(Fn)return qn;Fn=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.URL=qn.DNS=void 0,qn.default=function(e,a,i){function s(e,o,r,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const n=[];for(let t=0;t>>9<<4)+1}function n(e,n){const t=(65535&e)+(65535&n);return(e>>16)+(n>>16)+(t>>16)<<16|65535&t}function t(e,t,o,r,a,i){return n((s=n(n(t,e),n(r,i)))<<(c=a)|s>>>32-c,o);var s,c}function o(e,n,o,r,a,i,s){return t(n&o|~n&r,e,n,a,i,s)}function r(e,n,o,r,a,i,s){return t(n&r|o&~r,e,n,a,i,s)}function a(e,n,o,r,a,i,s){return t(n^o^r,e,n,a,i,s)}function i(e,n,o,r,a,i,s){return t(o^(n|~r),e,n,a,i,s)}Gn=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.default=void 0;var s=function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n>5]>>>r%32&255,a=parseInt(o.charAt(t>>>4&15)+o.charAt(15&t),16);n.push(a)}return n}(function(t,s){t[s>>5]|=128<>5]|=(255&n[e/8])<>>32-n}nt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.default=void 0;var t=function(t){const o=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n>>0;d=u,u=l,l=n(c,30)>>>0,c=i,i=s}r[0]=r[0]+i>>>0,r[1]=r[1]+c>>>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 rt.default=t,rt}());function t(e){return e&&e.__esModule?e:{default:e}}var o=(0,e.default)("v5",80,n.default);return ot.default=o,ot}var it,st={};var ct,lt,ut={};function dt(){return lt||(lt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return i.default}});var n=u(function(){if(Rn)return kn;Rn=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.default=void 0;var e,n=(e=Dn())&&e.__esModule?e:{default:e},t=Ln();let o,r,a=0,i=0;var s=function(e,s,c){let l=s&&c||0;const u=s||new Array(16);let d=(e=e||{}).node||o,p=void 0!==e.clockseq?e.clockseq:r;if(null==d||null==p){const t=e.random||(e.rng||n.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!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:i+1;const g=f-a+(h-i)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||f>a)&&void 0===e.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 y=f/4294967296*1e4&268435455;u[l++]=y>>>8&255,u[l++]=255&y,u[l++]=y>>>24&15|16,u[l++]=y>>>16&255,u[l++]=p>>>8|128,u[l++]=255&p;for(let e=0;e<6;++e)u[l+e]=d[e];return s||(0,t.unsafeStringify)(u)};return kn.default=s,kn}()),t=u(function(){if(Kn)return Un;Kn=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.default=void 0;var e=t(Wn()),n=t(Qn());function t(e){return e&&e.__esModule?e:{default:e}}var o=(0,e.default)("v3",48,n.default);return Un.default=o,Un}()),o=u(et()),r=u(at()),a=u((it||(it=1,Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0,st.default="00000000-0000-0000-0000-000000000000"),st)),i=u(function(){if(ct)return ut;ct=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.default=void 0;var e,n=(e=Bn())&&e.__esModule?e:{default:e},t=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};return ut.default=t,ut}()),s=u(Bn()),c=u(Ln()),l=u(zn());function u(e){return e&&e.__esModule?e:{default:e}}}(In)),In}Object.defineProperty(An,"__esModule",{value:!0}),An.v4=void 0,An.v4=function(){return"object"==typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():dt().v4()};var pt={},ft={};Object.defineProperty(ft,"__esModule",{value:!0}),ft.toUnderscoreCase=ft.convertAllEventsToUnderscoreCase=ft.convertStringToUnderscoreCase=void 0;var ht=vn;function gt(e,n){return void 0===n&&(n=!0),e&&Object.keys(e).length&&n?Object.keys(e).map((function(n){var t;return(t={})[mt(n)]=e[n],t})).reduce((function(e,n){return ht.__assign(ht.__assign({},e),n)})):e}function mt(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}ft.toUnderscoreCase=gt,ft.convertStringToUnderscoreCase=mt,ft.convertAllEventsToUnderscoreCase=function(e){return e.events.map((function(e){var n=!0,t=!0;return e&&e.options&&Object.prototype.hasOwnProperty.call(e.options,"convertEventCase")&&(n=Boolean(e.options.convertEventCase)),e&&e.options&&Object.prototype.hasOwnProperty.call(e.options,"convertMetaDataCase")&&(t=Boolean(e.options.convertMetaDataCase)),{schema_id:e.schemaId,payload:gt(e.payload,n),metadata:gt(e.metadata,t)}}))};var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.MonorailRetriesExceededError=yt.MonorailRequestError=yt.MonorailBatchProduceError=yt.MonorailUnableToProduceError=void 0;var vt=vn,_t=function(e){function n(t){var o=e.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(t)))||this;return o.response=t,Object.setPrototypeOf(o,n.prototype),o}return vt.__extends(n,e),n}(Error);yt.MonorailUnableToProduceError=_t;var bt=function(e){function n(t){var o=e.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(t)))||this;return Object.setPrototypeOf(o,n.prototype),o.response=t,o}return vt.__extends(n,e),n}(Error);yt.MonorailBatchProduceError=bt;var Ct=function(e){function n(t){var o=e.call(this,"Error completing request. A network failure may have prevented the request from completing. Error: ".concat(t))||this;return Object.setPrototypeOf(o,n.prototype),o}return vt.__extends(n,e),n}(Error);yt.MonorailRequestError=Ct;var wt=function(e){function n(t){var o=e.call(this,"".concat(t))||this;return Object.setPrototypeOf(o,n.prototype),o}return vt.__extends(n,e),n}(Error);yt.MonorailRetriesExceededError=wt,Object.defineProperty(pt,"__esModule",{value:!0}),pt.HttpProducer=void 0;var Et=vn,xt=_n,At=ft,It=An,kt=yt,Tt=function(){function e(e,n){void 0===e&&(e=xt.DEVELOPMENT_DOMAIN),void 0===n&&(n=!1),this.edgeDomain=e,this.keepalive=n}return e.withEndpoint=function(n){return new e(xt.extractDomain(n))},e.getHeadersFromMetadata=function(e){var n={"Content-Type":"application/json; charset=utf-8","X-Monorail-Edge-Event-Created-At-Ms":(e&&e.eventCreatedAtMs||Date.now()).toString(),"X-Monorail-Edge-Event-Sent-At-Ms":Date.now().toString(),"X-Monorail-Edge-Client-Message-Id":(e&&e.clientMessageId||(0,It.v4)()).toString()};return e&&e.userAgent&&(n["User-Agent"]=e.userAgent),e&&e.remoteIp&&(n["X-Forwarded-For"]=e.remoteIp),n},e.prototype.produceBatch=function(n){return Et.__awaiter(this,void 0,void 0,(function(){var t,o,r,a,i,s;return Et.__generator(this,(function(c){switch(c.label){case 0:t={events:(0,At.convertAllEventsToUnderscoreCase)(n),metadata:(0,At.toUnderscoreCase)(n.metadata)},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,fetch(this.produceBatchEndpoint(),{method:"post",headers:e.getHeadersFromMetadata(n.metadata),body:JSON.stringify(t),keepalive:this.keepalive})];case 2:return o=c.sent(),[3,4];case 3:throw r=c.sent(),new kt.MonorailRequestError(r);case 4:return 207!==o.status?[3,6]:[4,o.json()];case 5:throw a=c.sent(),new kt.MonorailBatchProduceError(a);case 6:return o.ok?[3,8]:(i=kt.MonorailUnableToProduceError.bind,s={status:o.status},[4,o.text()]);case 7:throw new(i.apply(kt.MonorailUnableToProduceError,[void 0,(s.message=c.sent(),s)]));case 8:return[2,{status:o.status}]}}))}))},e.prototype.produce=function(n){return Et.__awaiter(this,void 0,void 0,(function(){var t,o,r,a,i,s;return Et.__generator(this,(function(c){switch(c.label){case 0:t=!0,n&&n.options&&Object.prototype.hasOwnProperty.call(n.options,"convertEventCase")&&(t=Boolean(n.options.convertEventCase)),o={schema_id:n.schemaId,payload:(0,At.toUnderscoreCase)(n.payload,t)},c.label=1;case 1:return c.trys.push([1,3,,4]),[4,fetch(this.produceEndpoint(),{method:"post",headers:e.getHeadersFromMetadata(n.metadata),body:JSON.stringify(o),keepalive:this.keepalive})];case 2:return r=c.sent(),[3,4];case 3:throw a=c.sent(),new kt.MonorailRequestError(a);case 4:if(!r)throw new kt.MonorailUnableToProduceError({message:"No response from edge"});return r.ok?[3,6]:(i=kt.MonorailUnableToProduceError.bind,s={status:r.status},[4,r.text()]);case 5:throw new(i.apply(kt.MonorailUnableToProduceError,[void 0,(s.message=c.sent(),s)]));case 6:return[2,{status:r.status}]}}))}))},e.prototype.produceBatchEndpoint=function(){return this.edgeDomain+xt.PRODUCE_BATCH_ENDPOINT},e.prototype.produceEndpoint=function(){return this.edgeDomain+xt.PRODUCE_ENDPOINT},e}();pt.HttpProducer=Tt;var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.LogProducer=void 0;var Ot=function(){function e(n){this.sendToConsole=n,n&&e.printWelcomeMessage(n)}return e.printWelcomeMessage=function(e){console.log("%c👋 from Monorail%c\n\n"+"We've noticed that you're".concat(e?"":" not"," ")+"running in debug mode. "+"As such, we will ".concat(e?"produce":"not produce"," ")+"Monorail events to the console. "+"\n\nIf you want Monorail events to ".concat(e?"stop":"start"," ")+"appearing here, %cset debugMode=".concat((!e).toString(),"%c, ")+"for the Monorail Log Producer in your code.","font-size: large;","font-size: normal;","font-weight: bold;","font-weight: normal;")},e.prototype.produce=function(e){return this.sendToConsole&&console.log("Monorail event produced",e),new Promise((function(n){n(e)}))},e.prototype.produceBatch=function(e){return this.sendToConsole&&console.log("Monorail Batch event produced",e),new Promise((function(n){n(e)}))},e}();Dt.LogProducer=Ot,Object.defineProperty(yn,"__esModule",{value:!0}),yn.Monorail=void 0;var St=vn,Pt=_n,Rt=bn,Mt=An,Nt=pt,jt=Dt,Bt=function(){function e(n,t){this.producer=n,this.middleware=t,this.executeChain=e.buildMiddlewareChain(this.middleware.concat(new Rt.ProducerMiddleware(n)))}return e.createLogProducer=function(n){return new e(new jt.LogProducer(n.debugMode),n.middleware||[])},e.createHttpProducerWithEndpoint=function(n,t){return void 0===t&&(t=[]),new e(Nt.HttpProducer.withEndpoint(n),t)},e.createHttpProducer=function(n){var t=n.options&&n.options.keepalive;return new e(n.production?new Nt.HttpProducer(Pt.PRODUCTION_DOMAIN,t):new Nt.HttpProducer(Pt.DEVELOPMENT_DOMAIN,t),n.middleware||[])},e.buildMiddlewareChain=function(e,n){var t=this;return void 0===n&&(n=0),n===e.length?this.identityFn:function(o){return e[n].do(o,t.buildMiddlewareChain(e,n+1))}},e.prototype.produce=function(e){return e.metadata=St.__assign({eventCreatedAtMs:Date.now(),clientMessageId:(0,Mt.v4)()},e.metadata),this.executeChain(e)},e.prototype.produceBatch=function(e){return this.executeChain(e)},e}();yn.Monorail=Bt;var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.RetryMiddleware=void 0;var Ht=vn,Ft=yt,Ut=function(){function e(e,n){void 0===e&&(e=3),void 0===n&&(n=150),this.maxRetries=e,this.delayMs=n}return e.prototype.do=function(e,n){return Ht.__awaiter(this,void 0,void 0,(function(){var t,o,r,a,i;return Ht.__generator(this,(function(s){switch(s.label){case 0:t=0,s.label=1;case 1:if(!(t=400&&i<500)throw a;return[4,this.delay(this.delayMs*Math.pow(2,t))];case 5:return s.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(e)):o=new Error,new Ft.MonorailRetriesExceededError(o)}}))}))},e.prototype.delay=function(e){return new Promise((function(n){return setTimeout(n,e)}))},e}();Lt.RetryMiddleware=Ut,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RetryMiddleware=e.MonorailRetriesExceededError=e.MonorailUnableToProduceError=e.MonorailRequestError=e.Monorail=void 0;var n=yn;Object.defineProperty(e,"Monorail",{enumerable:!0,get:function(){return n.Monorail}});var t=yt;Object.defineProperty(e,"MonorailRequestError",{enumerable:!0,get:function(){return t.MonorailRequestError}}),Object.defineProperty(e,"MonorailUnableToProduceError",{enumerable:!0,get:function(){return t.MonorailUnableToProduceError}}),Object.defineProperty(e,"MonorailRetriesExceededError",{enumerable:!0,get:function(){return t.MonorailRetriesExceededError}});var o=Lt;Object.defineProperty(e,"RetryMiddleware",{enumerable:!0,get:function(){return o.RetryMiddleware}})}(mn);var qt,Vt,zt,Wt=function(){function e(e){var n=void 0===e?{}:e,t=n.shopDomain,o=n.isHeadless;this.VISIT_TOKEN="_shopify_s",this.shopDomain=t,this.isHeadless=o,this.monorail=mn.Monorail.createHttpProducer({production:!0})}return e.prototype.shouldEmit=function(){return!(this.isHeadless&&!0)},e.prototype.emitInteraction=function(e,n){if(void 0===n&&(n=""),this.shouldEmit()){var t=this.getCommonPayload();this.monorail.produce({schemaId:"privacy_banner_interact/1.1",payload:o(o(o({},t),n&&{interactionMetadata:n}),{interactionType:e})})}},e.prototype.emitRender=function(){if(this.shouldEmit()){var e=this.getCommonPayload();this.monorail.produce({schemaId:"privacy_banner_render/1.0",payload:o({},e)})}},e.prototype.visitorRegion=function(){var e=document.cookie.split(";").find((function(e){return e.includes("_tracking_consent=")}));if(!e)return null;var n={};try{n=JSON.parse(unescape(e.split("=")[1]))}catch(e){return null}return n.region||null},e.prototype.getCommonPayload=function(){var e,n=this.shopDomain||(null===(e=window.Shopify)||void 0===e?void 0:e.shop),t=an(this.VISIT_TOKEN)||"0",r=window.location.pathname,a=this.visitorRegion();return o({shopPermanentDomain:n,sessionToken:t,regulation:"CMP",path:r},a&&{region:a})},e}();function Gt(e,n){return(null==n?void 0:n.id)&&e.setAttribute("id",n.id),(null==n?void 0:n.class)&&e.setAttribute("class",n.class),(null==n?void 0:n.onClick)&&e.addEventListener("click",n.onClick),(null==n?void 0:n.appendTo)&&n.appendTo.appendChild(e),(null==n?void 0:n.role)&&e.setAttribute("role",n.role),(null==n?void 0:n.autofocus)&&e.setAttribute("autofocus",""),(null==n?void 0:n.ariaHidden)&&e.setAttribute("aria-hidden","".concat(null==n?void 0:n.ariaHidden)),e}function Kt(e){var n=Gt(document.createElement("div"),e);return(null==e?void 0:e.text)&&(n.textContent=e.text),(null==e?void 0:e.ariaModal)&&n.setAttribute("aria-modal",e.ariaModal),(null==e?void 0:e.ariaLabelledby)&&n.setAttribute("aria-labelledby",e.ariaLabelledby),n}function $t(e){var n=Gt(document.createElement("span"),e);return(null==e?void 0:e.text)&&(n.textContent=e.text),n}function Qt(e){var n,t=Gt(document.createElement("button"),e);return t.textContent=null!==(n=null==e?void 0:e.text)&&void 0!==n?n:null,e.disabled&&t.setAttribute("disabled",""),e.ariaHaspopup&&t.setAttribute("aria-haspopup",e.ariaHaspopup),e.type&&t.setAttribute("type",e.type),e.ariaLabel&&t.setAttribute("aria-label",e.ariaLabel),t}function Yt(e){var n=Gt(document.createElement("a"),e);return n.setAttribute("href",e.href),n.textContent=e.text,n.setAttribute("target",void 0===e.target?"_blank":e.target),e.target&&"_blank"!==e.target||n.setAttribute("rel","noopener noreferrer"),n}function Jt(e){var n=Gt(document.createElement("p"),e);return n.textContent=e.text,n}function Xt(e,n){var t=Gt(document.createElement(e),n);return t.textContent=n.text,t}function Zt(e){return Xt(zt.H2,e)}function eo(e){return Xt(zt.H3,e)}function no(e){var n=Gt(document.createElement("style"),e);return n.textContent=e.content,n}function to(e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"width",e.width),n.setAttributeNS(null,"height",e.height),n.setAttributeNS(null,"viewBox","0 0 ".concat(e.width," ").concat(e.height)),(null==e?void 0:e.fillRule)&&n.setAttributeNS(null,"fill-rule",e.fillRule),(null==e?void 0:e.clipRule)&&n.setAttributeNS(null,"clip-rule",e.clipRule);var t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttributeNS(null,"fill",(null==e?void 0:e.colour)||"#000"),t.setAttributeNS(null,"d",e.path),n.appendChild(t),(null==e?void 0:e.id)&&n.setAttribute("id",e.id),(null==e?void 0:e.class)&&n.setAttribute("class",e.class),(null==e?void 0:e.dataIconType)&&n.setAttribute("data-icon-type",e.dataIconType),(null==e?void 0:e.ariaHidden)&&n.setAttribute("aria-hidden","".concat(null==e?void 0:e.ariaHidden)),(null==e?void 0:e.focusable)&&n.setAttribute("focusable","".concat(null==e?void 0:e.focusable)),(null==e?void 0:e.appendTo)&&e.appendTo.appendChild(n),n}function oo(e){var n=Gt(document.createElement("section"),e);return(null==e?void 0:e.text)&&(n.textContent=e.text),(null==e?void 0:e.ariaModal)&&n.setAttribute("aria-modal",e.ariaModal),(null==e?void 0:e.ariaLabelledby)&&n.setAttribute("aria-labelledby",e.ariaLabelledby),n}function ro(e){var n=e.bannerData,t=n.experimentVariant===Ge.ConsolidatedText,o=n.experimentVariant===Ge.BestHypothesis,r=n.experimentVariant===Ge.SwapButtonOrder,a=oo({id:Ke.DialogId,class:Ke.DialogClass,role:"alertdialog",ariaModal:"false",ariaLabelledby:Ke.BodyTitleId}),i=Kt({class:Ke.WrapperClass});a.appendChild(i);var s=Kt({class:Ke.BodyClass});i.appendChild(s);var c=Kt({class:Ke.ButtonsClass});return c.classList.add(Ke.ButtonsGranularClass),i.appendChild(c),t||o?function(e,n){var t,o=Zt({id:Ke.BodyTitleId,text:(null===(t=e.experiment)||void 0===t?void 0:t.title)||""});n.appendChild(o)}(n,s):function(e,n){if(e.title){var t=Zt({id:Ke.BodyTitleId,text:e.title});n.appendChild(t)}}(n,s),t||o?function(e,n){var t,o,r,a=Jt({text:"".concat(e.text," ")}),i=Yt({id:Ke.ButtonManagePrefsId,href:"#",text:(null===(t=e.experiment)||void 0===t?void 0:t.preferences)||""}),s=Yt({id:Ke.BodyCopyPolicyLinkId,href:e.policyLinkUrl,target:"_blank",text:(null===(o=e.experiment)||void 0===o?void 0:o.privacyPolicy)||""}),c=" ".concat((null===(r=e.experiment)||void 0===r?void 0:r.customizeYour)||""," ");a.appendChild(s),a.appendChild($t({text:c})),a.appendChild(i),a.appendChild($t({text:"."})),n.appendChild(a)}(n,s):function(e,n){var t=Jt({text:"".concat(e.text," ")}),o=Yt({id:Ke.BodyCopyPolicyLinkId,href:e.policyLinkUrl,target:"_blank",text:e.policyLinkText?e.policyLinkText:"Privacy Policy"});t.appendChild(o),n.appendChild(t)}(n,s),t||o||function(e,n){var t=$t({text:e.buttonPrefsOpenText}),o=Qt({id:Ke.ButtonManagePrefsId,class:Ke.ButtonManagePrefsClass,ariaHaspopup:"dialog",type:"button"});o.appendChild(t),n.appendChild(o)}(n,c),r||o?(io(n,c),ao(n,c)):(ao(n,c),io(n,c)),a}function ao(e,n){n.appendChild(Qt({id:Ke.ButtonAcceptId,class:Ke.ButtonAcceptClass,type:"button",text:e.buttonAcceptText}))}function io(e,n){n.appendChild(Qt({id:Ke.ButtonDeclineId,class:Ke.ButtonDeclineClass,type:"button",text:e.buttonDeclineText}))}function so(e,n){var t,o,r,a,i=(t={appendTo:e},Gt(document.createElement("header"),t));o=i,r="Close dialog",to({appendTo:a=Qt({id:$e.HeaderCloseId,class:$e.HeaderCloseClass,ariaLabel:r,type:"button",text:""}),ariaHidden:!0,width:"12",height:"12",path:"M7.41401 6.00012L11.707 1.70721C12.098 1.31622 12.098 0.684236 11.707 0.293244C11.316 -0.097748 10.684 -0.097748 10.293 0.293244L6.00001 4.58615L1.70701 0.293244C1.31601 -0.097748 0.684006 -0.097748 0.293006 0.293244C-0.0979941 0.684236 -0.0979941 1.31622 0.293006 1.70721L4.58601 6.00012L0.293006 10.293C-0.0979941 10.684 -0.0979941 11.316 0.293006 11.707C0.488006 11.902 0.744006 12 1.00001 12C1.25601 12 1.51201 11.902 1.70701 11.707L6.00001 7.4141L10.293 11.707C10.488 11.902 10.744 12 11 12C11.256 12 11.512 11.902 11.707 11.707C12.098 11.316 12.098 10.684 11.707 10.293L7.41401 6.00012Z"}),o.appendChild(a),Zt({id:$e.HeaderTitleId,text:n.preferences.title,appendTo:i});var s=Kt({class:$e.HeaderActionsClass,appendTo:i});return function(e,n){e.appendChild(Qt({id:$e.HeaderAcceptId,type:"button",text:n}))}(s,n.preferences.buttonAcceptText),function(e,n){e.appendChild(Qt({id:$e.HeaderDeclineId,type:"button",text:n}))}(s,n.preferences.buttonDeclineText),function(e,n){e.appendChild(Qt({id:$e.HeaderSaveId,type:"button",text:n}))}(s,n.preferences.buttonSaveText),i}function co(e,n){var t=Kt({class:$e.IntroClass,appendTo:e});return function(e,n){var t=Kt({class:$e.IntroMainClass,appendTo:e});eo({text:n.preferences.introTitle,appendTo:t}),Jt({text:n.preferences.introText,appendTo:t})}(t,n),n.preferences.bulletPoints.enabled&&function(e,n){var t=Kt({class:$e.IntroExplainWrapperClass,appendTo:e}),o=Kt({class:$e.IntroExplainAcceptClass,appendTo:t});eo({text:n.preferences.bulletPoints.title||"",appendTo:o});var r=[];n.preferences.bulletPoints.firstText&&r.push(n.preferences.bulletPoints.firstText);n.preferences.bulletPoints.secondText&&r.push(n.preferences.bulletPoints.secondText);n.preferences.bulletPoints.thirdText&&r.push(n.preferences.bulletPoints.thirdText);(function(e){var n=Gt(document.createElement("ul"),e);e.lis&&e.lis.forEach((function(e){var t=document.createElement("li");t.textContent=e,n.appendChild(t)}))})({lis:r,appendTo:o})}(t,n),t}function lo(e){var n=e.themeColours,t=e.purpose,o=e.ids,r=e.parent,a=o.input===$e.OptionEssentialInputId,i=to({dataIconType:"unchecked",width:"24",height:"24",path:"M5 2c-1.654 0-3 1.346-3 3v14c0 1.654 1.346 3 3 3h14c1.654 0 3-1.346 3-3v-14c0-1.654-1.346-3-3-3h-14zm19 3v14c0 2.761-2.238 5-5 5h-14c-2.762 0-5-2.239-5-5v-14c0-2.761 2.238-5 5-5h14c2.762 0 5 2.239 5 5z",colour:n.iconColor,focusable:!0}),s=function(e){return to({dataIconType:"checked",width:"24",height:"24",path:"M19 0h-14c-2.762 0-5 2.239-5 5v14c0 2.761 2.238 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-8.959 17l-4.5-4.319 1.395-1.435 3.08 2.937 7.021-7.183 1.422 1.409-8.418 8.591z",colour:e,focusable:!0})}(n.iconColor),c=Kt({class:$e.OptionClass,id:o.section}),l=function(e){var n=Gt(document.createElement("label"),e);return n.setAttribute("for",e.for),(null==e?void 0:e.text)&&(n.textContent=e.text),n}({appendTo:c,for:o.input,text:t.description});!function(e){var n=Gt(document.createElement("input"),e);n.setAttribute("type",e.type),e.checked&&n.setAttribute("checked","true"),e.disabled&&n.setAttribute("disabled","".concat(e.disabled)),(null==e?void 0:e.onChange)&&n.addEventListener("change",e.onChange),e.tabindex&&n.setAttribute("tabindex","".concat(e.tabindex)),!0===e.ariaReadonly&&n.setAttribute("aria-readonly","".concat(e.ariaReadonly))}({appendTo:l,id:o.input,type:"checkbox",checked:a,ariaReadonly:a,tabindex:"0"});var u=$t({appendTo:l,ariaHidden:!0});u.appendChild(s),u.appendChild(i),Jt({appendTo:c,text:t.longDescription}),a?(s.style.display="block",i.style.display="none"):(s.style.display="none",i.style.display="block"),r.appendChild(c)}function uo(e){var n=e.bannerData,t=Kt({id:$e.WrapperId,class:$e.WrapperClass}),o=Kt({id:$e.OverlayId,class:$e.OverlayClass,text:" "});t.appendChild(o);var r=oo({id:$e.DialogId,class:$e.DialogClass,role:"dialog",ariaModal:"true",ariaLabelledby:$e.HeaderTitleId});t.appendChild(r),so(r,n);var a=Kt({class:$e.DialogScrollableClass});return r.appendChild(a),co(a,n),function(e,n){var t=en(n.theme.theme,n.theme.fontColor,n.theme.backgroundColor,n.theme.buttonFontColor,n.theme.buttonBackgroundColor),o=Kt({class:$e.OptionWrapperClass});e.appendChild(o),lo({themeColours:t,ids:{section:$e.OptionEssentialId,input:$e.OptionEssentialInputId},purpose:{description:n.preferences.purposes.essentialName,longDescription:n.preferences.purposes.essentialDesc},parent:o}),lo({themeColours:t,ids:{section:$e.OptionPreferencesId,input:$e.OptionPreferencesInputId},purpose:{description:n.preferences.purposes.preferencesName,longDescription:n.preferences.purposes.preferencesDesc},parent:o}),lo({themeColours:t,ids:{section:$e.OptionMarketingId,input:$e.OptionMarketingInputId},purpose:{description:n.preferences.purposes.marketingName,longDescription:n.preferences.purposes.marketingDesc},parent:o}),lo({themeColours:t,ids:{section:$e.OptionAnalyticsId,input:$e.OptionAnalyticsInputId},purpose:{description:n.preferences.purposes.performanceName,longDescription:n.preferences.purposes.performanceDesc},parent:o})}(a,n),t}!function(e){e.Accepted="accept",e.Declined="decline",e.AcceptedAll="accept_all",e.DeclinedAll="decline_all",e.ManagePreferences="manage_preferences",e.Save="save",e.LeavePreferences="leave_preferences",e.PrivacyPolicyView="privacy_policy_view"}(qt||(qt={})),function(e){e.BottomFullWidth="bottom-full-width",e.BottomLeft="bottom-left",e.Center="center",e.BottomRight="bottom-right",e.BottomCenter="bottom-center"}(Vt||(Vt={})),function(e){e.H1="h1",e.H2="h2",e.H3="h3"}(zt||(zt={}));var po,fo=function(){function e(e){var n=e.bannerData,t=e.storefrontAccessToken,o=e.checkoutRootDomain,r=e.storefrontRootDomain;this.bannerData=n,t?(this.storefrontAccessToken=t,this.checkoutRootDomain=o,this.storefrontRootDomain=r,this.logger=new Wt({shopDomain:o,isHeadless:!0})):this.logger=new Wt}return e.show=function(){var e=document.getElementById($e.WrapperId);null!==e&&(e.style.display="block",document.body.style.setProperty("overflow","hidden"))},e.hide=function(){var e=document.getElementById($e.WrapperId);null!==e&&(e.style.display="none",document.body.style.removeProperty("overflow"))},e.hideModalAndBanner=function(){e.hide();var n=document.getElementById(Ke.DialogId);null!==n&&(n.style.display="none")},e.selectedConsent=function(){var e=document.getElementById($e.OptionMarketingInputId),n=document.getElementById($e.OptionAnalyticsInputId),t=document.getElementById($e.OptionPreferencesInputId),o=e.checked?"1":"0",r=n.checked?"1":"0",a=t.checked?"1":"0";return"".concat(o).concat(r).concat(a)},e.prototype.init=function(){return c(this,void 0,void 0,(function(){return l(this,(function(e){return this.render(),[2]}))}))},e.prototype.setCheckboxesToCurrentConsent=function(){var e=document.getElementById($e.OptionAnalyticsInputId),n=document.getElementById($e.OptionPreferencesInputId),t=document.getElementById($e.OptionMarketingInputId);this.handleOptionChange({target:e,isReadOnly:!1,sectionId:$e.OptionAnalyticsId,checked:je()}),this.handleOptionChange({target:n,isReadOnly:!1,sectionId:$e.OptionPreferencesId,checked:Be()}),this.handleOptionChange({target:t,isReadOnly:!1,sectionId:$e.OptionMarketingId,checked:Ne()})},e.prototype.render=function(){this.addCSS(this.bannerData),this.addHTML(this.bannerData),e.show(),this.setupCheckboxEventHandlers(),this.setupButtonEventHandlers(),this.setupKeyboardEventHandlers(),this.logger.emitInteraction(qt.ManagePreferences)},e.prototype.addCSS=function(e){var n=function(e){var n=e.bannerData,t=e.selectorPrefix,o=t?"".concat(t," "):"",r=en(n.theme.theme,n.theme.fontColor,n.theme.backgroundColor,n.theme.buttonFontColor,n.theme.buttonBackgroundColor);return"\n ".concat(o,".").concat($e.WrapperClass," {\n position: relative;\n }\n ").concat(o,".").concat($e.WrapperClass,':after {\n content: "";\n display: block;\n clear: both;\n }\n\n ').concat(o,".").concat($e.DialogClass," {\n box-shadow: 0 5px 10px rgb(63 63 68 / 50%);\n position: fixed;\n z-index: 2000002;\n opacity: 1;\n background-color: ").concat(r.backgroundColor,";\n max-height: 80%;\n overflow-y: auto;\n top: 50%;\n transform: translate(0, -50%);\n min-width: 280px;\n border-radius: 3px;\n display: flex;\n flex-direction: column;\n left: 25%;\n width: 50%;\n text-align: left;\n }\n @media only screen and (max-width: 1900px) {\n ").concat(o,".").concat($e.DialogClass," {\n left: 20%;\n width: 60%;\n }\n }\n @media only screen and (max-width: 1600px) {\n ").concat(o,".").concat($e.DialogClass," {\n left: 15%;\n width: 70%;\n }\n }\n @media only screen and (max-width: 1350px) {\n ").concat(o,".").concat($e.DialogClass," {\n left: 5%;\n width: 90%;\n }\n }\n\n ").concat(o,".").concat($e.OverlayClass," {\n z-index: 2000001;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n }\n\n /* Header */\n\n ").concat(o,".").concat($e.DialogClass," header {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 32px 32px 20px 32px;\n border-bottom: 1px solid ").concat(r.sectionDivider,";\n position: relative;\n background: transparent;\n }\n\n @media only screen and (max-width: 1200px) {\n ").concat(o,".").concat($e.DialogClass," header {\n flex-direction: column;\n }\n }\n @media only screen and (max-width: 400px) {\n ").concat(o,".").concat($e.DialogClass," header {\n padding: 15px 20px 10px 20px;\n }\n }\n ").concat(o,".").concat($e.DialogClass," header h2 {\n color: ").concat(r.fontColor,";\n font-family: inherit;\n margin: 0;\n padding: 0 20px 0 0 !important;\n font-weight: 600;\n font-size: 130%;\n line-height: 1.2;\n width: 100%;\n text-align: left;\n word-break: normal;\n }\n @media only screen and (max-width: 1200px) {\n ").concat(o,".").concat($e.DialogClass," header h2 {\n margin: 0 0 .8em 0;\n padding: 0 !important;\n text-align: center;\n }\n }\n @media only screen and (max-width: 750px) {\n ").concat(o,".").concat($e.DialogClass," header h2 {\n text-align: left;\n padding: 0 25px 0 0 !important;\n }\n }\n\n ").concat(o,".").concat($e.HeaderCloseClass," {\n position: absolute;\n top: 40px;\n right: 35px;\n width: 24px;\n height: 24px;\n padding: 0;\n margin: 0;\n background: transparent;\n border: none;\n outline: none;\n display: flex;\n justify-content: center;\n align-items: center;\n align-content: center;\n border-radius: 50%;\n min-width: 24px;\n }\n\n ").concat(o,".").concat($e.HeaderCloseClass," svg {\n height: 12px;\n width: 12px;\n }\n\n @media only screen and (max-width: 1200px) {\n ").concat(o,".").concat($e.HeaderCloseClass," {\n top: 20px;\n right: 20px;\n }\n }\n @media only screen and (max-width: 750px) {\n ").concat(o,".").concat($e.HeaderCloseClass," {\n top: 30px;\n right: 30px;\n }\n }\n @media only screen and (max-width: 400px) {\n ").concat(o,".").concat($e.HeaderCloseClass," {\n top: 15px;\n right: 15px;\n }\n }\n ").concat(o,".").concat($e.HeaderCloseClass,":hover {\n cursor: pointer;\n }\n ").concat(o,".").concat($e.HeaderCloseClass,":focus {\n outline: none;\n box-shadow: 0 0 0 3px ").concat(r.focused,";\n }\n ").concat(o,".").concat($e.HeaderCloseClass," svg path {\n fill: ").concat(r.fontColor,";\n }\n ").concat(o,".").concat($e.HeaderCloseClass,":disabled svg path {\n fill: ").concat(r.sectionDivider,";\n }\n\n ").concat(o,".").concat($e.HeaderActionsClass," {\n margin: 0;\n display: flex;\n justify-content: space-around;\n flex-direction: row;\n padding: 0 50px 0 0;\n width: auto;\n }\n\n @media only screen and (max-width: 750px) {\n ").concat(o,".").concat($e.HeaderActionsClass," {\n flex-direction: column;\n width: 100%;\n }\n }\n @media only screen and (max-width: 1200px) {\n ").concat(o,".").concat($e.HeaderActionsClass," {\n padding: 0;\n }\n }\n ").concat(o,".").concat($e.HeaderActionsClass," button {\n text-decoration: none;\n font-family: inherit;\n padding: 8px 25px 10px 25px;\n margin: 0 20px 0 0;\n font-size: 110%;\n background: ").concat(r.button.backgroundColor,";\n color: ").concat(r.button.fontColor,";\n border: 1px solid ").concat(r.button.borderColor,";\n white-space: nowrap;\n border-radius: 2px;\n line-height: 120%;\n height: unset;\n }\n @media only screen and (max-width: 750px) {\n ").concat(o,".").concat($e.HeaderActionsClass," button {\n width: 100%;\n margin-bottom: 15px;\n }\n }\n ").concat(o,".").concat($e.HeaderActionsClass," button.primary {\n background: ").concat(r.primaryButton.backgroundColor,";\n color: ").concat(r.primaryButton.fontColor,";\n border: 1px solid ").concat(r.primaryButton.borderColor,";\n }\n ").concat(o,".").concat($e.HeaderActionsClass," button:last-child {\n margin-right: 0;\n }\n ").concat(o,".").concat($e.HeaderActionsClass," button:hover {\n cursor: pointer;\n }\n ").concat(o,".").concat($e.HeaderActionsClass," button:focus {\n outline: none;\n box-shadow: 0 0 0 4px ").concat(r.focused,";\n }\n\n ").concat(o,".").concat($e.DialogScrollableClass," {\n overflow-y: scroll;\n position: relative;\n }\n\n ").concat(o,".").concat($e.DialogScrollableClass,"::-webkit-scrollbar {\n width: 0px;\n background: transparent;\n }\n\n /* Intro */\n\n ").concat(o,".").concat($e.IntroClass," h3 {\n color: ").concat(r.fontColor,";\n font-family: inherit;\n margin: 0 0 15px 0;\n padding: 0 !important;\n font-weight: 600;\n line-height: 1.2;\n text-align: left;\n }\n ").concat(o,".").concat($e.IntroClass," p {\n color: ").concat(r.fontSubduedColor,";\n font-family: inherit;\n margin: 0;\n padding: 0;\n }\n ").concat(o,".").concat($e.IntroClass," ul {\n margin: 0;\n padding: 0;\n }\n ").concat(o,".").concat($e.IntroClass," ul li {\n margin: 0 0 0.5em 1.7em;\n padding: 0;\n line-height: 1.2;\n }\n ").concat(o,".").concat($e.IntroMainClass," {\n padding: 20px 32px 0 32px;\n line-height: 1.5;\n }\n @media only screen and (max-width: 400px) {\n ").concat(o,".").concat($e.IntroMainClass," {\n padding: 20px 20px 0 20px;\n }\n }\n ").concat(o,".").concat($e.IntroMainClass," p {\n padding-bottom: 20px;\n }\n ").concat(o,".").concat($e.IntroMainClass," h3 {\n font-size: 110%;\n }\n ").concat(o,".").concat($e.IntroMainClass," p {\n font-size: 105%;\n margin: 0;\n padding: 0;\n }\n ").concat(o,".").concat($e.IntroExplainWrapperClass," {\n display: flex;\n flex-direction: row;\n justify-content: center;\n margin: 0;\n padding: 20px 32px 0 32px;\n color: ").concat(r.fontSubduedColor,";\n }\n @media only screen and (max-width: 700px) {\n ").concat(o,".").concat($e.IntroExplainWrapperClass," {\n flex-direction: column;\n padding-bottom: 0;\n }\n }\n @media only screen and (max-width: 400px) {\n ").concat(o,".").concat($e.IntroExplainWrapperClass," {\n padding: 20px 20px 0 20px;\n }\n }\n ").concat(o,".").concat($e.IntroExplainAcceptClass," {\n width: 100%;\n padding: 0 40px 0 0;\n }\n ").concat(o,".").concat($e.IntroExplainAcceptClass," li {\n list-style-type: disc;\n }\n @media only screen and (max-width: 700px) {\n ").concat(o,".").concat($e.IntroExplainAcceptClass," {\n width: 100%;\n padding-right: 0;\n }\n }\n ").concat(o,".").concat($e.IntroExplainAcceptClass," h3 {\n font-size: 110%;\n }\n\n /* Options */\n\n ").concat(o,".").concat($e.OptionWrapperClass," {\n padding: 0 32px 32px 32px;\n color: ").concat(r.fontColor,";\n }\n @media only screen and (max-width: 400px) {\n ").concat(o,".").concat($e.OptionWrapperClass," {\n padding: 0 20px 15px 20px;\n }\n }\n\n ").concat(o,".").concat($e.OptionClass," {\n margin: 0;\n font-size: 100%;\n line-height: 1.1;\n padding: 20px 0 0 0;\n }\n ").concat(o,".").concat($e.OptionClass,":first-child {\n padding: 25px 0 0 0;\n margin: 20px 0 0 0;\n border-top: 1px solid ").concat(r.sectionDivider,";\n }\n ").concat(o,".").concat($e.OptionClass," label {\n display: flex;\n gap: 20px;\n color: ").concat(r.fontColor,";\n cursor: pointer;\n font-family: inherit;\n margin: 0 0 5px 0;\n padding: 0;\n font-weight: 600;\n font-size: 110%;\n line-height: 1.2;\n }\n ").concat(o,".").concat($e.OptionClass," label input {\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n padding: 0;\n border: 0;\n height: 1px;\n width: 1px;\n overflow: hidden;\n }\n ").concat(o,".").concat($e.OptionClass," label span {\n order: -1;\n display: inline-block;\n background-color: ").concat(r.backgroundColor,";\n width: 24px;\n height: 24px;\n }\n ").concat(o,".").concat($e.OptionClass," label span svg {\n background-color: ").concat(r.backgroundColor,";\n border-radius: 3px;\n }\n ").concat(o,".").concat($e.OptionClass,' label input[aria-readonly="true"] ~ span svg {\n opacity: 0.2;\n cursor: not-allowed;\n }\n ').concat(o,".").concat($e.OptionClass," label input:focus ~ span {\n background-color: ").concat(r.focused,";\n }\n ").concat(o,".").concat($e.OptionClass," label input:focus ~ span svg {\n outline: none;\n border-radius: 5px;\n box-shadow: 0 0 0 4px ").concat(r.focused,";\n }\n ").concat(o,".").concat($e.OptionClass," p {\n line-height: 1.3;\n font-size: 100%;\n color: ").concat(r.fontSubduedColor,";\n margin: 0;\n padding: 0 0 0 45px;\n }\n @media only screen and (max-width: 700px) {\n ").concat(o,".").concat($e.OptionClass," p {\n width: 100%;\n line-height: 1.4;\n }\n }\n ")}({bannerData:e}),t=no({id:$e.StylesContainerId,content:n});document.head.appendChild(t)},e.prototype.addHTML=function(n){var t,o,r,a=uo({bannerData:n}),i=document.getElementById(Ke.DialogId);o=a,null===(r=null==(t=i)?void 0:t.parentNode)||void 0===r||r.insertBefore(o,t.nextSibling);var s=document.getElementById($e.DialogId);s&&(this.setCheckboxesToCurrentConsent(),s.dataset.consent=e.selectedConsent()),e.hide()},e.prototype.handleOptionChange=function(n){var t=n.target,o=n.isReadOnly,r=n.sectionId,a=n.checked;(void 0!==a&&a||o)&&(t.checked=!0);var i,s,c,l=t.checked,u=document.getElementById(r),d=u.querySelector('svg[data-icon-type="checked"]'),p=u.querySelector('svg[data-icon-type="unchecked"]');l?(d.style.display="block",p.style.display="none"):(d.style.display="none",p.style.display="block"),i=e.selectedConsent(),s=document.getElementById($e.DialogId),c=document.getElementById($e.HeaderSaveId),(null==s?void 0:s.dataset.consent)&&(null==s?void 0:s.dataset.consent)!==i?c.className="primary":c.className=""},e.prototype.setupCheckboxEventHandlers=function(){var e=this,n=document.getElementById($e.OptionEssentialInputId);null==n||n.addEventListener("change",(function(n){e.handleOptionChange({target:n.target,isReadOnly:!0,sectionId:$e.OptionEssentialId})}));var t=document.getElementById($e.OptionAnalyticsInputId);null==t||t.addEventListener("change",(function(n){e.handleOptionChange({target:n.target,isReadOnly:!1,sectionId:$e.OptionAnalyticsId})}));var o=document.getElementById($e.OptionPreferencesInputId);null==o||o.addEventListener("change",(function(n){e.handleOptionChange({target:n.target,isReadOnly:!1,sectionId:$e.OptionPreferencesId})}));var r=document.getElementById($e.OptionMarketingInputId);null==r||r.addEventListener("change",(function(n){e.handleOptionChange({target:n.target,isReadOnly:!1,sectionId:$e.OptionMarketingId})}))},e.prototype.setupButtonEventHandlers=function(){var n=this,t=document.getElementById($e.HeaderCloseId);null==t||t.addEventListener("click",(function(){e.hide(),n.logger.emitInteraction(qt.LeavePreferences)}));var o=document.getElementById($e.HeaderSaveId);null==o||o.addEventListener("click",(function(){if(un())e.hideModalAndBanner();else{var t=document.getElementById($e.OptionMarketingInputId),o=document.getElementById($e.OptionAnalyticsInputId),r=document.getElementById($e.OptionPreferencesInputId),a=t.checked,i=o.checked,s=r.checked;sn({marketing:a,analytics:i,preferences:s,checkoutRootDomain:n.checkoutRootDomain,storefrontRootDomain:n.storefrontRootDomain,storefrontAccessToken:n.storefrontAccessToken,callback:e.hideModalAndBanner}),n.logger.emitInteraction(qt.Save,"".concat(a?"m":"").concat(i?"a":"").concat(s?"p":"")),e.hideModalAndBanner()}}));var r=document.getElementById($e.HeaderAcceptId);null==r||r.addEventListener("click",(function(){un()?e.hideModalAndBanner():(sn({marketing:!0,analytics:!0,preferences:!0,checkoutRootDomain:n.checkoutRootDomain,storefrontRootDomain:n.storefrontRootDomain,storefrontAccessToken:n.storefrontAccessToken,callback:e.hideModalAndBanner}),n.logger.emitInteraction(qt.AcceptedAll))}));var a=document.getElementById($e.HeaderDeclineId);null==a||a.addEventListener("click",(function(){un()?e.hideModalAndBanner():(sn({marketing:!1,analytics:!1,preferences:!1,checkoutRootDomain:n.checkoutRootDomain,storefrontRootDomain:n.storefrontRootDomain,storefrontAccessToken:n.storefrontAccessToken,callback:e.hideModalAndBanner}),n.logger.emitInteraction(qt.DeclinedAll))}))},e.prototype.setupKeyboardEventHandlers=function(){var n=this,t=document.getElementById($e.WrapperId);if(null==t||t.addEventListener("keydown",(function(t){if("Escape"===t.code){e.hide(),n.logger.emitInteraction(qt.LeavePreferences);var o=document.getElementById(Ke.ButtonManagePrefsId);null==o||o.focus()}})),t){var o=function(e){if("Tab"===e.code){e.preventDefault();var n=document.getElementById($e.HeaderCloseId);null==n||n.focus()}window.removeEventListener("keydown",o)};window.addEventListener("keydown",o)}},e}();class ho extends Error{constructor(e,n){super(e),this.cause=n}}!function(e){e.Draft="draft",e.Scheduled="scheduled",e.Running="running",e.Cooldown="cooldown",e.Ended="ended",e.Concluded="concluded"}(po||(po={}));const go=["default","adwords_campaign","api_client","brochure_session","business","checkout","collabs_creator_id","email","facebook_ad","facebook_campaign","fraud_review","handshake_retailer_account","identity_user","mobile_native_install_id","mozart_campaign_contact","mozart_campaign_shop","mozart_contact","mozart_email_send","mozart_message","mozart_shop","risk_analysis_order","session_token","shop","shop_account","shop_analytics_trace_id","shop_app_user","shop_pay_checkout","shop_pay_user","shop_website_visitor","shopify_protect","shopify_user_token","storefront","storefront_user","support_ticket"];class mo{constructor(e,n,t={}){this.currentRequest=new Map,this.API_KEY=n,this.API_URL=`${e}/public/graphql`,this.FETCH_OPTIONS=t}async getFlagsAndExperimentsByClientHandle(e,n){const t=this.sortHandles(n),o=this.sortHandles(e);try{var r,a,i;const e=await this.gqlRequest("query experimentsAndFlagsByHandle($experimentHandles: [String!]!, $flagHandles: [String!]!) {\n experimentsByClientHandle(clientHandles: $experimentHandles) {\n handle\n clientHandle\n version\n currentRollout {\n salt\n percentage\n }\n holdouts {\n handle\n percentage\n subjectType {\n handle\n }\n }\n subjectType {\n handle\n }\n manualAssignments {\n subjectId\n variantHandle\n }\n shippedVariant {\n handle\n id\n size\n }\n status\n variants {\n handle\n id\n size\n }\n }\n featuresByClientHandle(clientHandles: $flagHandles) {\n handle\n clientHandle\n version\n currentRolloutPercentage\n holdouts {\n handle\n percentage\n subjectType {\n handle\n }\n }\n manualAssignments {\n subjectId\n variantHandle\n }\n subjectTypeHandle\n}\n}",{flagHandles:t,experimentHandles:o});var s,c;if(null!=e&&null!=(r=e.data)&&r.experimentsByClientHandle||null!=e&&null!=(a=e.data)&&a.featuresByClientHandle)return{experiments:(null==e||null==(s=e.data)?void 0:s.experimentsByClientHandle)||[],flags:(null==e||null==(c=e.data)?void 0:c.featuresByClientHandle)||[]};if(null!=(i=e.errors)&&i.length)return this.FETCH_OPTIONS.onError&&this.FETCH_OPTIONS.onError(new ho("Network error",e.errors[0].message)),null}catch(e){this.FETCH_OPTIONS.onError&&this.FETCH_OPTIONS.onError(new ho("Network error",e))}return null}async gqlRequest(e,n){const{timeout:t}=this.FETCH_OPTIONS,o=AbortSignal.timeout(void 0===t?5e3:t),r=JSON.stringify({query:e,variables:n}),a=this.currentRequest.get(r);if(a)return(await a).json();try{const e=fetch(this.API_URL,{method:"POST",body:r,signal:o,headers:{"content-type":"application/json",Authorization:`Token ${this.API_KEY}`}});return this.currentRequest.set(r,e),(await e).json()}finally{this.currentRequest.delete(r)}}sortHandles(e){return e.sort(((e,n)=>e.localeCompare(n)))}}function yo(e){throw new Error(`Missing case statement for ${JSON.stringify(e)}`)}function vo(e){return e.holdoutSubject?_o(e.holdoutSubject):null}function _o(e){switch(e.type){case"shop":return e.shopId;case"brochure_session":case"shopify_user_token":case"shop_website_visitor":case"storefront_user":return e.userToken;case"default":case"adwords_campaign":case"api_client":case"business":case"checkout":case"collabs_creator_id":case"email":case"facebook_ad":case"facebook_campaign":case"fraud_review":case"handshake_retailer_account":case"identity_user":case"mobile_native_install_id":case"mozart_campaign_contact":case"mozart_campaign_shop":case"mozart_contact":case"mozart_email_send":case"mozart_message":case"mozart_shop":case"risk_analysis_order":case"session_token":case"shop_account":case"shop_analytics_trace_id":case"shop_app_user":case"shop_pay_checkout":case"shop_pay_user":case"shopify_protect":case"storefront":case"support_ticket":return e.subjectId;default:return yo(e),null}}function bo(e,n){return go.includes(n)?e.type===n:"default"===e.type}const Co="non-pii",wo="shopify-owned-pii",Eo="merchant-owned-pii";const xo="new",Ao="manual",Io="storage",ko="shipped",To="inactive",Do="cooldown",Oo="holdout",So="non-rollout",Po="unqualified",Ro="missing-in-storage",Mo="error";class No{constructor(e){this.variant=null,this.subject=null,this.duration=void 0,this.experiment=e.experiment,this.variant=e.variant||null,this.subject=e.subject||null,this.source=e.source}variantHandle(){return this.variant?this.variant.handle:null}experimentHandle(){return this.experiment.handle}experimentSubjectTypeHandle(){return this.experiment.subjectType.handle}subjectId(){var e;return this.subject&&(null==(e=_o(this.subject))?void 0:e.toString())||null}subjectTypeHandle(){var e;return(null==(e=this.subject)?void 0:e.type)||null}salt(){var e;return"percentage"in this.experiment?null:(null==(e=this.experiment.currentRollout)?void 0:e.salt)||null}isManualAssignment(){return this.source===Ao}}var jo,Bo,Lo={exports:{}},Ho={exports:{}};jo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bo={rotl:function(e,n){return e<>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(e){if(e.constructor==Number)return 16711935&Bo.rotl(e,8)|4278255360&Bo.rotl(e,24);for(var n=0;n0;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,o=0;t>>5]|=e[t]<<24-o%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t>>6*(3-r)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,o=0;t>>6-2*o);return n}},Ho.exports=Bo;var Fo=Ho.exports,Uo={utf8:{stringToBytes:function(e){return Uo.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Uo.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t>>24)|4278255360&(s[f]<<24|s[f]>>>8);s[c>>>5]|=128<>>9<<4)]=c;var h=r._ff,g=r._gg,m=r._hh,y=r._ii;for(f=0;f>>0,u=u+_>>>0,d=d+b>>>0,p=p+C>>>0}return e.endian([l,u,d,p])};r._ff=function(e,n,t,o,r,a,i){var s=e+(n&t|~n&o)+(r>>>0)+i;return(s<>>32-a)+n},r._gg=function(e,n,t,o,r,a,i){var s=e+(n&o|t&~o)+(r>>>0)+i;return(s<>>32-a)+n},r._hh=function(e,n,t,o,r,a,i){var s=e+(n^t^o)+(r>>>0)+i;return(s<>>32-a)+n},r._ii=function(e,n,t,o,r,a,i){var s=e+(t^(n|~o))+(r>>>0)+i;return(s<>>32-a)+n},r._blocksize=16,r._digestsize=16,Lo.exports=function(n,t){if(null==n)throw new Error("Illegal argument "+n);var a=e.wordsToBytes(r(n,t));return t&&t.asBytes?a:t&&t.asString?o.bytesToString(a):e.bytesToHex(a)}}();var Wo=hn(Lo.exports);class Go{constructor(e,n=10){this.value=16===n?`0x${e}`:e}modulo(e){return this.value=BigInt(this.value)%BigInt(e),this}toNumber(){return Number(this.value)}}const Ko=(e,n,t="")=>{const o=Wo(`${e}${n}${t}`);return new Go(o,16).modulo(100).toNumber()};class $o{constructor(e){this.assignmentLogQueue=new Set,this.experiment=e.rawExperiment,this.assignments=e.assignments,this.qualifier=e.qualifier,this.qualifierOptions=e.qualifierOptions}get bucketingHandle(){return this.experiment.version>0?this.clientHandle:this.experiment.handle}get clientHandle(){return this.experiment.clientHandle}setQualifier(e){this.qualifier=e}removeQualifier(){this.qualifier=void 0}async variantFor(e,n){const t=await this.assignmentWithDuration((()=>this.variantForHelper(e,n)));return null==n||n.enqueue(t),t}async assignmentWithDuration(e){const n=performance.now(),t=await e();return t.duration=Math.ceil(performance.now()-n),t}async variantForHelper(e,n){var t,o;const{assignments:r,experiment:a}=this,i=null==(t=_o(e))?void 0:t.toString();if(!i)return new No({experiment:a,source:Mo});if(!bo(e,a.subjectType.handle))return new No({experiment:a,subject:e,source:Mo});const s=await this.lookupVariantFor(e,n);if(s)return s;const c=this.shouldAssignSubject(e,n);if(!c.assignable)return new No({experiment:a,subject:e,source:c.reason});if(!await this.qualify(e)){var l,u;if(null!=(l=this.qualifierOptions)&&l.storeUnqualified)await r.store(a.handle,i,null,(null==(u=a.currentRollout)?void 0:u.salt)||"");return new No({experiment:a,subject:e,source:Po})}const d=this.getVariant(i);if(!d)return new No({experiment:a,subject:e,source:So});const p=new No({experiment:a,subject:e,variant:d,source:xo});return await r.store(a.handle,i,p.variantHandle(),(null==(o=a.currentRollout)?void 0:o.salt)||""),this.assignmentLogQueue.add({subject:e,isManualAssignment:!1,handle:this.bucketingHandle,variant:p.variantHandle()}),p}async lookupVariantFor(e,n){const t=this.manualAssignmentFor(e);if(t){this.assignmentLogQueue.add({subject:e,isManualAssignment:!0,handle:this.bucketingHandle,variant:t});const n=this.findVariantByHandle(t);return new No(n?{experiment:this.experiment,variant:n,source:Ao,subject:e}:{experiment:this.experiment,source:Mo,subject:e})}if(this.experiment.shippedVariant)return this.shippedVariantFor(e,this.experiment.shippedVariant,n);if(this.shouldReturnPreviousAssignment(e)){const n=await this.previousAssignment(e);if(n){if(n.variant){const t=this.findVariantByHandle(n.variant);return new No(t?{experiment:this.experiment,variant:this.findVariantByHandle(n.variant),source:Io,subject:e}:{experiment:this.experiment,source:Mo,subject:e})}return new No({experiment:this.experiment,source:Ro,subject:e})}}return null}subjectInRollout(e){var n,t,o,r;const a=null==(n=_o(e))?void 0:n.toString();if(!a)return!1;if(0===(null==(t=this.experiment.currentRollout)?void 0:t.percentage))return!1;if(null==(o=this.experiment.currentRollout)||!o.percentage)return!0;const i=this.getDynamicRolloutHash(a);return(null==(r=this.experiment.currentRollout)?void 0:r.percentage)>i}getVariant(e){return this.pickVariant(this.experimentHash(e),this.experiment.variants)}qualify(e){var n;const t=null==(n=_o(e))?void 0:n.toString();if(!t)return!0;return!this.qualifier||this.qualifier(t,this.experiment)}shouldReturnPreviousAssignment(e){return this.active()&&this.subjectInRollout(e)}shouldAssignSubject(e,n){return this.active()?this.inCooldown()?{assignable:!1,reason:Do}:this.subjectInRollout(e)?this.assignHoldouts(e,n)?{assignable:!1,reason:Oo}:{assignable:!0,reason:xo}:{assignable:!1,reason:So}:{assignable:!1,reason:To}}assignHoldouts(e,n){var t,o;const r=null==(t=_o(e))?void 0:t.toString(),a=null==(o=vo(e))?void 0:o.toString();if(!this.hasHoldouts())return!1;const i=a||r;if(!i)return!1;let s=!1;for(const t of this.experiment.holdouts){const o=this.holdoutHash(t.handle,i),r=this.pickVariant(o,[{id:"control",handle:"control",size:t.percentage},{id:"exposure",handle:"exposure",size:100-t.percentage}]);"control"===(null==r?void 0:r.handle)&&(s=!0),r&&(null==n||n.enqueue(new No({experiment:t,subject:e.holdoutSubject||e,variant:r,source:xo}))),this.assignmentLogQueue.add({subject:e.holdoutSubject||e,isManualAssignment:!1,handle:t.handle,variant:null==r?void 0:r.handle})}return s}hasHoldouts(){return this.experiment.holdouts.length>0}flushAssignmentLogs(){this.assignmentLogQueue.clear()}assignmentLogs(){return Array.from(this.assignmentLogQueue.values())}async previousAssignment(e){var n,t;const o=null==(n=_o(e))?void 0:n.toString();if(!o)return null;const{assignments:r,experiment:a}=this,i=await r.get(a.handle,o,(null==(t=a.currentRollout)?void 0:t.salt)||"");return i||null}pickVariant(e,n){let t=0;for(const o of n)if(t+=o.size,t>e)return o;return null}async shippedVariantFor(e,n,t){if(this.assignHoldouts(e,t))return new No({experiment:this.experiment,source:Oo,subject:e});const o=await this.qualify(e);return new No(o?{experiment:this.experiment,variant:n,source:ko,subject:e}:{experiment:this.experiment,source:Po,subject:e})}manualAssignmentFor(e){var n;const t=null==(n=_o(e))?void 0:n.toString();if(!t)return null;const o=this.experiment.manualAssignments.find((e=>e.subjectId===t));return o?o.variantHandle:null}experimentHash(e){var n;const t=(null==(n=this.experiment.currentRollout)?void 0:n.salt)||"";return Ko(this.bucketingHandle,e,t)}holdoutHash(e,n){return Ko(e,n,"")}getDynamicRolloutHash(e){return Ko(this.bucketingHandle,e,"_in_beta")}findVariantByHandle(e){return this.experiment.variants.find((n=>n.handle===e))||null}active(){return this.experiment.status===po.Running||this.experiment.status===po.Cooldown}inCooldown(){return this.experiment.status===po.Cooldown}dehydrate(){return this.experiment}}var Qo;function Yo(e){return 1e3*e}function Jo(e){return Date.now()-((null==e?void 0:e.updatedAt)||0)}function Xo(e,n){return Jo(e)>Yo(n)}!function(e){e.CacheFirst="cache-first",e.CacheOnly="cache-only",e.NetworkOnly="network-only"}(Qo||(Qo={}));class Zo{constructor(e){this.assignmentLogQueue=new Set,this.telemetryLogQueue=new Set,this.flag=e.rawFlag,this.qualifier=e.qualifier,this.qualifierOptions=e.qualifierOptions}get bucketingHandle(){return this.flag.version>0?this.clientHandle:this.flag.handle}get clientHandle(){return this.flag.clientHandle}async enabled(e){var n;const{flag:t}=this,o=null==(n=_o(e))?void 0:n.toString();if(!bo(e,t.subjectTypeHandle))return this.telemetryLogQueue.add({subject:e,assignmentSource:"error",flagHandle:this.bucketingHandle,result:"false",salt:"salt"}),{enabled:!1,isManualAssignment:!1};if(!o)return this.telemetryLogQueue.add({subject:e,assignmentSource:"error",flagHandle:this.bucketingHandle,result:"false",salt:"salt"}),{enabled:!1,isManualAssignment:!1};const r=this.checkManualAssignment(e);if(r)return r;if(this.isSubjectHeldOut(e))return{enabled:!1,isManualAssignment:!1};if(!await this.qualify(e))return this.telemetryLogQueue.add({subject:e,assignmentSource:"unqualified",flagHandle:this.bucketingHandle,result:"false",salt:"salt"}),{enabled:!1,isManualAssignment:!1};const a=this.subjectInRollout(e);return 0!==this.flag.currentRolloutPercentage&&this.telemetryLogQueue.add({subject:e,assignmentSource:"rollout",flagHandle:this.bucketingHandle,result:a?"true":"false",salt:"salt"}),{enabled:a,isManualAssignment:!1}}checkManualAssignment(e){const n=this.manualAssignmentFor(e);return n?(this.telemetryLogQueue.add({subject:e,assignmentSource:"manual",flagHandle:this.bucketingHandle,result:n.enabled?"true":"false",salt:"salt"}),n):null}isSubjectHeldOut(e){var n,t;const o=null==(n=_o(e))?void 0:n.toString(),r=null==(t=vo(e))?void 0:t.toString();if(!this.hasHoldouts())return!1;const a=r||o;if(!a)return!1;let i=!1;for(const n of this.flag.holdouts){const t=this.holdoutHash(n.handle,a),o=this.pickVariant(t,[{id:"control",handle:"control",size:n.percentage},{id:"exposure",handle:"exposure",size:100-n.percentage}]);"control"===o&&(i=!0),i&&this.telemetryLogQueue.add({subject:e,flagHandle:this.bucketingHandle,assignmentSource:"holdout",result:"false",salt:"salt",duration:0}),this.assignmentLogQueue.add({subject:e.holdoutSubject||e,isManualAssignment:!1,handle:n.handle,variant:o})}return i}hasHoldouts(){return this.flag.holdouts.length>0}flushTelemetryEvents(){this.telemetryLogQueue.clear()}telemetryEvents(){return Array.from(this.telemetryLogQueue.values())}flushAssignmentEvents(){this.assignmentLogQueue.clear()}assignmentEvents(){return Array.from(this.assignmentLogQueue.values())}subjectInRollout(e){var n;const t=null==(n=_o(e))?void 0:n.toString();if(!t)return!1;if(0===this.flag.currentRolloutPercentage)return!1;const o=this.getDynamicRolloutHash(t);return this.flag.currentRolloutPercentage>o}manualAssignmentFor(e){var n;const t=null==(n=_o(e))?void 0:n.toString();if(!t)return null;const o=this.flag.manualAssignments.find((e=>e.subjectId===t));return o?{enabled:"true"===o.variantHandle,isManualAssignment:!0}:null}qualify(e){var n;const t=null==(n=_o(e))?void 0:n.toString();return!t||(!this.qualifier||this.qualifier(t,this.flag))}pickVariant(e,n){let t=0;for(const o of n)if(t+=o.size,t>e)return o.handle;return null}holdoutHash(e,n){return Ko(e,n,"")}getDynamicRolloutHash(e){return Ko(this.bucketingHandle,e,"")}dehydrate(){return this.flag}}const er="verdict:configs:v6";class nr{constructor(e){this.qualifiers=new Map,this.assignments=e.assignments,this.storageAdapter=e.storageAdapter,this.cacheConfiguration=Object.assign({cachePolicy:Qo.CacheFirst,cacheTTLSeconds:300,staleWhileRevalidateSeconds:60,staleIfErrorSeconds:300},e.cacheConfiguration||{}),this.networkFetcher=new mo(e.apiHost,e.apiKey,e.fetchOptions)}async hydrate(e){await this.assignments.hydrate(e.assignments||[]),await this.storeConfigs(e.experiments||[],e.flags||[])}async dehydrate(){const e=await this.storageAdapter.get(er),{experiments:n=[],flags:t=[]}=JSON.parse(e||"{}");return{experiments:n,flags:t,assignments:await this.assignments.dehydrate()||[]}}allHandlesInConfig(e,n,t){const o=new Set(t.experiments.map((({clientHandle:e})=>e))),r=new Set(t.flags.map((({clientHandle:e})=>e)));return e.every((e=>o.has(e)))&&n.every((e=>r.has(e)))}async loadConfig(e,n){if(this.cacheConfiguration.cachePolicy===Qo.CacheOnly){const e=await this.getConfigsFromStorage();return e?{experiments:e.experiments.map((e=>this.getExperimentFromExperimentDefinition(e))),flags:e.flags.map((e=>this.getFlagFromFlagDefinition(e))),updatedAt:Date.now()}:null}if(this.cacheConfiguration.cachePolicy===Qo.NetworkOnly)return this.fetchConfigWithCacheFallback(e,n,null);if(this.cacheConfiguration.cachePolicy===Qo.CacheFirst){const r=await this.getConfigsFromStorage(!0);if(r&&this.allHandlesInConfig(e,n,r)){const a=Xo(r,this.cacheConfiguration.cacheTTLSeconds),i=(t=r,o=this.cacheConfiguration.staleWhileRevalidateSeconds,Date.now()-((null==t?void 0:t.updatedAt)||0)this.getExperimentFromExperimentDefinition(e))),flags:r.flags.map((e=>this.getFlagFromFlagDefinition(e))),updatedAt:Date.now()}):a&&!i?this.fetchConfigWithCacheFallback(e,n,r):{experiments:r.experiments.map((e=>this.getExperimentFromExperimentDefinition(e))),flags:r.flags.map((e=>this.getFlagFromFlagDefinition(e))),updatedAt:Date.now()}}return this.fetchConfigWithCacheFallback(e,n,r)}var t,o;return null}async fetchConfigWithCacheFallback(e,n,t){try{const o=await this.getConfigsFromNetwork(e,n,t);if(!o)throw new Error(`Error Fetching Config - ${e.join(",")} ${n.join(",")}`);return await this.storeConfigs(o.experiments,o.flags),{experiments:o.experiments.map((e=>this.getExperimentFromExperimentDefinition(e))),flags:o.flags.map((e=>this.getFlagFromFlagDefinition(e))),updatedAt:Date.now()}}catch(e){const n=await this.getConfigsFromStorage(!0);return function(e,n){const t=Jo(e),o=Yo(n);return n>0&&tthis.getExperimentFromExperimentDefinition(e))),flags:n.flags.map((e=>this.getFlagFromFlagDefinition(e))),updatedAt:Date.now()}:null}}async lookupConfigsByHandles(e,n){const t=await this.loadConfig(e,n);if(t){const o=[],r=[];return n.forEach((e=>{const n=t.flags.find((n=>n.clientHandle===e));n?o.push(n):o.push(null)})),e.forEach((e=>{const n=t.experiments.find((n=>n.clientHandle===e));n?r.push(n):r.push(null)})),{experiments:r,flags:o}}return{experiments:e.map((()=>null)),flags:n.map((()=>null))}}addQualifier(e,n,t){this.qualifiers.set(e,[n,t])}removeQualifier(e){this.qualifiers.delete(e)}async fetchAndStoreConfigsInStorage(e,n){const t=await this.getConfigsFromNetwork(e,n,await this.getConfigsFromStorage(!0));if(!t)return;const{experiments:o,flags:r}=t;await this.storeConfigs(o,r)}async getConfigsFromStorage(e){const n=await this.storageAdapter.get(er);if(!n)return null;const t=JSON.parse(n);return Xo(t,this.cacheConfiguration.cacheTTLSeconds)&&!e?null:t}getFlagFromFlagDefinition(e){const[n,t]=this.qualifiers.get(e.clientHandle)||[];return new Zo({qualifier:n,qualifierOptions:t,rawFlag:e})}getExperimentFromExperimentDefinition(e){const[n,t]=this.qualifiers.get(e.clientHandle)||[];return new $o({rawExperiment:e,assignments:this.assignments,qualifier:n,qualifierOptions:t})}async getConfigsFromNetwork(e,n,t){const o=(null==t?void 0:t.experiments.map((({clientHandle:e})=>e)))||[],r=(null==t?void 0:t.flags.map((({clientHandle:e})=>e)))||[],a=Array.from(new Set([...e,...o])),i=Array.from(new Set([...n,...r])),s=await this.networkFetcher.getFlagsAndExperimentsByClientHandle(a,i);return s?{experiments:s.experiments,flags:s.flags,updatedAt:Date.now()}:null}storeConfigs(e,n){const t={experiments:e,flags:n,updatedAt:Date.now()};return this.storageAdapter.set(er,JSON.stringify(t))}}const tr="feature_telemetry_non_pii/1.0",or="feature_telemetry_merchant_owned_cookie_pii/2.0",rr="feature_telemetry_shopify_owned_cookie_pii/2.0",ar="experiment_assignments/1.2",ir="experiment_assignments_merchant_owned_pii/1.2",sr="experiment_assignments_shopify_owned_pii/1.2",cr="experiment_telemetry_non_pii/1.0",lr="experiment_telemetry_shopify_owned_cookie_pii/1.0",ur="experiment_telemetry_merchant_owned_cookie_pii/1.0";function dr(e){return Math.max(Math.round(e),1)}class pr{constructor(e){this.logger=e.logger,this.sourceApp=e.sourceApp||"",this.sdkRuntime=e.sdkRuntime||"javascript",this.sampling=e.sampling}shouldSample(e){var n;const{sampling:t}=this;return!t||(!(e in t)||Math.random()<(null!=(n=t[e])?n:1))}maybeProduce(e){return this.shouldSample(e.schemaId)?this.logger.produce(e):null}async logFlagEvent(e,n,t,o,r,a){const i={sourceApp:this.sourceApp,featureHandle:n,result:t,subjectType:e.type,assignmentSource:o,duration:dr(r),sdkVersion:"7.1.4",sdkRuntime:this.sdkRuntime,salt:a};switch(e.type){case"shop":await this.maybeProduce({schemaId:tr,payload:Object.assign({subjectId:e.shopId.toString()},i)});break;case"brochure_session":case"shopify_user_token":case"shop_website_visitor":await this.maybeProduce({schemaId:rr,payload:Object.assign({subjectId:e.userToken},i)});break;case"storefront_user":await this.maybeProduce({schemaId:or,payload:Object.assign({subjectId:e.userToken,shopId:e.shopId},i)});break;case"default":case"adwords_campaign":case"api_client":case"business":case"checkout":case"collabs_creator_id":case"email":case"facebook_ad":case"facebook_campaign":case"fraud_review":case"handshake_retailer_account":case"identity_user":case"mobile_native_install_id":case"mozart_campaign_contact":case"mozart_campaign_shop":case"mozart_contact":case"mozart_email_send":case"mozart_message":case"mozart_shop":case"risk_analysis_order":case"session_token":case"shop_account":case"shop_analytics_trace_id":case"shop_app_user":case"shop_pay_checkout":case"shop_pay_user":case"shopify_protect":case"storefront":case"support_ticket":await this.maybeProduce({schemaId:tr,payload:Object.assign({subjectId:e.subjectId},i)});break;default:yo(e)}}async logAssignment(e,n,t,o){const r={experiment:n,group:t,sourceApp:this.sourceApp,manualAssignment:o};switch(e.type){case"shop":await this.maybeProduce({schemaId:ar,payload:Object.assign({subjectId:e.shopId.toString()},r)});break;case"brochure_session":case"shopify_user_token":case"shop_website_visitor":await this.maybeProduce({schemaId:sr,payload:Object.assign({userToken:e.userToken,sessionToken:e.sessionToken},r)});break;case"storefront_user":await this.maybeProduce({schemaId:ir,payload:Object.assign({userToken:e.userToken,sessionToken:e.sessionToken,shopId:e.shopId},r)});break;case"default":case"adwords_campaign":case"api_client":case"business":case"checkout":case"collabs_creator_id":case"email":case"facebook_ad":case"facebook_campaign":case"fraud_review":case"handshake_retailer_account":case"identity_user":case"mobile_native_install_id":case"mozart_campaign_contact":case"mozart_campaign_shop":case"mozart_contact":case"mozart_email_send":case"mozart_message":case"mozart_shop":case"risk_analysis_order":case"session_token":case"shop_account":case"shop_analytics_trace_id":case"shop_app_user":case"shop_pay_checkout":case"shop_pay_user":case"shopify_protect":case"storefront":case"support_ticket":await this.maybeProduce({schemaId:ar,payload:Object.assign({subjectId:e.subjectId},r)});break;default:yo(e)}}async logTelemetry(e){const n=e.subjectId();if(!n)return;const t=e.subjectTypeHandle();if(!t)return;const o=function(e){switch(e.type){case"shop":case"default":case"adwords_campaign":case"api_client":case"business":case"checkout":case"collabs_creator_id":case"email":case"facebook_ad":case"facebook_campaign":case"fraud_review":case"handshake_retailer_account":case"identity_user":case"mobile_native_install_id":case"mozart_campaign_contact":case"mozart_campaign_shop":case"mozart_contact":case"mozart_email_send":case"mozart_message":case"mozart_shop":case"risk_analysis_order":case"session_token":case"shop_account":case"shop_analytics_trace_id":case"shop_app_user":case"shop_pay_checkout":case"shop_pay_user":case"shopify_protect":case"storefront":case"support_ticket":return Co;case"brochure_session":case"shopify_user_token":case"shop_website_visitor":return wo;case"storefront_user":return Eo;default:return null}}(e.subject);if(!o)return;const r={experimentHandle:e.experimentHandle(),sourceApp:this.sourceApp,variant:e.variantHandle()||void 0,subjectType:t,assignmentSource:e.source,duration:e.duration,sdkVersion:"7.1.4",sdkRuntime:this.sdkRuntime,salt:e.salt()||void 0};switch(o){case Co:await this.maybeProduce({schemaId:cr,payload:Object.assign(Object.assign({},r),{},{subjectId:n})});break;case wo:await this.maybeProduce({schemaId:lr,payload:Object.assign(Object.assign({},r),{},{subjectId:n})});break;case Eo:await this.maybeProduce({schemaId:ur,payload:Object.assign(Object.assign({},r),{},{subjectId:n,shopId:e.subject.shopId})})}}}class fr{constructor(e){this.DEFAULT_TTL_SECONDS=15778476,this.NAMESPACE="v:a:3",this.storageAdapter=e}delete(e,n,t){return this.storageAdapter.delete(this.keyFor(e,n,t))}flush(){return this.storageAdapter.flush(this.NAMESPACE)}async hydrate(e){for(const[n,t]of e)await this.storageAdapter.set(n,t,this.DEFAULT_TTL_SECONDS)}async dehydrate(){return await this.storageAdapter.getAll(this.NAMESPACE)}async get(e,n,t){const o=await this.storageAdapter.get(this.keyFor(e,n,t));return o?JSON.parse(o):null}getAll(){return this.storageAdapter.getAll(this.NAMESPACE)}store(e,n,t,o,r){const a={variant:t,createdAt:Date.now()};return this.storageAdapter.set(this.keyFor(e,n,o),JSON.stringify(a),r||this.DEFAULT_TTL_SECONDS)}keyFor(e,n,t){return Wo(`${this.NAMESPACE}:${e}:${t}:${n}`)}}class hr{constructor(){this.storage=new Map}delete(e){return this.storage.delete(e),!0}get(e){return this.storage.get(e)||null}getAll(){return Array.from(this.storage.entries())}flush(){return this.storage.clear(),!0}set(e,n){return this.storage.set(e,n),!0}}class gr{produce(e){console.log(JSON.stringify(e))}}class mr{constructor(e){this.configuration={enable:!0,experiments:[]},this.assignmentEventQueue=new Set,this.configuration=Object.assign(Object.assign({},this.configuration),e.config),this.logger=e.logger}isEnabled(e){return!!this.configuration.enable||!!this.configuration.experiments&&(!!e&&this.configuration.experiments.includes(e))}assignmentEvents(){return Array.from(this.assignmentEventQueue.values())}flushAssignmentEvents(){this.assignmentEventQueue.clear()}enqueue(e){this.isEnabled(e.experimentHandle())&&this.assignmentEventQueue.add(e)}produce(){const e=this.assignmentEvents();return this.flushAssignmentEvents(),Promise.allSettled(e.map((e=>this.logger.logTelemetry(e))))}}class yr{constructor(){this.marks=new Map}mark(){return this.marks.set(this.marks.size,{start:performance.now()}),this.marks.size-1}measure(e){const n=void 0===e?null:this.marks.get(e),t=performance.now(),o=Number((t-((null==n?void 0:n.start)||0)).toPrecision(3));return void 0===e?0:o}}class vr{constructor(e){const{configurationRepository:n,logger:t,onError:o}=this.buildVerdictConfiguration(e);this.configurationRepository=n,this.logger=t,this.onError=o,this.telemetry=new mr({config:null==e?void 0:e.telemetry,logger:t})}addQualifier(e,n,t={storeUnqualified:!1}){this.configurationRepository.addQualifier(e,n,t)}removeQualifier(e){this.configurationRepository.removeQualifier(e)}async flagEnabled(e,n){try{const t=await this.lookupFlag(e);return!!t&&await this.flagEnabledForFlag(t,n)}catch(n){return this.onError(new ho(`Error determining enabled state for flag: ${e}`,n)),!1}}async flagEnabledForFlag(e,n){const t=new yr,o=t.mark(),{enabled:r}=await e.enabled(n),a=t.measure(o);return await this.flushAndLogEventsForFlag(e,a),r}async flushAndLogEventsForFlag(e,n){const t=e.telemetryEvents(),o=e.assignmentEvents();e.flushTelemetryEvents(),e.flushAssignmentEvents(),await Promise.all([...t.map((e=>this.logger.logFlagEvent(e.subject,e.flagHandle,e.result,e.assignmentSource,n,e.salt))),...o.map((e=>this.logger.logAssignment(e.subject,e.handle,e.variant,e.isManualAssignment)))])}async flagDisabled(e,n){return!await this.flagEnabled(e,n)}async assignVariant(e,n,t={shouldLogAssignment:!0}){try{const o=await this.lookupExperiment(e);if(!o)return null;const r=await this.assignVariantForExperiment(o,n,t);return await this.flushTelemetry(),r}catch(n){return this.onError(new ho(`Error assigning subject for experiment: ${e}`,n)),null}}async assignVariantForExperiment(e,n,t={shouldLogAssignment:!0}){const o=await e.variantFor(n,this.telemetry);if(t.shouldLogAssignment){const n=e.assignmentLogs();e.flushAssignmentLogs(),await Promise.all(n.map((e=>this.logger.logAssignment(e.subject,e.handle,e.variant,e.isManualAssignment))))}return o.variantHandle()}async flushTelemetry(){const e=(await this.telemetry.produce()).find((e=>"rejected"===e.status));e&&this.onError(new ho("Error producing telemetry event",e.reason))}async assignAll(e,n,t={shouldLogAssignment:!0}){return(await this.assignExperimentsAndFlags(e,[],n,t)).experiments}async flagsEnabled(e,n){return(await this.assignExperimentsAndFlags([],e,n)).flags}async assignExperimentsAndFlags(e,n,t,o={shouldLogAssignment:!0}){const r=Array.from(new Set(n).values()),a=Array.from(new Set(e).values()),i=await this.configurationRepository.lookupConfigsByHandles(a,r),[s,c]=await Promise.all([Promise.all(a.map((e=>new Promise((n=>{const r=i.experiments.find((n=>(null==n?void 0:n.clientHandle)===e));r?this.assignVariantForExperiment(r,t,o).then((t=>{n([e,t])})).catch((t=>{this.onError(t),n([e,null])})):n([e,null])}))))),Promise.all(r.map((e=>new Promise((n=>{const o=i.flags.find((n=>(null==n?void 0:n.clientHandle)===e));o?this.flagEnabledForFlag(o,t).then((t=>{n([e,t])})).catch((t=>{this.onError(new ho(`Error determining state of flag: ${e}`,t)),n([e,!1])})):n([e,!1])})))))]);return await this.flushTelemetry(),{experiments:s,flags:c}}async flagsDisabled(e,n){return(await this.flagsEnabled(e,n)).map((e=>[e[0],!e[1]]))}async lookupVariant(e,n){try{const t=await this.lookupExperiment(e);if(!t)return null;const o=await t.lookupVariantFor(n);return o?o.variantHandle():null}catch(n){return this.onError(new ho(`Error looking up subject for experiment: ${e}`,n)),null}}async preload(e,n=[]){try{await this.configurationRepository.fetchAndStoreConfigsInStorage(e,n)}catch(e){this.onError(new ho("Error preloading experiments",e))}}async hydrate(e){try{await this.configurationRepository.hydrate(e)}catch(e){this.onError(new ho("Hydration error",e))}}async dehydrate(){try{return await this.configurationRepository.dehydrate()}catch(e){return this.onError(new ho("Dehydration error",e)),null}}async lookupExperiment(e){const n=(await this.configurationRepository.lookupConfigsByHandles([e],[])).experiments[0];return n||null}async lookupFlag(e){const n=(await this.configurationRepository.lookupConfigsByHandles([],[e])).flags[0];return n||null}buildVerdictConfiguration(e){var n;const t=(null==e?void 0:e.onError)||console.error,o=new nr({apiKey:(null==e?void 0:e.apiKey)||"",apiHost:(null==e?void 0:e.apiHost)||"https://experiments.shopify.com",fetchOptions:Object.assign({onError:t},null==e?void 0:e.fetchOptions),assignments:new fr((null==e?void 0:e.assignmentStorage)||new hr),storageAdapter:(null==e?void 0:e.configurationStorage)||new hr,cacheConfiguration:(null==e?void 0:e.cacheConfiguration)||{}}),r=null==e?void 0:e.sdkRuntime;return{configurationRepository:o,onError:t,logger:new pr({logger:(null==e?void 0:e.logger)||new gr,sdkRuntime:r,sourceApp:null==e?void 0:e.appName,sampling:null==e||null==(n=e.telemetry)?void 0:n.sampling}),sdkRuntime:r||"javascript"}}}var _r,br=Boolean(void 0),Cr=void 0,wr="banner_subject_id",Er=function(){var e=new vr(o({logger:mn.Monorail.createHttpProducer({production:!0}),apiKey:"1da4d04e-2f91-4290-8071-2f4d800bcfed",appName:"privacy-banner"},br&&Cr)),n=function(){var e=window.sessionStorage.getItem(wr);return e||(e=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),window.sessionStorage.setItem(wr,e)),e};return{getExperimentVariant:function(t,o){return c(void 0,void 0,void 0,(function(){var r,a;return l(this,(function(i){return(r=function(e){var n=new URLSearchParams(window.location.search).get("exp-".concat(e));return n||null}(t.handle))?[2,r]:function(e){return 0===e.qualifiers.length||e.qualifiers.every((function(e){return e.execute()}))}(t)?[2,e.assignVariant(t.handle,{type:null!==(a=t.type)&&void 0!==a?a:"default",subjectId:null!=o?o:n()})]:[2,null]}))}))},getSubjectId:n}},xr={handle:"e_3d8aa7d17da3a41768926f0ddb4a994d",clientHandle:"cookie-banner-ux",qualifiers:[{handle:"cookie-banner-ux",execute:function(e){var n,t,o,r,a=null===(t=null===(n=null==e?void 0:e.metadata)||void 0===n?void 0:n.onDefaults)||void 0===t||t,i=null===(r=null===(o=window.Shopify.customerPrivacy)||void 0===o?void 0:o.getRegion())||void 0===r?void 0:r.slice(0,2);return["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IS","IE","IT","LV","LI","LT","LU","MT","NL","NO","PL","PT","RO","SK","SI","ES","SE","GB"].includes(i)&&a}}]},Ar=function(){function e(e){var n=void 0===e?{}:e,t=n.storefrontAccessToken,o=n.checkoutRootDomain,r=n.storefrontRootDomain,a=n.locale,i=n.country;this.locale=a,this.country=i,this.storefrontAccessToken=t;var s=t;s&&(this.checkoutRootDomain=o,this.storefrontRootDomain=r),this.logger=new Wt({shopDomain:o,isHeadless:Boolean(s)}),this.preferencesModal=void 0}return e.show=function(){var e=document.getElementById(Ke.DialogId);if(null!==e){e.style.display="block";var n=function(e){if("Tab"===e.code){e.preventDefault();var t=document.getElementById(Ke.ButtonManagePrefsId);null==t||t.focus()}window.removeEventListener("keydown",n)};window.addEventListener("keydown",n)}},e.hide=function(){var e=document.getElementById(Ke.DialogId);null!==e&&(e.style.display="none")},e.prototype.init=function(){return c(this,arguments,void 0,(function(n){var t,r;return void 0===n&&(n=!1),l(this,(function(a){switch(a.label){case 0:return this.removeExistingElements(),[4,fn.getServerData(this.checkoutRootDomain,this.storefrontAccessToken,this.locale,this.country)];case 1:return t=a.sent(),[4,(0,Er().getExperimentVariant)(xr)];case 2:if((r=a.sent())&&(t.experimentVariant=r),this.render(o({},t)),n){if(!t||!Object.keys(t).length)return console.warn("banner not rendered due to lack of saved data"),[2];this.preferencesModal=new fo({bannerData:t,storefrontAccessToken:this.storefrontAccessToken,checkoutRootDomain:this.checkoutRootDomain,storefrontRootDomain:this.storefrontRootDomain}),this.preferencesModal.init(),e.hide()}return[2]}}))}))},e.prototype.render=function(n){if(n&&Object.keys(n).length){var t=n.enabled,o=window.Shopify.country,r=dn()&&this.isCountryInRegionVisibility(o,n);(t||un()||r)&&(this.addCSS(n),this.addBannerHTML(n),e.show(),dn()||this.logger.emitRender())}},e.prototype.isCountryInRegionVisibility=function(e,n){var t;return null===(t=n.regionVisibility)||void 0===t?void 0:t.includes(e)},e.prototype.addCSS=function(e){var n=no({id:Ke.StylesContainerId,content:nn({bannerData:e})});document.head.appendChild(n)},e.prototype.addBannerHTML=function(e){var n=ro({bannerData:e}),t=document.getElementsByTagName("body")[0];t.insertBefore(n,t.firstChild),this.addEventListeners(e)},e.prototype.removeExistingElements=function(){var e,n,t,o,r=document.getElementById(Ke.DialogId),a=document.getElementById(Ke.StylesContainerId),i=document.getElementById($e.WrapperId),s=document.getElementById($e.StylesContainerId);null===(e=null==r?void 0:r.parentNode)||void 0===e||e.removeChild(r),null===(n=null==a?void 0:a.parentNode)||void 0===n||n.removeChild(a),null===(t=null==i?void 0:i.parentNode)||void 0===t||t.removeChild(i),null===(o=null==s?void 0:s.parentNode)||void 0===o||o.removeChild(s)},e.prototype.addEventListeners=function(e){var n=this;this.addEssentialEventListeners(),un()||this.addMetricsEventListeners();var t=document.getElementById(Ke.ButtonManagePrefsId);null==t||t.addEventListener("click",(function(t){t.preventDefault(),n.preferencesModal=new fo({bannerData:e,storefrontAccessToken:n.storefrontAccessToken,checkoutRootDomain:n.checkoutRootDomain,storefrontRootDomain:n.storefrontRootDomain}),n.preferencesModal.init()}))},e.prototype.addEssentialEventListeners=function(){var n=this,t=document.getElementById(Ke.ButtonAcceptId);null==t||t.addEventListener("click",(function(){un()?e.hide():sn({marketing:!0,analytics:!0,preferences:!0,checkoutRootDomain:n.checkoutRootDomain,storefrontRootDomain:n.storefrontRootDomain,storefrontAccessToken:n.storefrontAccessToken,callback:e.hide})}));var o=document.getElementById(Ke.ButtonDeclineId);null==o||o.addEventListener("click",(function(){un()?e.hide():sn({marketing:!1,analytics:!1,preferences:!1,checkoutRootDomain:n.checkoutRootDomain,storefrontRootDomain:n.storefrontRootDomain,storefrontAccessToken:n.storefrontAccessToken,callback:e.hide})}))},e.prototype.addMetricsEventListeners=function(){var e=this,n=document.getElementById(Ke.BodyCopyPolicyLinkId);null==n||n.addEventListener("click",(function(){e.logger.emitInteraction(qt.PrivacyPolicyView)}));var t=document.getElementById(Ke.ButtonAcceptId);null==t||t.addEventListener("click",(function(){e.logger.emitInteraction(qt.Accepted)}));var o=document.getElementById(Ke.ButtonDeclineId);null==o||o.addEventListener("click",(function(){e.logger.emitInteraction(qt.Declined)}))},e}();function Ir(){return c(this,arguments,void 0,(function(e){var n,t,o,r,a,i=void 0===e?{}:e,s=i.storefrontAccessToken,c=i.checkoutRootDomain,u=i.storefrontRootDomain,d=i.showPreferences,p=void 0!==d&&d,f=i.locale,h=i.country;return l(this,(function(e){return c||(c=window.location.hostname),u||(u=window.location.hostname),f||(f=null===(r=null===window||void 0===window?void 0:window.Shopify)||void 0===r?void 0:r.locale),h||(h=null===(a=null===window||void 0===window?void 0:window.Shopify)||void 0===a?void 0:a.country),n=function(){(pn()||ln()||p)&&new Ar({storefrontAccessToken:s,checkoutRootDomain:c,storefrontRootDomain:u,locale:f,country:h}).init(p)},s?(t=He(),sn({marketing:(o={yes:!0,no:!1})[t.marketing],analytics:o[t.analytics],preferences:o[t.preferences],sale_of_data:o[t.sale_of_data],storefrontAccessToken:s,checkoutRootDomain:c,storefrontRootDomain:u,callback:n})):n(),[2]}))}))}function kr(){window.Shopify=window.Shopify||{},window.Shopify.customerPrivacy&&window.Shopify.trackingConsent||(window.Shopify.customerPrivacy=qe(),window.Shopify.trackingConsent=qe())}function Tr(){return c(this,arguments,void 0,(function(e){return void 0===e&&(e={}),l(this,(function(n){switch(n.label){case 0:return kr(),[4,Ir(o(o({},e),{showPreferences:!0}))];case 1:return n.sent(),[2]}}))}))}return _r=Boolean(window.Shopify),kr(),_r&&Ir(),window.onload=function(){var e,n=null===(e=document.querySelector('li > a[href="'.concat("#shopifyReshowConsentBanner",'"]')))||void 0===e?void 0:e.parentElement;n&&ie()&&n.addEventListener("click",(function(e){e.preventDefault(),Tr()}))},e.loadBanner=Ir,e.showPreferences=Tr,e}({});