"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__typeError=e=>{throw TypeError(e)},__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var n={};for(var r in e)__hasOwnProp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&__getOwnPropSymbols)for(var r of __getOwnPropSymbols(e))t.indexOf(r)<0&&__propIsEnum.call(e,r)&&(n[r]=e[r]);return n},__accessCheck=(e,t,n)=>t.has(e)||__typeError(`Cannot `+n),__privateGet=(e,t,n)=>(__accessCheck(e,t,`read from private field`),n?n.call(e):t.get(e)),__privateAdd=(e,t,n)=>t.has(e)?__typeError(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),__privateSet=(e,t,n,r)=>(__accessCheck(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),__privateMethod=(e,t,n)=>(__accessCheck(e,t,`access private method`),n),__async=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});(function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee;let C=Symbol.for(`RemoteUi::Retain`),w=Symbol.for(`RemoteUi::Release`),T=Symbol.for(`RemoteUi::RetainedBy`);var te=class{constructor(){this.memoryManaged=/* @__PURE__ */ new Set}add(e){this.memoryManaged.add(e),e[T].add(this),e[C]()}release(){for(let e of this.memoryManaged)e[T].delete(this),e[w]();this.memoryManaged.clear()}};function E(e){return!!(e&&e[C]&&e[w])}function D(e,{deep:t=!0}={}){return O(e,t,/* @__PURE__ */ new Map)}function O(e,t,n){let r=n.get(e);if(r!=null)return r;let i=E(e);if(i&&e[C](),n.set(e,i),t){if(Array.isArray(e)){let r=e.reduce((e,r)=>O(r,t,n)||e,i);return n.set(e,r),r}if(j(e)){let r=Object.keys(e).reduce((r,i)=>O(e[i],t,n)||r,i);return n.set(e,r),r}}return n.set(e,i),i}function k(e,{deep:t=!0}={}){return A(e,t,/* @__PURE__ */ new Map)}function A(e,t,n){let r=n.get(e);if(r!=null)return r;let i=E(e);if(i&&e[w](),n.set(e,i),t){if(Array.isArray(e)){let r=e.reduce((e,r)=>A(r,t,n)||e,i);return n.set(e,r),r}if(j(e)){let r=Object.keys(e).reduce((r,i)=>A(e[i],t,n)||r,i);return n.set(e,r),r}}return i}function j(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t==null||t===Object.prototype}let M=`_@fn`;function ne(e){var t;let n=typeof self<`u`&&self.name||((t=globalThis.location)==null?void 0:t.origin)||`unknown`,r=e.uuid(),i=null,a=/* @__PURE__ */ new Map,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map;return{encode:function t(n,r=/* @__PURE__ */ new Map){if(n==null)return[n];let i=r.get(n);if(i)return i;if(typeof n==`object`){if(Array.isArray(n)){r.set(n,[void 0]);let e=[],i=[n.map(n=>{let[i,a=[]]=t(n,r);return e.push(...a),i}),e];return r.set(n,i),i}if(j(n)){r.set(n,[void 0]);let e=[],i=[Object.keys(n).reduce((i,a)=>{let[o,s=[]]=t(n[a],r);return e.push(...s),__spreadProps(__spreadValues({},i),{[a]:o})},{}),e];return r.set(n,i),i}}if(typeof n==`function`){if(a.has(n)){let e=[{"_@f":a.get(n)}];return r.set(n,e),e}let t=e.uuid();a.set(n,t),o.set(t,n);let i=[{"_@f":t,[M]:n.name||String(n).slice(0,100)}];return r.set(n,i),i}let s=[n];return r.set(n,s),s},decode:l,call(e,t){return __async(this,null,function*(){let a=new te,s=o.get(e);if(s==null){let t=c.get(e)||`unknown`,a=Error(`[`.concat(n,`] You attempted to call a function that was already released. (function: `,t,`, endpoint: `,r,i==null?``:`, endpoint terminated `.concat(Date.now()-i,`ms ago`),`)`));throw a.name=`RemoteFunctionReleasedError`,a}try{return yield s(...l(t,E(s)?[a,...s[T]]:[a]))}finally{a.release()}})},release(e){let t=o.get(e);t&&(o.delete(e),a.delete(t),c.set(e,t.name||`unknown`))},terminate(){i=Date.now(),a.clear(),o.clear(),s.clear(),c.clear()}};function l(t,a){if(typeof t==`object`){if(t==null)return t;if(Array.isArray(t))return t.map(e=>l(e,a));if(`_@f`in t){let o=t[`_@f`];if(s.has(o))return s.get(o);let c=0,l=!1,u=null,d=()=>{--c,c===0&&(l=!0,u=Date.now(),s.delete(o),e.release(o))},f=()=>{c+=1},p=new Set(a),m=M in t&&t[M]||`unknown`,h=(...t)=>{if(l){let e=Error(`[`.concat(n,`] You attempted to call a function that was already released. (function: `,m,`, endpoint: `,r,u==null?``:`, released `.concat(Date.now()-u,`ms ago`),`, retained by `,p.size,`)`));throw e.name=`RemoteFunctionReleasedError`,e}if(!s.has(o)){let e=Error(`[`.concat(n,`] You attempted to call a function that was already revoked. (function: `,m,`, endpoint: `,r,i==null?``:`, endpoint terminated `.concat(Date.now()-i,`ms ago`),`, retained by `,p.size,`)`));throw e.name=`RemoteFunctionRevokedError`,e}return e.call(o,t)};Object.defineProperties(h,{[w]:{value:d,writable:!1},[C]:{value:f,writable:!1},[T]:{value:p,writable:!1}});for(let e of p)e.add(h);return s.set(o,h),h}if(j(t))return Object.keys(t).reduce((e,n)=>__spreadProps(__spreadValues({},e),{[n]:l(t[n],a)}),{})}return t}}function re(e,{uuid:t=ie,createEncoder:n=ne,callable:r}={}){let i=!1,a=e,o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=ae(f,r),l=n({uuid:t,release(e){u(3,[e])},call(e,n,r){let i=t(),a=p(i,r),[o,s]=l.encode(n);return u(5,[i,e,o],s),a}});return a.addEventListener(`message`,d),{call:c,replace(e){let t=a;a=e,t.removeEventListener(`message`,d),e.addEventListener(`message`,d)},expose(e){for(let t of Object.keys(e)){let n=e[t];typeof n==`function`?o.set(t,n):o.delete(t)}},callable(...e){if(r!=null)for(let t of e)Object.defineProperty(c,t,{value:f(t),writable:!1,configurable:!0,enumerable:!0})},terminate(){u(2,void 0),m(),a.terminate&&a.terminate()}};function u(e,t,n){i||a.postMessage(t?[e,t]:[e],n)}function d(e){return __async(this,null,function*(){if(i)return;let{data:t}=e;if(oe(t))switch(t[0]){case 2:m();break;case 0:{let e=new te,[n,r,i]=t[1],a=o.get(r);try{if(a==null)throw Error(`No '`.concat(r,`' method is exposed on this endpoint`));let[t,o]=l.encode(yield a(...l.decode(i,[e])));u(1,[n,void 0,t],o)}catch(e){let{name:t,message:r,stack:i}=e;throw u(1,[n,{name:t,message:r,stack:i}]),e}finally{e.release()}break}case 1:{let[e]=t[1],n=s.get(e);if(n==null)break;n(...t[1]),s.delete(e);break}case 3:{let[e]=t[1];l.release(e);break}case 6:{let[e]=t[1],n=s.get(e);if(n==null)break;n(...t[1]),s.delete(e);break}case 5:{let[e,n,r]=t[1];try{let t=yield l.call(n,r),[i,a]=l.encode(t);u(6,[e,void 0,i],a)}catch(t){let{name:n,message:r,stack:i}=t;throw u(6,[e,{name:n,message:r,stack:i}]),t}break}}})}function f(e){return(...n)=>{if(i)return Promise.reject(/* @__PURE__ */ Error(`You attempted to call a function on a terminated web worker.`));if(typeof e!=`string`&&typeof e!=`number`)return Promise.reject(Error(`Can’t call a symbol method on a remote endpoint: `.concat(e.toString())));let r=t(),a=p(r),[o,s]=l.encode(n);return u(0,[r,e,o],s),a}}function p(e,t){return new Promise((n,r)=>{s.set(e,(e,i,a)=>{if(i==null)n(a&&l.decode(a,t));else{let e=/* @__PURE__ */ Error();Object.assign(e,i),r(e)}})})}function m(){var e;i=!0,o.clear(),s.clear(),(e=l.terminate)==null||e.call(l),a.removeEventListener(`message`,d)}}function ie(){return``.concat(N(),`-`,N(),`-`,N(),`-`,N())}function N(){return Math.floor(Math.random()*9007199254740991).toString(16)}function ae(e,t){let n;if(t==null){if(typeof Proxy!=`function`)throw Error(`You must pass an array of callable methods in environments without Proxies.`);let t=/* @__PURE__ */ new Map;n=new Proxy({},{get(n,r){if(t.has(r))return t.get(r);let i=e(r);return t.set(r,i),i}})}else{n={};for(let r of t)Object.defineProperty(n,r,{value:e(r),writable:!1,configurable:!0,enumerable:!0})}return n}function oe(e){return Array.isArray(e)&&typeof e[0]==`number`&&(e[1]==null||Array.isArray(e[1]))}function se(e){return e}function ce(e){D(e);let t=e.initial,n=!0,r=!1,i=/* @__PURE__ */ new Set,a=Promise.resolve(e.subscribe(o)).then(e=>(r||o(e[1]),e));return{get current(){return t},subscribe:e=>(i.add(e),()=>{i.delete(e)}),destroy(){return __async(this,null,function*(){n=!1,i.clear();let[t]=yield a;t(),k(e)})}};function o(e){if(r=!0,n&&t!==e){t=e;for(let e of i)e(t)}}}function P(e,t){if(!{}.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var le=0;function ue(e){return`__private_`+le+++`_`+e}de(!0);function de(e=!1){let t=null,n=e?null:/* @__PURE__ */ new Set;var r=ue(`value`),i=ue(`callbacks`);class a{constructor(e){var t;Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,i,{writable:!0,value:/* @__PURE__ */ new Set}),P(this,r)[r]=e,(t=n)==null||t.add(this)}get value(){return P(this,r)[r]}set value(e){e!==P(this,r)[r]&&(P(this,r)[r]=e,P(this,i)[i].forEach(t=>t(e)))}subscribe(e){return P(this,i)[i].add(e),()=>{P(this,i)[i].delete(e)}}}class o extends a{constructor(e){var n;super(e),(n=t)==null||n.call(this,e)}get current(){return this.value}get value(){return c().get.call(this)}set value(e){throw Error(`This signal is read-only`)}}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o.prototype),`value`);function c(){if(!s||typeof s.get!=`function`||typeof s.set!=`function`)throw Error(`Value descriptor is not found`);return s}function l(){n=null}return{SignalLike:o,applyRealSignal:function(e){if(!n)return;t=e;let r=c();if(Object.setPrototypeOf(o.prototype,e.prototype),s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(o.prototype),`value`),Object.defineProperties(o.prototype,{$$typeof:{configurable:!0,value:e.prototype.$$typeof},ref:{configurable:!0,value:null},constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:e.prototype.type},props:{configurable:!0,get(){return{data:this}}},__b:{configurable:!0,value:1}}),n)for(let t of n){let n=r.get.call(t);e.call(t,n)}l()},sealImplementation:l,updateSignalValue:function(e,t){c().set.call(e,t)}}}function fe(e){`signal`in e&&Object.assign(e,{signal:pe(e.signal)})}function pe(e){if(me(e))return e;let t=new AbortController,{aborted:n,start:r}=e;return n?(t.abort(),t.signal):(r&&(D(r),r(e=>{e&&t.abort()})),t.signal.addEventListener(`abort`,()=>__async(null,null,function*(){k(r)}),{once:!0}),t.signal)}function me(e){return e!=null&&e.aborted!=null&&typeof e.addEventListener==`function`}var F=class extends Error{constructor(...e){super(...e),this.name=`ExtensionSandboxError`}},I=class extends Error{constructor(...e){super(...e),this.name=`ExtensionUsageError`}},he=class extends Error{constructor(...e){super(...e),this.name=`ExtensionAssetFetchError`}};function L(e){return(...t)=>{var n;try{return e(...t)}catch(e){throw e.name===`ExtensionUsageError`?e:new F((n=e==null?void 0:e.message)==null?`Unknown error`:n,{cause:e})}}}function ge(e){let t=/* @__PURE__ */ new Set;return e.subscribeToClose(()=>{for(let e of t)e()}),{close:L(()=>e.close()),addEventListener:L((e,n)=>{e===`close`&&typeof n==`function`&&t.add(n)}),removeEventListener:L((e,n)=>{e===`close`&&t.delete(n)})}}let R=`latn`,z=`-u-nu-`.concat(R);function B(e){try{let t=new Intl.Locale(e);return new Intl.Locale(t.baseName,{numberingSystem:R}).toString()}catch(t){return _e(e)}}function _e(e){return e.includes(`-u-nu-`)?e.replace(/-u-nu-[a-z0-9]+/i,z):``.concat(e,z)}function ve(e,t,n){let r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map;function a(t,n){let i=n==null?{}:n,{inExtensionLocale:a}=i,o=__objRest(i,[`inExtensionLocale`]);if(o.style===`currency`&&(typeof o.currency!=`string`||o.currency.length===0))throw new I(`i18n.formatNumber(): currency option must be a valid currency code string when style is "currency"`);let s=U(!0===a?e.extensionLanguage:e.language),c=V(s,o),l=r.get(c);return l||(l=ye(s,o),r.set(c,l)),l.format(t)}return{formatNumber:L(a),formatCurrency:L(function(t,n){let r=n==null?{}:n,{inExtensionLocale:i}=r,o=__objRest(r,[`inExtensionLocale`]);return a(t,__spreadValues({inExtensionLocale:i,style:`currency`,currency:Ce(e.currency)},o))}),formatDate:L(function(t,n){let r=n==null?{}:n,{inExtensionLocale:a}=r,o=__objRest(r,[`inExtensionLocale`]),s=U(!0===a?e.extensionLanguage:e.language),c=V(s,o),l=i.get(c);l||(l=be(s,o),i.set(c,l));try{return l.format(t)}catch(e){throw e instanceof RangeError?new I(`i18n.formatDate(): date must be a valid Date`,{cause:e}):e}}),translate:L((r,i)=>{let a=i==null?{}:i,o=t[r],s=!1,c=U(e.extensionLanguage);function l(e){if(n===`local`)throw new I(`translate(): `.concat(e));console.error(new I(`translate(): `.concat(e)))}if(typeof a.count==`number`){let e=xe(c).select(a.count),n=``.concat(r,`.`,e);if(o=t[n],o===void 0){let i=t[``.concat(r,`.other`)];if(e!==`other`&&i!==void 0)o=i,console.warn(new I(`translate(): MISSING PLURALIZATION KEY for locale "`.concat(c,`": "`,n,`". Using fallback key of "`,r,`.other".`)));else{if(typeof t[r]!=`string`){let e=`MISSING PLURALIZATION KEY for locale "`.concat(c,`": "`,n,`"`);return l(e),e}s=!0,o=t[r]}}}else if(typeof a.count==`string`&&typeof t[r]==`string`)o=t[r];else if(a.count!==void 0){let e=`INCORRECT TYPE for options.count. Must be typeof "number".`;return l(e),e}if(o===void 0){let e=[``.concat(r,`.zero`),``.concat(r,`.one`),``.concat(r,`.two`),``.concat(r,`.few`),``.concat(r,`.many`),``.concat(r,`.other`)],n=`MISSING KEY for locale "`.concat(c,`": "`,r,`"`);for(let r of e)if(t[r]!==void 0){n=`MISSING PROPERTY "options.count" for pluralization.`,l(n);break}return l(n),n}let u=[],d=/([\s\S]*?)(?:{{(.+?)}}|$)/g,f=new Set(Object.keys(a)),p=/* @__PURE__ */ new Set,m=[],h=d.exec(o),g=!1;for(;h&&!(h.index>=o.length);){let e=h[0],t=h[2],n=t==null?void 0:t.trim(),i=u.length-1,s=h[1]||``,m=!1;if(n!==void 0){if(!f.has(n)){l(`MISSING PLACEHOLDER VALUE for locale "`.concat(c,`": "options.`,t,`" is required for "`,r,`"`)),u.push(e),h=d.exec(o);continue}typeof a[n]==`string`||typeof a[n]==`number`?s+=String(a[n]):t!==void 0&&(g=!0,m=!0),p.add(n)}typeof u[i]==`string`?u[i]+=s:u.push(s),m&&n!==void 0&&u.push(a[n]),h=d.exec(o)}for(let e of f)!1===s&&e===`count`||p.has(e)||m.push(`"{{`.concat(e,`}}"`));return m.length>0&&l(``.concat(m.length===1?`MISSING PLACEHOLDER`:`MISSING PLACEHOLDERS`,` for locale "`,c,`": `,m.join(`, `),` not found in "`,r,`"`)),g?u:u.join(``)})}}function V(e,t={}){return``.concat(e,`|`,JSON.stringify(t))}function H(e,t){try{return t(e)}catch(n){let r=Se(e);if(r&&r!==e)return t(r);throw n}}function ye(e,t){return H(e,e=>new Intl.NumberFormat(B(e),t))}function be(e,t){return H(e,e=>new Intl.DateTimeFormat(B(e),t))}function xe(e){return H(e,e=>new Intl.PluralRules(e))}function Se(e){var t;return(t=e.match(/^([a-z]{2,3})(?:[-_].*)?$/i))==null?void 0:t[1]}function U(e){return`current`in e?e.current.isoCode:e.isoCode}function Ce(e){return`current`in e?e.current.isoCode:e.isoCode}function we(e,t,n,r){let i=G(e),a=__spreadProps(__spreadValues({},i),{i18n:ve(i.localization,n,r)});return fe(a),a.extensionPoint=t,a.extension.target=t,a}let W=(e,...t)=>{let n=we(e,...t),r=e.announcement;return r&&Object.assign(n,{announcement:ge(r)}),n};function G(e){if(Te(e))return De(e);if(typeof e==`object`&&e&&!Ee(e)){for(let t of Object.keys(e)){let n=e;n[t]=G(n[t])}return e}return e}function Te(e){return typeof e==`object`&&!!e&&`initial`in e&&typeof e.subscribe==`function`}function Ee(e){return typeof e==`object`&&!!e&&`current`in e&&typeof e.subscribe==`function`}function De(e){let t=ce(e);return Object.defineProperty(t,"__remote_signal__",{value:!0}),Object.defineProperty(t,"value",{get:()=>t.current}),t}function Oe(e){let t=[];return e=>{t.push(e),t.length===1&&(typeof requestIdleCallback==`function`?requestIdleCallback(n,{timeout:1e3}):setTimeout(n,50))};function n(){if(t.length===0)return;let n=t;t=[],e(n)}}let ke=/* @__PURE__ */ new Set([`extend`,`setSignals`]);function Ae(e,t,{shouldReport:n,reportedApiPropertyNames:r=/* @__PURE__ */ new Set}={}){let i=/* @__PURE__ */ new WeakMap,a=Oe(t);return Me(e)?(function e(t,o){let s=i.get(t);if(s)return s;let c=new Proxy(t,{get(t,i){let s=Reflect.get(t,i,t);if(typeof i!=`string`||!Object.prototype.hasOwnProperty.call(t,i))return s;let c=[...o,i];return(o.length>0||!ke.has(i))&&(l=c.join(`.`),n&&!n()||r.has(l)||(r.add(l),a(l))),Me(s)&&!je(s)?e(s,c):s;var l}});return i.set(t,c),c})(e,[]):e}function je(e){return typeof e.subscribe==`function`&&(`current`in e||`value`in e)}function Me(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}let K=new(t=class{constructor(){__privateAdd(this,e,/* @__PURE__ */ new Set)}throwDetachedOnce(t,n){let r=(()=>{try{return String(n)}catch(e){return`unknown error`}})();try{if(__privateGet(this,e).has(t))return;let i=new F(`[extension-tts] `.concat(t,` ExtensionSandboxError: `,r),{cause:n});setTimeout(()=>{throw i},0),__privateGet(this,e).add(t)}catch(e){}}reset(){__privateGet(this,e).clear()}},e=/* @__PURE__ */ new WeakMap,t);function Ne(e,t){try{let n=e,r=n.query;if(typeof r!=`function`)return;D(r),n.query=function(...e){t.fetchStarted(!0);try{return Reflect.apply(r,this,e).finally(()=>{t.fetchResolved()})}catch(e){throw t.fetchResolved(),e}}}catch(e){t.silence(),K.throwDetachedOnce(`wrap-query-setup`,e)}}function Pe(e,t){let n=e;do{let e=Object.getOwnPropertyNames(n).filter(e=>e in t&&!1!==t[e]);for(let r of e)try{let e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(n,r,{value:!0===t[r]?void 0:t[r],configurable:!0,enumerable:e==null?void 0:e.enumerable,writable:!1})}catch(e){}n=Object.getPrototypeOf(n)}while(n!==Object.prototype)}function Fe(e,t){Pe(e,t)}let Ie=/^\/api\/.+\/graphql\.json$/,Le=/^(\/\/)?(\/)?storefront\/api\/(.+\/)?graphql\.json$/;function Re(e,t,n){let r=new URL(e);if(r.protocol===`shopify:`)return Le.test(r.pathname);let i=new URL(t),a=new URL(`https://`.concat(n));return(r.host===i.host||r.host===a.host)&&Ie.test(r.pathname)}function ze(){return __async(this,null,function*(){throw new I(`permission to access the storefront API must be specified under [capabilities] with flag "api_access = true"; this can be done within your extension's configuration. View the docs for more information: https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access`)})}function q(){return __async(this,null,function*(){throw new I(`permission to use fetch() must be specified under [capabilities] with flag "network_access = true"; this can be done within your extension's configuration. View the docs for more information: https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access`)})}function Be(){throw new I(`permission to use WebSocket must be specified under [capabilities] with flag "network_access = true"; this can be done within your extension's configuration. View the docs for more information: https://shopify.dev/docs/api/checkout-ui-extensions/configuration#network-access`)}let Ve={XMLHttpRequestUpload:!0,XMLHttpRequestEventTarget:!0,XMLHttpRequest:!0,BackgroundFetchManager:!0,BackgroundFetchRecord:!0,BackgroundFetchRegistration:!0,BackgroundFetchEvent:!0,BackgroundFetchUpdateUIEvent:!0,Cache:!0,CacheStorage:!0,caches:!0,fetch:q,Request:!0,Response:!0,Headers:!0,Worker:!0,SharedWorker:!0,WebSocket:Be,EventSource:!0,PaymentMethodChangeEvent:!0,PaymentRequest:!0,PaymentRequestUpdateEvent:!0,PaymentResponse:!0,PushEvent:!0,PushManager:!0,PushMessageData:!0,PushSubscription:!0,PushSubscriptionOptions:!0,ServiceWorkerRegistration:!0,importScripts:!0},J=re(se(self),{callable:[]});function He(){let e=J;return e.callable(`reload`),e.callable(`apiFetch`),e.callable(`extensionPerformanceMarkStarted`),e.callable(`extensionPerformanceMarkFinished`),e.callable(`reportSandboxError`),e.callable(`reportApiRead`),e.callable(`reportPolicyViolation`),e}self.addEventListener(`message`,({data:e})=>{e!=null&&e.__replace instanceof MessagePort&&(J.replace(e.__replace),e.__replace.start())}),Object.defineProperty(self,"endpoint",{value:J,enumerable:!1,writable:!1,configurable:!0});function Ue(e,t,n){return e===`purchase.address-autocomplete.suggest`&&!0===(n==null?void 0:n.aborted)&&(t==null?void 0:t.name)===`AbortError`}let We=/* @__PURE__ */ new WeakSet;function Ge(e){We.add(e)}function Ke(e){e.addEventListener(`unhandledrejection`,e=>{let{reason:t}=e;typeof t==`object`&&t&&We.has(t)&&(e.preventDefault(),e.stopImmediatePropagation())})}function qe(e){if(typeof e==`function`||e instanceof AbortSignal)return;if(typeof e!=`object`||!e)return e;let t={};for(let n in e)t[n]=qe(e[n]);return t}let Je=Request,Ye=Response,Xe=[101,103,204,205,304];function Ze(e){return __async(this,arguments,function*(e,t={}){let{port1:n,port2:r}=new MessageChannel;try{let i=new Je(e,t);if(new URL(i.url).origin===self.origin)throw Error(`Fetches to the iframe's origin are not allowed.`);i.signal.throwIfAborted(),i.signal.addEventListener(`abort`,()=>{n.postMessage({action:`abort`,reason:i.signal.reason})});let a=i.url,o={method:i.method,headers:[...i.headers],mode:i.mode,credentials:i.credentials,cache:i.cache,redirect:i.redirect,referrer:i.referrer,integrity:i.integrity,keepalive:i.keepalive},s=[r];i.method!==`GET`&&i.method!==`HEAD`&&(o.body=yield i.arrayBuffer(),s.push(o.body));let c={action:`fetch`,url:a,requestInit:o,returnPort:r};return self.postMessage(c,s),new Promise((e,t)=>{n.addEventListener(`message`,r=>{if(r.data){if(r.data.error)t(r.data.error),n.close();else if(r.data.response){let{status:t}=r.data.response.init,i=Xe.includes(t)?null:r.data.response.body;e(new Ye(i,r.data.response.init)),n.close()}}}),n.start()})}catch(e){return n==null||n.close(),Promise.reject(e)}})}let Qe=Date.now();function $e(){return et(performance.now())}function et(e){return typeof(performance==null?void 0:performance.timeOrigin)==`number`?e+performance.timeOrigin:e+Qe}function tt(e){let t=et(e.settledAt);return __spreadValues({startTime:t,timestamp:t,ttsCompletionReason:e.reason,ttsRenderObserved:e.renderedContent},!0===e.fetchAttributable&&{ttsRequestCount:e.fetchCount})}function Y(){return{startTime:$e(),timestamp:Date.now()}}function nt(e){return{extensionPerformanceMarkStarted:(t,n={})=>{e.call.extensionPerformanceMarkStarted(t,__spreadValues(__spreadValues({},Y()),n))},extensionPerformanceMarkFinished:(t,n={})=>{e.call.extensionPerformanceMarkFinished(t,__spreadValues(__spreadValues({},Y()),n))}}}let X=new(r=class{constructor(){__privateAdd(this,n,/* @__PURE__ */ new Map)}registerCapture(e,t){let r=__privateGet(this,n).get(e);r&&r!==t&&this.discardCapture(e,r),__privateGet(this,n).set(e,t)}discardCapture(e,t){try{if(__privateGet(this,n).get(e)!==t)return;try{t.silence()}finally{__privateGet(this,n).delete(e)}}catch(e){K.throwDetachedOnce(`bridge-discard-capture`,e)}}liveCaptureCount(){return __privateGet(this,n).size}isSoleCapture(e){return __privateGet(this,n).size===1&&__privateGet(this,n).has(e)}notifyFetchStarted(){let e=[...__privateGet(this,n).values()];try{for(let t of e)t.fetchStarted()}catch(e){K.throwDetachedOnce(`bridge-notify-fetch-started`,e)}return()=>{try{for(let t of e)t.fetchResolved()}catch(e){K.throwDetachedOnce(`bridge-resolve-fetch`,e)}}}reset(){__privateGet(this,n).clear()}},n=/* @__PURE__ */ new WeakMap,r),rt=Request,it=Response,at=e=>t=>__async(null,null,function*(){return ct(yield e.call.apiFetch(t))}),ot;function st(e){ot=at(e)}function ct(e){var t=e,{body:n}=t,r=__objRest(t,[`body`]);return new it(n,r)}function lt({allowNetworkAccess:e,allowApiAccess:t,storefrontUrl:n,myshopifyDomain:r,metrics:i,extensionId:a,instanceId:o,capture:s}){let c=Ze;return function(l,u){return __async(this,null,function*(){var d,f;let p,m,h=`external`,g=performance.now(),{startTime:_}=Y(),v;s?(s.fetchStarted(!0),v=()=>s.fetchResolved()):v=X.notifyFetchStarted();try{if(!e&&!t)throw yield q();let i;try{i=new rt(l,u)}catch(e){throw new I(`Invalid request: `.concat(e))}if(Re(i.url,n,r)){if(h=`storefront`,!t)return yield ze();let e=yield i.text(),n=yield ot(__spreadProps(__spreadValues({},qe(i)),{headers:i.headers?Array.from(i.headers.entries()):[],body:e}));return`status`in n&&typeof n.status==`number`&&(m=n.status),n}if(h=`external`,e){let e=yield c(l,u);return`status`in e&&typeof e.status==`number`&&(m=e.status),e}return yield q()}catch(e){throw p=e instanceof Error&&e.name===`ExtensionUsageError`?`ExtensionUsageError`:`unknown`,e}finally{v();let e=`unknown`,t=`unknown`;try{let n=typeof l==`string`?l:l.url;t=n,e=new URL(n).origin}catch(e){}let n=((f=(d=u==null?void 0:u.method)==null?typeof l==`string`?void 0:l.method:d)==null?`GET`:f).toUpperCase(),r=performance.now()-g;i.extensionPerformanceMarkFinished(`extension-fetch-call`,{type:`extension-fetch`,startTime:_,duration:r,errorType:p,destination:h,httpStatus:m,httpMethod:n,origin:e,requestUrl:t,extensionId:a,instanceId:o})}})}}let Z=/* @__PURE__ */ new Map;function ut(e){let t=Object.freeze({extend(e,t){Z.set(e,t)},reload(){e.call.reload()}});Reflect.defineProperty(self,"shopify",{value:t,configurable:!1,enumerable:!0,writable:!1})}function dt(e,t){let n=/* @__PURE__ */ new Set;e.addEventListener(`securitypolicyviolation`,e=>{if(!e.isTrusted)return;let{effectiveDirective:r,blockedURI:i,sourceFile:a}=e,o=``.concat(a,` `,r);n.has(o)||(n.add(o),t.call.reportPolicyViolation({effectiveDirective:r,blockedOrigin:ft(i)},{scriptUrl:a||void 0}))})}function ft(e){try{return new URL(e).origin}catch(t){return e}}function pt(e){return Array.isArray(e)?e.find(e=>Z.has(e)):Z.has(e)?e:void 0}var mt=(ee=class{constructor(e){__privateAdd(this,h),__privateAdd(this,i),__privateAdd(this,a),__privateAdd(this,o),__privateAdd(this,s,!1),__privateAdd(this,c,0),__privateAdd(this,l,0),__privateAdd(this,u,!0),__privateAdd(this,d,!1),__privateAdd(this,f,!1),__privateAdd(this,p,null),__privateAdd(this,m,null),__privateSet(this,i,e.emit),__privateSet(this,a,e.isSoleCapture),this.recordMutation=__privateMethod(this,h,g).call(this,this.recordMutation,`record-mutation`),this.fetchStarted=__privateMethod(this,h,g).call(this,this.fetchStarted,`fetch-started`),this.fetchResolved=__privateMethod(this,h,g).call(this,this.fetchResolved,`fetch-resolved`);try{__privateSet(this,m,setTimeout(()=>{try{__privateSet(this,m,null),__privateMethod(this,h,b).call(this,`exceeded-deadline`)}catch(e){__privateMethod(this,h,_).call(this,`deadline-timer`,e)}},1e4))}catch(e){__privateMethod(this,h,_).call(this,`capture-construct`,e)}}recordMutation(){__privateGet(this,d)||(__privateSet(this,s,!0),__privateSet(this,o,performance.now()),__privateMethod(this,h,y).call(this,500))}fetchStarted(e){if(__privateGet(this,d))return;let t=e==null?__privateGet(this,a).call(this):e;__privateGet(this,u)&&!t&&__privateSet(this,u,!1),__privateSet(this,l,__privateGet(this,l)+1),__privateSet(this,c,__privateGet(this,c)+1)}fetchResolved(){__privateGet(this,d)||(__privateSet(this,c,Math.max(0,__privateGet(this,c)-1)),__privateMethod(this,h,v).call(this)&&__privateMethod(this,h,y).call(this,0))}silence(){__privateSet(this,f,!0),__privateSet(this,d,!0),__privateMethod(this,h,x).call(this),__privateMethod(this,h,S).call(this)}},i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap,c=/* @__PURE__ */ new WeakMap,l=/* @__PURE__ */ new WeakMap,u=/* @__PURE__ */ new WeakMap,d=/* @__PURE__ */ new WeakMap,f=/* @__PURE__ */ new WeakMap,p=/* @__PURE__ */ new WeakMap,m=/* @__PURE__ */ new WeakMap,h=/* @__PURE__ */ new WeakSet,g=function(e,t){let n=e.bind(this);return(...e)=>{if(!__privateGet(this,f))try{n(...e)}catch(e){__privateMethod(this,h,_).call(this,t,e)}}},_=function(e,t){this.silence(),K.throwDetachedOnce(e,t)},v=function(){return!__privateGet(this,d)&&__privateGet(this,s)&&__privateGet(this,p)===null&&__privateGet(this,c)===0},y=function(e){__privateMethod(this,h,x).call(this),__privateSet(this,p,setTimeout(()=>{try{__privateSet(this,p,null),__privateMethod(this,h,v).call(this)&&__privateMethod(this,h,b).call(this,`settled`)}catch(e){__privateMethod(this,h,_).call(this,`settle-timer`,e)}},e))},b=function(e){if(__privateSet(this,d,!0),__privateMethod(this,h,x).call(this),__privateMethod(this,h,S).call(this),!__privateGet(this,s)||__privateGet(this,o)===void 0)return void __privateGet(this,i).call(this,{reason:e,renderedContent:!1,fetchCount:0,settledAt:performance.now()});let t=__privateGet(this,u);__privateGet(this,i).call(this,{reason:e,renderedContent:!0,fetchAttributable:t,fetchCount:t?__privateGet(this,l):0,settledAt:__privateGet(this,o)})},x=function(){__privateGet(this,p)!==null&&(clearTimeout(__privateGet(this,p)),__privateSet(this,p,null))},S=function(){__privateGet(this,m)!==null&&(clearTimeout(__privateGet(this,m)),__privateSet(this,m,null))},ee);function ht(e,...t){if(e!==0)return!0;let[n]=t;return n.length>0}function gt(e,t){return(n,...r)=>{let i=e(n,...r);return ht(n,...r)&&t.recordMutation(),i}}let _t=Y(),Q=He();dt(globalThis,Q),ut(Q),st(Q),Ke(globalThis);let $=nt(Q),vt=/* @__PURE__ */ new Set;function yt({allowNetworkAccess:e,allowApiAccess:t,storefrontUrl:n,myshopifyDomain:r}){vt=/* @__PURE__ */ new Set,$.extensionPerformanceMarkFinished(`sandbox-js-eval-2025-07`,_t);let i=__spreadProps(__spreadValues({},Ve),{fetch:lt({allowNetworkAccess:e,allowApiAccess:t,storefrontUrl:n,myshopifyDomain:r,metrics:$})}),a=e||t?__spreadProps(__spreadValues({},i),{WebSocket:!e&&Be,Request:!1,Response:!1,Headers:!1}):i;Fe(self,a)}function bt(e){return __async(this,null,function*(){try{$.extensionPerformanceMarkStarted(`partner-js-eval`),eval==null||(0,eval)(``.concat(e.scriptBody,` //# sourceURL=`,e.scriptUrl)),$.extensionPerformanceMarkFinished(`partner-js-eval`)}catch(e){throw(e==null?void 0:e.name)===`NetworkError`?new he(String(e),{cause:e}):(e==null?void 0:e.name)===`ExtensionUsageError`||(e==null?void 0:e.name)===`ExtensionSandboxError`?e:new I(String(e),{cause:e})}})}function xt(e,t,n,r,i,a,o){return __async(this,null,function*(){let s=new mt({emit:e=>{$.extensionPerformanceMarkFinished(`extension-tts`,__spreadValues({instanceId:o},tt(e)))},isSoleCapture:()=>X.isSoleCapture(o)});try{X.registerCapture(o,s);let c=gt(t,s);D(t);let l={channel:c,components:n};D(l),D(r);let u=pt(e),d=W(r,u,i,a);return Ne(d,s),$.extensionPerformanceMarkStarted(`extension-tts`,{instanceId:o}),{output:yield wt(u,o,[l,Ct(d)]),teardown:()=>__async(null,null,function*(){X.discardCapture(o,s)})}}catch(e){throw X.discardCapture(o,s),e}})}function St(e,t,n,r,i){return __async(this,null,function*(){D(t);let a=pt(e),o=W(t,a,n,r);return{output:yield wt(e,i,[Ct(o)],o.signal),teardown:()=>__async(null,null,function*(){})}})}function Ct(e){return Ae(e,e=>{Q.call.reportApiRead(e)},{reportedApiPropertyNames:vt})}function wt(e,t,n,r){return __async(this,null,function*(){var i;$.extensionPerformanceMarkStarted(`partner-js-exec`,{instanceId:t});try{let t=(i=Z.get(e))==null?void 0:i(...n);return typeof t==`object`&&t&&`then`in t&&(t=yield t),t}catch(t){throw Ue(e,t,r)?(Ge(t),t):(t==null?void 0:t.name)===`ExtensionUsageError`||(t==null?void 0:t.name)===`ExtensionSandboxError`?t:new I(String(t),{cause:t})}finally{$.extensionPerformanceMarkFinished(`partner-js-exec`,{instanceId:t})}})}Q.expose({sandbox:yt,load:bt,render:xt,run:St})})();