!function(){"use strict";function e(e=window.location.origin,t){const n=`${e}/services/login_with_shop/finalize`;return fetch(n).catch(t)}var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,n)};var n=function(){return(n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=s.next()).done;)r.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r}function l(e){return this instanceof l?(this.v=e,this):new l(e)}var c=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function u(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function d(e,t,n,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(e,n):i?i.value=n:t.set(e,n),n}var h=Object.freeze({__proto__:null,__extends:function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)},get __assign(){return n},__rest:o,__decorate:function(e,t,n,o){var i,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(r=(s<3?i(r):s>3?i(t,n,r):i(t,n))||r);return s>3&&r&&Object.defineProperty(t,n,r),r},__param:function(e,t){return function(n,o){t(n,o,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:i,__generator:function(e,t){var n,o,i,s,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,o=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]1||a(e,t)}))})}function a(e,t){try{!function(e){e.value instanceof l?Promise.resolve(e.value.v).then(c,u):d(s[0][2],e)}(i[e](t))}catch(e){d(s[0][3],e)}}function c(e){a("next",e)}function u(e){a("throw",e)}function d(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}},__asyncDelegator:function(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,i){t[o]=e[o]?function(t){return(n=!n)?{value:l(e[o](t)),done:"return"===o}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=r(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,i){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,i,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return c(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:u,__classPrivateFieldSet:d,__classPrivateFieldIn:function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}});let p;const m=new Uint8Array(16);function f(){if(!p&&(p="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!p))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(m)}var g=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function v(e){return"string"==typeof e&&g.test(e)}const _=[];for(let e=0;e<256;++e)_.push((e+256).toString(16).slice(1));function b(e,t=0){return(_[e[t+0]]+_[e[t+1]]+_[e[t+2]]+_[e[t+3]]+"-"+_[e[t+4]]+_[e[t+5]]+"-"+_[e[t+6]]+_[e[t+7]]+"-"+_[e[t+8]]+_[e[t+9]]+"-"+_[e[t+10]]+_[e[t+11]]+_[e[t+12]]+_[e[t+13]]+_[e[t+14]]+_[e[t+15]]).toLowerCase()}let y,w,k=0,C=0;function S(e){if(!v(e))throw TypeError("Invalid UUID");let t;const n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}function x(e,t,n){function o(e,o,i,s){var r;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let n=0;n>>9<<4)+1}function A(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function T(e,t,n,o,i,s){return A((r=A(A(t,e),A(o,s)))<<(a=i)|r>>>32-a,n);var r,a}function P(e,t,n,o,i,s,r){return T(t&n|~t&o,e,t,i,s,r)}function M(e,t,n,o,i,s,r){return T(t&o|n&~o,e,t,i,s,r)}function L(e,t,n,o,i,s,r){return T(t^n^o,e,t,i,s,r)}function I(e,t,n,o,i,s,r){return T(n^(t|~o),e,t,i,s,r)}var j=x("v3",48,(function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let n=0;n>5]>>>i%32&255,s=parseInt(o.charAt(n>>>4&15)+o.charAt(15&n),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[o/8])<>>32-t}var R=x("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let n=0;n>>0;c=l,l=a,a=D(r,30)>>>0,r=i,i=s}n[0]=n[0]+i>>>0,n[1]=n[1]+r>>>0,n[2]=n[2]+a>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+c>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var B=Object.freeze({__proto__:null,v1:function(e,t,n){let o=t&&n||0;const i=t||new Array(16);let s=(e=e||{}).node||y,r=void 0!==e.clockseq?e.clockseq:w;if(null==s||null==r){const t=e.random||(e.rng||f)();null==s&&(s=y=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==r&&(r=w=16383&(t[6]<<8|t[7]))}let a=void 0!==e.msecs?e.msecs:Date.now(),l=void 0!==e.nsecs?e.nsecs:C+1;const c=a-k+(l-C)/1e4;if(c<0&&void 0===e.clockseq&&(r=r+1&16383),(c<0||a>k)&&void 0===e.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");k=a,C=l,w=r,a+=122192928e5;const u=(1e4*(268435455&a)+l)%4294967296;i[o++]=u>>>24&255,i[o++]=u>>>16&255,i[o++]=u>>>8&255,i[o++]=255&u;const d=a/4294967296*1e4&268435455;i[o++]=d>>>8&255,i[o++]=255&d,i[o++]=d>>>24&15|16,i[o++]=d>>>16&255,i[o++]=r>>>8|128,i[o++]=255&r;for(let e=0;e<6;++e)i[o+e]=s[e];return t||b(i)},v3:j,v4:N,v5:R,NIL:"00000000-0000-0000-0000-000000000000",version:function(e){if(!v(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)},validate:v,stringify:function(e,t=0){const n=b(e,t);if(!v(n))throw TypeError("Stringified UUID is invalid");return n},parse:S});const F="1.0.0",U="show_login_with_shop",$=/^[^@]+@[^@]+\.[^@]{2,}$/i;function W(e){return!!e&&RegExp($).test(e)}const q=()=>({width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight});function V({url:e,width:t,height:n,windowName:o,onClose:i}){const s={left:void 0===window.screenLeft?window.screenX:window.screenLeft,top:void 0===window.screenTop?window.screenY:window.screenTop},r=q(),a=r.width||screen.width,l=r.height||screen.height,c=screen.width&&window.screen.availWidth?screen.width/window.screen.availWidth:1,u=(a-t)/2/c+s.left,d=(l-n)/2/c+s.top,h=window.open(e,o,`scrollbars=yes,width=${t},height=${n},top=${d},left=${u}`);if(!h)return null;if(h.focus(),i){const e=setInterval((()=>{h.closed&&(i(),clearInterval(e))}),1e3)}return h}function H(e,t,n){e.getAttribute(t)!==n&&!0!==e[t]&&e.setAttribute(t,n)}function K(e){try{const t=new RegExp(`(${e})=([^;]+)`).exec(document.cookie);return t?t[2]:null}catch(e){return null}}function G(){return N()}function Z(e=location.origin){return i(this,void 0,void 0,(function*(){const t=fetch(`${e}/meta.json`);try{const e=yield t;return yield e.json()}catch(e){return null}}))}function J(e){try{return new URL(e).hostname}catch(t){return console.error(`[Shop Pay] Store URL (${e}) is not valid`,t),null}}function Q(e){return new URLSearchParams(window.location.search).get(e)}function Y(e,t){let n;return(...o)=>{clearTimeout(n),n=setTimeout((()=>{e(...o)}),t)}}function X(){return Boolean(navigator.userAgent)&&/(android|iphone|ipad|mobile|phone)/i.test(navigator.userAgent)}function ee(e){return null===e||""===e.trim()}function te(e){const t=Y((()=>function({shopLoginButton:e,emailInput:t,emailLookupStarted:n,emailLookupEnded:o}){if(!W(t.value))return;n();const i=new Promise((t=>{const n=()=>t();e.addEventListener("shopusernotmatched",(()=>{n()}),{once:!0}),e.addEventListener("shopusermatched",(()=>{n()}),{once:!0})}));(function(e,t){let n;const o=new Promise((e=>{n=setTimeout((()=>{e()}),t)}));return Promise.race([e,o]).finally((()=>{clearTimeout(n)}))})(i,1500).then((()=>o())).catch((()=>o()))}(e)),300);e.emailInput.addEventListener("input",(()=>{const n=e.emailInput.value;e.emailChanged({email:n,emailIsValid:W(n)}),t()})),t()}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oe(e,t){return e(t={exports:{}},t.exports),t.exports}var ie=oe((function(e,t){e.exports=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var o=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],s=["fileName","functionName","source"],r=["args"],a=["evalOrigin"],l=o.concat(i,s,r,a);function c(e){if(e)for(var n=0;n-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),o=t.match(/ (\(.+\)$)/);t=o?t.replace(o[0],""):t;var i=this.extractLocation(o?o[1]:t),s=o&&t||void 0,r=["eval",""].indexOf(i[0])>-1?void 0:i[0];return new n({functionName:s,fileName:r,lineNumber:i[1],columnNumber:i[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(s)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new n({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,o=e.match(t),i=o&&o[1]?o[1]:void 0,s=this.extractLocation(e.replace(t,""));return new n({functionName:i,fileName:s[0],lineNumber:s[1],columnNumber:s[2],source:e})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,o=e.message.split("\n"),i=[],s=2,r=o.length;s/,"$2").replace(/\([^)]*\)/g,"")||void 0;s.match(/\(([^)]*)\)/)&&(t=s.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new n({functionName:r,args:a,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})}),this)}})}));const re="development",ae="production",le={name:"Bugsnag JavaScript",version:"7.13.2",url:"https://github.com/bugsnag/bugsnag-js"};function ce({error:e,breadcrumbs:t,appId:n,appVersion:o,releaseStage:i,duration:s,time:r,metaData:a}){var l,c;const u=e.name,d=e.message,h=function(e){return se.parse(e).map((e=>({method:e.functionName,file:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber})))}(e),p=window.location.href,m=window.location.pathname,f=navigator.userAgent;return{payloadVersion:"4",exceptions:[{errorClass:u,errorMessage:d,type:"browserjs",stacktrace:h,message:d}],severity:"error",unhandled:!1,severityReason:{type:"handledException"},app:{id:n,version:o,releaseStage:i,type:"browser",duration:s},device:{locale:navigator.userLanguage||navigator.language,userAgent:f,time:r,orientation:null===(c=null===(l=window.screen)||void 0===l?void 0:l.orientation)||void 0===c?void 0:c.type},request:{url:p},breadcrumbs:t,context:m,metaData:a,user:{shopifyS:K("_shopify_s")},session:{}}}class ue{constructor({apiKey:e,appId:t,appVersion:n}){this.breadcrumbs=[],this.apiKey=e,this.appId=t,this.appVersion=n,this.startTime=new Date,this.releaseStage=ae,this.initWindowErrorHandler(),this.leaveBreadcrumb("Bugsnag started",{},"state")}leaveBreadcrumb(e,t,n){this.breadcrumbs.push({name:e,metaData:t,type:n,timestamp:(new Date).toISOString()})}notify(e,t){this.releaseStage!==re?this.sendToBugsnag(e,t):this.logToConsole(e)}initWindowErrorHandler(){const e=window.onerror;window.onerror=(t,n,o,i,s)=>{s&&function(e){const t=se.parse(e);return 0!==t.length&&t.some((e=>{var t;return null===(t=e.fileName)||void 0===t?void 0:t.includes("shop-js")}))}(s)&&this.notify(s),"function"==typeof e&&e.apply(this,[t,n,o,i,s])}}logToConsole(e){console.error(`[bugsnag - shop-js] error in ${this.releaseStage}`,{error:e})}sendToBugsnag(e,t){const n=new Date,o=n.toISOString(),i=function(e,t){if(e&&t)return t.getTime()-e.getTime()}(this.startTime,n),{breadcrumbs:s,appId:r,appVersion:a,releaseStage:l}=this,c=ce({error:e,breadcrumbs:s,appId:r,appVersion:a,releaseStage:l,duration:i,time:o,metaData:t}),u=new XMLHttpRequest;u.open("POST","https://notify.bugsnag.com/"),u.setRequestHeader("Content-Type","application/json"),u.setRequestHeader("Bugsnag-Api-Key",this.apiKey),u.setRequestHeader("Bugsnag-Payload-Version","4"),u.setRequestHeader("Bugsnag-Sent-At",o);const d={apiKey:this.apiKey,notifier:le,events:[c]};u.send(JSON.stringify(d))}}let de;const he=e=>{de?console.warn("Bugsnag.start() has already been called. Ignoring."):de=new ue(e)},pe=(e,t,n)=>{de?de.leaveBreadcrumb(e,t,n):console.warn("Bugsnag.leaveBreadcrumb() called before start().")},me=(e,t)=>{de?de.notify(e,t):console.warn("Bugsnag.notify() called before start().")};function fe({selector:e,onElementFound:t}){const n=new WeakSet,o=new MutationObserver((e=>{let t=!1;for(const n of e)if(n.addedNodes.length>0){t=!0;break}t&&s()}));function s(){document.querySelectorAll(e).forEach((e=>{n.has(e)||(t(e),n.add(e))}))}return function(){i(this,void 0,void 0,(function*(){yield function(){if(document.body)return Promise.resolve();return new Promise((e=>{window.addEventListener("DOMContentLoaded",(()=>e()))}))}(),s(),o.observe(document.body||document.documentElement,{childList:!0,subtree:!0})}))}(),o}function ge(e,t=!0){const n=Boolean(e);return!n&&t&&me(new Error("HTML Element was not provided")),n}function ve(e){return e.split("-")[1]}function _e(e){return"y"===e?"height":"width"}function be(e){return e.split("-")[0]}function ye(e){return["top","bottom"].includes(be(e))?"x":"y"}function we(e,t,n){let{reference:o,floating:i}=e;const s=o.x+o.width/2-i.width/2,r=o.y+o.height/2-i.height/2,a=ye(t),l=_e(a),c=o[l]/2-i[l]/2,u="x"===a;let d;switch(be(t)){case"top":d={x:s,y:o.y-i.height};break;case"bottom":d={x:s,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:r};break;case"left":d={x:o.x-i.width,y:r};break;default:d={x:o.x,y:o.y}}switch(ve(t)){case"start":d[a]-=c*(n&&u?-1:1);break;case"end":d[a]+=c*(n&&u?-1:1)}return d}function ke(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ce(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Se(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:s,rects:r,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=t,m=ke(p),f=a[h?"floating"===d?"reference":"floating":d],g=Ce(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(f)))||n?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{...r.floating,x:o,y:i}:r.reference,_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),b=await(null==s.isElement?void 0:s.isElement(_))&&await(null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},y=Ce(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:_,strategy:l}):v);return{top:(g.top-y.top+m.top)/b.y,bottom:(y.bottom-g.bottom+m.bottom)/b.y,left:(g.left-y.left+m.left)/b.x,right:(y.right-g.right+m.right)/b.x}}const xe=Math.min,Ee=Math.max;function Ae(e,t,n){return Ee(e,xe(t,n))}const Te=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:o=0}=e||{},{x:i,y:s,placement:r,rects:a,platform:l,elements:c}=t;if(null==n)return{};const u=ke(o),d={x:i,y:s},h=ye(r),p=_e(h),m=await l.getDimensions(n),f="y"===h,g=f?"top":"left",v=f?"bottom":"right",_=f?"clientHeight":"clientWidth",b=a.reference[p]+a.reference[h]-d[h]-a.floating[p],y=d[h]-a.reference[h],w=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let k=w?w[_]:0;k&&await(null==l.isElement?void 0:l.isElement(w))||(k=c.floating[_]||a.floating[p]);const C=b/2-y/2,S=u[g],x=k-m[p]-u[v],E=k/2-m[p]/2+C,A=Ae(S,E,x),T=null!=ve(r)&&E!=A&&a.reference[p]/2-(Ee.concat(t,t+"-start",t+"-end")),[]);const Pe={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,(e=>Pe[e]))}function Le(e,t,n){void 0===n&&(n=!1);const o=ve(e),i=ye(e),s=_e(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Me(r)),{main:r,cross:Me(r)}}const Ie={start:"end",end:"start"};function je(e){return e.replace(/start|end/g,(e=>Ie[e]))}const Oe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:i,rects:s,initialPlacement:r,platform:a,elements:l}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...f}=e,g=be(o),v=be(r)===r,_=await(null==a.isRTL?void 0:a.isRTL(l.floating)),b=d||(v||!m?[Me(r)]:function(e){const t=Me(e);return[je(e),t,je(t)]}(r));d||"none"===p||b.push(...function(e,t,n,o){const i=ve(e);let s=function(e,t,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?s:r;default:return[]}}(be(e),"start"===n,o);return i&&(s=s.map((e=>e+"-"+i)),t&&(s=s.concat(s.map(je)))),s}(r,m,p,_));const y=[r,...b],w=await Se(t,f),k=[];let C=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&k.push(w[g]),u){const{main:e,cross:t}=Le(o,s,_);k.push(w[e],w[t])}if(C=[...C,{placement:o,overflows:k}],!k.every((e=>e<=0))){var S,x;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=y[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(x=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:x.placement;if(!n)switch(h){case"bestFit":{var E;const e=null==(E=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=r}if(o!==n)return{reset:{placement:n}}}return{}}}},Ne=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:o}=t,i=await async function(e,t){const{placement:n,platform:o,elements:i}=e,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),r=be(n),a=ve(n),l="x"===ye(n),c=["left","top"].includes(r)?-1:1,u=s&&l?-1:1,d="function"==typeof t?t(e):t;let{mainAxis:h,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}(t,e);return{x:n+i.x,y:o+i.y,data:i}}}};function ze(e){return"x"===e?"y":"x"}const De=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:o},u=await Se(t,l),d=ye(be(i)),h=ze(d);let p=c[d],m=c[h];if(s){const e="y"===d?"bottom":"right";p=Ae(p+u["y"===d?"top":"left"],p,p-u[e])}if(r){const e="y"===h?"bottom":"right";m=Ae(m+u["y"===h?"top":"left"],m,m-u[e])}const f=a.fn({...t,[d]:p,[h]:m});return{...f,data:{x:f.x-n,y:f.y-o}}}}},Re=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=e,u={x:n,y:o},d=ye(i),h=ze(d);let p=u[d],m=u[h];const f="function"==typeof a?a(t):a,g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const e="y"===d?"height":"width",t=s.reference[d]-s.floating[e]+g.mainAxis,n=s.reference[d]+s.reference[e]-g.mainAxis;pn&&(p=n)}if(c){var v,_;const e="y"===d?"width":"height",t=["top","left"].includes(be(i)),n=s.reference[h]-s.floating[e]+(t&&(null==(v=r.offset)?void 0:v[h])||0)+(t?0:g.crossAxis),o=s.reference[h]+s.reference[e]+(t?0:(null==(_=r.offset)?void 0:_[h])||0)-(t?g.crossAxis:0);mo&&(m=o)}return{[d]:p,[h]:m}}}};function Be(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fe(e){return Be(e).getComputedStyle(e)}function Ue(e){return e instanceof Be(e).Node}function $e(e){return Ue(e)?(e.nodeName||"").toLowerCase():""}let We;function qe(){if(We)return We;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(We=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),We):navigator.userAgent}function Ve(e){return e instanceof Be(e).HTMLElement}function He(e){return e instanceof Be(e).Element}function Ke(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Be(e).ShadowRoot||e instanceof ShadowRoot)}function Ge(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Ze(e){return["table","td","th"].includes($e(e))}function Je(e){const t=/firefox/i.test(qe()),n=Fe(e),o=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!o&&"none"!==o||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function Qe(){return/^((?!chrome|android).)*safari/i.test(qe())}function Ye(e){return["html","body","#document"].includes($e(e))}const Xe=Math.min,et=Math.max,tt=Math.round;function nt(e){const t=Fe(e);let n=parseFloat(t.width),o=parseFloat(t.height);const i=Ve(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,a=tt(n)!==s||tt(o)!==r;return a&&(n=s,o=r),{width:n,height:o,fallback:a}}function ot(e){return He(e)?e:e.contextElement}const it={x:1,y:1};function st(e){const t=ot(e);if(!Ve(t))return it;const n=t.getBoundingClientRect(),{width:o,height:i,fallback:s}=nt(t);let r=(s?tt(n.width):n.width)/o,a=(s?tt(n.height):n.height)/i;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function rt(e,t,n,o){var i,s;void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=ot(e);let l=it;t&&(o?He(o)&&(l=st(o)):l=st(e));const c=a?Be(a):window,u=Qe()&&n;let d=(r.left+(u&&(null==(i=c.visualViewport)?void 0:i.offsetLeft)||0))/l.x,h=(r.top+(u&&(null==(s=c.visualViewport)?void 0:s.offsetTop)||0))/l.y,p=r.width/l.x,m=r.height/l.y;if(a){const e=Be(a),t=o&&He(o)?Be(o):o;let n=e.frameElement;for(;n&&o&&t!==e;){const e=st(n),t=n.getBoundingClientRect(),o=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(o.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(o.paddingTop))*e.y,d*=e.x,h*=e.y,p*=e.x,m*=e.y,d+=t.x,h+=t.y,n=Be(n).frameElement}}return Ce({width:p,height:m,x:d,y:h})}function at(e){return((Ue(e)?e.ownerDocument:e.document)||window.document).documentElement}function lt(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ct(e){return rt(at(e)).left+lt(e).scrollLeft}function ut(e){if("html"===$e(e))return e;const t=e.assignedSlot||e.parentNode||Ke(e)&&e.host||at(e);return Ke(t)?t.host:t}function dt(e){const t=ut(e);return Ye(t)?t.ownerDocument.body:Ve(t)&&Ge(t)?t:dt(t)}function ht(e,t){var n;void 0===t&&(t=[]);const o=dt(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),s=Be(o);return i?t.concat(s,s.visualViewport||[],Ge(o)?o:[]):t.concat(o,ht(o))}function pt(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Be(e),o=at(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,a=0,l=0;if(i){s=i.width,r=i.height;const e=Qe();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:r,x:a,y:l}}(e,n);else if("document"===t)o=function(e){const t=at(e),n=lt(e),o=e.ownerDocument.body,i=et(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=et(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ct(e);const a=-n.scrollTop;return"rtl"===Fe(o).direction&&(r+=et(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:a}}(at(e));else if(He(t))o=function(e,t){const n=rt(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=Ve(e)?st(e):{x:1,y:1};return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:i*s.x,y:o*s.y}}(t,n);else{const n={...t};if(Qe()){var i,s;const t=Be(e);n.x-=(null==(i=t.visualViewport)?void 0:i.offsetLeft)||0,n.y-=(null==(s=t.visualViewport)?void 0:s.offsetTop)||0}o=n}return Ce(o)}function mt(e,t){return Ve(e)&&"fixed"!==Fe(e).position?t?t(e):e.offsetParent:null}function ft(e,t){const n=Be(e);if(!Ve(e))return n;let o=mt(e,t);for(;o&&Ze(o)&&"static"===Fe(o).position;)o=mt(o,t);return o&&("html"===$e(o)||"body"===$e(o)&&"static"===Fe(o).position&&!Je(o))?n:o||function(e){let t=ut(e);for(;Ve(t)&&!Ye(t);){if(Je(t))return t;t=ut(t)}return null}(e)||n}function gt(e,t,n){const o=Ve(t),i=at(t),s=rt(e,!0,"fixed"===n,t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==$e(t)||Ge(i))&&(r=lt(t)),Ve(t)){const e=rt(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&(a.x=ct(i));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const vt={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let o=ht(e).filter((e=>He(e)&&"body"!==$e(e))),i=null;const s="fixed"===Fe(e).position;let r=s?ut(e):e;for(;He(r)&&!Ye(r);){const e=Fe(r),t=Je(r);"fixed"===e.position&&(i=null),(s?t||i:t||"static"!==e.position||!i||!["absolute","fixed"].includes(i.position))?i=e:o=o.filter((e=>e!==r)),r=ut(r)}return t.set(e,o),o}(t,this._c):[].concat(n),o],r=s[0],a=s.reduce(((e,n)=>{const o=pt(t,n,i);return e.top=et(o.top,e.top),e.right=Xe(o.right,e.right),e.bottom=Xe(o.bottom,e.bottom),e.left=et(o.left,e.left),e}),pt(t,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:o}=e;const i=Ve(n),s=at(n);if(n===s)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==$e(n)||Ge(s))&&(r=lt(n)),Ve(n))){const e=rt(n);a=st(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:He,getDimensions:function(e){return nt(e)},getOffsetParent:ft,getDocumentElement:at,getScale:st,async getElementRects(e){let{reference:t,floating:n,strategy:o}=e;const i=this.getOffsetParent||ft,s=this.getDimensions;return{reference:gt(t,await i(n),o),floating:{x:0,y:0,...await s(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===Fe(e).direction};const _t=(e,t,n)=>{const o=new Map,i={platform:vt,...n},s={...i.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=we(c,o,l),h=o,p={},m=0;for(let n=0;n\n.sda-overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 2147483647 !important;\n will-change: opacity, transform;\n}\n\n.sda-modal {\n background-color: #fff;\n position: absolute;\n min-width: 320px;\n border-radius: 32px;\n padding: 40px 28px 16px;\n will-change: opacity, transform;\n}\n\n.sda-modal:focus {\n outline: 0;\n}\n\n@media screen and (max-width: 430px) {\n .sda-modal {\n ${yt}\n padding: 32px 0 16px;\n box-sizing: border-box;\n }\n\n .arrow {\n display: none;\n }\n}\n\n.sda-modal.disable-popup {\n ${yt}\n}\n\n.sda-modal-close-button {\n background: none;\n border: none;\n position: absolute;\n right: 16px;\n top: 24px;\n padding: 8px;\n cursor: pointer;\n display: flex;\n}\n\n.sda-modal-close-button:focus,\n.sda-modal-close-button:hover {\n border-radius: 6px;\n background: rgb(0 0 0 / 0.03);\n color: #7b61f0;\n outline: none;\n\n --icon-color: #7b61f0;\n}\n\n.sda-modal-close-button close-icon {\n pointer-events: none;\n}\n\n.sda-landing {\n width: 320px;\n margin: auto;\n}\n\n.sda-shop-logo {\n text-align: center;\n padding: 12px 0 8px 0;\n}\n\n.sda-hidden {\n height: 0 !important;\n border: 0;\n padding: 0;\n margin: 0;\n visibility: hidden;\n overflow: hidden;\n}\n\n.focus-trap {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n@media (forced-colors: active) {\n .sda-modal {\n border: 1px solid;\n }\n}\n\n.arrow {\n position: absolute;\n background-color: #fff;\n width: 24px;\n height: 24px;\n transform: rotate(45deg);\n}\n\n\n
\n \n \n \n
\n`;var kt;!function(e){e.Dynamic="DYNAMIC",e.Static="STATIC",e.Mobile="MOBILE"}(kt||(kt={}));const Ct=new Map([["top","bottom"],["top-end","bottom"],["top-start","bottom"],["right","left"],["right-end","left"],["right-start","left"],["bottom","top"],["bottom-end","top"],["bottom-start","top"],["left","right"],["left-end","right"],["left-start","right"]]),St={[kt.Dynamic]:e=>{let t=e.querySelector(".arrow");return null===t&&(t=document.createElement("div"),t.className="arrow",e.appendChild(t)),{config:{placement:"right",middleware:[Ne(22),De({limiter:Re({offset:64})}),Oe({fallbackPlacements:["left","top","bottom"]}),Te({element:t}),{name:"center",fn(){return i(this,void 0,void 0,(function*(){return{data:{center:window.matchMedia("screen and (((min-width: 430px) and (max-width: 1280px)) or (max-height: 750px))").matches}}}))}}]},fn:({x:n,y:o,placement:i,strategy:s,middlewareData:r})=>{const{center:a}=r;if(a.center)return null!==t&&(t.style.display="none"),Object.assign(e.style,{top:(window.innerHeight-e.offsetHeight)/2+"px",left:(window.innerWidth-e.offsetWidth)/2+"px",bottom:"",right:""}),null;Object.assign(e.style,{left:`${n}px`,top:`${o}px`,right:"",bottom:""});const{arrow:l}=r,c=Ct.get(i);return null!==t&&Object.assign(t.style,{left:void 0===(null==l?void 0:l.x)?"":`${null==l?void 0:l.x}px`,top:void 0===(null==l?void 0:l.y)?"":`${null==l?void 0:l.y}px`,right:"",bottom:"",display:"",[c]:"-12px"}),{x:n,y:o,strategy:s,placement:i,staticSide:c,middlewareData:r}}}},[kt.Static]:(e,t={})=>({config:{},fn:()=>{const n=e.querySelector(".arrow");return null!==n&&(n.style.display="none"),Object.assign(e.style,{top:"16px",right:"16px",bottom:"auto",left:"auto"},t),null}}),[kt.Mobile]:e=>({config:{},fn:()=>(Object.assign(e.style,{top:"auto !important",right:"0 !important",bottom:"0 !important",left:"auto"}),null)})},xt={cleanup:()=>{},updatePosition:()=>i(void 0,void 0,void 0,(function*(){return Promise.resolve(null)}))};function Et({anchorElement:e,floatingElement:t,behavior:n=kt.Static},o={}){if(null===t)return xt;const s=null==e&&n!==kt.Mobile?St[kt.Static](t,o):St[n](t,o),r=e||document.body,a=()=>i(this,void 0,void 0,(function*(){const e=yield _t(r,t,s.config);return s.fn(e)}));return{cleanup:function(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=o,l=i&&!a,c=l||s?[...He(e)?ht(e):e.contextElement?ht(e.contextElement):[],...ht(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)}));let u,d=null;r&&(d=new ResizeObserver((()=>{n()})),He(e)&&!a&&d.observe(e),He(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t));let h=a?rt(e):null;return a&&function t(){const o=rt(e);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n(),h=o,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}(r,t,a,{ancestorScroll:!1,ancestorResize:!0,elementResize:!0,animationFrame:!1}),updatePosition:a}}var At,Tt;class Pt{constructor(e,t){At.set(this,void 0),Tt.set(this,void 0),e&&(d(this,At,e,"f"),d(this,Tt,(e=>{t(e.target.value)}),"f"),u(this,At,"f").addEventListener("input",u(this,Tt,"f")))}destroy(){u(this,At,"f")&&u(this,Tt,"f")&&u(this,At,"f").removeEventListener("input",u(this,Tt,"f"))}}At=new WeakMap,Tt=new WeakMap;var Mt=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.extractDomain=t.PRODUCTION_CANADA_ENDPOINT=t.PRODUCE_ENDPOINT=t.PRODUCE_BATCH_ENDPOINT=t.PRODUCTION_DOMAIN=t.DEVELOPMENT_DOMAIN=void 0,t.DEVELOPMENT_DOMAIN="http://localhost:8082",t.PRODUCTION_DOMAIN="https://monorail-edge.shopifysvc.com",t.PRODUCE_BATCH_ENDPOINT="/unstable/produce_batch",t.PRODUCE_ENDPOINT="/v1/produce",t.PRODUCTION_CANADA_ENDPOINT="https://monorail-edge-ca.shopifycloud.com/v1/produce",t.extractDomain=function(e){return"https://".concat(new URL(e).hostname)}}));ne(Mt),Mt.extractDomain,Mt.PRODUCTION_CANADA_ENDPOINT,Mt.PRODUCE_ENDPOINT,Mt.PRODUCE_BATCH_ENDPOINT,Mt.PRODUCTION_DOMAIN,Mt.DEVELOPMENT_DOMAIN;var Lt=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeMonorailEvent=void 0,t.isCompositeMonorailEvent=function(e){return void 0!==e.schemaId}}));ne(Lt),Lt.isCompositeMonorailEvent;var It=Lt,jt=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProducerMiddleware=void 0;var n=function(){function e(e){this.producer=e}return e.prototype.do=function(e,t){return(0,It.isCompositeMonorailEvent)(e)?this.producer.produce(e):this.producer.produceBatch(e)},e}();t.ProducerMiddleware=n}));ne(jt),jt.ProducerMiddleware;var Ot=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.v4=void 0,t.v4=function(){return"object"==typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():B.v4()}}));ne(Ot),Ot.v4;var Nt=oe((function(e,t){function n(e,t){return void 0===t&&(t=!0),e&&Object.keys(e).length&&t?Object.keys(e).map((function(t){var n;return(n={})[o(t)]=e[t],n})).reduce((function(e,t){return h.__assign(h.__assign({},e),t)})):e}function o(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.toUnderscoreCase=t.convertAllEventsToUnderscoreCase=t.convertStringToUnderscoreCase=void 0,t.toUnderscoreCase=n,t.convertStringToUnderscoreCase=o,t.convertAllEventsToUnderscoreCase=function(e){return e.events.map((function(e){var t=!0,o=!0;return e&&e.options&&Object.prototype.hasOwnProperty.call(e.options,"convertEventCase")&&(t=Boolean(e.options.convertEventCase)),e&&e.options&&Object.prototype.hasOwnProperty.call(e.options,"convertMetaDataCase")&&(o=Boolean(e.options.convertMetaDataCase)),{schema_id:e.schemaId,payload:n(e.payload,t),metadata:n(e.metadata,o)}}))}}));ne(Nt),Nt.toUnderscoreCase,Nt.convertAllEventsToUnderscoreCase,Nt.convertStringToUnderscoreCase;var zt=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MonorailRetriesExceededError=t.MonorailRequestError=t.MonorailBatchProduceError=t.MonorailUnableToProduceError=void 0;var n=function(e){function t(n){var o=e.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(n)))||this;return o.response=n,Object.setPrototypeOf(o,t.prototype),o}return h.__extends(t,e),t}(Error);t.MonorailUnableToProduceError=n;var o=function(e){function t(n){var o=e.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(n)))||this;return Object.setPrototypeOf(o,t.prototype),o.response=n,o}return h.__extends(t,e),t}(Error);t.MonorailBatchProduceError=o;var i=function(e){function t(n){var o=e.call(this,"Error completing request. A network failure may have prevented the request from completing. Error: ".concat(n))||this;return Object.setPrototypeOf(o,t.prototype),o}return h.__extends(t,e),t}(Error);t.MonorailRequestError=i;var s=function(e){function t(n){var o=e.call(this,"".concat(n))||this;return Object.setPrototypeOf(o,t.prototype),o}return h.__extends(t,e),t}(Error);t.MonorailRetriesExceededError=s}));ne(zt),zt.MonorailRetriesExceededError,zt.MonorailRequestError,zt.MonorailBatchProduceError,zt.MonorailUnableToProduceError;var Dt=Mt,Rt=Nt,Bt=Ot,Ft=zt,Ut=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.HttpProducer=void 0;var n=function(){function e(e,t){void 0===e&&(e=Dt.DEVELOPMENT_DOMAIN),void 0===t&&(t=!1),this.edgeDomain=e,this.keepalive=t}return e.withEndpoint=function(t){return new e(Dt.extractDomain(t))},e.getHeadersFromMetadata=function(e){var t={"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,Bt.v4)()).toString()};return e&&e.userAgent&&(t["User-Agent"]=e.userAgent),t},e.prototype.produceBatch=function(t){return h.__awaiter(this,void 0,void 0,(function(){var n,o,i,s,r,a;return h.__generator(this,(function(l){switch(l.label){case 0:n={events:(0,Rt.convertAllEventsToUnderscoreCase)(t),metadata:(0,Rt.toUnderscoreCase)(t.metadata)},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,fetch(this.produceBatchEndpoint(),{method:"post",headers:e.getHeadersFromMetadata(t.metadata),body:JSON.stringify(n),keepalive:this.keepalive})];case 2:return o=l.sent(),[3,4];case 3:throw i=l.sent(),new Ft.MonorailRequestError(i);case 4:return 207!==o.status?[3,6]:[4,o.json()];case 5:throw s=l.sent(),new Ft.MonorailBatchProduceError(s);case 6:return o.ok?[3,8]:(r=Ft.MonorailUnableToProduceError.bind,a={status:o.status},[4,o.text()]);case 7:throw new(r.apply(Ft.MonorailUnableToProduceError,[void 0,(a.message=l.sent(),a)]));case 8:return[2,{status:o.status}]}}))}))},e.prototype.produce=function(t){return h.__awaiter(this,void 0,void 0,(function(){var n,o,i,s,r,a;return h.__generator(this,(function(l){switch(l.label){case 0:n=!0,t&&t.options&&Object.prototype.hasOwnProperty.call(t.options,"convertEventCase")&&(n=Boolean(t.options.convertEventCase)),o={schema_id:t.schemaId,payload:(0,Rt.toUnderscoreCase)(t.payload,n)},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,fetch(this.produceEndpoint(),{method:"post",headers:e.getHeadersFromMetadata(t.metadata),body:JSON.stringify(o),keepalive:this.keepalive})];case 2:return i=l.sent(),[3,4];case 3:throw s=l.sent(),new Ft.MonorailRequestError(s);case 4:if(!i)throw new Ft.MonorailUnableToProduceError({message:"No response from edge"});return i.ok?[3,6]:(r=Ft.MonorailUnableToProduceError.bind,a={status:i.status},[4,i.text()]);case 5:throw new(r.apply(Ft.MonorailUnableToProduceError,[void 0,(a.message=l.sent(),a)]));case 6:return[2,{status:i.status}]}}))}))},e.prototype.produceBatchEndpoint=function(){return this.edgeDomain+Dt.PRODUCE_BATCH_ENDPOINT},e.prototype.produceEndpoint=function(){return this.edgeDomain+Dt.PRODUCE_ENDPOINT},e}();t.HttpProducer=n}));ne(Ut),Ut.HttpProducer;var $t=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.LogProducer=void 0;var n=function(){function e(t){this.sendToConsole=t,t&&e.printWelcomeMessage(t)}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(t){t(e)}))},e.prototype.produceBatch=function(e){return this.sendToConsole&&console.log("Monorail Batch event produced",e),new Promise((function(t){t(e)}))},e}();t.LogProducer=n}));ne($t),$t.LogProducer;var Wt=jt,qt=Ut,Vt=$t,Ht=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Monorail=void 0;var n=function(){function e(t,n){this.producer=t,this.middleware=n,this.executeChain=e.buildMiddlewareChain(this.middleware.concat(new Wt.ProducerMiddleware(t)))}return e.createLogProducer=function(t){return new e(new Vt.LogProducer(t.debugMode),t.middleware||[])},e.createHttpProducerWithEndpoint=function(t,n){return void 0===n&&(n=[]),new e(qt.HttpProducer.withEndpoint(t),n)},e.createHttpProducer=function(t){var n=t.options&&t.options.keepalive;return new e(t.production?new qt.HttpProducer(Dt.PRODUCTION_DOMAIN,n):new qt.HttpProducer(Dt.DEVELOPMENT_DOMAIN,n),t.middleware||[])},e.buildMiddlewareChain=function(e,t){var n=this;return void 0===t&&(t=0),t===e.length?this.identityFn:function(o){return e[t].do(o,n.buildMiddlewareChain(e,t+1))}},e.prototype.produce=function(e){return e.metadata=h.__assign({eventCreatedAtMs:Date.now(),clientMessageId:(0,Bt.v4)()},e.metadata),this.executeChain(e)},e.prototype.produceBatch=function(e){return this.executeChain(e)},e}();t.Monorail=n}));ne(Ht),Ht.Monorail;var Kt=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.RetryMiddleware=void 0;var n=function(){function e(e,t){void 0===e&&(e=3),void 0===t&&(t=150),this.maxRetries=e,this.delayMs=t}return e.prototype.do=function(e,t){return h.__awaiter(this,void 0,void 0,(function(){var n,o,i,s,r;return h.__generator(this,(function(a){switch(a.label){case 0:n=0,a.label=1;case 1:if(!(n=400&&r<500)throw s;return[4,this.delay(this.delayMs*Math.pow(2,n))];case 5:return a.sent(),n++,[3,1];case 6:return[2,i];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(t){return setTimeout(t,e)}))},e}();t.RetryMiddleware=n}));ne(Kt),Kt.RetryMiddleware;var Gt=Ht,Zt=Kt,Jt=oe((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.RetryMiddleware=t.MonorailRetriesExceededError=t.MonorailUnableToProduceError=t.MonorailRequestError=t.Monorail=void 0,Object.defineProperty(t,"Monorail",{enumerable:!0,get:function(){return Gt.Monorail}}),Object.defineProperty(t,"MonorailRequestError",{enumerable:!0,get:function(){return Ft.MonorailRequestError}}),Object.defineProperty(t,"MonorailUnableToProduceError",{enumerable:!0,get:function(){return Ft.MonorailUnableToProduceError}}),Object.defineProperty(t,"MonorailRetriesExceededError",{enumerable:!0,get:function(){return Ft.MonorailRetriesExceededError}}),Object.defineProperty(t,"RetryMiddleware",{enumerable:!0,get:function(){return Zt.RetryMiddleware}})}));ne(Jt),Jt.RetryMiddleware,Jt.MonorailRetriesExceededError,Jt.MonorailUnableToProduceError,Jt.MonorailRequestError;var Qt,Yt,Xt,en,tn,nn,on,sn,rn,an,ln=Jt.Monorail;function cn(...e){var t;return i(this,void 0,void 0,(function*(){if(!window.ShopifyAnalytics&&!window.analytics)return{};let n;Boolean(null===(t=window.trekkie)||void 0===t?void 0:t.ready)?n=un():(window.trekkie=window.trekkie||[],n=new Promise((e=>{window.trekkie.push(["ready",()=>{e(un())}])})));const o=yield n;return e.reduce(((e,t)=>{const n=o[t];return void 0!==n&&(e[t]=n),e}),{})}))}function un(){let e;return Promise.race([new Promise((t=>e=setTimeout((()=>t({})),1e4))),new Promise((e=>{var t,n,o;const i=(null===(n=null===(t=window.ShopifyAnalytics)||void 0===t?void 0:t.lib)||void 0===n?void 0:n.ready)||(null===(o=window.analytics)||void 0===o?void 0:o.ready);null==i||i((()=>{var t,n,o;const i=(null===(n=null===(t=window.ShopifyAnalytics)||void 0===t?void 0:t.lib)||void 0===n?void 0:n.trekkie)||(null===(o=window.analytics)||void 0===o?void 0:o.trekkie);e(i.defaultAttributes)}))}))]).finally((()=>clearTimeout(e)))}!function(e){e.Interest="interest",e.SplitPay="split_pay",e.ZeroPercent="zero_percent"}(Qt||(Qt={})),function(e){e.Cart="cart",e.Product="product"}(Yt||(Yt={})),function(e){e.PayInFour="pay_in_4",e.AsLowAs="as_low_as",e.PayInFourAsLowAs="pay_in_4_or_as_low_as"}(Xt||(Xt={})),function(e){e.Standard="standard",e.CustomizedByMerchant="customized_by_merchant"}(en||(en={})),function(e){e.SplitPay="split_pay",e.ZeroInterest="zero_interest",e.InterestOnly="interest_only",e.ZeroInterestOnly="zero_interest_only",e.Adaptive="adaptive",e.Ineligible="ineligible"}(tn||(tn={})),function(e){e.Close="close",e.ContinueToCheckout="continue_to_checkout"}(nn||(nn={})),function(e){e.SplitPay="split_pay",e.Monthly="monthly"}(on||(on={})),function(e){e.UiImpression="shop_js_ui_impression/1.1",e.InstallmentsModalOpened="shop_pay_installments_dynamic_modal_impression/1.0",e.InstallmentsModalUserAction="shop_pay_installments_dynamic_modal_user_actions/1.0",e.InstallmentsBannerImpression="shop_pay_installments_banner_ui_impression/1.1",e.InstallmentsInvalidMetadata="shop_pay_installments_banner_invalid_metadata/1.0",e.ShopLoginFirstTimeRender="shop_js_ui_shop_login_first_time_render/1.0",e.ShopifyLoginWithShopSdkDiscountStatus="shopify_pay_login_with_shop_sdk_discount_status/2.0",e.LoginWithShopSdkPageImpression="shopify_pay_login_with_shop_sdk_page_impressions/3.0",e.LoginWithShopSdkUserAction="shopify_pay_login_with_shop_sdk_user_actions/2.0",e.LoginWithShopSdkErrorEvents="shopify_pay_login_with_shop_sdk_error_events/1.0"}(sn||(sn={})),function(e){e.AuthorizeModal="AUTHORIZE_MODAL",e.ClassicCustomerAccount="CLASSIC_CUSTOMER_ACCOUNTS_ACCOUNT_PAGE",e.ClassicCustomerAccountCreateAccount="CLASSIC_CUSTOMER_ACCOUNTS_CREATE_ACCOUNT_PAGE",e.ClassicCustomerAccountLogin="CLASSIC_CUSTOMER_ACCOUNTS_LOGIN_PAGE",e.ComponentLoadedFollowing="COMPONENT_LOADED_FOLLOWING",e.ComponentLoadedNotFollowing="COMPONENT_LOADED_NOT_FOLLOWING",e.ContinueWithShop="CONTINUE_WITH_SHOP_PAGE",e.DiscountSaved="DISCOUNT_SAVE_CONFIRMATION_PAGE",e.DiscountShown="DISCOUNT_SHOWN",e.FollowButtonShownInViewport="FOLLOW_BUTTON_SHOWN_IN_VIEWPORT",e.FollowingGetShopAppCta="FOLLOWING_GET_SHOP_APP_CTA",e.PartnerEmailInputShown="PARTNER_EMAIL_INPUT_SHOWN",e.PhoneConsent="TEXT_MARKETING_SIGN_UP",e.PhoneConsentConfirmed="TEXT_MARKETING_CONFIRMED_PAGE",e.PhoneConsentDeclined="TEXT_MARKETING_DECLINED_PAGE",e.SdkLoaded="SDK_HAS_LOADED_INITIAL_PAGE"}(rn||(rn={})),function(e){e.ThirdPartyFormSubmission="3RD_PARTY_EMAIL_CAPTURE_FORM_SUBMISSION_CLICK",e.FollowOnShopClicked="FOLLOW_ON_SHOP_CLICKED",e.FollowingGetShopAppClick="FOLLOWING_GET_SHOP_APP_CLICK",e.ContinueWithShopClicked="CONTINUE_WITH_SHOP_BUTTON_CLICK",e.EmailEntered="EMAIL_ENTERED",e.CreateAccountLinkClicked="CREATE_ACCOUNT_CLICK",e.PhoneConsentProvided="SHARE_PHONE_CLICK",e.PhoneConsentDeclined="DO_NOT_SHARE_PHONE_CLICK"}(an||(an={}));const dn=ln.createHttpProducer({production:!0});class hn{constructor(e,t,n=""){var o,i;this.shopifyPermanentDomain=null!==(i=null===(o=window.Shopify)||void 0===o?void 0:o.shop)&&void 0!==i?i:"",this.impressionTracked=!1,this.bannerImpressionTracked={},this.modalActionTracker={},this.shopLoginFirstTimeRenderTracked={},this.invalidBannerMetadataTracked=!1,this.pageImpressionTracked={AUTHORIZE_MODAL:!1,CLASSIC_CUSTOMER_ACCOUNTS_ACCOUNT_PAGE:!1,CLASSIC_CUSTOMER_ACCOUNTS_CREATE_ACCOUNT_PAGE:!1,CLASSIC_CUSTOMER_ACCOUNTS_LOGIN_PAGE:!1,COMPONENT_LOADED_FOLLOWING:!1,COMPONENT_LOADED_NOT_FOLLOWING:!1,CONTINUE_WITH_SHOP_PAGE:!1,DISCOUNT_SAVE_CONFIRMATION_PAGE:!1,DISCOUNT_SHOWN:!1,FOLLOWING_GET_SHOP_APP_CTA:!1,FOLLOW_BUTTON_SHOWN_IN_VIEWPORT:!1,PARTNER_EMAIL_INPUT_SHOWN:!1,SDK_HAS_LOADED_INITIAL_PAGE:!1,TEXT_MARKETING_SIGN_UP:!1,TEXT_MARKETING_CONFIRMED_PAGE:!1,TEXT_MARKETING_DECLINED_PAGE:!1},this.elementName=e,this.flow=n,this.analyticsTraceId=t,this.initTimestamp=(new Date).getTime()}trackElementImpression(e){return i(this,void 0,void 0,(function*(){if(this.impressionTracked)return;this.impressionTracked=!0;const t=yield cn("uniqToken","visitToken","microSessionId","microSessionCount","shopId","themeId","themeCityHash","contentLanguage","referer"),n=Object.assign(Object.assign({},t),{elementType:e,elementName:this.elementName,shopJsVersion:F});pn({schemaId:sn.UiImpression,payload:n},(()=>{this.impressionTracked=!1}))}))}trackPageImpression({shopLoginVersion:e,shopAccountUuid:t,apiKey:n,page:o}){return i(this,void 0,void 0,(function*(){if(this.pageImpressionTracked[o])return;this.pageImpressionTracked[o]=!0;const i=yield cn("uniqToken","visitToken","isPersistentCookie","path","customerId"),s=Object.assign(Object.assign(Object.assign(Object.assign({},i),{shopPermanentDomain:this.shopifyPermanentDomain,flow:this.flow,flowVersion:e,sdkVersion:F,analyticsTraceId:this.analyticsTraceId,pageName:o}),n&&{apiKey:n}),t&&{shopAccountUuid:t});pn({schemaId:sn.LoginWithShopSdkPageImpression,payload:s},(()=>{this.pageImpressionTracked[o]=!1}))}))}trackShopLoginFirstTimeRender(e,t=this.initTimestamp){return i(this,void 0,void 0,(function*(){if(this.shopLoginFirstTimeRenderTracked[e])return;this.shopLoginFirstTimeRenderTracked[e]=!0;const n=(new Date).getTime()-t,{shopId:o}=yield cn("shopId"),i={analyticsTraceId:this.analyticsTraceId,duration:n,shopId:o,shopLoginVersion:e,url:window.location.href,userAgent:navigator.userAgent};pn({schemaId:sn.ShopLoginFirstTimeRender,payload:i},(()=>{this.shopLoginFirstTimeRenderTracked[e]=!1}))}))}trackShopPayLoginWithShopSdkUserAction({apiKey:e,shopLoginVersion:t,userAction:n}){const o=Object.assign(Object.assign({},e&&{apiKey:e}),{flow:this.flow,flowVersion:t,sdkVersion:F,analyticsTraceId:this.analyticsTraceId,shopPermanentDomain:this.shopifyPermanentDomain,userAction:n});pn({schemaId:sn.LoginWithShopSdkUserAction,payload:o})}trackShopPayLoginWithSdkErrorEvents({apiKey:e,shopLoginVersion:t,errorCode:n,errorMessage:o}){const i={apiKey:e,flow:this.flow,flowVersion:t,sdkVersion:F,analyticsTraceId:this.analyticsTraceId,shopPermanentDomain:this.shopifyPermanentDomain,errorCode:n,errorMessage:o};pn({schemaId:sn.LoginWithShopSdkErrorEvents,payload:i})}trackModalOpened(e,t,n,o,s,r,a){return i(this,void 0,void 0,(function*(){let i;if(i=e===Yt.Cart?`${e}-open`:`${t}-open`,this.modalActionTracker[i])return;this.modalActionTracker[i]=!0;const l=yield cn("uniqToken","visitToken","microSessionId","microSessionCount","shopId","currency"),c=Object.assign(Object.assign({},l),{origin:e,modalToken:t,eligibleSpiPlanType:n,price:r,cartPermalink:a,spiPlanDetails:o,variantId:s,shopJsVersion:F});pn({schemaId:sn.InstallmentsModalOpened,payload:c},(()=>{this.modalActionTracker[i]=!1}))}))}trackModalAction(e,t,n){return i(this,void 0,void 0,(function*(){const o=`${e}-${t}`;if(this.modalActionTracker[o])return;this.modalActionTracker[o]=!0;const i=yield cn("uniqToken","visitToken","microSessionId","microSessionCount","shopId"),s=Object.assign(Object.assign({},i),{modalToken:e,action:t,cartPermalink:n,shopJsVersion:F});pn({schemaId:sn.InstallmentsModalUserAction,payload:s},(()=>{this.modalActionTracker[o]=!1}))}))}trackInstallmentsBannerImpression(e,t,n,o,s,r){return i(this,void 0,void 0,(function*(){const i=r?String(r):"cart";if(this.bannerImpressionTracked[i])return;this.bannerImpressionTracked[i]=!0;const a=yield cn("uniqToken","visitToken","shopId","microSessionId","contentLanguage","currency"),l=Object.assign(Object.assign({},a),{origin:e,bannerContent:t,eligible:n,bannerTemplateCodeSignature:o,price:s,shopJsVersion:F});pn({schemaId:sn.InstallmentsBannerImpression,payload:l},(()=>{this.bannerImpressionTracked[i]=!1}))}))}trackInvalidInstallmentBannerMetadata(e,t){return i(this,void 0,void 0,(function*(){if(this.invalidBannerMetadataTracked)return;this.invalidBannerMetadataTracked=!0;const n=yield cn("uniqToken","visitToken","microSessionId","microSessionCount","shopId"),o=Object.assign(Object.assign({},n),{origin:e,metadata:t,shopJsVersion:F});pn({schemaId:sn.InstallmentsInvalidMetadata,payload:o},(()=>{this.invalidBannerMetadataTracked=!1}))}))}}function pn(e,t){dn.produce(e).catch((e=>{null==t||t();const n=e instanceof Error?e:new Error(String(e));me(n)}))}var mn;!function(e){e.Default="loginWithShop",e.ClassicCustomerAccounts="loginWithShopClassicCustomerAccounts"}(mn||(mn={}));const fn={[mn.Default]:"default",[mn.ClassicCustomerAccounts]:"classic_customer_accounts"},gn=1e4,vn={code:"temporarily_unavailable",message:"Shop login is temporarily unavailable"},_n="client-id",bn="version",yn="storefront-origin",wn="email-verification-required",kn="hide-button",Cn="disable-sign-up",Sn="redirect-uri",xn="auto-open",En="analytics-context",An="analytics-trace-id",Tn="response-type",Pn="response-mode",Mn="code-challenge",Ln="code-challenge-method",In="state",jn="scope",On="use-pay-alt-domain",Nn="email",zn="anchor-to",Dn="dev-mode";class Rn extends hn{constructor(e,t){super(e,t,"follow")}trackFollowButtonPageImpression(e,t){this.trackPageImpression({shopLoginVersion:e,page:t?rn.ComponentLoadedFollowing:rn.ComponentLoadedNotFollowing})}trackFollowButtonInViewport(e){this.trackPageImpression({shopLoginVersion:e,page:rn.FollowButtonShownInViewport})}trackFollowingGetAppButtonPageImpression(e){this.trackPageImpression({shopLoginVersion:e,page:rn.FollowingGetShopAppCta})}trackFollowButtonClicked(e){this.trackShopPayLoginWithShopSdkUserAction({shopLoginVersion:e,userAction:an.FollowOnShopClicked})}trackFollowingGetAppButtonClicked(e){this.trackShopPayLoginWithShopSdkUserAction({shopLoginVersion:e,userAction:an.FollowingGetShopAppClick})}}class Bn extends hn{constructor(e,t,n=mn.Default){super(e,t,fn[n]),this._emailEnteredUserActionTracked=!1}trackLoginDefaultButtonClicked(e){this.trackShopPayLoginWithShopSdkUserAction({shopLoginVersion:e,userAction:an.ContinueWithShopClicked})}trackEmailEnteredAction(e){this._emailEnteredUserActionTracked||(this._emailEnteredUserActionTracked=!0,this.trackShopPayLoginWithShopSdkUserAction({shopLoginVersion:e,userAction:an.EmailEntered}))}}class Fn extends Bn{constructor(e,t){super(e,t,mn.ClassicCustomerAccounts)}trackClassicCustomerAccountsLoginPageImpression(e){this.trackPageImpression({shopLoginVersion:e,page:rn.ClassicCustomerAccountLogin})}trackClassicCustomerAccountsCreateAccountPageImpression(e){this.trackPageImpression({shopLoginVersion:e,page:rn.ClassicCustomerAccountCreateAccount})}trackClassicCustomerAccountsAccountPageImpression(e){this.trackPageImpression({shopLoginVersion:e,page:rn.ClassicCustomerAccount})}trackClassicCustomerAccountsContinueWithShopPageImpression(e){this.trackPageImpression({shopLoginVersion:e,page:rn.ContinueWithShop})}trackClassicCustomerAccountsCreateAccountAction(e){this.trackShopPayLoginWithShopSdkUserAction({shopLoginVersion:e,userAction:an.CreateAccountLinkClicked})}}function Un(){return i(this,void 0,void 0,(function*(){try{if(("/"===(e=window.location.pathname)?e:e.endsWith("/")?e.slice(0,-1):e).endsWith("/account"))return void function(){const e=Q("analytics_trace_id");if(e){new Fn("shop-login-button",e).trackClassicCustomerAccountsAccountPageImpression("2")}const t=K(U);if(t){const e=JSON.parse(decodeURIComponent(JSON.parse(`"${t.replace(/"/g,'\\"')}"`))),s=null==e?void 0:e.analytics_trace_id,r=null==e?void 0:e.email;if(!s)throw new $n("Missing analytics trace ID in Sign in with Shop cookie");if(!W(r))throw new $n("Tried to show Login with Shop on customer account page with an invalid email",s);const a=document.createElement("shop-login-button");a.setAttribute("client-id",""),a.setAttribute("action","default"),a.setAttribute("version","2"),a.setAttribute("analytics-context",mn.ClassicCustomerAccounts),a.setAttribute("analytics-trace-id",s),a.setAttribute("hide-button","true"),a.setAttribute("email-verification-required","true"),document.body.appendChild(a),a.requestShow(r),o="/account",K(n=U)&&(document.cookie=`${n}=${o?`;path=${o}`:""}${i?`;domain=${i}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT`);new Fn("shop-login-button",s).trackClassicCustomerAccountsAccountPageImpression("2")}var n,o,i}();!function(){const e=G(),t=new Fn("shop-login-button",e),n=new WeakMap;let o=null;const i=function({onVisible:e,onFallback:t}){const n=new IntersectionObserver((i=>{for(const s of i){const{target:i,isIntersecting:r}=s;r&&(o(i)?e(i):t(i),n.unobserve(i))}}),{threshold:1});function o(e){let t=e;for(;t;){if(!["","1"].includes(getComputedStyle(t).opacity))return!1;t=t.parentElement}return!0}return n}({onVisible:a,onFallback:e=>{e.addEventListener("focus",s,{once:!0}),t.trackShopPayLoginWithSdkErrorEvents({apiKey:"",shopLoginVersion:"2",errorCode:"fallback_to_focus_event",errorMessage:"Fallback to focus event for classic customer accounts"})}});function s(e){a(e.target)}function r(e,t){var n,o;const i=null===(n=e.elements.namedItem("checkout_url"))||void 0===n?void 0:n.value,s=null===(o=e.elements.namedItem("return_url"))||void 0===o?void 0:o.value,r=new URLSearchParams(Object.assign(Object.assign({analytics_trace_id:t},i&&{checkout_url:i}),s&&{return_url:s}));return`${window.location.origin}/account/redirect?${r.toString()}`}function a(i){var s;const a=i.form;if(!a)return void me(new Error("Email form missing for classic customer accounts"));n.has(i)&&(me(new Error("Input listener already exists for input")),null===(s=n.get(i))||void 0===s||s.destroy(),n.delete(i));const l=document.createElement("input");l.type="hidden",l.name="login_with_shop[analytics_trace_id]",l.value=e,a.appendChild(l),o||(o=function(e){const t=document.createElement("shop-login-button");return t.setAttribute("client-id",""),t.setAttribute("action","default"),t.setAttribute("version","2"),t.setAttribute("analytics-context",mn.ClassicCustomerAccounts),t.setAttribute("analytics-trace-id",e),t.setAttribute("hide-button","true"),t.setAttribute("email-verification-required","true"),t.setAttribute("disable-sign-up","true"),t.setAttribute("auto-open","true"),document.body.appendChild(t),t}(e),t.trackClassicCustomerAccountsLoginPageImpression("2"),o.addEventListener("completed",(()=>{const t=r(a,e);window.location.assign(t)}))),o.email=i.value,n.set(i,new Pt(i,(e=>{o.email=e})))}fe({selector:'form[data-login-with-shop-sign-in] input[type="email"],form[data-login-with-shop-sign-in] input[name="customer[email]"]',onElementFound:e=>i.observe(e)})}()}catch(e){if(e instanceof Error&&me(e),e instanceof $n){new Fn("shop-login-button",e.analyticsTraceId).trackShopPayLoginWithSdkErrorEvents({apiKey:"",shopLoginVersion:"2",errorCode:e.code,errorMessage:e.message})}}var e}))}class $n extends Error{constructor(e,t=G()){super(e),this.analyticsTraceId=t,this.name="InitCustomerAccountsError",this.code="init_customer_accounts_error"}}class Wn{constructor(e,t,n,o=window){this.subscribers=new Set,this.subscribers.add(n),this.eventListener=n=>{e.isSourceOf(n)&&(t.some((e=>function(e,t){try{const n=new URL(e).host.split(".").reverse(),o=new URL(t).host.split(".").reverse();for(let e=0;e{const s=()=>{i(new Error("Abort signal received"))};(null==t?void 0:t.aborted)&&s(),n=n=>{n.type===e&&(null==t||t.removeEventListener("abort",s),o(n))},this.subscribers.add(n),null==t||t.addEventListener("abort",s)})).finally((()=>{this.subscribers.delete(n)}))}notify(e){this.subscribers.forEach((t=>t(e)))}}function qn(e){console.error(`[shop-js] ${e}`),me(new Error(e))}const Vn="https://shop.app",Hn="https://pay.shopify.com";class Kn{constructor(e,t){this.eventDestination=e,this.eventOrigins=t}postMessage(e){const t=this.eventDestination instanceof HTMLIFrameElement?this.eventDestination.contentWindow:this.eventDestination;this.eventOrigins.forEach((n=>{null==t||t.postMessage(e,n)}))}}class Gn extends Kn{constructor(e){super(e,[Vn,Hn])}}class Zn{constructor(e){this.source=e}isSourceOf(e){return e.source===this.source.contentWindow}}class Jn{constructor(e){this.source=e}isSourceOf(e){return e.source===this.source}}function Qn(e){const t=document.createElement("iframe");return t.src=function(e){const t=new URLSearchParams({client_id:e.clientId,response_mode:e.responseMode||"",response_type:e.responseType||"",redirect_uri:e.redirectUri||"",code_challenge:e.codeChallenge||"",code_challenge_method:e.codeChallengeMethod||"",analytics_trace_id:e.analyticsTraceId||"",analytics_context:e.analyticsContext||"",scope:e.scope||"",state:e.state||"",flow:e.flow,version:"1"});return`${Hn}/pay/shop-auth-input?${t}`}(e),t.setAttribute("style","border: none; margin-top: 0.75rem;"),t.setAttribute("allow","publickey-credentials-get *"),t.tabIndex=0,t.width="100%",t.height="0",t}function Yn({loader:e,target:t,targetWrapper:n,attributes:o,analyticsTraceId:i,analyticsContext:s,flow:r,hiddenClassName:a,onLoaded:l}){var c,u;if(!ge(t)||!ge(n))return;a||me(new Error("Please provide a hiddenClassName value."));const d=Qn(Object.assign(Object.assign({},o),{analyticsTraceId:i,analyticsContext:s,version:"1",flow:r}));d.classList.add(a),d.id="shop-login-email-input-iframe",null===(c=n.parentNode)||void 0===c||c.insertBefore(d,n);const h=new Wn(new Zn(d),[Vn,Hn,null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.origin],(function(n){const o=(e=>{const t=e.replace("shopify_pay:","");try{return JSON.parse(t)}catch(t){return me(new Error(`postMessage payload did not match expected shape: ${e}`)),{}}})(n);switch(o.action){case"loaded":!function(){if("shop-loading"===(null==e?void 0:e.getAttribute("data-status")))return d.classList.remove(a),null==e||e.dispatchEvent(new Event("shopinputloaded")),void l();h.destroy(),d.remove(),null==t||t.removeEventListener("change",p),me(new Error("Input iframe is loading too slow."))}();break;case"error":s=o.message,null==e||e.dispatchEvent(new CustomEvent("processingerror",{detail:{message:s}}));break;case"enterPressed":!function(){(null==t?void 0:t.form)||me(new Error("Could not find target's form"));t.form.requestSubmit()}();break;case"processing":null==e||e.dispatchEvent(new Event("processing"));break;case"resized":i=o.height,d.height=i;break;case"changed":!function(e){if(!ge(t))return;t.value!==e&&(t.value=e,t.dispatchEvent(new Event("input")))}(o.value);break;case"loggedIn":h.destroy()}var i;var s})),p=e=>{const t=e.target;null==m||m.postMessage({type:"emailsubmitted",email:t.value})},m=new Kn(d,[Vn,Hn]);t.addEventListener("change",p)}var Xn,eo,to;!function(e){e.Follow="follow",e.Default="default"}(Xn||(Xn={})),function(e){e.Start="start",e.SignUp="signup",e.Verify="verify",e.Captcha="captcha",e.OneClick="one-click"}(eo||(eo={})),function(e){e.ApiUnavailable="api_unavailable",e.InvalidApiKey="invalid_api_key",e.ServerError="server_error",e.UserBlocked="user_blocked",e.NoDiscountReceived="no_discount_received",e.InvalidAnalyticsContext="invalid_analytics_context",e.InstallmentsIneligible="installments_ineligible",e.CaptchaChallenge="captcha_challenge"}(to||(to={}));const no={clientId:"",responseType:"code",responseMode:"query",scope:"openid email pay:session_token",redirectUri:"",codeChallenge:"",codeChallengeMethod:"",state:""};function oo({loaderSelector:e,inputSelector:t,inputWrapperSelector:n,attributes:o,unixTimestamp:i,hiddenClassName:s}){var r;const a=G(),l="loginWithShopSelfServe",c=Xn.Default,u=new hn("new-customer-accounts-passkeys",a);u.trackShopLoginFirstTimeRender("sdk-rendered",i);const d=document.createElement("shop-login-button");d.setAttribute("id","hidden-button-identity"),d.setAttribute("version","1"),d.setAttribute("response-type",no.responseType),d.setAttribute("response-mode",no.responseMode),d.setAttribute("scope",no.scope),d.setAttribute("action","default"),d.setAttribute("analytics-context",l),d.setAttribute("analytics-trace-id",a),d.setAttribute("flow",c),d.setAttribute("email-verification-required",""),d.setAttribute("hide-button",""),d.setAttribute("disable-sign-up",""),d.setAttribute("auto-open",""),d.setAttribute("client-id",o.clientId),d.setAttribute("redirect-uri",o.redirectUri||""),d.setAttribute("state",o.state||""),d.setAttribute("code-challenge",o.codeChallenge||""),d.setAttribute("code-challenge-method",o.codeChallengeMethod||"");const h=function(){const e="shop-passkeys-force",t=Q(e),n=Boolean(t&&"false"!==t.toLowerCase()),o=K(e),i=n||Boolean("true"===o),s=!1,r=s,a=X(),l=Boolean(navigator.userAgent)&&/(iphone|ipad|ipod)/i.test(navigator.userAgent),c=a&&!l||l&&"fromAsync"in Array;!c&&r&&i&&console.log(`%cPASSKEYS: Test device is on DESKTOP. Enabling passkeys for testing purposes only!\n Spin: ${s};\n QueryParam Override: ${n};\n Cookie Override: ${o}`,"font-size: 12px; background-color: lightyellow; color:red;");return c||r||i}(),p=document.querySelector(e),m=document.querySelector(t),f=document.querySelector(n);return h?(Yn({loader:p,target:m,targetWrapper:f,attributes:Object.assign(Object.assign({},no),o),analyticsTraceId:a,analyticsContext:l,flow:c,hiddenClassName:s,onLoaded:()=>{u.trackShopLoginFirstTimeRender("iframed-input-rendered",i)}}),d.setAttribute(zn,"#shop-login-email-input-iframe")):(null==p||p.dispatchEvent(new Event("inputwillnotload")),d.setAttribute("use-pay-alt-domain",""),d.setAttribute(zn,"div.next-input.combined-input-wrapper.type-ahead-wrapper")),null===(r=f.parentNode)||void 0===r||r.insertBefore(d,f),d.listenToInput(m),d}class io extends HTMLElement{constructor(){super()}updateAttribute(e,t){this.getAttribute(e)!==t&&(t?this.setAttribute(e,t):this.removeAttribute(e))}getBooleanAttribute(e){const t=this.getAttribute(e);return null!=t}dispatchCustomEvent(e,t){const n=new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:t});this.dispatchEvent(n)}}const so={brand:"#5a31f4",white:"#fff",black:"#000",warning:"#d02e11",close:"#707070",foregroundSecondary:"#3F454D",backgroundSubdued:"#F2F3F5",backgroundError:"#FFECE9",error:"#D02E11"};function ro(e){let t=0,n=0,o=0;return 4===e.length?(t=Number(`0x${e[1]}${e[1]}`),n=Number(`0x${e[2]}${e[2]}`),o=Number(`0x${e[3]}${e[3]}`)):7===e.length&&(t=Number(`0x${e[1]}${e[2]}`),n=Number(`0x${e[3]}${e[4]}`),o=Number(`0x${e[5]}${e[6]}`)),[t,n,o]}function ao(e){const t=e.match(/\d+/g)||[],[n=0,o=0,i=0]=t.map((e=>Number(e)));return[n,o,i]}function lo(e){const t=[90,49,244],n=[255,255,255];let o=[255,255,255];return e.startsWith("#")?o=ro(e):e.startsWith("rgb(")&&(o=ao(e)),ho(o,t)>ho(o,n)?t:n}function co(e,t){return ho(e.startsWith("#")?ro(e):ao(e),t.startsWith("#")?ro(t):ao(t))}function uo(e,t,n){const o=[e,t,n].map((function(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}));return.2126*o[0]+.7152*o[1]+.0722*o[2]}function ho(e,t){const n=uo(e[0],e[1],e[2]),o=uo(t[0],t[1],t[2]);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}var po,mo,fo;class go extends HTMLElement{constructor(){super(),po.set(this,void 0),d(this,po,this.attachShadow({mode:"open"}),"f")}connectedCallback(){const e=document.createElement("template"),t=this.getAttribute("size")||"",n=this.getAttribute("color")||"",o=this.getAttribute("label")||"";e.innerHTML=function(e,t="brand",n){return`\n \n \n ${n}\n