var t;!function(t){t.Default="loginWithShop",t.CheckoutModal="loginWithShopCheckoutModal",t.ClassicCustomerAccounts="loginWithShopClassicCustomerAccounts",t.Prequal="loginWithShopPrequal",t.Web="loginWithShopShopWeb",t.SelfServe="loginWithShopSelfServe",t.CheckoutExtension="loginWithShopCheckoutExtension",t.PaymentRequest="loginWithShopPaymentRequest",t.CheckoutSheet="checkout_sheet"}(t||(t={}));const e={[t.Default]:"default",[t.SelfServe]:"default",[t.ClassicCustomerAccounts]:"classic_customer_accounts",[t.Prequal]:"shop_pay_installments_prequal",[t.PaymentRequest]:"payment_request",[t.CheckoutExtension]:"default",[t.CheckoutModal]:"checkout_modal",[t.CheckoutSheet]:"checkout_sheet",[t.Web]:""},n="shop-login-default",i=`${n}-iframe`,o=`${n}-iframe-compact`,s=`${n}-header`,r=`${s}-contents-container`,a=`${s}-title`,l=`${s}-description`,c=`${s}-divider`,u=`${n}-footer`,h=`${u}-content`,d=`${n}-hidden`,p=`\n \n`,f="${storeName}",m=[t.CheckoutModal,t.ClassicCustomerAccounts,t.Web,t.SelfServe];function g(t){return!!t&&m.includes(t)}var v="e35d7136cee78d344ccffdbd5ca710fa",b=function(t,e){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},b(t,e)};function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var y=function(){return y=Object.assign||function(t){for(var e,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,n,r):o(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function k(t,e){return function(n,i){e(n,i,t)}}function C(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function O(t,e,n,i){return new(n||(n=Promise))((function(o,s){function r(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,a)}l((i=i.apply(t,e||[])).next())}))}function S(t,e){var n,i,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[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(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,s=n.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return r}function $(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{!function(t){t.value instanceof L?Promise.resolve(t.value.v).then(l,c):u(s[0][2],t)}(o[t](e))}catch(t){u(s[0][3],t)}}function l(t){a("next",t)}function c(t){a("throw",t)}function u(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function P(t){var e,n;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,o){e[i]=t[i]?function(e){return(n=!n)?{value:L(t[i](e)),done:!1}:o?o(e):e}:o}}function R(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=j(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,o){(function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)})(i,o,(e=t[n](e)).done,e.value)}))}}}function D(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var F=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function V(t){if(t&&t.s_a)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&T(e,t,n);return F(e,t),e}function U(t){return t&&t.s_a?t:{default:t}}function z(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function B(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}function W(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}function H(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose]}if("function"!=typeof i)throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:i,async:n})}else n&&t.stack.push({async:!0});return e}var q="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var i=new Error(n);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};function G(t){function e(e){t.error=t.hasError?new q(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}return function n(){for(;t.stack.length;){var i=t.stack.pop();try{var o=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(o).then(n,(function(t){return e(t),n()}))}catch(t){e(t)}}if(t.hasError)throw t.error}()}var K={s_b:_,s_c:y,s_d:w,s_e:x,s_f:k,s_g:C,s_h:O,s_i:S,s_j:T,s_k:E,s_l:j,s_m:A,s_n:$,s_o:I,s_p:N,s_q:L,s_r:M,s_s:P,s_t:R,s_u:D,s_v:V,s_w:U,s_x:z,s_y:B,s_z:W,s_A:H,s_B:G},Z=Object.freeze({__proto__:null,s_A:H,get s_c(){return y},s_s:P,s_r:M,s_t:R,s_q:L,s_h:O,s_x:z,s_z:W,s_y:B,s_j:T,s_e:x,s_B:G,s_C:function(t,e,n,i,o,s){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?i.static?t:t.prototype:null,h=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in i)f[m]="access"===m?{}:i[m];for(var m in i.access)f.access[m]=i.access[m];f.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(r(t||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=r(g.get))&&(h.get=a),(a=r(g.set))&&(h.set=a),(a=r(g.init))&&o.unshift(a)}else(a=r(g))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,i.name,h),d=!0},s_k:E,s_b:_,s_i:S,s_w:U,s_v:V,s_u:D,s_g:C,s_f:k,s_D:function(t){return"symbol"==typeof t?t:"".concat(t)},s_m:A,s_d:w,s_E:function(t,e,n){for(var i=arguments.length>2,o=0;o>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function lt(t,e,n){function i(t,i,o,s){var r;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n>>9<<4)+1}function ut(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function ht(t,e,n,i,o,s){return ut((r=ut(ut(e,t),ut(i,s)))<<(a=o)|r>>>32-a,n);var r,a}function dt(t,e,n,i,o,s,r){return ht(e&n|~e&i,t,e,o,s,r)}function pt(t,e,n,i,o,s,r){return ht(e&i|n&~i,t,e,o,s,r)}function ft(t,e,n,i,o,s,r){return ht(e^n^i,t,e,o,s,r)}function mt(t,e,n,i,o,s,r){return ht(n^(e|~i),t,e,o,s,r)}const gt=lt("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n>5]>>>o%32&255,s=parseInt(i.charAt(n>>>4&15)+i.charAt(15&n),16);e.push(s)}return e}(function(t,e){t[e>>5]|=128<>5]|=(255&t[i/8])<>>32-e}const xt=lt("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n>>0;c=l,l=a,a=wt(r,30)>>>0,r=o,o=s}n[0]=n[0]+o>>>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 kt=xt;var Ct=Object.freeze({__proto__:null,NIL:"00000000-0000-0000-0000-000000000000",parse:at,stringify:function(t,e=0){const n=nt(t,e);if(!tt(n))throw TypeError("Stringified UUID is invalid");return n},v1:function(t,e,n){let i=e&&n||0;const o=e||new Array(16);let s=(t=t||{}).node||it,r=void 0!==t.clockseq?t.clockseq:ot;if(null==s||null==r){const e=t.random||(t.rng||Y)();null==s&&(s=it=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==r&&(r=ot=16383&(e[6]<<8|e[7]))}let a=void 0!==t.msecs?t.msecs:Date.now(),l=void 0!==t.nsecs?t.nsecs:rt+1;const c=a-st+(l-rt)/1e4;if(c<0&&void 0===t.clockseq&&(r=r+1&16383),(c<0||a>st)&&void 0===t.nsecs&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");st=a,rt=l,ot=r,a+=122192928e5;const u=(1e4*(268435455&a)+l)%4294967296;o[i++]=u>>>24&255,o[i++]=u>>>16&255,o[i++]=u>>>8&255,o[i++]=255&u;const h=a/4294967296*1e4&268435455;o[i++]=h>>>8&255,o[i++]=255&h,o[i++]=h>>>24&15|16,o[i++]=h>>>16&255,o[i++]=r>>>8|128,o[i++]=255&r;for(let t=0;t<6;++t)o[i+t]=s[t];return e||nt(o)},v3:vt,v4:_t,v5:kt,validate:tt,version:function(t){if(!tt(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}});const Ot="1.0.11",St="show_login_with_shop",Tt="sign_in_with_shop_modal_dismissed",Et="form[data-login-with-shop-sign-in]",jt="form[data-login-with-shop-sign-up]",At='input[name="customer[email]"',$t='input[name="customer[first_name]"',It='input[name="customer[last_name]"',Nt=`${Et} input[type="email"],${Et} ${At}`,Lt=`${jt} input[type="email"],${jt} ${At}`,Mt=()=>({width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight});function Pt({url:t,width:e,height:n,windowName:i,onClose:o}){const s={left:void 0===window.screenLeft?window.screenX:window.screenLeft,top:void 0===window.screenTop?window.screenY:window.screenTop},r=Mt(),a=r.width||screen.width,l=r.height||screen.height,c=screen.width&&window.screen.availWidth?screen.width/window.screen.availWidth:1,u=(a-e)/2/c+s.left,h=(l-n)/2/c+s.top,d=window.open(t,i,`scrollbars=yes,width=${e},height=${n},top=${h},left=${u}`);if(!d)return null;if(d.focus(),o){const t=setInterval((()=>{d.closed&&(o(),clearInterval(t))}),1e3)}return d}function Rt(t,e,n,i){(i||t.getAttribute(e)!==n)&&!0!==t[e]&&t.setAttribute(e,n)}function Dt(t,e,n){if(!n&&t.src===e)return;const i=t.parentNode;i&&(i.removeChild(t),t.setAttribute("src",e),i.appendChild(t))}function Ft(){return _t()}function Vt(t=location.origin){return O(this,void 0,void 0,(function*(){const e=fetch(`${t}/meta.json`);try{const t=yield e;return yield t.json()}catch(t){return null}}))}function Ut(t){try{return new URL(t).hostname}catch(e){return console.error(`[Shop Pay] Store URL (${t}) is not valid`,e),null}}function zt(t){return new URLSearchParams(window.location.search).get(t)}function Bt(t,e){let n;return(...i)=>{clearTimeout(n),n=setTimeout((()=>{t(...i)}),e)}}function Wt(t){return"/"===t?t:t.endsWith("/")?t.slice(0,-1):t}function Ht(){return Boolean(navigator.userAgent)&&/(android|iphone|ipad|mobile|phone)/i.test(navigator.userAgent)}function qt(t){return null===t||""===t.trim()}function Gt(t,e){let n;const i=new Promise((t=>{n=setTimeout((()=>{t()}),e)}));return Promise.race([t,i]).finally((()=>{clearTimeout(n)}))}function Kt(){var t;const e=null===(t=document.querySelector("script#shop-js-features"))||void 0===t?void 0:t.innerHTML;return e?JSON.parse(e):{}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Zt(t){return t&&t.s_a&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Xt(t,e){return t(e={exports:{}},e.exports),e.exports}var Jt=Xt((function(t,e){t.exports=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t){return t.charAt(0).toUpperCase()+t.substring(1)}function n(t){return function(){return this[t]}}var i=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],s=["fileName","functionName","source"],r=["args"],a=["evalOrigin"],l=i.concat(o,s,r,a);function c(t){if(t)for(var n=0;n-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),i=e.match(/ (\(.+\)$)/);e=i?e.replace(i[0],""):e;var o=this.extractLocation(i?i[1]:e),s=i&&e||void 0,r=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new n({functionName:s,fileName:r,lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(s)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new n({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),o=i&&i[1]?i[1]:void 0,s=this.extractLocation(t.replace(e,""));return new n({functionName:o,fileName:s[0],lineNumber:s[1],columnNumber:s[2],source:t})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),o=[],s=2,r=i.length;s/,"$2").replace(/\([^)]*\)/g,"")||void 0;s.match(/\(([^)]*)\)/)&&(e=s.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new n({functionName:r,args:a,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)}})}));const Qt="development",te="spin",ee="production",ne={name:"Bugsnag JavaScript",version:"7.13.2",url:"https://github.com/bugsnag/bugsnag-js"};function ie(t){return Yt.parse(t).map((t=>({method:t.functionName,file:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber})))}function oe(t,e,n){const i=n?new Date(Date.now()+n).toUTCString():"session";document.cookie=`${t}=${e};expires=${i};path=/`}function se(t){try{const e=new RegExp(`(${t})=([^;]+)`).exec(document.cookie);return e?e[2]:null}catch(t){return null}}function re(t,e,n){se(t)&&(document.cookie=`${t}=${e?`;path=${e}`:""}${n?`;domain=${n}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT`)}class ae{constructor({error:t,severity:e,breadcrumbs:n,appId:i,appVersion:o,releaseStage:s,duration:r,time:a,metaData:l}){var c,u;this.payloadVersion="4",this.exceptions=[],this.unhandled=!1,this.severityReason={type:"handledException"},this.metaData={},this.session={},this.groupingHash="",this.exceptions=[{errorClass:t.name,errorMessage:t.message,type:"browserjs",stacktrace:ie(t),message:t.message}],this.severity=e||"error",this.app={id:i,version:o,releaseStage:s,type:"browser",duration:r},this.device={locale:navigator.userLanguage||navigator.language,userAgent:navigator.userAgent,time:a,orientation:null===(u=null===(c=window.screen)||void 0===c?void 0:c.orientation)||void 0===u?void 0:u.type},this.request={url:window.location.href},this.breadcrumbs=n,this.context=window.location.pathname,this.metaData=l,this.user={shopifyS:se("_shopify_s")}}addMetadata(t,e){this.metaData[t]=e}}class le{constructor({apiKey:t,appId:e,appVersion:n,metadata:i,onError:o}){this.s_G=[],this.s_H=[],this.s_I=t,this.s_J=e,this.s_K=n,this.s_L=i,this.s_G=o||[],this.s_M=new Date,this.s_N=ee,this.s_O(),this.leaveBreadcrumb("Bugsnag started",{},"state")}leaveBreadcrumb(t,e,n){this.s_H.push({name:t,metaData:e,type:n,timestamp:(new Date).toISOString()})}notify(t,e){const n=new Date,i=n.toISOString(),o=function(t,e){if(t&&e)return e.getTime()-t.getTime()}(this.s_M,n),{s_H:s,s_J:r,s_K:a,s_N:l,s_L:c}=this,u=new ae({error:t,breadcrumbs:s,appId:r,appVersion:a,releaseStage:l,duration:o,time:i,metaData:Object.assign({},c)}),h=[...this.s_G,...e?[e]:[]];if(h){if(h.some((t=>!1===t(u))))return}this.s_N!==Qt&&this.s_N!==te?this.s_P(u,i):this.s_Q(u)}s_O(){window.addEventListener("error",(t=>{const{error:e}=t;e&&function(t){const e=Yt.parse(t);return 0!==e.length&&e.some((t=>{var e;return null===(e=t.fileName)||void 0===e?void 0:e.includes("shop-js")}))}(e)&&this.notify(e)}))}s_Q(t){console.error(`[bugsnag - shop-js] error in ${this.s_N}`,t)}s_P(t,e){const n=new XMLHttpRequest;n.open("POST","https://notify.bugsnag.com/"),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Bugsnag-Api-Key",this.s_I),n.setRequestHeader("Bugsnag-Payload-Version","4"),n.setRequestHeader("Bugsnag-Sent-At",e);const i={apiKey:this.s_I,notifier:ne,events:[t]};n.send(JSON.stringify(i))}}let ce;const ue={start:t=>{ce?console.warn("Bugsnag.start() has already been called. Ignoring."):ce=new le(t)},leaveBreadcrumb:(t,e,n)=>{ce?ce.leaveBreadcrumb(t,e,n):console.warn("Bugsnag.leaveBreadcrumb() called before start().")},notify:(t,e)=>{ce?ce.notify(t,e):console.warn("Bugsnag.notify() called before start().")}};function he(){return Boolean(window.customElements)}function de(t,e){window.customElements&&(customElements.get(t)||customElements.define(t,e))}function pe(t){const e=Array.from(document.querySelectorAll('script[src*="/shop-js/"]')).map((t=>t.src));t.addMetadata("shopJsUrls",e)}function fe(t){var e,n;const i=null===(n=null===(e=window.Shopify)||void 0===e?void 0:e.featureAssets)||void 0===n?void 0:n["shop-js"],o=Boolean(i&&Object.keys(i).length>0);t.addMetadata("shopJsFeatureAssetsExist",o)}function me(t){const e=Array.from(document.querySelectorAll("shop-login-button[compact]"));e.filter((t=>g(t.getAttribute("analytics-context")))),t.addMetadata("compactUX",e.length>0)}function ge(t){const e=`${t.exceptions[0].errorClass}:${t.exceptions[0].errorMessage}`;t.groupingHash=e}function ve(t={}){ue.start({apiKey:v,appId:"shop-js",appVersion:Ot,metadata:t,onError:[pe,fe,me,ge]})}function be(t,e){window.Shopify||(window.Shopify={}),window.Shopify.SignInWithShop||(window.Shopify.SignInWithShop={}),window.Shopify.SignInWithShop[t]=e}var _e,ye,we,xe;function ke(t){console.error(`[shop-js] ${t}`),ue.notify(new Error(t))}!function(t){t.UiImpression="shop_js_ui_impression/1.1",t.InstallmentsModalOpened="shop_pay_installments_dynamic_modal_impression/1.0",t.InstallmentsModalUserAction="shop_pay_installments_dynamic_modal_user_actions/1.0",t.InstallmentsBannerImpression="shop_pay_installments_banner_ui_impression/3.0",t.InstallmentsPrequalPopupPageImpression="shop_pay_installments_prequal_popup_page_impression/3.0",t.InstallmentsBannerPrequalInteraction="shop_pay_installments_banner_prequal_interaction/3.0",t.InstallmentsInvalidMetadata="shop_pay_installments_banner_invalid_metadata/1.0",t.ShopLoginFirstTimeRender="shop_js_ui_shop_login_first_time_render/1.0",t.ShopifyLoginWithShopSdkDiscountStatus="shopify_pay_login_with_shop_sdk_discount_status/2.0",t.LoginWithShopSdkPageImpression="shopify_pay_login_with_shop_sdk_page_impressions/3.2",t.LoginWithShopSdkUserAction="shopify_pay_login_with_shop_sdk_user_actions/2.1",t.LoginWithShopSdkErrorEvents="shopify_pay_login_with_shop_sdk_error_events/1.0",t.ShopifyPayModalStateChange="shopify_pay_modal_state_change/1.3",t.ShopifyPayPaymentPageUiInteraction="shopify_pay_payment_page_ui_interaction/1.1"}(_e||(_e={})),function(t){t.AuthorizeModal="AUTHORIZE_MODAL",t.ClassicCustomerAccount="CLASSIC_CUSTOMER_ACCOUNTS_ACCOUNT_PAGE",t.ClassicCustomerAccountCreateAccount="CLASSIC_CUSTOMER_ACCOUNTS_CREATE_ACCOUNT_PAGE",t.ClassicCustomerAccountLogin="CLASSIC_CUSTOMER_ACCOUNTS_LOGIN_PAGE",t.ComponentLoadedFollowing="COMPONENT_LOADED_FOLLOWING",t.ComponentLoadedNotFollowing="COMPONENT_LOADED_NOT_FOLLOWING",t.ContinueWithShop="CONTINUE_WITH_SHOP_PAGE",t.DiscountSaved="DISCOUNT_SAVE_CONFIRMATION_PAGE",t.DiscountShown="DISCOUNT_SHOWN",t.FollowButtonShownInViewport="FOLLOW_BUTTON_SHOWN_IN_VIEWPORT",t.FollowingGetShopAppCta="FOLLOWING_GET_SHOP_APP_CTA",t.PartnerEmailInputShown="PARTNER_EMAIL_INPUT_SHOWN",t.PhoneConsent="TEXT_MARKETING_SIGN_UP",t.PhoneConsentConfirmed="TEXT_MARKETING_CONFIRMED_PAGE",t.PhoneConsentDeclined="TEXT_MARKETING_DECLINED_PAGE",t.SdkLoaded="SDK_HAS_LOADED_INITIAL_PAGE"}(ye||(ye={})),function(t){t.ThirdPartyFormSubmission="3RD_PARTY_EMAIL_CAPTURE_FORM_SUBMISSION_CLICK",t.FollowOnShopClicked="FOLLOW_ON_SHOP_CLICKED",t.FollowingGetShopAppClick="FOLLOWING_GET_SHOP_APP_CLICK",t.ContinueWithShopClicked="CONTINUE_WITH_SHOP_BUTTON_CLICK",t.EmailEntered="EMAIL_ENTERED",t.CreateAccountLinkClicked="CREATE_ACCOUNT_CLICK",t.PhoneConsentProvided="SHARE_PHONE_CLICK",t.PhoneConsentDeclined="DO_NOT_SHARE_PHONE_CLICK"}(we||(we={})),function(t){t.Loaded="loaded",t.Shown="shown",t.Hidden="hidden"}(xe||(xe={}));class Ce{constructor(t){this.s_R=t}isSourceOf(t){return t.source===this.s_R.contentWindow}}class Oe{constructor(t){this.s_R=t}isSourceOf(t){return t.source===this.s_R}}function Se(t=window.location.origin,e){const n=`${t}/services/login_with_shop/finalize`;return fetch(n).catch(e)}function Te(t){const e=t?"sessionStorage":"localStorage";try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(t){return!1}}function Ee(t,e,{session:n}={}){if(!Te(n))return!1;return window[n?"sessionStorage":"localStorage"].setItem(t,e),!0}function je(t,{session:e}={}){if(!Te(e))return null;return window[e?"sessionStorage":"localStorage"].getItem(t)}function Ae(t,{session:e}={}){if(!Te(e))return!1;return window[e?"sessionStorage":"localStorage"].removeItem(t),!0}const $e=/^[^@]+@[^@]+\.[^@]{2,}$/i;function Ie(t){return!!t&&RegExp($e).test(t)}function Ne({selector:t,onElementFound:e}){const n=new WeakSet,i=new MutationObserver((t=>{let e=!1;for(const n of t)if(n.addedNodes.length>0){e=!0;break}e&&o()}));function o(){document.querySelectorAll(t).forEach((t=>{n.has(t)||(e(t),n.add(t))}))}return function(){O(this,void 0,void 0,(function*(){yield function(){if(document.body)return Promise.resolve();return new Promise((t=>{window.addEventListener("DOMContentLoaded",(()=>t()))}))}(),o(),i.observe(document.body||document.documentElement,{childList:!0,subtree:!0})}))}(),i}function Le({onVisible:t,onFallback:e}){const n=new IntersectionObserver((o=>{for(const s of o){const{target:o,isIntersecting:r}=s;r&&(i(o)?t(o):e(o),n.unobserve(o))}}),{threshold:1});function i(t){let e=t;for(;e;){if(!["","1"].includes(getComputedStyle(e).opacity))return!1;e=e.parentElement}return!0}return n}function Me(t,e=!0){const n=Boolean(t);return!n&&e&&ue.notify(new Error("HTML Element was not provided")),n}function Pe(t,e,n){const i=n.querySelector(`#${e}`),o=null==i?void 0:i.parentElement,s=null!=o?o:document.createElement("div");s.innerHTML=t,s.style.display="none","innerHTML"in n&&(n.innerHTML=""),n.prepend(s);const r=n.querySelector(`#${e}`).content;n.appendChild(r.cloneNode(!0))}function Re(t){return t.split("-")[1]}function De(t){return"y"===t?"height":"width"}function Fe(t){return t.split("-")[0]}function Ve(t){return["top","bottom"].includes(Fe(t))?"x":"y"}function Ue(t,e,n){let{reference:i,floating:o}=t;const s=i.x+i.width/2-o.width/2,r=i.y+i.height/2-o.height/2,a=Ve(e),l=De(a),c=i[l]/2-o[l]/2,u="x"===a;let h;switch(Fe(e)){case"top":h={x:s,y:i.y-o.height};break;case"bottom":h={x:s,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:r};break;case"left":h={x:i.x-o.width,y:r};break;default:h={x:i.x,y:i.y}}switch(Re(e)){case"start":h[a]-=c*(n&&u?-1:1);break;case"end":h[a]+=c*(n&&u?-1:1)}return h}function ze(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Be(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function We(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:s,rects:r,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:p=0}=e,f=ze(p),m=a[d?"floating"===h?"reference":"floating":h],g=Be(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(m)))||n?m:m.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===h?{...r.floating,x:i,y:o}:r.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),_=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},y=Be(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-y.top+f.top)/_.y,bottom:(y.bottom-g.bottom+f.bottom)/_.y,left:(g.left-y.left+f.left)/_.x,right:(y.right-g.right+f.right)/_.x}}const He=Math.min,qe=Math.max;function Ge(t,e,n){return qe(t,He(e,n))}const Ke=t=>({name:"arrow",options:t,async fn(e){const{element:n,padding:i=0}=t||{},{x:o,y:s,placement:r,rects:a,platform:l,elements:c}=e;if(null==n)return{};const u=ze(i),h={x:o,y:s},d=Ve(r),p=De(d),f=await l.getDimensions(n),m="y"===d,g=m?"top":"left",v=m?"bottom":"right",b=m?"clientHeight":"clientWidth",_=a.reference[p]+a.reference[d]-h[d]-a.floating[p],y=h[d]-a.reference[d],w=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let x=w?w[b]:0;x&&await(null==l.isElement?void 0:l.isElement(w))||(x=c.floating[b]||a.floating[p]);const k=_/2-y/2,C=u[g],O=x-f[p]-u[v],S=x/2-f[p]/2+k,T=Ge(C,S,O),E=null!=Re(r)&&S!=T&&a.reference[p]/2-(St.concat(e,e+"-start",e+"-end")),[]);const Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function Xe(t){return t.replace(/left|right|bottom|top/g,(t=>Ze[t]))}function Je(t,e,n){void 0===n&&(n=!1);const i=Re(t),o=Ve(t),s=De(o);let r="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=Xe(r)),{main:r,cross:Xe(r)}}const Ye={start:"end",end:"start"};function Qe(t){return t.replace(/start|end/g,(t=>Ye[t]))}const tn=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:s,initialPlacement:r,platform:a,elements:l}=e,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:f=!0,...m}=t,g=Fe(i),v=Fe(r)===r,b=await(null==a.isRTL?void 0:a.isRTL(l.floating)),_=h||(v||!f?[Xe(r)]:function(t){const e=Xe(t);return[Qe(t),e,Qe(e)]}(r));h||"none"===p||_.push(...function(t,e,n,i){const o=Re(t);let s=function(t,e,n){const i=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?s:r;default:return[]}}(Fe(t),"start"===n,i);return o&&(s=s.map((t=>t+"-"+o)),e&&(s=s.concat(s.map(Qe)))),s}(r,f,p,b));const y=[r,..._],w=await We(e,m),x=[];let k=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&x.push(w[g]),u){const{main:t,cross:e}=Je(i,s,b);x.push(w[t],w[e])}if(k=[...k,{placement:i,overflows:x}],!x.every((t=>t<=0))){var C,O;const t=((null==(C=o.flip)?void 0:C.index)||0)+1,e=y[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let n=null==(O=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:O.placement;if(!n)switch(d){case"bestFit":{var S;const t=null==(S=k.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:S[0];t&&(n=t);break}case"initialPlacement":n=r}if(i!==n)return{reset:{placement:n}}}return{}}}},en=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await async function(t,e){const{placement:n,platform:i,elements:o}=t,s=await(null==i.isRTL?void 0:i.isRTL(o.floating)),r=Fe(n),a=Re(n),l="x"===Ve(n),c=["left","top"].includes(r)?-1:1,u=s&&l?-1:1,h="function"==typeof e?e(t):e;let{mainAxis:d,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}(e,t);return{x:n+o.x,y:i+o.y,data:o}}}};function nn(t){return"x"===t?"y":"x"}const on=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=t,c={x:n,y:i},u=await We(e,l),h=Ve(Fe(o)),d=nn(h);let p=c[h],f=c[d];if(s){const t="y"===h?"bottom":"right";p=Ge(p+u["y"===h?"top":"left"],p,p-u[t])}if(r){const t="y"===d?"bottom":"right";f=Ge(f+u["y"===d?"top":"left"],f,f-u[t])}const m=a.fn({...e,[h]:p,[d]:f});return{...m,data:{x:m.x-n,y:m.y-i}}}}},sn=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:o,rects:s,middlewareData:r}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=t,u={x:n,y:i},h=Ve(o),d=nn(h);let p=u[h],f=u[d];const m="function"==typeof a?a(e):a,g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const t="y"===h?"height":"width",e=s.reference[h]-s.floating[t]+g.mainAxis,n=s.reference[h]+s.reference[t]-g.mainAxis;pn&&(p=n)}if(c){var v,b;const t="y"===h?"width":"height",e=["top","left"].includes(Fe(o)),n=s.reference[d]-s.floating[t]+(e&&(null==(v=r.offset)?void 0:v[d])||0)+(e?0:g.crossAxis),i=s.reference[d]+s.reference[t]+(e?0:(null==(b=r.offset)?void 0:b[d])||0)-(e?g.crossAxis:0);fi&&(f=i)}return{[h]:p,[d]:f}}}};function rn(t){var e;return(null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function an(t){return rn(t).getComputedStyle(t)}function ln(t){return t instanceof rn(t).Node}function cn(t){return ln(t)?(t.nodeName||"").toLowerCase():""}let un;function hn(){if(un)return un;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(un=t.brands.map((t=>t.brand+"/"+t.version)).join(" "),un):navigator.userAgent}function dn(t){return t instanceof rn(t).HTMLElement}function pn(t){return t instanceof rn(t).Element}function fn(t){return"undefined"!=typeof ShadowRoot&&(t instanceof rn(t).ShadowRoot||t instanceof ShadowRoot)}function mn(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=an(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function gn(t){return["table","td","th"].includes(cn(t))}function vn(t){const e=/firefox/i.test(hn()),n=an(t),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((t=>n.willChange.includes(t)))||["paint","layout","strict","content"].some((t=>{const e=n.contain;return null!=e&&e.includes(t)}))}function bn(){return/^((?!chrome|android).)*safari/i.test(hn())}function _n(t){return["html","body","#document"].includes(cn(t))}const yn=Math.min,wn=Math.max,xn=Math.round;function kn(t){const e=an(t);let n=parseFloat(e.width),i=parseFloat(e.height);const o=dn(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,a=xn(n)!==s||xn(i)!==r;return a&&(n=s,i=r),{width:n,height:i,fallback:a}}function Cn(t){return pn(t)?t:t.contextElement}const On={x:1,y:1};function Sn(t){const e=Cn(t);if(!dn(e))return On;const n=e.getBoundingClientRect(),{width:i,height:o,fallback:s}=kn(e);let r=(s?xn(n.width):n.width)/i,a=(s?xn(n.height):n.height)/o;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function Tn(t,e,n,i){var o,s;void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),a=Cn(t);let l=On;e&&(i?pn(i)&&(l=Sn(i)):l=Sn(t));const c=a?rn(a):window,u=bn()&&n;let h=(r.left+(u&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/l.x,d=(r.top+(u&&(null==(s=c.visualViewport)?void 0:s.offsetTop)||0))/l.y,p=r.width/l.x,f=r.height/l.y;if(a){const t=rn(a),e=i&&pn(i)?rn(i):i;let n=t.frameElement;for(;n&&i&&e!==t;){const t=Sn(n),e=n.getBoundingClientRect(),i=getComputedStyle(n);e.x+=(n.clientLeft+parseFloat(i.paddingLeft))*t.x,e.y+=(n.clientTop+parseFloat(i.paddingTop))*t.y,h*=t.x,d*=t.y,p*=t.x,f*=t.y,h+=e.x,d+=e.y,n=rn(n).frameElement}}return Be({width:p,height:f,x:h,y:d})}function En(t){return((ln(t)?t.ownerDocument:t.document)||window.document).documentElement}function jn(t){return pn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function An(t){return Tn(En(t)).left+jn(t).scrollLeft}function $n(t){if("html"===cn(t))return t;const e=t.assignedSlot||t.parentNode||fn(t)&&t.host||En(t);return fn(e)?e.host:e}function In(t){const e=$n(t);return _n(e)?e.ownerDocument.body:dn(e)&&mn(e)?e:In(e)}function Nn(t,e){var n;void 0===e&&(e=[]);const i=In(t),o=i===(null==(n=t.ownerDocument)?void 0:n.body),s=rn(i);return o?e.concat(s,s.visualViewport||[],mn(i)?i:[]):e.concat(i,Nn(i))}function Ln(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=rn(t),i=En(t),o=n.visualViewport;let s=i.clientWidth,r=i.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;const t=bn();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}(t,n);else if("document"===e)i=function(t){const e=En(t),n=jn(t),i=t.ownerDocument.body,o=wn(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=wn(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+An(t);const a=-n.scrollTop;return"rtl"===an(i).direction&&(r+=wn(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:a}}(En(t));else if(pn(e))i=function(t,e){const n=Tn(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=dn(t)?Sn(t):{x:1,y:1};return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:o*s.x,y:i*s.y}}(e,n);else{const n={...e};if(bn()){var o,s;const e=rn(t);n.x-=(null==(o=e.visualViewport)?void 0:o.offsetLeft)||0,n.y-=(null==(s=e.visualViewport)?void 0:s.offsetTop)||0}i=n}return Be(i)}function Mn(t,e){return dn(t)&&"fixed"!==an(t).position?e?e(t):t.offsetParent:null}function Pn(t,e){const n=rn(t);if(!dn(t))return n;let i=Mn(t,e);for(;i&&gn(i)&&"static"===an(i).position;)i=Mn(i,e);return i&&("html"===cn(i)||"body"===cn(i)&&"static"===an(i).position&&!vn(i))?n:i||function(t){let e=$n(t);for(;dn(e)&&!_n(e);){if(vn(e))return e;e=$n(e)}return null}(t)||n}function Rn(t,e,n){const i=dn(e),o=En(e),s=Tn(t,!0,"fixed"===n,e);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(i||!i&&"fixed"!==n)if(("body"!==cn(e)||mn(o))&&(r=jn(e)),dn(e)){const t=Tn(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else o&&(a.x=An(o));return{x:s.left+r.scrollLeft-a.x,y:s.top+r.scrollTop-a.y,width:s.width,height:s.height}}const Dn={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s="clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=Nn(t).filter((t=>pn(t)&&"body"!==cn(t))),o=null;const s="fixed"===an(t).position;let r=s?$n(t):t;for(;pn(r)&&!_n(r);){const t=an(r),e=vn(r);"fixed"===t.position&&(o=null),(s?e||o:e||"static"!==t.position||!o||!["absolute","fixed"].includes(o.position))?o=t:i=i.filter((t=>t!==r)),r=$n(r)}return e.set(t,i),i}(e,this.s_S):[].concat(n),r=[...s,i],a=r[0],l=r.reduce(((t,n)=>{const i=Ln(e,n,o);return t.top=wn(i.top,t.top),t.right=yn(i.right,t.right),t.bottom=yn(i.bottom,t.bottom),t.left=wn(i.left,t.left),t}),Ln(e,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=dn(n),s=En(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==cn(n)||mn(s))&&(r=jn(n)),dn(n))){const t=Tn(n);a=Sn(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-r.scrollLeft*a.x+l.x,y:e.y*a.y-r.scrollTop*a.y+l.y}},isElement:pn,getDimensions:function(t){return kn(t)},getOffsetParent:Pn,getDocumentElement:En,getScale:Sn,async getElementRects(t){let{reference:e,floating:n,strategy:i}=t;const o=this.getOffsetParent||Pn,s=this.getDimensions;return{reference:Rn(e,await o(n),i),floating:{x:0,y:0,...await s(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===an(t).direction};const Fn=(t,e,n)=>{const i=new Map,o={platform:Dn,...n},s={...o.platform,s_S:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,a=s.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:h}=Ue(c,i,l),d=i,p={},f=0;for(let n=0;n{let o=t.querySelector(".arrow");return t.style.position="absolute",null===o&&(o=document.createElement("div"),o.className="arrow",t.appendChild(o)),{config:{placement:null!=i?i:"right",middleware:[en(22),i?void 0:on({limiter:sn({offset:64})}),tn({fallbackPlacements:i?[]:["left","top","bottom"]}),Ke({element:o,padding:32}),{name:"center",fn(){return O(this,void 0,void 0,(function*(){return{data:{center:window.matchMedia("screen and (((min-width: 401px) and (max-width: 999px)) or (max-height: 750px))").matches}}}))}}]},fn:({x:e,y:n,placement:i,strategy:s,middlewareData:r})=>{const{center:a}=r;if(a.center)return null!==o&&(o.style.display="none"),Object.assign(t.style,{top:(window.innerHeight-t.offsetHeight)/2+"px",left:(window.innerWidth-t.offsetWidth)/2+"px",bottom:"",right:""}),null;Object.assign(t.style,{left:`${e}px`,top:`${n}px`,right:"",bottom:""});const{arrow:l}=r,c=zn.get(i);return null!==o&&Object.assign(o.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:e,y:n,strategy:s,placement:i,staticSide:c,middlewareData:r}}}},[Vn.Center]:(t,e,n={})=>({config:{},fn:()=>{const i=t.querySelector(".arrow");null!==i&&(i.style.display="none");const o=Object.keys(n).length>0;return o&&Object.assign(t.style,n,{position:"absolute"}),e.classList.toggle("centered",!o),null}}),[Vn.Mobile]:t=>({config:{},fn:()=>(Object.assign(t.style,{top:"auto !important",right:"0 !important",bottom:"0 !important",left:"auto"}),null)}),[Vn.Corner]:(t,e,n={})=>({config:{},fn:()=>{const i=t.querySelector(".arrow");null!==i&&(i.style.display="none");const o=Object.keys(n).length>0;return o&&Object.assign(t.style,n,{position:"absolute"}),e.classList.toggle("sda-cornered",!o),null}})},Wn={cleanup:()=>{},updatePosition:()=>O(void 0,void 0,void 0,(function*(){return Promise.resolve(null)}))};function Hn({anchorElement:t,floatingElement:e,overlayElement:n,behavior:i=Vn.Center},o={},s){if(null===e)return Wn;const r=null!=t||[Vn.Mobile,Vn.Corner].includes(i)?Bn[i](e,n,o,s):Bn[Vn.Center](e,n,o),a=t||document.body,l=()=>O(this,void 0,void 0,(function*(){const t=yield Fn(a,e,r.config);return r.fn(t)})),c=function(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:a=!1}=i,l=o&&!a,c=l||s?[...pn(t)?Nn(t):t.contextElement?Nn(t.contextElement):[],...Nn(e)]:[];c.forEach((t=>{l&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)}));let u,h=null;r&&(h=new ResizeObserver((()=>{n()})),pn(t)&&!a&&h.observe(t),pn(t)||!t.contextElement||a||h.observe(t.contextElement),h.observe(e));let d=a?Tn(t):null;return a&&function e(){const i=Tn(t);!d||i.x===d.x&&i.y===d.y&&i.width===d.width&&i.height===d.height||n(),d=i,u=requestAnimationFrame(e)}(),n(),()=>{var t;c.forEach((t=>{l&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)})),null==(t=h)||t.disconnect(),h=null,a&&cancelAnimationFrame(u)}}(a,e,l,{ancestorScroll:!1,ancestorResize:!0,elementResize:!0,animationFrame:!1});return{cleanup:c,updatePosition:l}}var qn;!function(t){t.UserStatusIdentity="userstatuschange:identity",t.UserStatusScope="userstatuschange:scope",t.UserSessionCreate="usersession:create"}(qn||(qn={}));const Gn=(()=>{class t{constructor(){this.s_T={}}subscribe(t,e,n){this.s_T[t]=[...this.s_T[t]||[],{publisherId:e,callback:n}]}unsubscribe(t,e){this.s_T[t]=(this.s_T[t]||[]).filter((t=>t.publisherId!==e))}unsubscribeAll(t){Object.keys(this.s_T).forEach((e=>{this.unsubscribe(e,t)}))}publish(t,e,n){var i;null===(i=this.s_T[t])||void 0===i||i.forEach((t=>{t.publisherId!==e&&t.callback(n)}))}}let e;return{getInstance:()=>(e||(e=new t),e)}})();class Kn extends Error{constructor(t,e=Ft()){super(t),this.analyticsTraceId=e,this.name="MonorailProducerError",this.code="monorail_producer_error"}}function Zn(){var t;null===(t=document.querySelector("com-1password-notification"))||void 0===t||t.remove()}class Xn{constructor(t,e,n,i=window){this.s_U=new Set,this.s_U.add(n),this.s_V=n=>{t.isSourceOf(n)&&(e.some((t=>function(t,e){try{const n=new URL(t).host.split(".").reverse(),i=new URL(e).host.split(".").reverse();for(let t=0;t{const s=()=>{o(new Error("Abort signal received"))};(null==e?void 0:e.aborted)&&s(),n=n=>{n.type===t&&(null==e||e.removeEventListener("abort",s),i(n))},this.s_U.add(n),null==e||e.addEventListener("abort",s)})).finally((()=>{this.s_U.delete(n)}))}s_W(t){this.s_U.forEach((e=>e(t)))}}var Jn,Yn,Qn;!function(t){t.Histogram="Histogram",t.Counter="Counter",t.UpDownCounter="UpDownCounter"}(Jn||(Jn={})),function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"}(Yn||(Yn={})),function(t){t.InvalidStorefrontOrigin="shop_js_invalid_storefront_origin",t.RequestShowCalledBeforeIframeLoaded="shop_js_request_show_called_before_iframe_loaded",t.HandleSilentError="shop_js_handle_silent_error"}(Qn||(Qn={}));const ti={serviceName:"shop-js",throttleLimit:1e3,prefixMetric:!1,metrics:{[Qn.InvalidStorefrontOrigin]:{type:Jn.Counter,description:"Number of times the storefront origin is invalid",valueType:Yn.INT},[Qn.RequestShowCalledBeforeIframeLoaded]:{type:Jn.Counter,description:"Number of times requestShow is called before iframe is loaded",valueType:Yn.INT},[Qn.HandleSilentError]:{type:Jn.Counter,description:"Number of times silent errors are handled",valueType:Yn.INT}},env:"production"};let ei,ni=3;const ii=(t=!1)=>(ei&&!t||(ei=new Promise(((t,e)=>{import("./chunk.index_52c0f1ff.esm.js").then((e=>{const n=new(0,e.DefaultOtelService)(ti);t(n)})).catch((t=>{e(t)}))}))),ei),oi=()=>O(void 0,void 0,void 0,(function*(){try{return yield ii(!0)}catch(t){if(ni--,ni>0)return oi();throw t}})),si=(t,e,n)=>{oi().then((i=>{i.record(t,e,n)})).catch((()=>{throw new Error("Failed to record opentelemetry metric")}))};const ri="https://shop.app",ai="https://pay.shopify.com",li="https://shop.app";var ci;function ui(t){let e;try{const n=new URL(t);"localhost"!==n.hostname&&"127.0.0.1"!==n.hostname||"https:"===n.protocol?"https:"!==n.protocol?e=ci.NotUsingHttps:"/"!==n.pathname?e=ci.HasPath:n.hash?e=ci.HasHash:n.search&&(e=ci.HasSearch):e=ci.UsingLocalhost}catch(t){e=ci.InvalidUrl}finally{e&&(console.error(`[shop-js] Invalid storefront origin: ${t}`),si(Qn.InvalidStorefrontOrigin,1,{error:e}))}}!function(t){t.UsingLocalhost="using_localhost",t.NotUsingHttps="not_using_https",t.HasPath="has_path",t.HasHash="has_hash",t.HasSearch="has_search",t.InvalidUrl="invalid_url"}(ci||(ci={}));class hi{constructor(t,e){this.s_X=t,this.s_Y=e}postMessage(t){const e=this.s_X instanceof HTMLIFrameElement?this.s_X.contentWindow:this.s_X;this.s_Y.forEach((n=>{null==e||e.postMessage(t,n)}))}}class di extends hi{constructor(t){super(t,[ri,ai])}}var pi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.extractDomain=e.PRODUCTION_CANADA_ENDPOINT=e.PRODUCE_ENDPOINT=e.PRODUCE_BATCH_ENDPOINT=e.PRODUCTION_DOMAIN=e.DEVELOPMENT_DOMAIN=void 0,e.DEVELOPMENT_DOMAIN="http://localhost:8082",e.PRODUCTION_DOMAIN="https://monorail-edge.shopifysvc.com",e.PRODUCE_BATCH_ENDPOINT="/unstable/produce_batch",e.PRODUCE_ENDPOINT="/v1/produce",e.PRODUCTION_CANADA_ENDPOINT="https://monorail-edge-ca.shopifycloud.com/v1/produce",e.extractDomain=function(t){return"https://".concat(new URL(t).hostname)}}));Zt(pi),pi.extractDomain,pi.PRODUCTION_CANADA_ENDPOINT,pi.PRODUCE_ENDPOINT,pi.PRODUCE_BATCH_ENDPOINT,pi.PRODUCTION_DOMAIN,pi.DEVELOPMENT_DOMAIN;var fi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.isCompositeMonorailEvent=void 0,e.isCompositeMonorailEvent=function(t){return void 0!==t.schemaId}}));Zt(fi),fi.isCompositeMonorailEvent;var mi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.ProducerMiddleware=void 0;var n=function(){function t(t){this.producer=t}return t.prototype.do=function(t,e){return(0,fi.isCompositeMonorailEvent)(t)?this.producer.produce(t):this.producer.produceBatch(t)},t}();e.ProducerMiddleware=n}));Zt(mi),mi.ProducerMiddleware;var gi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.v4=void 0,e.v4=function(){return"object"==typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():Ct.v4()}}));Zt(gi),gi.v4;var vi=function(t){return t&&t.default||t}(Z),bi=Xt((function(t,e){function n(t,e){return void 0===e&&(e=!0),t&&Object.keys(t).length&&e?Object.keys(t).map((function(e){var n;return(n={})[i(e)]=t[e],n})).reduce((function(t,e){return vi.s_c(vi.s_c({},t),e)})):t}function i(t){return t.split(/(?=[A-Z])/).join("_").toLowerCase()}Object.defineProperty(e,"s_a",{value:!0}),e.toUnderscoreCase=e.convertAllEventsToUnderscoreCase=e.convertStringToUnderscoreCase=void 0,e.toUnderscoreCase=n,e.convertStringToUnderscoreCase=i,e.convertAllEventsToUnderscoreCase=function(t){return t.events.map((function(t){var e=!0,i=!0;return t&&t.options&&Object.prototype.hasOwnProperty.call(t.options,"convertEventCase")&&(e=Boolean(t.options.convertEventCase)),t&&t.options&&Object.prototype.hasOwnProperty.call(t.options,"convertMetaDataCase")&&(i=Boolean(t.options.convertMetaDataCase)),{schema_id:t.schemaId,payload:n(t.payload,e),metadata:n(t.metadata,i)}}))}}));Zt(bi),bi.toUnderscoreCase,bi.convertAllEventsToUnderscoreCase,bi.convertStringToUnderscoreCase;var _i=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.MonorailRetriesExceededError=e.MonorailRequestError=e.MonorailBatchProduceError=e.MonorailUnableToProduceError=void 0;var n=function(t){function e(n){var i=t.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(n)))||this;return i.response=n,Object.setPrototypeOf(i,e.prototype),i}return vi.s_b(e,t),e}(Error);e.MonorailUnableToProduceError=n;var i=function(t){function e(n){var i=t.call(this,"Error producing to the Monorail Edge. Response received: ".concat(JSON.stringify(n)))||this;return Object.setPrototypeOf(i,e.prototype),i.response=n,i}return vi.s_b(e,t),e}(Error);e.MonorailBatchProduceError=i;var o=function(t){function e(n){var i=t.call(this,"Error completing request. A network failure may have prevented the request from completing. Error: ".concat(n))||this;return Object.setPrototypeOf(i,e.prototype),i}return vi.s_b(e,t),e}(Error);e.MonorailRequestError=o;var s=function(t){function e(n){var i=t.call(this,"".concat(n))||this;return Object.setPrototypeOf(i,e.prototype),i}return vi.s_b(e,t),e}(Error);e.MonorailRetriesExceededError=s}));Zt(_i),_i.MonorailRetriesExceededError;var yi=_i.MonorailRequestError;_i.MonorailBatchProduceError,_i.MonorailUnableToProduceError;var wi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.HttpProducer=void 0;var n=function(){function t(t,e){void 0===t&&(t=pi.DEVELOPMENT_DOMAIN),void 0===e&&(e=!1),this.edgeDomain=t,this.keepalive=e}return t.withEndpoint=function(e){return new t(pi.extractDomain(e))},t.getHeadersFromMetadata=function(t){var e={"Content-Type":"application/json; charset=utf-8","X-Monorail-Edge-Event-Created-At-Ms":(t&&t.eventCreatedAtMs||Date.now()).toString(),"X-Monorail-Edge-Event-Sent-At-Ms":Date.now().toString(),"X-Monorail-Edge-Client-Message-Id":(t&&t.clientMessageId||(0,gi.v4)()).toString()};return t&&t.userAgent&&(e["User-Agent"]=t.userAgent),t&&t.remoteIp&&(e["X-Forwarded-For"]=t.remoteIp),e},t.prototype.produceBatch=function(e){return vi.s_h(this,void 0,void 0,(function(){var n,i,o,s,r,a;return vi.s_i(this,(function(l){switch(l.label){case 0:n={events:(0,bi.convertAllEventsToUnderscoreCase)(e),metadata:(0,bi.toUnderscoreCase)(e.metadata)},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,fetch(this.produceBatchEndpoint(),{method:"post",headers:t.getHeadersFromMetadata(e.metadata),body:JSON.stringify(n),keepalive:this.keepalive})];case 2:return i=l.sent(),[3,4];case 3:throw o=l.sent(),new _i.MonorailRequestError(o);case 4:return 207!==i.status?[3,6]:[4,i.json()];case 5:throw s=l.sent(),new _i.MonorailBatchProduceError(s);case 6:return i.ok?[3,8]:(r=_i.MonorailUnableToProduceError.bind,a={status:i.status},[4,i.text()]);case 7:throw new(r.apply(_i.MonorailUnableToProduceError,[void 0,(a.message=l.sent(),a)]));case 8:return[2,{status:i.status}]}}))}))},t.prototype.produce=function(e){return vi.s_h(this,void 0,void 0,(function(){var n,i,o,s,r,a;return vi.s_i(this,(function(l){switch(l.label){case 0:n=!0,e&&e.options&&Object.prototype.hasOwnProperty.call(e.options,"convertEventCase")&&(n=Boolean(e.options.convertEventCase)),i={schema_id:e.schemaId,payload:(0,bi.toUnderscoreCase)(e.payload,n)},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,fetch(this.produceEndpoint(),{method:"post",headers:t.getHeadersFromMetadata(e.metadata),body:JSON.stringify(i),keepalive:this.keepalive})];case 2:return o=l.sent(),[3,4];case 3:throw s=l.sent(),new _i.MonorailRequestError(s);case 4:if(!o)throw new _i.MonorailUnableToProduceError({message:"No response from edge"});return o.ok?[3,6]:(r=_i.MonorailUnableToProduceError.bind,a={status:o.status},[4,o.text()]);case 5:throw new(r.apply(_i.MonorailUnableToProduceError,[void 0,(a.message=l.sent(),a)]));case 6:return[2,{status:o.status}]}}))}))},t.prototype.produceBatchEndpoint=function(){return this.edgeDomain+pi.PRODUCE_BATCH_ENDPOINT},t.prototype.produceEndpoint=function(){return this.edgeDomain+pi.PRODUCE_ENDPOINT},t}();e.HttpProducer=n}));Zt(wi),wi.HttpProducer;var xi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.LogProducer=void 0;var n=function(){function t(e){this.sendToConsole=e,e&&t.printWelcomeMessage(e)}return t.printWelcomeMessage=function(t){console.log("%c👋 from Monorail%c\n\n"+"We've noticed that you're".concat(t?"":" not"," ")+"running in debug mode. "+"As such, we will ".concat(t?"produce":"not produce"," ")+"Monorail events to the console. "+"\n\nIf you want Monorail events to ".concat(t?"stop":"start"," ")+"appearing here, %cset debugMode=".concat((!t).toString(),"%c, ")+"for the Monorail Log Producer in your code.","font-size: large;","font-size: normal;","font-weight: bold;","font-weight: normal;")},t.prototype.produce=function(t){return this.sendToConsole&&console.log("Monorail event produced",t),new Promise((function(e){e(t)}))},t.prototype.produceBatch=function(t){return this.sendToConsole&&console.log("Monorail Batch event produced",t),new Promise((function(e){e(t)}))},t}();e.LogProducer=n}));Zt(xi),xi.LogProducer;var ki=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.Monorail=void 0;var n=function(){function t(e,n){this.producer=e,this.middleware=n,this.executeChain=t.buildMiddlewareChain(this.middleware.concat(new mi.ProducerMiddleware(e)))}return t.createLogProducer=function(e){return new t(new xi.LogProducer(e.debugMode),e.middleware||[])},t.createHttpProducerWithEndpoint=function(e,n){return void 0===n&&(n=[]),new t(wi.HttpProducer.withEndpoint(e),n)},t.createHttpProducer=function(e){var n=e.options&&e.options.keepalive;return new t(e.production?new wi.HttpProducer(pi.PRODUCTION_DOMAIN,n):new wi.HttpProducer(pi.DEVELOPMENT_DOMAIN,n),e.middleware||[])},t.buildMiddlewareChain=function(t,e){var n=this;return void 0===e&&(e=0),e===t.length?this.identityFn:function(i){return t[e].do(i,n.buildMiddlewareChain(t,e+1))}},t.prototype.produce=function(t){return t.metadata=vi.s_c({eventCreatedAtMs:Date.now(),clientMessageId:(0,gi.v4)()},t.metadata),this.executeChain(t)},t.prototype.produceBatch=function(t){return this.executeChain(t)},t}();e.Monorail=n}));Zt(ki),ki.Monorail;var Ci=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.RetryMiddleware=void 0;var n=function(){function t(t,e){void 0===t&&(t=3),void 0===e&&(e=150),this.maxRetries=t,this.delayMs=e}return t.prototype.do=function(t,e){return vi.s_h(this,void 0,void 0,(function(){var n,i,o,s,r;return vi.s_i(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,o];case 7:throw i?i.message="Retry count of ".concat(this.maxRetries," exceeded. Failed with error: \n").concat(i.message," Aborting request for ").concat(JSON.stringify(t)):i=new Error,new _i.MonorailRetriesExceededError(i)}}))}))},t.prototype.delay=function(t){return new Promise((function(e){return setTimeout(e,t)}))},t}();e.RetryMiddleware=n}));Zt(Ci),Ci.RetryMiddleware;var Oi=Xt((function(t,e){Object.defineProperty(e,"s_a",{value:!0}),e.RetryMiddleware=e.MonorailRetriesExceededError=e.MonorailUnableToProduceError=e.MonorailRequestError=e.Monorail=void 0,Object.defineProperty(e,"Monorail",{enumerable:!0,get:function(){return ki.Monorail}}),Object.defineProperty(e,"MonorailRequestError",{enumerable:!0,get:function(){return _i.MonorailRequestError}}),Object.defineProperty(e,"MonorailUnableToProduceError",{enumerable:!0,get:function(){return _i.MonorailUnableToProduceError}}),Object.defineProperty(e,"MonorailRetriesExceededError",{enumerable:!0,get:function(){return _i.MonorailRetriesExceededError}}),Object.defineProperty(e,"RetryMiddleware",{enumerable:!0,get:function(){return Ci.RetryMiddleware}})}));Zt(Oi),Oi.RetryMiddleware,Oi.MonorailRetriesExceededError,Oi.MonorailUnableToProduceError,Oi.MonorailRequestError;var Si=Oi.Monorail;function Ti(...t){var e;return O(this,void 0,void 0,(function*(){if(!window.ShopifyAnalytics&&!window.analytics)return{};let n;Boolean(null===(e=window.trekkie)||void 0===e?void 0:e.ready)?n=Ei():(window.trekkie=window.trekkie||[],n=new Promise((t=>{window.trekkie.push(["ready",()=>{t(Ei())}])})));const i=yield n;return t.reduce(((t,e)=>{const n=i[e];return void 0!==n&&(t[e]=n),t}),{})}))}function Ei(){let t;return Promise.race([new Promise((e=>t=setTimeout((()=>e({})),1e4))),new Promise((t=>{var e,n,i;const o=(null===(n=null===(e=window.ShopifyAnalytics)||void 0===e?void 0:e.lib)||void 0===n?void 0:n.ready)||(null===(i=window.analytics)||void 0===i?void 0:i.ready);null==o||o((()=>{var e,n,i;const o=(null===(n=null===(e=window.ShopifyAnalytics)||void 0===e?void 0:e.lib)||void 0===n?void 0:n.trekkie)||(null===(i=window.analytics)||void 0===i?void 0:i.trekkie);t(o.defaultAttributes)}))}))]).finally((()=>clearTimeout(t)))}const ji=Si.createHttpProducer({production:!0});let Ai=class{constructor({elementName:t,analyticsTraceId:e,flow:n="",flowVersion:i="unspecified",shopId:o,shopPermanentDomain:s,checkoutVersion:r,checkoutToken:a}){var l;this.s_Z="",this.s_aa=!1,this.s_ba={},this.s_ca={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.s_da=t,this.s_ea=n,this.s_fa=e,this.s_ga=(new Date).getTime(),this.s_ha=i,this.s_ia=r,this.s_ja=a,this.s_ka=o,this.s_Z=s||(null===(l=window.Shopify)||void 0===l?void 0:l.shop)||""}get analyticsTraceId(){return this.s_fa}trackElementImpression(t){return O(this,void 0,void 0,(function*(){if(this.s_aa)return;this.s_aa=!0;const e=yield Ti("uniqToken","visitToken","microSessionId","microSessionCount","shopId","themeId","themeCityHash","contentLanguage","referer"),n=Object.assign(Object.assign({},e),{elementType:t,elementName:this.s_da,shopJsVersion:Ot});$i({schemaId:_e.UiImpression,payload:n},e,(()=>{this.s_aa=!1}))}))}trackPageImpression({shopAccountUuid:t,apiKey:e,page:n}){return O(this,void 0,void 0,(function*(){if(this.s_ca[n])return;this.s_ca[n]=!0;const i=yield Ti("uniqToken","visitToken","isPersistentCookie","path","customerId"),o=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),{shopPermanentDomain:this.s_Z,flow:this.s_ea,flowVersion:this.s_ha,sdkVersion:Ot,analyticsTraceId:this.s_fa,pageName:n}),e&&{apiKey:e}),t&&{shopAccountUuid:t}),this.s_ja&&{checkoutToken:this.s_ja});$i({schemaId:_e.LoginWithShopSdkPageImpression,payload:o},i,(()=>{this.s_ca[n]=!1}))}))}trackShopLoginFirstTimeRender(t=this.s_ha,e=this.s_ga){return O(this,void 0,void 0,(function*(){if(this.s_ba[t])return;this.s_ba[t]=!0;const n=(new Date).getTime()-e,i=yield Ti("shopId"),o=Object.assign(Object.assign({analyticsTraceId:this.s_fa,duration:n},i),{shopLoginVersion:t,url:window.location.href,userAgent:navigator.userAgent});$i({schemaId:_e.ShopLoginFirstTimeRender,payload:o},i,(()=>{this.s_ba[t]=!1}))}))}trackShopPayLoginWithShopSdkUserAction({apiKey:t,userAction:e}){const n=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t&&{apiKey:t}),{flow:this.s_ea,flowVersion:this.s_ha,sdkVersion:Ot,analyticsTraceId:this.s_fa}),this.s_ia&&{checkoutVersion:this.s_ia}),this.s_ka&&{shopId:this.s_ka}),{shopPermanentDomain:this.s_Z,userAction:e});$i({schemaId:_e.LoginWithShopSdkUserAction,payload:n})}trackShopPayLoginWithSdkErrorEvents({apiKey:t,errorCode:e,errorMessage:n}){const i={apiKey:t,flow:this.s_ea,flowVersion:this.s_ha,sdkVersion:Ot,analyticsTraceId:this.s_fa,shopPermanentDomain:this.s_Z,errorCode:e,errorMessage:n};$i({schemaId:_e.LoginWithShopSdkErrorEvents,payload:i})}trackShopPayModalStateChange({currentState:t}){if(this.s_ja){const e={checkoutToken:this.s_ja,checkoutVersion:this.s_ia,shopId:this.s_ka,shopifyDomain:this.s_Z,previousState:"",currentState:t,analyticsTraceId:this.s_fa,clientTimestampMs:(new Date).getTime()};$i({schemaId:_e.ShopifyPayModalStateChange,payload:e})}}};function $i(t,e,n){!e||Object.keys(e).length?(t.payload=Object.assign(t.payload,e),ji.produce(t).catch((t=>{if(null==n||n(t),function(t){var e;return!(t instanceof yi||(null===(e=null==t?void 0:t.message)||void 0===e?void 0:e.includes("Invalid agent:")))}(t)){const e=t instanceof Error?t:new Kn(String(t));ue.notify(e)}}))):null==n||n({message:"trekkie attributes are empty"})}const Ii={brand:"#5a31f4",white:"#fff",black:"#000",warning:"#d02e11",close:"#707070",foregroundSecondary:"#3F454D",backgroundSubdued:"#F2F3F5",backgroundError:"#FFECE9",backgroundFaint:"#F2F4F5",error:"#D02E11"};function Ni(t){let e=0,n=0,i=0;return 4===t.length?(e=Number(`0x${t[1]}${t[1]}`),n=Number(`0x${t[2]}${t[2]}`),i=Number(`0x${t[3]}${t[3]}`)):7===t.length&&(e=Number(`0x${t[1]}${t[2]}`),n=Number(`0x${t[3]}${t[4]}`),i=Number(`0x${t[5]}${t[6]}`)),[e,n,i]}function Li(t){const e=t.match(/\d+/g)||[],[n=0,i=0,o=0]=e.map((t=>Number(t)));return[n,i,o]}function Mi(t){const e=[90,49,244],n=[255,255,255];let i=[255,255,255];return t.startsWith("#")?i=Ni(t):t.startsWith("rgb(")&&(i=Li(t)),Di(i,e)>Di(i,n)?e:n}function Pi(t,e){return Di(t.startsWith("#")?Ni(t):Li(t),e.startsWith("#")?Ni(e):Li(e))}function Ri(t,e,n){const i=[t,e,n].map((function(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return.2126*i[0]+.7152*i[1]+.0722*i[2]}function Di(t,e){const n=Ri(t[0],t[1],t[2]),i=Ri(e[0],e[1],e[2]);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)}function Fi(t){var e;const n=null===(e=window.getComputedStyle(t).getPropertyValue("--color-background"))||void 0===e?void 0:e.trim();if(n)return n;for(const e of function*(t){let e=t;for(;e;){if(e.parentElement)e=e.parentElement;else if(e instanceof ShadowRoot)e=e.host;else{if(!(e instanceof Element))break;{const t=e.getRootNode();if(!(t instanceof ShadowRoot))break;e=t.host}}if(yield e,e===document.body)break}}(t)){const t=window.getComputedStyle(e).getPropertyValue("background-color");if(t&&"rgba(0, 0, 0, 0)"!==t)return t}return"#ffffff"}class Vi extends HTMLElement{constructor(){super();const t=document.createElement("template"),e=this.getAttribute("size")||"",n=this.getAttribute("background-color")||"#FFF";t.innerHTML=function(t,e){const n="large"===t?"shop-pay-logo-large":"shop-pay-logo",[i,o,s]=Mi(e),r=`rgb(${i}, ${o}, ${s})`;return`\n \n \n `}(e,n),this.attachShadow({mode:"open"}).appendChild(t.content.cloneNode(!0))}}const Ui=1e4,zi={temporarilyUnavailable:{code:"temporarily_unavailable",message:"Shop login is temporarily unavailable"}},Bi="client-id",Wi="version",Hi="action",qi="storefront-origin",Gi="keep-modal-open",Ki="email-verification-required",Zi="hide-button",Xi="disable-sign-up",Ji="redirect-uri",Yi="redirect-type",Qi="auto-open",to="analytics-context",eo="analytics-trace-id",no="compact",io="position-variant",oo="response-type",so="response-mode",ro="code-challenge",ao="code-challenge-method",lo="state",co="scope",uo="avoid-pay-alt-domain",ho="avoid-sdk-session",po="flow",fo="flow-version",mo="email",go="anchor-to",vo="dev-mode",bo="modal-title",_o="modal-description",yo="modal-logo-src",wo="api-key",xo="pop-up-name",ko="pop-up-features",Co="modal-brand",Oo="consent-challenge",So="checkout-version",To="shop-id",Eo="require-verification",jo="first-name",Ao="last-name",$o="checkout-token",Io="transaction-params",No="shop-permanent-domain";class Lo extends HTMLElement{constructor(){super()}updateAttribute(t,e){this.getAttribute(t)!==e&&(e?this.setAttribute(t,e):this.removeAttribute(t))}getBooleanAttribute(t){const e=this.getAttribute(t);return null!=e}dispatchCustomEvent(t,e){const n=new CustomEvent(t,{bubbles:!0,cancelable:!1,composed:!0,detail:e});this.dispatchEvent(n)}}var Mo,Po,Ro,Do;class Fo extends HTMLElement{constructor(){super(),Mo.set(this,void 0),B(this,Mo,this.attachShadow({mode:"open"}),"f")}connectedCallback(){const t=document.createElement("template"),e=this.getAttribute("size")||"",n=this.getAttribute("color")||"",i=this.getAttribute("label")||"";t.innerHTML=function(t,e="brand",n){return`\n \n \n ${n}\n