@occluze/tether 0.3.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -7
- package/dist/esm/astro.js +2 -0
- package/dist/esm/chunks/chunk-HHMOPDZG.js +1 -0
- package/dist/esm/chunks/chunk-HXKV6QGB.js +4 -0
- package/dist/esm/chunks/chunk-RBVRRQIU.js +1 -0
- package/dist/esm/chunks/chunk-RNZMTQTX.js +1 -0
- package/dist/esm/chunks/chunk-VC46IEJQ.js +1 -0
- package/dist/esm/chunks/diagnose-J667GHGS.js +1 -0
- package/dist/esm/chunks/markets-ui-EGWIEUOZ.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/server.js +1 -0
- package/dist/presets/barba.esm.js +4 -5
- package/dist/tether.diagnose.js +320 -0
- package/dist/tether.diagnose.min.js +1 -0
- package/dist/tether.esm.js +2 -2608
- package/dist/tether.js +637 -833
- package/dist/tether.markets.js +213 -0
- package/dist/tether.markets.min.js +1 -0
- package/dist/tether.min.js +3 -132
- package/dist/tether.min.js.map +4 -4
- package/package.json +52 -11
- package/src/astro.js +73 -0
- package/src/cart.js +79 -7
- package/src/client.js +25 -15
- package/src/config.js +4 -0
- package/src/diagnose.js +1 -1
- package/src/dom.js +32 -9
- package/src/fragments.js +12 -11
- package/src/index.js +80 -160
- package/src/initial.js +66 -0
- package/src/lazy-iife.js +43 -0
- package/src/lazy.js +9 -0
- package/src/loader.js +50 -7
- package/src/markets-ui.js +89 -0
- package/src/markets.js +1 -1
- package/src/mounting.js +129 -0
- package/src/parts/diagnose.js +3 -0
- package/src/parts/markets.js +3 -0
- package/src/product.js +86 -61
- package/src/server.js +179 -0
- package/src/status.js +2 -6
- package/types/astro.d.ts +15 -0
- package/types/barba.d.ts +16 -0
- package/types/index.d.ts +347 -0
- package/types/server.d.ts +94 -0
package/dist/tether.min.js
CHANGED
|
@@ -1,134 +1,5 @@
|
|
|
1
|
-
(()=>{var
|
|
2
|
-
namespace key type value
|
|
3
|
-
reference { ... on MediaImage { image { ${G} } } }
|
|
4
|
-
}`:""}var Oe=`
|
|
5
|
-
id name description recurringDeliveries
|
|
6
|
-
options { name value }
|
|
7
|
-
priceAdjustments {
|
|
8
|
-
orderCount
|
|
9
|
-
adjustmentValue {
|
|
10
|
-
__typename
|
|
11
|
-
... on SellingPlanPercentagePriceAdjustment { adjustmentPercentage }
|
|
12
|
-
... on SellingPlanFixedAmountPriceAdjustment { adjustmentAmount { ${E} } }
|
|
13
|
-
... on SellingPlanFixedPriceAdjustment { price { ${E} } }
|
|
14
|
-
}
|
|
15
|
-
}`,_e=`
|
|
16
|
-
sellingPlan { id }
|
|
17
|
-
checkoutChargeAmount { ${E} }
|
|
18
|
-
remainingBalanceChargeAmount { ${E} }
|
|
19
|
-
priceAdjustments {
|
|
20
|
-
price { ${E} }
|
|
21
|
-
compareAtPrice { ${E} }
|
|
22
|
-
perDeliveryPrice { ${E} }
|
|
23
|
-
unitPrice { ${E} }
|
|
24
|
-
}`;function pt(){return`
|
|
25
|
-
fragment TetherProduct on Product {
|
|
26
|
-
id handle title description descriptionHtml productType vendor tags
|
|
27
|
-
availableForSale publishedAt onlineStoreUrl requiresSellingPlan
|
|
28
|
-
seo { title description }
|
|
29
|
-
featuredImage { ${G} }
|
|
30
|
-
images(first: ${c.imagesFirst}) { nodes { ${G} } }
|
|
31
|
-
options { name optionValues { name swatch { color image { previewImage { ${G} } } } } }
|
|
32
|
-
priceRange { minVariantPrice { ${E} } maxVariantPrice { ${E} } }
|
|
33
|
-
compareAtPriceRange { minVariantPrice { ${E} } maxVariantPrice { ${E} } }
|
|
34
|
-
${Ne()}
|
|
35
|
-
sellingPlanGroups(first: ${c.sellingPlanGroupsFirst}) {
|
|
36
|
-
nodes {
|
|
37
|
-
name appName
|
|
38
|
-
options { name values }
|
|
39
|
-
sellingPlans(first: ${c.sellingPlansFirst}) { nodes { ${Oe} } }
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
variants(first: ${c.variantsFirst}) {
|
|
43
|
-
nodes {
|
|
44
|
-
id title availableForSale currentlyNotInStock quantityAvailable sku barcode
|
|
45
|
-
selectedOptions { name value }
|
|
46
|
-
image { ${G} }
|
|
47
|
-
price { ${E} }
|
|
48
|
-
compareAtPrice { ${E} }
|
|
49
|
-
unitPrice { ${E} }
|
|
50
|
-
sellingPlanAllocations(first: ${c.sellingPlansFirst}) { nodes { ${_e} } }
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}`}function Ot(){return`
|
|
54
|
-
fragment TetherCart on Cart {
|
|
55
|
-
id checkoutUrl totalQuantity note createdAt updatedAt
|
|
56
|
-
attributes { key value }
|
|
57
|
-
buyerIdentity { countryCode email }
|
|
58
|
-
discountCodes { code applicable }
|
|
59
|
-
cost {
|
|
60
|
-
subtotalAmount { ${E} }
|
|
61
|
-
totalAmount { ${E} }
|
|
62
|
-
checkoutChargeAmount { ${E} }
|
|
63
|
-
}
|
|
64
|
-
lines(first: 100) {
|
|
65
|
-
nodes {
|
|
66
|
-
id quantity
|
|
67
|
-
attributes { key value }
|
|
68
|
-
cost {
|
|
69
|
-
totalAmount { ${E} }
|
|
70
|
-
subtotalAmount { ${E} }
|
|
71
|
-
amountPerQuantity { ${E} }
|
|
72
|
-
compareAtAmountPerQuantity { ${E} }
|
|
73
|
-
}
|
|
74
|
-
discountAllocations { discountedAmount { ${E} } }
|
|
75
|
-
sellingPlanAllocation {
|
|
76
|
-
sellingPlan { id name description recurringDeliveries options { name value } }
|
|
77
|
-
checkoutChargeAmount { ${E} }
|
|
78
|
-
priceAdjustments { price { ${E} } compareAtPrice { ${E} } perDeliveryPrice { ${E} } }
|
|
79
|
-
}
|
|
80
|
-
merchandise {
|
|
81
|
-
... on ProductVariant {
|
|
82
|
-
id title sku availableForSale requiresShipping
|
|
83
|
-
image { ${G} }
|
|
84
|
-
price { ${E} }
|
|
85
|
-
compareAtPrice { ${E} }
|
|
86
|
-
selectedOptions { name value }
|
|
87
|
-
product { id title handle vendor featuredImage { ${G} } }
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
... on ComponentizableCartLine {
|
|
91
|
-
lineComponents {
|
|
92
|
-
id quantity
|
|
93
|
-
merchandise { ... on ProductVariant { id title product { title handle } } }
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}`}function ee(){return`
|
|
1
|
+
(()=>{var rr=Object.defineProperty;var F=(t,e)=>{for(var r in e)rr(t,r,{get:e[r],enumerable:!0})};var It={};F(It,{DEFAULTS:()=>Jt,cfg:()=>c,configure:()=>zt,isConfigured:()=>Ct,log:()=>T,reportError:()=>x,warn:()=>L});var Jt={domain:"",token:"",apiVersion:"2026-07",country:void 0,language:void 0,locale:void 0,markets:null,prefix:"tether",productPath:"/product",collectionPath:"/collection",metafields:[],imagesFirst:25,variantsFirst:100,sellingPlanGroupsFirst:10,sellingPlansFirst:25,collectionFirst:24,retries:2,revalidate:!0,storageKey:null,cartDrawerOpenClass:"is-open",openCartOnAdd:!0,cartFocus:!0,checkoutTarget:"_self",defaultPurchase:"one-time",autoMount:!0,observe:!1,astro:!0,partsUrl:null,formatMoney:null,onLayoutChange:null,onCartOpen:null,onCartClose:null,onLineEnter:null,onLineLeave:null,onValueChange:null,onError:null,debug:!1},c={...Jt};function zt(t={}){return Object.keys(c).forEach(e=>delete c[e]),Object.assign(c,Jt,t),c.domain&&(c.domain=String(c.domain).replace(/^https?:\/\//,"").replace(/\/.*$/,"")),c.storageKey||(c.storageKey=`${c.prefix}:cart:${c.domain}`),c.apiVersion==="unstable"&&L('apiVersion "unstable" changes without notice. Pin a dated version (e.g. 2026-07).'),c}var Ct=()=>!!(c.domain&&c.token);function T(...t){c.debug&&console.log(`[${c.prefix}]`,...t)}function L(...t){console.warn(`[${c.prefix}]`,...t)}function x(t,e){if(L(e,t&&t.message?t.message:t),typeof c.onError=="function")try{c.onError(t,e)}catch{}}var Zt={};F(Zt,{TetherError:()=>I,endpoint:()=>Oe,gql:()=>q,request:()=>kt,unwrap:()=>Xt,withContext:()=>Tt});var I=class extends Error{constructor(e,{status:r,errors:n,userErrors:i,code:s}={}){super(e),this.name="TetherError",this.code=s||(r?`HTTP_${r}`:"ERROR"),this.status=r,this.errors=n,this.userErrors=i}};function Oe(t=c){return`https://${t.domain}/api/${t.apiVersion}/graphql.json`}function Tt(t,e=c){let r=[];if(e.country&&r.push(`country: ${String(e.country).toUpperCase()}`),e.language&&r.push(`language: ${String(e.language).toUpperCase().replace("-","_")}`),!r.length||/@inContext/.test(t))return t;let n=`@inContext(${r.join(", ")})`;return/^\s*\{/.test(t)?`query ${n} ${t.trimStart()}`:t.replace(/^(\s*(?:query|mutation)(?:\s+\w+)?\s*(?:\([^)]*\))?)/,`$1 ${n}`)}var Yt=t=>new Promise(e=>setTimeout(e,t));async function kt(t,e,r={},{context:n=!0}={}){if(!t.domain||!t.token)throw new I("Tether is not configured: domain and token are required",{code:"NOT_CONFIGURED"});let i=JSON.stringify({query:n?Tt(e,t):e,variables:r}),s=0;for(;;){let o;try{o=await(t.fetch||fetch)(Oe(t),{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":t.token},body:i})}catch(f){if(s++<t.retries){await Yt(300*2**s);continue}throw new I(`Network error: ${f.message}`,{code:"NETWORK"})}if(o.status===430)throw new I("Shopify security rejection (430)",{status:430});if((o.status===429||o.status>=500)&&s++<t.retries){T("retry",o.status,s),await Yt(300*2**s);continue}let p;try{p=await o.json()}catch{throw new I(`Invalid response (${o.status})`,{status:o.status})}if(p.errors?.length){if(p.errors.some(h=>/quantityAvailable/.test(h.message||""))&&/\bquantityAvailable\b/.test(i))return T("no inventory permission, retrying without quantityAvailable"),kt(t,e.replace(/\bquantityAvailable\b/g,""),r,{context:n});if(p.errors.some(h=>/'warnings'/.test(h.message||""))&&/warnings \{ code message \}/.test(e))return kt(t,e.replace(/ warnings \{ code message \}/g,""),r,{context:n});if(p.errors.some(h=>h.extensions?.code==="THROTTLED")&&s++<t.retries){await Yt(500*2**s);continue}throw new I(p.errors.map(h=>h.message).join(" | "),{status:o.status,errors:p.errors})}if(!o.ok)throw new I(`HTTP ${o.status}`,{status:o.status});return p.data}}var q=(t,e,r)=>kt(c,t,e,r);function Xt(t,e){if(!t)throw new I(`${e}: empty response`);let r=t.userErrors||[];if(r.length)throw new I(r.map(n=>n.message).join(" | "),{userErrors:r});return t}var $e={};F($e,{Cart:()=>P,focusables:()=>Ut,toLineInput:()=>Ke});var ee={};F(ee,{ALLOCATION_FIELDS:()=>_e,SELLING_PLAN_FIELDS:()=>Fe,cartFragment:()=>Lt,collectionFields:()=>te,metafieldIdentifiers:()=>Ne,productFragment:()=>ut});var w="amount currencyCode",z="url altText width height";function Ne(t=c){return(t.metafields||[]).map(e=>{if(typeof e=="string"){let r=e.indexOf(".");return{namespace:e.slice(0,r),key:e.slice(r+1)}}return e}).filter(e=>e.namespace&&e.key)}function nr(t=c){let e=Ne(t);return e.length?`metafields(identifiers:[${e.map(n=>`{namespace: ${JSON.stringify(n.namespace)}, key: ${JSON.stringify(n.key)}}`).join(", ")}]){namespace key type value reference{... on MediaImage{image{${z}}}}}`:""}var Fe=` id name description recurringDeliveries options{name value}priceAdjustments{orderCount adjustmentValue{__typename ... on SellingPlanPercentagePriceAdjustment{adjustmentPercentage}... on SellingPlanFixedAmountPriceAdjustment{adjustmentAmount{${w}}}... on SellingPlanFixedPriceAdjustment{price{${w}}}}}`,_e=` sellingPlan{id}checkoutChargeAmount{${w}}remainingBalanceChargeAmount{${w}}priceAdjustments{price{${w}}compareAtPrice{${w}}perDeliveryPrice{${w}}unitPrice{${w}}}`;function ut(t=c){return` fragment TetherProduct on Product{id handle title description descriptionHtml productType vendor tags availableForSale publishedAt onlineStoreUrl requiresSellingPlan seo{title description}featuredImage{${z}}images(first:${t.imagesFirst}){nodes{${z}}}options{name optionValues{name swatch{color image{previewImage{${z}}}}}}priceRange{minVariantPrice{${w}}maxVariantPrice{${w}}}compareAtPriceRange{minVariantPrice{${w}}maxVariantPrice{${w}}}${nr(t)} sellingPlanGroups(first:${t.sellingPlanGroupsFirst}){nodes{name appName options{name values}sellingPlans(first:${t.sellingPlansFirst}){nodes{${Fe}}}}}variants(first:${t.variantsFirst}){nodes{id title availableForSale currentlyNotInStock quantityAvailable sku barcode selectedOptions{name value}image{${z}}price{${w}}compareAtPrice{${w}}unitPrice{${w}}sellingPlanAllocations(first:${t.sellingPlansFirst}){nodes{${_e}}}}}}`}function Lt(){return` fragment TetherCart on Cart{id checkoutUrl totalQuantity note createdAt updatedAt attributes{key value}buyerIdentity{countryCode email}discountCodes{code applicable}cost{subtotalAmount{${w}}totalAmount{${w}}checkoutChargeAmount{${w}}}lines(first:100){nodes{id quantity attributes{key value}cost{totalAmount{${w}}subtotalAmount{${w}}amountPerQuantity{${w}}compareAtAmountPerQuantity{${w}}}discountAllocations{discountedAmount{${w}}}sellingPlanAllocation{sellingPlan{id name description recurringDeliveries options{name value}}checkoutChargeAmount{${w}}priceAdjustments{price{${w}}compareAtPrice{${w}}perDeliveryPrice{${w}}}}merchandise{... on ProductVariant{id title sku availableForSale requiresShipping image{${z}}price{${w}}compareAtPrice{${w}}selectedOptions{name value}product{id title handle vendor featuredImage{${z}}}}}... on ComponentizableCartLine{lineComponents{id quantity merchandise{... on ProductVariant{id title product{title handle}}}}}}}}`}function te(){return`
|
|
99
2
|
id handle title description descriptionHtml
|
|
100
|
-
image { ${
|
|
101
|
-
seo { title description }`}var W=new Map,ne=[],_t=new Map,Dt=!1,st=0,Ft=t=>typeof t=="string"&&t.startsWith("gid://");function Ut(t){let e=String(t!=null?t:"").trim();if(!e)return null;if(Ft(e))return e;if(/^\d+$/.test(e))return`gid://shopify/Product/${e}`;let n=e.match(/\/products\/([^/?#]+)/);return n?n[1]:e}function tt(t){if(!t)return;let e=Promise.resolve(t);W.set(t.handle,e),W.set(t.id,e)}function B(t){let e=Ut(t);if(!e)return Promise.reject(new L("empty product key",{code:"NOT_FOUND"}));if(W.has(e))return W.get(e);let n=new Promise((r,o)=>{_t.set(e,{resolve:r,reject:o}),ne.push(e),Dt||(Dt=!0,setTimeout(De,0))});return W.set(e,n),n}async function De(){Dt=!1;let t=st,e=ne.splice(0);if(!e.length)return;let n=e.filter(Ft),r=e.filter(d=>!Ft(d)),o=[],i=[],s={};n.length&&(o.push("$ids: [ID!]!"),s.ids=n,i.push("byId: nodes(ids: $ids) { ... on Product { ...TetherProduct } }")),r.forEach((d,f)=>{o.push(`$h${f}: String!`),s[`h${f}`]=d,i.push(`h${f}: product(handle: $h${f}) { ...TetherProduct }`)});let a=`query TetherProducts(${o.join(", ")}) {
|
|
102
|
-
${i.join(`
|
|
103
|
-
`)}
|
|
104
|
-
}
|
|
105
|
-
${pt()}`;D("fetch products",e);let l=(d,f)=>{let h=_t.get(d);_t.delete(d),h&&f(h)};try{let d=await O(a,s),f=new Map;(d.byId||[]).forEach(h=>{h&&f.set(h.id,h)}),r.forEach((h,C)=>{d[`h${C}`]&&f.set(h,d[`h${C}`])}),e.forEach(h=>l(h,C=>{f.has(h)?(t===st&&tt(f.get(h)),C.resolve(f.get(h))):(t===st&&W.delete(h),C.reject(new L(`Product not found: ${h}`,{code:"NOT_FOUND"})))}))}catch(d){e.forEach(f=>l(f,h=>{t===st&&W.delete(f),h.reject(d)}))}}function Vt(){W.clear(),st++}async function ht({collection:t,query:e,first:n=c.collectionFirst,after:r=null,sortKey:o,reverse:i=!1,filters:s}={}){let a=pt();if(t){let d=await O(`query TetherCollection($handle: String!, $first: Int!, $after: String, $sortKey: ProductCollectionSortKeys, $reverse: Boolean, $filters: [ProductFilter!]) {
|
|
106
|
-
collection(handle: $handle) {
|
|
107
|
-
${ee()}
|
|
108
|
-
products(first: $first, after: $after, sortKey: $sortKey, reverse: $reverse, filters: $filters) {
|
|
109
|
-
nodes { ...TetherProduct }
|
|
110
|
-
pageInfo { hasNextPage endCursor }
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
${a}`,{handle:t,first:n,after:r,sortKey:o||void 0,reverse:i,filters:s||void 0});if(!d.collection)throw new L(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:f,...h}=d.collection;return f.nodes.forEach(tt),{collection:h,products:f.nodes,pageInfo:f.pageInfo}}let l=await O(`query TetherSearch($first: Int!, $after: String, $query: String, $sortKey: ProductSortKeys, $reverse: Boolean) {
|
|
115
|
-
products(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {
|
|
116
|
-
nodes { ...TetherProduct }
|
|
117
|
-
pageInfo { hasNextPage endCursor }
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
${a}`,{first:n,after:r,query:e||void 0,sortKey:o||void 0,reverse:i});return l.products.nodes.forEach(tt),{collection:null,products:l.products.nodes,pageInfo:l.products.pageInfo}}async function ft(t,e="RELATED"){let r=(await O(`query TetherRecs($id: ID!, $intent: ProductRecommendationIntent) {
|
|
121
|
-
productRecommendations(productId: $id, intent: $intent) { ...TetherProduct }
|
|
122
|
-
}
|
|
123
|
-
${pt()}`,{id:t,intent:e})).productRecommendations||[];return r.forEach(tt),r}var jt={};Le(jt,{GID:()=>R,allPlans:()=>F,allocationFor:()=>U,findPlan:()=>ct,hasPlans:()=>Fe,planAdjustment:()=>Rt,planCheckoutCharge:()=>Mt,planPrice:()=>at,planSavings:()=>gt,plansForVariant:()=>Ue,toGid:()=>mt});var R={product:t=>mt(t,"Product"),variant:t=>mt(t,"ProductVariant"),sellingPlan:t=>mt(t,"SellingPlan")};function mt(t,e){let n=String(t!=null?t:"").trim();return n?n.startsWith("gid://")?n:/^\d+$/.test(n)?`gid://shopify/${e}/${n}`:n:null}function F(t){var n;return(((n=t==null?void 0:t.sellingPlanGroups)==null?void 0:n.nodes)||[]).flatMap(r=>{var o;return(((o=r.sellingPlans)==null?void 0:o.nodes)||[]).map(i=>({...i,group:r}))})}function Fe(t){return F(t).length>0}function U(t,e){var n;return!t||!e?null:(((n=t.sellingPlanAllocations)==null?void 0:n.nodes)||[]).find(r=>{var o;return((o=r.sellingPlan)==null?void 0:o.id)===e})||null}function Ue(t,e){return F(t).filter(n=>U(e,n.id))}function at(t,e){var o;let n=U(t,e),r=(o=n==null?void 0:n.priceAdjustments)==null?void 0:o[0];return(r==null?void 0:r.perDeliveryPrice)||(r==null?void 0:r.price)||(t==null?void 0:t.price)||null}function Mt(t,e){var r,o;let n=U(t,e);return(n==null?void 0:n.checkoutChargeAmount)||((o=(r=n==null?void 0:n.priceAdjustments)==null?void 0:r[0])==null?void 0:o.price)||(t==null?void 0:t.price)||null}function gt(t,e){var o,i;let n=parseFloat((o=t==null?void 0:t.price)==null?void 0:o.amount),r=parseFloat((i=at(t,e))==null?void 0:i.amount);return!Number.isFinite(n)||!Number.isFinite(r)||n<=0||r>=n?{amount:null,percentage:0}:{amount:{amount:(n-r).toFixed(2),currencyCode:t.price.currencyCode},percentage:Math.round((1-r/n)*100)}}function Rt(t){var n,r;let e=(r=(n=t==null?void 0:t.priceAdjustments)==null?void 0:n[0])==null?void 0:r.adjustmentValue;if(!e)return null;switch(e.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:e.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"amount",value:e.adjustmentAmount};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:e.price};default:return null}}function ct(t,e){if(!e)return null;let n=F(t),r=R.sellingPlan(e),o=String(e).trim().toLowerCase();return n.find(i=>i.id===r)||n.find(i=>i.name.toLowerCase()===o)||n.find(i=>(i.options||[]).some(s=>String(s.value).toLowerCase()===o))||null}var y=t=>`${c.prefix}-${t}`,u=(t,e)=>e===void 0?`[${y(t)}]`:`[${y(t)}="${e}"]`,m=(t,e)=>t.getAttribute(y(e)),J=(t,e)=>t.hasAttribute(y(e)),Ve=()=>`data-${c.prefix}-key`;function bt(t,e){let n=c.productPath||"/product";if(!/\{(handle|id)\}/.test(n))return`${n.replace(/\/$/,"")}/${t}`;let r=e?String(e).split("/").pop():"";return n.replace(/\{handle\}/g,encodeURIComponent(t||"")).replace(/\{id\}/g,encodeURIComponent(r))}var w=(t,e)=>t?[...t.querySelectorAll(e)]:[],X=(t,e,n)=>w(t,e).filter(r=>r.closest(n)===t);function S(t,e,n=document){n.dispatchEvent(new CustomEvent(`${c.prefix}:${t}`,{detail:e,bubbles:!0}))}function I(t){if(!t)return"";if(typeof c.formatMoney=="function")return c.formatMoney(t,c.locale);let e=parseFloat(t.amount);if(Number.isNaN(e))return"";try{return new Intl.NumberFormat(c.locale||void 0,{style:"currency",currency:t.currencyCode}).format(e)}catch{return`${t.currencyCode} ${e.toFixed(2)}`}}function ie(t){if(!t)return"";try{return new Date(t).toLocaleDateString(c.locale||void 0)}catch{return""}}function Me(t,e){if(!t||!e)return t;let n=e.getAttribute("max-width"),r=e.getAttribute("max-height"),o=e.getAttribute("crop");if(!n&&!r)return t;try{let i=new URL(t);return n&&i.searchParams.set("width",n),r&&i.searchParams.set("height",r),o&&i.searchParams.set("crop",o),i.toString()}catch{return t}}function V(t,e,n){if(!e)return;let r=Me(e,t);t.tagName==="IMG"?(t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.setAttribute("src",r),n!=null&&t.setAttribute("alt",n),t.getAttribute("loading")||t.setAttribute("loading","lazy")):t.style.backgroundImage=`url("${r}")`}function g(t,e){let n=e==null?"":String(e);t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value=n:t.textContent=n}var re=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value:t.textContent;function et(t,e){let n=re(t);g(t,e);let r=re(t);if(n!==r&&t.dataset.tetherSeen&&typeof c.onValueChange=="function")try{c.onValueChange(t,n)}catch{}t.dataset.tetherSeen="1"}function j(t,e){let n="tetherPrevDisplay";e?t.dataset[n]!==void 0?(t.style.display=t.dataset[n],delete t.dataset[n]):t.style.display==="none"&&(t.style.display=""):(t.dataset[n]===void 0&&(t.dataset[n]=t.style.display||""),t.style.display="none")}function vt(t,e){var r;t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),t.tagName==="INPUT"&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let n=(r=t.querySelector)==null?void 0:r.call(t,'input[type="radio"],input[type="checkbox"]');n&&(n.checked=e)}var yt=new WeakMap,se=t=>!!yt.get(t);function ae(t){var e,n;if(!yt.has(t)){let r=(n=(e=t.firstElementChild)==null?void 0:e.cloneNode(!0))!=null?n:null;yt.set(t,r),t.innerHTML=""}return yt.get(t)}function K(t,e,n){let r=ae(t);if(!r){M("repeater without a template child",t);return}t.innerHTML="",e.forEach((o,i)=>{let s=r.cloneNode(!0);n(s,o,i),t.appendChild(s)})}function ce(t,e,n,r,{onEnter:o,onLeave:i}={}){let s=ae(t);if(!s){M("repeater without a template child",t);return}let a=Ve(),l=`data-${c.prefix}-leaving`,d=()=>[...t.children].filter(b=>b.hasAttribute(a)&&!b.hasAttribute(l)),f=new Map(d().map(b=>[b.getAttribute(a),b])),h=[],C=new Set;e.forEach((b,p)=>{let P=String(n(b,p)),v=f.get(P);v?f.delete(P):(v=s.cloneNode(!0),v.setAttribute(a,P),C.add(v)),r(v,b,p,C.has(v)),h.push(v)});let $=h.filter(b=>!C.has(b)),q=d().filter(b=>$.includes(b));if(!(q.length===$.length&&q.every((b,p)=>b===$[p]))){f.forEach(b=>b.remove()),h.forEach(b=>t.appendChild(b));return}h.forEach((b,p)=>{if(!C.has(b))return;let P=h[p-1];if(P&&P.parentNode===t?P.after(b):t.prepend(b),o)try{o(b)}catch{}}),f.forEach(b=>{b.setAttribute(l,""),b.removeAttribute(a),b.style.pointerEvents="none",b.inert=!0;let p=()=>b.remove();if(i)try{i(b,p)}catch{p()}else p()})}var oe=null;function z(t){clearTimeout(oe),oe=setTimeout(()=>{var e;typeof c.onLayoutChange=="function"?c.onLayoutChange(t):(e=window.ScrollTrigger)!=null&&e.refresh&&window.ScrollTrigger.refresh(),S("layout-changed",{reason:t})},120)}function ue(t,e){let n=w(t,"img").filter(i=>!i.complete);if(!n.length)return;let r=n.length,o=()=>{--r===0&&z(`${e}:images`)};n.forEach(i=>{i.addEventListener("load",o,{once:!0}),i.addEventListener("error",o,{once:!0})})}function H(t,e){return t.getAttribute("aria-busy")==="true"?Promise.resolve():(t.setAttribute("aria-busy","true"),Promise.resolve().then(e).finally(()=>t.removeAttribute("aria-busy")))}function $t(t,e){let n=t&&m(t,e);if(!n)return null;try{return JSON.parse(n)}catch{return M(`invalid JSON in ${y(e)}`,t),null}}function Q(t){return t?Array.isArray(t)?t.map(e=>{var n;return{key:String(e.key),value:String((n=e.value)!=null?n:"")}}):Object.entries(t).map(([e,n])=>({key:e,value:String(n!=null?n:"")})):[]}function Re(t,e=1,n={}){var l;let r=typeof t=="object"&&t!==null?t:{variantId:t,quantity:e,...n},o=R.variant(r.merchandiseId||r.variantId||r.id);if(!o)throw new L("add(): variantId is required");let i={merchandiseId:o,quantity:Math.max(1,parseInt((l=r.quantity)!=null?l:1,10)||1)},s=r.sellingPlanId||r.sellingPlan;s&&(i.sellingPlanId=R.sellingPlan(s));let a=Q(r.attributes);return a.length&&(i.attributes=a),i}function le(t,e,n){return`mutation Tether_${t}(${e}) {
|
|
124
|
-
${t}(${n}) { cart { ...TetherCart } userErrors { field message } }
|
|
125
|
-
}
|
|
126
|
-
${Ot()}`}var Bt=t=>/does not exist|not found|invalid id/i.test((t==null?void 0:t.message)||""),A={state:null,_chain:Promise.resolve(),id(){try{return localStorage.getItem(c.storageKey)}catch{return null}},_setId(t){try{t?localStorage.setItem(c.storageKey,t):localStorage.removeItem(c.storageKey)}catch{}},get lines(){var t,e;return((e=(t=this.state)==null?void 0:t.lines)==null?void 0:e.nodes)||[]},get count(){var t;return((t=this.state)==null?void 0:t.totalQuantity)||0},lastError:null,_queue(t){let e=this._chain.then(t,t).then(n=>(this.lastError&&(this.lastError=null,this.render()),n),n=>{throw this.lastError=n,this.render(),S("cart-error",{error:n}),n});return this._chain=e.catch(()=>{}),e},_commit(t,e){return this.state=t,t!=null&&t.id&&this._setId(t.id),this.render(),S("cart-updated",{cart:t,reason:e}),t},async init(){let t=this.id();if(!t)return this.state=null,this.render(),null;try{let e=await O(`query TetherCart($id: ID!) { cart(id: $id) { ...TetherCart } }
|
|
127
|
-
${Ot()}`,{id:t});e.cart?this.state=e.cart:(this._setId(null),this.state=null)}catch(e){k(e,"cart load failed"),this.lastError=e,Bt(e)&&this._setId(null),this.state=null}return this.render(),this.state},async _create(t={}){let e=c.country?{countryCode:String(c.country).toUpperCase()}:void 0,n=await O(le("cartCreate","$input: CartInput!","input: $input"),{input:{buyerIdentity:e,...t}});return Nt(n.cartCreate,"cartCreate").cart},async _mutate(t,e,n,r,o){let i=this.id();if(!i)return o?this._create(o):null;try{let s=await O(le(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${n}`),{...r,cartId:i});return Nt(s[t],t).cart}catch(s){if(o&&Bt(s))return D("cart expired, creating a new one"),this._setId(null),this._create(o);throw s}},add(t,e=1,n={}){let r=(Array.isArray(t)?t:[t]).map(o=>Re(o,e,n));return this._queue(async()=>{let o=await this._mutate("cartLinesAdd","$lines: [CartLineInput!]!","lines: $lines",{lines:r},{lines:r});return this._commit(o,"add"),S("added",{cart:o,lines:r}),c.openCartOnAdd&&this.open(),o})},updateLine(t,e){let n=typeof e=="number"?{quantity:e}:{...e};if(n.quantity!==void 0&&n.quantity<=0)return this.removeLine(t);let r={id:t};return n.quantity!==void 0&&(r.quantity=n.quantity),"sellingPlanId"in n&&(r.sellingPlanId=n.sellingPlanId?R.sellingPlan(n.sellingPlanId):null),n.attributes&&(r.attributes=Q(n.attributes)),(n.merchandiseId||n.variantId)&&(r.merchandiseId=R.variant(n.merchandiseId||n.variantId)),this._queue(async()=>this._commit(await this._mutate("cartLinesUpdate","$lines: [CartLineUpdateInput!]!","lines: $lines",{lines:[r]}),"update"))},removeLine(t){let e=Array.isArray(t)?t:[t];return this._queue(async()=>this._commit(await this._mutate("cartLinesRemove","$lineIds: [ID!]!","lineIds: $lineIds",{lineIds:e}),"remove"))},clear(){let t=this.lines.map(e=>e.id);return t.length?this.removeLine(t):Promise.resolve(this.state)},setNote(t){return this._queue(async()=>this._commit(await this._mutate("cartNoteUpdate","$note: String!","note: $note",{note:t!=null?t:""},{note:t!=null?t:""}),"note"))},setAttributes(t){var r;let e=new Map((((r=this.state)==null?void 0:r.attributes)||[]).map(o=>[o.key,o.value]));Q(t).forEach(o=>e.set(o.key,o.value));let n=[...e].filter(([,o])=>o!=="").map(([o,i])=>({key:o,value:i}));return this._queue(async()=>this._commit(await this._mutate("cartAttributesUpdate","$attributes: [AttributeInput!]!","attributes: $attributes",{attributes:n},{attributes:n}),"attributes"))},setDiscountCodes(t){let e=(Array.isArray(t)?t:[t]).map(n=>String(n).trim()).filter(Boolean);return this._queue(async()=>this._commit(await this._mutate("cartDiscountCodesUpdate","$discountCodes: [String!]!","discountCodes: $discountCodes",{discountCodes:e},{discountCodes:e}),"discount"))},applyDiscount(t){var n;let e=(((n=this.state)==null?void 0:n.discountCodes)||[]).map(r=>r.code);return this.setDiscountCodes([...new Set([...e,t])])},removeDiscount(t){var e;return this.setDiscountCodes((((e=this.state)==null?void 0:e.discountCodes)||[]).map(n=>n.code).filter(n=>n!==t))},setBuyerIdentity(t,{create:e=!0}={}){return this._queue(async()=>{let n=await this._mutate("cartBuyerIdentityUpdate","$buyerIdentity: CartBuyerIdentityInput!","buyerIdentity: $buyerIdentity",{buyerIdentity:t},e?{buyerIdentity:t}:null).catch(r=>{if(e||!Bt(r))throw r;return this._setId(null),null});return this._commit(n,"buyer-identity")})},async checkout(t=c.checkoutTarget){var r;let e=this.id();if(!e)return null;let n=t==="_blank"?window.open("","_blank"):null;if(n)try{n.opener=null}catch{}try{let i=(r=(await O("query TetherCheckout($id: ID!) { cart(id: $id) { checkoutUrl } }",{id:e})).cart)==null?void 0:r.checkoutUrl;if(!i)throw new L("No checkoutUrl (cart empty or expired)");return S("checkout",{url:i,cart:this.state}),n&&!n.closed?n.location.href=i:window.location.href=i,i}catch(o){return n&&n.close(),k(o,"checkout failed"),null}},drawers(){return w(document,u("cart-drawer"))},isOpen(){return this.drawers().some(t=>t.classList.contains(c.cartDrawerOpenClass))},open(){if(this.isOpen())return;let t=this.drawers().filter(e=>m(e,"cart-drawer")!=="manual");t.forEach(e=>{e.classList.add(c.cartDrawerOpenClass),e.setAttribute("aria-hidden","false")}),typeof c.onCartOpen=="function"&&c.onCartOpen(t),S("cart-toggled",{open:!0})},close(){if(!this.isOpen())return;let t=this.drawers();t.forEach(e=>{e.classList.remove(c.cartDrawerOpenClass),e.setAttribute("aria-hidden","true")}),typeof c.onCartClose=="function"&&c.onCartClose(t),S("cart-toggled",{open:!1})},toggle(){this.isOpen()?this.close():this.open()},render(){let t=this.state,e=t?t.totalQuantity:0,n=i=>{var s;return t?I((s=t.cost)==null?void 0:s[i]):""};w(document,u("cart-count")).forEach(i=>et(i,e)),w(document,u("cart-subtotal")).forEach(i=>et(i,n("subtotalAmount"))),w(document,u("cart-total")).forEach(i=>et(i,n("totalAmount"))),w(document,u("cart-checkout-charge")).forEach(i=>et(i,n("checkoutChargeAmount")));let r=this.lines.some(i=>i.sellingPlanAllocation),o={"cart-empty":e===0,"cart-filled":e>0,"cart-has-subscription":r,"cart-no-subscription":!r,"cart-has-discount":((t==null?void 0:t.discountCodes)||[]).some(i=>i.applicable),"cart-error":!!this.lastError};w(document,u("show")).forEach(i=>{let s=m(i,"show");s in o&&!i.closest(u("product"))&&j(i,o[s])}),w(document,`textarea${u("cart-note")},input${u("cart-note")}`).forEach(i=>{document.activeElement!==i&&(i.value=(t==null?void 0:t.note)||"")}),w(document,u("cart-discounts")).forEach(i=>{K(i,(t==null?void 0:t.discountCodes)||[],(s,a)=>{s.setAttribute(y("discount-code"),a.code);let l=s.querySelector(u("discount","code"))||(s.firstElementChild?null:s);l&&g(l,a.code),s.classList.toggle("is-inapplicable",!a.applicable)})}),w(document,u("cart-lines")).forEach(i=>{ce(i,this.lines,s=>s.id,(s,a)=>Be(s,a),{onEnter:c.onLineEnter,onLeave:c.onLineLeave})}),t&&z("cart")}};function je(t,e){var o,i,s,a,l,d,f,h,C;let n=t.merchandise||{},r=(o=t.sellingPlanAllocation)==null?void 0:o.sellingPlan;switch(e){case"title":return(i=n.product)==null?void 0:i.title;case"product-title":return(s=n.product)==null?void 0:s.title;case"variant-title":return n.title==="Default Title"?"":n.title;case"options":return(n.selectedOptions||[]).filter($=>$.value!=="Default Title").map($=>`${$.name}: ${$.value}`).join(", ");case"vendor":return(a=n.product)==null?void 0:a.vendor;case"sku":return n.sku;case"price":return I(((l=t.cost)==null?void 0:l.amountPerQuantity)||n.price);case"compare-at-price":return I(((d=t.cost)==null?void 0:d.compareAtAmountPerQuantity)||n.compareAtPrice);case"line-total":return I((f=t.cost)==null?void 0:f.totalAmount);case"line-subtotal":return I((h=t.cost)==null?void 0:h.subtotalAmount);case"quantity":return t.quantity;case"plan":return(r==null?void 0:r.name)||"";case"plan-description":return(r==null?void 0:r.description)||"";case"components":return(t.lineComponents||[]).map($=>{var q,T;return`${$.quantity} \xD7 ${((T=(q=$.merchandise)==null?void 0:q.product)==null?void 0:T.title)||""}`}).join(", ");default:if(e.startsWith("attribute:")){let $=e.slice(10);return((C=(t.attributes||[]).find(q=>q.key===$))==null?void 0:C.value)||""}return}}function Be(t,e){var i,s,a,l;let n=e.merchandise||{},r=!!e.sellingPlanAllocation;t.setAttribute(y("line-id"),e.id),t.classList.toggle("is-subscription",r),w(t,u("line")).forEach(d=>{var C,$,q,T,b,p;let f=m(d,"line");if(f==="image")return V(d,((C=n.image)==null?void 0:C.url)||((q=($=n.product)==null?void 0:$.featuredImage)==null?void 0:q.url),(T=n.product)==null?void 0:T.title);if(f==="url")return d.setAttribute("href",bt((b=n.product)==null?void 0:b.handle,(p=n.product)==null?void 0:p.id));let h=je(e,f);h!==void 0&&et(d,h)});let o={subscription:r,"one-time":!r,"on-sale":parseFloat((s=(i=e.cost)==null?void 0:i.compareAtAmountPerQuantity)==null?void 0:s.amount)>parseFloat((l=(a=e.cost)==null?void 0:a.amountPerQuantity)==null?void 0:l.amount),"has-components":(e.lineComponents||[]).length>0};w(t,u("line-show")).forEach(d=>{let f=m(d,"line-show");f in o&&j(d,o[f])}),w(t,`select${u("line-plan")}`).forEach(d=>{var h;let f=(h=n.product)==null?void 0:h.handle;f&&B(f).then(C=>{var p,P;let $=F(C),T=[...!C.requiresSellingPlan&&m(d,"line-plan")!=="subscription-only"?[{value:"",label:d.getAttribute(y("one-time-label"))||"One-time purchase"}]:[],...$.map(v=>({value:v.id,label:v.name}))],b=T.map(v=>v.value).join("|");d.dataset.tetherSig!==b&&(d.innerHTML="",T.forEach(v=>{let N=document.createElement("option");N.value=v.value,N.textContent=v.label,d.appendChild(N)}),d.dataset.tetherSig=b),d.value=((P=(p=e.sellingPlanAllocation)==null?void 0:p.sellingPlan)==null?void 0:P.id)||"",j(d,$.length>0)}).catch(C=>k(C,"line plan options"))})}function nt(t,e=window.location){let n=(m(t,"product")||"").trim();if(!n.toLowerCase().startsWith("url:"))return{key:n||null,fromUrl:!1,raw:n};let r=n.slice(4).trim(),o=null;if(r.toLowerCase()==="path"){let i=e.pathname.split("/").filter(Boolean);o=i.length?Ke(i[i.length-1]):null}else o=new URLSearchParams(e.search).get(r||"handle");return o=o&&o.trim()?o.trim():null,{key:o,fromUrl:!0,raw:n}}function Ke(t){try{return decodeURIComponent(t)}catch{return t}}var Kt=["loading","ready","error","not-found"],wt=t=>(t==null?void 0:t.code)==="NOT_FOUND",ut=()=>["product","collection","products","recommendations"].map(t=>u(t)).join(","),de=(t,e)=>{var n;return t===e||((n=t.parentElement)==null?void 0:n.closest(ut()))===e};function Y(t,e,n){let r=e==="not-found";t.setAttribute(y("state"),r?"error":e),e==="error"||r?t.setAttribute(y("error"),r?"not-found":(n==null?void 0:n.code)||"error"):t.removeAttribute(y("error")),X(t,u("show"),ut()).forEach(o=>{let i=m(o,"show");if(!Kt.includes(i))return;let s=i===e;j(o,s),s&&typeof getComputedStyle=="function"&&getComputedStyle(o).display==="none"&&(o.style.display=o.getAttribute(y("display"))||"block")}),(e==="error"||r)&&X(t,u("add-to-cart"),ut()).forEach(o=>{o.classList.add("is-disabled"),"disabled"in o&&(o.disabled=!0)})}var rt=new WeakMap,pe=()=>u("product");function He(t,e){let n=e.indexOf("."),r=e.slice(0,n),o=e.slice(n+1);return(t.metafields||[]).find(s=>s&&s.namespace===r&&s.key===o)||null}var Pt=class{constructor(e,n){var r;this.root=e,this.product=n,this.selected={},this.variant=null,this.quantity=Math.max(0,parseInt((r=m(e,"quantity"))!=null?r:"1",10)||(J(e,"quantity")?0:1)),this.plans=F(n),this.purchase="one-time",this.planId=null,rt.set(e,this),e.setAttribute(y("state"),"ready"),e.removeAttribute(y("error")),this.initSelection(),this.initPurchase(),this.renderProduct(),this.bind(),this.renderVariant(),ue(e,"product"),z("product"),S("product-ready",{product:n,scope:this},e)}update(e){var o,i;let n=(o=this.variant)==null?void 0:o.id;this.product=e,this.plans=F(e),this.planId&&!this.plans.some(s=>s.id===this.planId)&&(this.planId=((i=this.plans[0])==null?void 0:i.id)||null),!this.plans.length&&this.purchase==="subscription"&&(this.purchase="one-time");let r=e.variants.nodes.find(s=>s.id===n);r&&(this.selected={},r.selectedOptions.forEach(s=>{this.selected[s.name]=s.value})),this.root.setAttribute(y("state"),"ready"),this.root.removeAttribute(y("error")),this.renderProduct(),this.renderVariant(),z("product"),S("product-updated",{product:e,scope:this},this.root)}$(e){let n=X(this.root,e,pe());return this.root.matches(e)?[this.root,...n]:n}initSelection(){let e=this.product.variants.nodes,n=e.find(o=>o.availableForSale)||e[0];n&&n.selectedOptions.forEach(o=>{this.selected[o.name]=o.value});let r=new URLSearchParams(window.location.search).get("variant")||m(this.root,"variant");if(r){let o=R.variant(r),i=e.find(s=>s.id===o);i&&(this.selected={},i.selectedOptions.forEach(s=>{this.selected[s.name]=s.value}))}}initPurchase(){if(!this.plans.length)return;let e=new URLSearchParams(window.location.search),n=ct(this.product,e.get("selling_plan")),r=ct(this.product,m(this.root,"default-plan"));this.planId=(n||r||this.plans[0]).id;let o=n?"subscription":m(this.root,"default-purchase")||c.defaultPurchase;this.purchase=this.product.requiresSellingPlan||o==="subscription"?"subscription":"one-time"}findVariant(){return this.product.variants.nodes.find(e=>e.selectedOptions.every(n=>this.selected[n.name]===n.value))||null}isValueAvailable(e,n){return this.product.variants.nodes.some(r=>r.availableForSale&&r.selectedOptions.every(o=>o.name===e?o.value===n:this.selected[o.name]===o.value))}get plan(){return this.plans.find(e=>e.id===this.planId)||null}get subscriptionAvailable(){return!!(this.variant&&this.plans.some(e=>U(this.variant,e.id)))}get isSubscription(){return this.purchase==="subscription"&&!!U(this.variant,this.planId)}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity};this.isSubscription&&(e.sellingPlanId=this.planId);let n=this.collectAttributes();return n.length&&(e.attributes=n),e}collectAttributes(){let e=Q($t(this.root,"line-attributes")),n=this.$(u("line-attribute")).map(r=>{let o=m(r,"line-attribute"),i;return r.type==="checkbox"?i=r.checked?r.value&&r.value!=="on"?r.value:"Yes":"":r.type==="radio"?i=r.checked?r.value:null:i=r.value,i==null||i===""?null:{key:o,value:String(i)}}).filter(Boolean);return[...e,...n]}select(e,n){this.selected[e]!==n&&(this.selected[e]=n,this.renderVariant())}selectVariant(e){let n=this.product.variants.nodes.find(r=>r.id===R.variant(e));n&&(this.selected={},n.selectedOptions.forEach(r=>{this.selected[r.name]=r.value}),this.renderVariant())}setPurchase(e){let n=e==="subscription"?"subscription":"one-time";n==="one-time"&&this.product.requiresSellingPlan||this.purchase!==n&&(this.purchase=n,this.renderVariant())}selectPlan(e){let n=ct(this.product,e);n&&(this.planId=n.id,this.purchase="subscription",this.renderVariant())}setQuantity(e){let n=J(this.root,"quantity")?0:1;this.quantity=Math.max(n,parseInt(e,10)||0),this.$(u("qty")).forEach(r=>g(r,this.quantity)),this.renderVariant()}async addToCart(){var r;if(!((r=this.variant)!=null&&r.availableForSale))return null;let e=this.getLine();if(!e||e.quantity<1)return null;let n=await A.add(e);return S("product-added",{product:this.product,variant:this.variant,line:e},this.root),n}bind(){let e=n=>n&&n.closest(pe())===this.root;this.root.addEventListener("click",n=>{let r=n.target;if(!(r!=null&&r.closest))return;let o=r.closest(u("option-value"));if(e(o)&&o.closest(u("option-list"))){n.preventDefault(),this.select(m(o.closest(u("option-list")),"option-list"),m(o,"option-value"));return}let i=r.closest(u("plan-value"));if(e(i)){n.preventDefault(),this.selectPlan(m(i,"plan-value"));return}let s=r.closest(`${u("purchase")}:not(select)`);if(e(s)){s.tagName!=="INPUT"&&n.preventDefault(),this.setPurchase(m(s,"purchase"));return}let a=r.closest(u("qty-plus"));if(e(a)){n.preventDefault(),this.setQuantity(this.quantity+1);return}let l=r.closest(u("qty-minus"));if(e(l)){n.preventDefault(),this.setQuantity(this.quantity-1);return}let d=r.closest(u("add-to-cart"));e(d)&&(n.preventDefault(),this.onAddClick(d))}),this.root.addEventListener("change",n=>{let r=n.target;e(r)&&(r.matches(`select${u("option")}`)?this.select(m(r,"option"),r.value):r.matches(`select${u("variant-select")}`)?this.selectVariant(r.value):r.matches(`select${u("plan")}`)?r.value?this.selectPlan(r.value):this.setPurchase("one-time"):r.matches(`select${u("purchase")}`)?this.setPurchase(r.value):r.matches(u("qty"))&&this.setQuantity(r.value))})}onAddClick(e){let n=e.querySelector(u("add-label"))||e,r=m(e,"adding-text"),o=i=>g(n,i);n.dataset.tetherLabel===void 0&&(n.dataset.tetherLabel=n.tagName==="INPUT"?n.value:n.textContent),H(e,async()=>{r&&o(r);try{await this.addToCart()}catch(i){k(i,"add to cart failed"),S("error",{error:i,context:"add-to-cart"},this.root)}finally{r&&o(n.dataset.tetherLabel)}}).then(()=>{this.renderVariant()})}renderProduct(){let e=this.product;this.$(u("bind")).forEach(n=>{var o,i,s;let r=m(n,"bind");switch(r){case"title":return g(n,e.title);case"description":n.innerHTML=e.descriptionHtml||"";return;case"description-text":return g(n,e.description);case"vendor":return g(n,e.vendor);case"type":return g(n,e.productType);case"handle":return g(n,e.handle);case"published-at":return g(n,ie(e.publishedAt));case"min-price":return g(n,I(e.priceRange.minVariantPrice));case"max-price":return g(n,I(e.priceRange.maxVariantPrice));case"featured-image":return V(n,(o=e.featuredImage)==null?void 0:o.url,((i=e.featuredImage)==null?void 0:i.altText)||e.title);case"url":case"link":n.setAttribute("href",bt(e.handle,e.id)),r==="url"&&!n.firstElementChild&&!n.textContent.trim()&&g(n,e.title);return;case"images":return K(n,e.images.nodes,(a,l)=>{let d=a.matches(`img,${u("bind","image")}`)?a:a.querySelector("img")||a;V(d,l.url,l.altText||e.title)});case"tags":{let a=(n.getAttribute("exclude")||"").split(",").map(l=>l.trim()).filter(Boolean);return K(n,e.tags.filter(l=>!a.includes(l)),(l,d)=>g(l,d))}default:if(r&&/^image:\d+$/.test(r)){let a=e.images.nodes[parseInt(r.slice(6),10)-1]||e.featuredImage;return V(n,a==null?void 0:a.url,(a==null?void 0:a.altText)||e.title)}if(r&&r.startsWith("metafield:")){let a=He(e,r.slice(10));if(!a)return g(n,"");if((s=a.reference)!=null&&s.image)return V(n,a.reference.image.url,a.reference.image.altText);if(a.type==="rich_text_field"||a.type==="multi_line_text_field"){n.textContent=a.value,n.style.whiteSpace="pre-line";return}return g(n,a.value)}return}}),this.$(u("option-list")).forEach(n=>{let r=m(n,"option-list"),o=e.options.find(i=>i.name===r);return!o||o.optionValues.length<=1&&J(n,"hide-single")?j(n,!1):K(n,o.optionValues,(i,s)=>{var d,f,h;i.setAttribute(y("option-value"),s.name);let a=i.querySelector(u("bind","option-value"));a?g(a,s.name):i.firstElementChild||g(i,s.name);let l=i.querySelector(u("bind","swatch"));l&&((d=s.swatch)!=null&&d.color)&&(l.style.backgroundColor=s.swatch.color),l&&((h=(f=s.swatch)==null?void 0:f.image)!=null&&h.previewImage)&&V(l,s.swatch.image.previewImage.url,s.name)})}),this.$(`select${u("option")}`).forEach(n=>{let r=e.options.find(o=>o.name===m(n,"option"));if(!r)return j(n,!1);n.innerHTML="",r.optionValues.forEach(o=>n.appendChild(new Option(o.name,o.name)))}),this.$(`select${u("variant-select")}`).forEach(n=>{n.innerHTML="",e.variants.nodes.forEach(r=>n.appendChild(new Option(r.title,r.id)))}),this.$(u("plan-list")).forEach(n=>{let r=(m(n,"plan-list")||"").trim(),o=["","true","all","*"].includes(r.toLowerCase())?null:r,i=this.plans.filter(s=>!o||s.group.name===o);K(n,i,(s,a)=>{s.setAttribute(y("plan-value"),a.id),!s.firstElementChild&&!s.querySelector(u("plan-bind"))&&g(s,a.name)})}),this.$(`select${u("plan")}`).forEach(n=>{n.innerHTML="",!e.requiresSellingPlan&&m(n,"plan")!=="subscription-only"&&n.appendChild(new Option(n.getAttribute(y("one-time-label"))||"One-time purchase","")),this.plans.forEach(r=>n.appendChild(new Option(r.name,r.id)))})}renderVariant(){var q,T,b;let e=this.product,n=this.findVariant();if(n||([n]=e.variants.nodes,n&&(this.selected={},n.selectedOptions.forEach(p=>{this.selected[p.name]=p.value}))),this.variant=n,!n)return;if(this.plans.length&&!U(n,this.planId)){let p=this.plans.find(P=>U(n,P.id));p&&(this.planId=p.id)}let r=this.isSubscription,o=n.price,i=this.planId?at(n,this.planId):null,s=r?i:o,a=r&&((b=(T=(q=U(n,this.planId))==null?void 0:q.priceAdjustments)==null?void 0:T[0])==null?void 0:b.compareAtPrice)||n.compareAtPrice,l=a&&parseFloat(a.amount)>parseFloat(s.amount),d=l?Math.round((1-parseFloat(s.amount)/parseFloat(a.amount))*100):0,f=this.planId?gt(n,this.planId):{amount:null,percentage:0},h=this.plan,C={amount:(parseFloat(s.amount)*Math.max(1,this.quantity)).toFixed(2),currencyCode:s.currencyCode};this.$(u("bind")).forEach(p=>{var P,v,N,x,_;switch(m(p,"bind")){case"price":return g(p,I(s));case"total-price":return g(p,I(C));case"one-time-price":return g(p,I(o));case"subscription-price":return g(p,I(i));case"subscription-savings":return g(p,f.percentage?`${f.percentage}%`:"");case"subscription-savings-amount":return g(p,I(f.amount));case"checkout-charge":return g(p,I(r?Mt(n,this.planId):s));case"plan-name":return g(p,(h==null?void 0:h.name)||"");case"plan-description":return g(p,(h==null?void 0:h.description)||"");case"plan-group":return g(p,((P=h==null?void 0:h.group)==null?void 0:P.name)||"");case"compare-at-price":return g(p,l?I(a):"");case"unit-price":return g(p,I(n.unitPrice));case"discount-percentage":return g(p,`${d}%`);case"discount-amount":return g(p,l?I({amount:String(parseFloat(a.amount)-parseFloat(s.amount)),currencyCode:s.currencyCode}):"");case"variant-title":return g(p,n.title);case"variant-id":return g(p,n.id);case"sku":return g(p,n.sku);case"barcode":return g(p,n.barcode);case"stock":return g(p,(v=n.quantityAvailable)!=null?v:"");case"quantity":return g(p,this.quantity);case"variant-image":return V(p,((N=n.image)==null?void 0:N.url)||((x=e.featuredImage)==null?void 0:x.url),((_=n.image)==null?void 0:_.altText)||e.title);default:return}}),this.$(u("option-selected")).forEach(p=>g(p,this.selected[m(p,"option-selected")]||"")),this.$(u("option-list")).forEach(p=>{let P=m(p,"option-list");w(p,u("option-value")).forEach(v=>{let N=m(v,"option-value");vt(v,this.selected[P]===N);let x=!this.isValueAvailable(P,N);v.classList.toggle("is-unavailable",x),v.setAttribute("data-unavailable",x?"true":"false")})}),this.$(`select${u("option")}`).forEach(p=>{p.value=this.selected[m(p,"option")]||""}),this.$(`select${u("variant-select")}`).forEach(p=>{p.value=n.id}),this.$(u("purchase")).forEach(p=>{if(p.tagName==="SELECT"){p.value=this.purchase;return}let P=m(p,"purchase");vt(p,P===this.purchase);let v=P==="subscription"?!this.subscriptionAvailable:e.requiresSellingPlan;p.classList.toggle("is-unavailable",v)}),this.$(u("plan-value")).forEach(p=>{let P=m(p,"plan-value"),v=this.plans.find(x=>x.id===P),N=!!U(n,P);vt(p,r&&P===this.planId),p.classList.toggle("is-unavailable",!N),w(p,u("plan-bind")).forEach(x=>{let _=Rt(v),It=gt(n,P);switch(m(x,"plan-bind")){case"name":return g(x,v==null?void 0:v.name);case"description":return g(x,(v==null?void 0:v.description)||"");case"price":return g(x,I(at(n,P)));case"savings":return g(x,It.percentage?`${It.percentage}%`:"");case"savings-amount":return g(x,I(It.amount));case"adjustment":return _?g(x,_.type==="percentage"?`${_.value}%`:I(_.value)):g(x,"");default:return}})}),this.$(`select${u("plan")}`).forEach(p=>{p.value=r?this.planId:""});let $={"in-stock":n.availableForSale,"out-of-stock":!n.availableForSale,backorder:n.availableForSale&&n.currentlyNotInStock,"on-sale":!!l,"not-on-sale":!l,"has-variants":e.variants.nodes.length>1,"single-variant":e.variants.nodes.length===1,"low-stock":n.quantityAvailable!=null&&n.quantityAvailable>0&&n.quantityAvailable<=5,"subscription-available":this.subscriptionAvailable,"subscription-unavailable":!this.subscriptionAvailable,"subscription-only":!!e.requiresSellingPlan,"one-time-available":!e.requiresSellingPlan,"subscription-selected":r,"one-time-selected":!r,"has-savings":r?f.percentage>0:!!l,loading:!1,ready:!0,error:!1,"not-found":!1};this.$(u("show")).forEach(p=>{let P=m(p,"show");P in $&&(Kt.includes(P)&&!de(p,this.root)||j(p,$[P]))}),this.root.classList.toggle("is-subscription",r),this.root.setAttribute(y("purchase-mode"),r?"subscription":"one-time"),this.$(u("add-to-cart")).forEach(p=>{let P=!n.availableForSale;p.classList.toggle("is-disabled",P),"disabled"in p&&(p.disabled=P);let v=m(p,"soldout-text"),N=m(p,"subscribe-text");if(v||N){let x=p.querySelector(u("add-label"))||p;x.dataset.tetherLabel===void 0&&(x.dataset.tetherLabel=x.tagName==="INPUT"?x.value:x.textContent);let _=x.dataset.tetherLabel;r&&N&&(_=N),P&&v&&(_=v),p.getAttribute("aria-busy")!=="true"&&g(x,_)}}),S("variant-changed",{product:e,variant:n,selected:{...this.selected},purchase:this.purchase,sellingPlanId:r?this.planId:null},this.root)}};var ot=()=>`${u("collection")},${u("products")},${u("recommendations")}`,Ct=class{constructor(e){this.root=e,this.products=[],this.pageInfo=null,this.collection=null,Y(e,"loading"),e.addEventListener("click",n=>{var o,i;let r=(i=(o=n.target).closest)==null?void 0:i.call(o,u("load-more"));r&&r.closest(ot())===e&&(n.preventDefault(),H(r,()=>this.load(!0)))})}$(e){return X(this.root,e,ot())}options(){let e=this.root,n={first:parseInt(m(e,"limit")||"",10)||void 0,sortKey:m(e,"sort")||void 0,reverse:m(e,"reverse")==="true"};return J(e,"collection")?n.collection=m(e,"collection"):n.query=m(e,"products")||"",n}async load(e=!1){var o;let n=this.loadToken=(this.loadToken||0)+1,r=()=>n!==this.loadToken;try{if(J(this.root,"recommendations")){let i=m(this.root,"recommendations"),s=await B(i),a=await ft(s.id,m(this.root,"intent")||"RELATED");if(r())return;let l=parseInt(m(this.root,"limit")||"",10);this.products=l?a.slice(0,l):a}else{let i=await ht({...this.options(),after:e?(o=this.pageInfo)==null?void 0:o.endCursor:null});if(r())return;this.collection=i.collection,this.pageInfo=i.pageInfo,this.products=e?[...this.products,...i.products]:i.products}this.render(),Y(this.root,"ready"),S("list-ready",{products:this.products,collection:this.collection},this.root)}catch(i){if(r())return;e||Y(this.root,wt(i)?"not-found":"error",i),k(i,"list load failed"),S("error",{error:i,context:"list"},this.root)}}render(){let e=this.collection;this.$(u("collection-bind")).forEach(r=>{var o,i;switch(m(r,"collection-bind")){case"title":return g(r,(e==null?void 0:e.title)||"");case"description":r.innerHTML=(e==null?void 0:e.descriptionHtml)||"";return;case"image":return V(r,(o=e==null?void 0:e.image)==null?void 0:o.url,((i=e==null?void 0:e.image)==null?void 0:i.altText)||(e==null?void 0:e.title));case"count":return g(r,this.products.length);default:return}}),this.$(u("list")).forEach(r=>{K(r,this.products,(o,i)=>{o.setAttribute(y("product"),i.handle),o.removeAttribute(y("state"))}),S("list-rendered",{container:r},this.root)});let n=this.products.length===0;this.$(u("show")).forEach(r=>{let o=m(r,"show");o==="list-empty"&&(r.style.display=n?"":"none"),o==="list-filled"&&(r.style.display=n?"none":"")}),this.$(u("load-more")).forEach(r=>{var o;r.style.display=(o=this.pageInfo)!=null&&o.hasNextPage?"":"none"}),z("list")}};var fe=t=>{let e=/^(\d{4})-(01|04|07|10)$/.exec(String(t||""));return e?{y:+e[1],m:+e[2]}:null},Ge=(t,e)=>`${t}-${String(e).padStart(2,"0")}`;function he(t,e=1){let n=fe(t);if(!n)throw new Error(`not a quarterly Shopify API version: ${t}`);let r=n.y*4+(n.m-1)/3+e;return Ge(Math.floor(r/4),r%4*3+1)}function me(t,e=new Date){if(t==="unstable")return{version:t,ok:!1,note:'"unstable" changes without notice: pin a dated version such as 2026-07'};let n=fe(t);if(!n)return{version:t,ok:!1,note:"not a quarterly version (YYYY-01, -04, -07 or -10)"};let r=new Date(Date.UTC(n.y,n.m-1,1)),o=new Date(Date.UTC(n.y+1,n.m-1,1)),i=(o-e)/(30.44*24*3600*1e3),s=`supported until about ${o.toISOString().slice(0,7)}`;return r>e?s="not released yet (release candidate at best)":i<=0?s="no longer supported: Shopify falls back to the oldest supported version. Upgrade (see README)":i<3&&(s=`${s}: plan the upgrade to ${he(t)} or later (see README)`),{version:t,ok:r<=e&&i>0,monthsLeft:Math.round(i),next:he(t),note:s}}var We=/^[A-Z]{2}$/,ze=new Set(["PT_BR","PT_PT","ZH_CN","ZH_TW"]),ge=()=>`${c.prefix}:market:${c.domain}`,Qe=()=>({document:typeof document!="undefined"?document:null,location:typeof window!="undefined"?window.location:null,storage:(()=>{try{return window.localStorage}catch{return null}})(),global:typeof window!="undefined"?window:{}});function Wt(t){let e=String(t||"").trim().toUpperCase();return We.test(e)&&e!=="XX"&&e!=="T1"?e:null}function zt(t){let e=String(t||"").trim().replace("-","_").toUpperCase();if(!e)return null;if(ze.has(e))return e;let n=e.split("_")[0];return/^[A-Z]{2,3}$/.test(n)?n:null}function Ye(t,e){if(!t||!e)return null;let n=String(t.cookie||"").split(";").map(r=>r.trim()).find(r=>r.startsWith(`${e}=`));return n?decodeURIComponent(n.slice(e.length+1)):null}var Ht=(t,e)=>{if(!t||!e)return null;let n=String(e).toLowerCase(),r=Object.keys(t).find(o=>o.toLowerCase()===n);return r?t[r]:null},Gt={saved(t,e){if(t.remember===!1||!e.storage)return null;try{return JSON.parse(e.storage.getItem(ge())||"null")}catch{return null}},server(t,e){let n=i=>{var s,a,l;return(l=(a=(s=e.document)==null?void 0:s.querySelector)==null?void 0:a.call(s,`meta[name="${i}"]`))==null?void 0:l.getAttribute("content")},r=e.global.TETHER_COUNTRY||n("tether-country")||Ye(e.document,t.cookie||"tether_country"),o=e.global.TETHER_LANGUAGE||n("tether-language");return{country:r,language:o}},webflow(t,e){var a,l,d;let n=(((a=e.location)==null?void 0:a.pathname)||"/").split("/").filter(Boolean)[0],r=Ht(t.locales,n);if(r)return r;let o=(d=(l=e.document)==null?void 0:l.documentElement)==null?void 0:d.getAttribute("lang");if(!o)return null;let i=Ht(t.locales,o)||Ht(t.locales,o.split("-")[0]);if(i)return{locale:o,...i};if(t.locales&&t.strict)return null;let s=o.split("-")[1];return{language:o,country:s&&s.length===2?s:null,locale:o}}};function dt(t=c.markets,e=Qe()){let n=t||{};if(n.detect===!1)return{};let r=n.detect?n.detect===!0?["saved","server","webflow"]:[].concat(n.detect):["saved"];t=n;let o={sources:{}};return r.forEach(i=>{var l;let s=(l=Gt[i])==null?void 0:l.call(Gt,t,e);if(!s)return;let a={country:Wt(s.country),language:zt(s.language),locale:s.locale||null};Object.entries(a).forEach(([d,f])=>{f&&!o[d]&&(o[d]=f,o.sources[d]=i)})}),o}function ye(t){var e;if(((e=c.markets)==null?void 0:e.remember)!==!1)try{localStorage.setItem(ge(),JSON.stringify({country:t.country,language:t.language||void 0}))}catch{}}var lt=null;function be(){lt=null}function Qt(){return lt||(lt=O(`query TetherLocalization {
|
|
128
|
-
localization {
|
|
129
|
-
country { isoCode name currency { isoCode symbol } }
|
|
130
|
-
language { isoCode name }
|
|
131
|
-
availableCountries { isoCode name currency { isoCode symbol } availableLanguages { isoCode name } }
|
|
132
|
-
}
|
|
133
|
-
}`).then(t=>t.localization).catch(t=>{throw lt=null,t})),lt}var Je=t=>t?`${String(t).slice(0,4)}\u2026${String(t).slice(-4)} (${String(t).length} chars)`:"(missing)";function Xe(t){let e=t.id?`#${t.id}`:"",n=t.className&&typeof t.className=="string"?`.${t.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return`<${t.tagName.toLowerCase()}${e}${n}>`}function Ze(t=document){let e=[],n=(a,l,d)=>e.push({level:a,message:l,element:d?Xe(d):void 0,el:d}),r=a=>!!a.closest(u("product")),o=`${u("collection")},${u("products")},${u("recommendations")}`;w(t,u("product")).forEach(a=>{if(a.closest(o)&&a.closest(u("list")))return;let{key:l,fromUrl:d,raw:f}=nt(a);f?d&&!l&&n("warn",`${y("product")}="${f}" but this URL has no value for it (e.g. ?handle=my-product).`,a):n("error",`${y("product")} has no value. Bind it to the Shopify handle (CMS field), or use "url:handle".`,a)}),["bind","option-list","option","variant-select","add-to-cart","purchase","plan-list","plan","qty","line-attribute"].forEach(a=>{w(t,u(a)).forEach(l=>{r(l)||a==="line-attribute"&&l.closest(u("group"))||n("warn",`${y(a)} outside any ${y("product")}: it does nothing here.`,l)})}),w(t,u("group-add")).forEach(a=>{a.closest(u("group"))||n("warn",`${y("group-add")} outside a ${y("group")}.`,a)}),[...w(t,u("option-list")),...w(t,u("plan-list")),...w(t,u("cart-lines")),...w(t,u("list"))].forEach(a=>{!a.firstElementChild&&!se(a)&&n("warn","Repeater without a template child: put one example element inside it.",a)}),w(t,o).forEach(a=>{w(a,u("list")).length||n("error",`List without a ${y("list")} child: products have nowhere to render.`,a)});let s=new Set(["in-stock","out-of-stock","backorder","low-stock","on-sale","not-on-sale","has-variants","single-variant","subscription-available","subscription-unavailable","subscription-only","one-time-available","subscription-selected","one-time-selected","has-savings","loading","ready","error","not-found","cart-empty","cart-filled","cart-has-subscription","cart-no-subscription","cart-has-discount","cart-error","list-empty","list-filled"]);return w(t,u("show")).forEach(a=>{let l=m(a,"show");s.has(l)||n("warn",`Unknown ${y("show")}="${l}".`,a)}),w(t,u("bind")).forEach(a=>{let l=m(a,"bind")||"";if(!l.startsWith("metafield:"))return;let d=l.slice(10);(c.metafields||[]).some(h=>(typeof h=="string"?h:`${h.namespace}.${h.key}`)===d)||n("error",`${y("bind")}="${l}" but "${d}" is not in config.metafields, so it stays empty.`,a)}),w(t,u("cart-open")).length&&!w(t,u("cart-drawer")).length&&n("warn",`${y("cart-open")} exists but there is no ${y("cart-drawer")} on this page.`),w(t,u("cart-drawer")).length>1&&n("warn",`More than one ${y("cart-drawer")}.`),w(t,`[${y("state")}="error"]`).forEach(a=>{a.matches(ut())&&n("error",`Scope failed to load (${m(a,"error")||"error"}).`,a)}),e}async function ve({root:t=document,silent:e=!1,version:n,now:r=new Date}={}){var i,s,a,l,d,f,h;let o={version:n,config:{domain:c.domain||"(missing)",token:Je(c.token),apiVersion:c.apiVersion,endpoint:c.domain?Lt():null,country:c.country,language:c.language,locale:c.locale,markets:c.markets||null,prefix:c.prefix,productPath:c.productPath,metafields:c.metafields,autoMount:c.autoMount,observe:c.observe,onError:typeof c.onError=="function"},apiVersion:me(c.apiVersion,r),market:(i=c.markets)!=null&&i.detect?dt(c.markets):null,reachable:!1,shop:null,latencyMs:null,products:[],sellingPlans:[],problems:[]};if(!it())o.problems.push({level:"error",message:"TETHER_CONFIG needs domain and token."});else{let C=Date.now();try{let $=await O("query TetherDiagnose { shop { name primaryDomain { url } paymentSettings { currencyCode } } }",{},{context:!1});o.reachable=!0,o.shop={name:(s=$.shop)==null?void 0:s.name,url:(l=(a=$.shop)==null?void 0:a.primaryDomain)==null?void 0:l.url,currency:(f=(d=$.shop)==null?void 0:d.paymentSettings)==null?void 0:f.currencyCode}}catch($){let q=$.status===401||$.status===403?"Token rejected: use the public Storefront token from the Headless channel, not an Admin token.":$.status===404?"Store or API version not found: check domain (x.myshopify.com) and apiVersion.":"";o.problems.push({level:"error",message:`Storefront API not reachable: ${$.message}${q?`. ${q}`:""}`})}if(o.latencyMs=Date.now()-C,o.reachable){let $=[...new Set(w(t,u("product")).map(T=>nt(T).key).filter(Boolean))].slice(0,20);(await Promise.allSettled($.map(T=>B(T)))).forEach((T,b)=>{var p,P;if(T.status==="fulfilled"){let v=T.value,N=F(v);o.products.push({key:$[b],handle:v.handle,title:v.title,plans:N.length,requiresSellingPlan:v.requiresSellingPlan}),N.forEach(x=>{var _;return o.sellingPlans.push({product:v.handle,group:(_=x.group)==null?void 0:_.name,plan:x.name,id:x.id})})}else o.products.push({key:$[b],error:(p=T.reason)==null?void 0:p.message}),o.problems.push({level:"error",message:`Product "${$[b]}": ${(P=T.reason)==null?void 0:P.message}. Is it published to the Headless channel?`})})}}return(!o.apiVersion.ok||((h=o.apiVersion.monthsLeft)!=null?h:99)<3)&&o.problems.push({level:o.apiVersion.ok?"warn":"error",message:`apiVersion ${c.apiVersion}: ${o.apiVersion.note}`}),typeof document!="undefined"&&o.problems.push(...Ze(t)),e||tn(o),o}function tn(t){var r,o,i;let e=console,n=t.problems.filter(s=>s.level==="error").length;(r=e.group)==null||r.call(e,`[${c.prefix}] diagnose: ${n?`${n} error(s)`:"no errors"}, ${t.problems.length-n} warning(s)`),e.log("version",t.version,"| API",t.apiVersion.version,`(${t.apiVersion.note})`),e.log("config",t.config),t.market&&e.log("market detected",t.market,"(in use:",t.config.country,t.config.language,")"),e.log(t.reachable?`Storefront API reachable: ${(o=t.shop)==null?void 0:o.name} (${t.latencyMs} ms)`:"Storefront API NOT reachable"),t.products.length&&(e.table||e.log)(t.products),t.sellingPlans.length?(e.table||e.log)(t.sellingPlans):t.reachable&&e.log("No selling plans on the products of this page."),t.problems.forEach(s=>(s.level==="error"?e.error:e.warn)(s.message,s.el||"")),(i=e.groupEnd)==null||i.call(e)}var $e="0.3.6",Et=new WeakSet,we=new WeakSet,xt=new Set,At=new Set,Pe=new WeakMap;function xe(){xt.forEach(t=>{t.isConnected||xt.delete(t)}),At.forEach(t=>{t.root.isConnected||At.delete(t)})}var Z=null,Yt=null;function St(t,e){var n;return[...(n=t.matches)!=null&&n.call(t,e)?[t]:[],...w(t,e)]}function kt(t=document){if(!it())return 0;let e=0;return xe(),St(t,ot()).forEach(n=>{if(we.has(n))return;we.add(n),e++;let r=new Ct(n);At.add(r),n.addEventListener(`${c.prefix}:list-rendered`,o=>kt(o.detail.container)),r.load()}),St(t,u("product")).forEach(n=>{Ae(n)&&e++}),Jt(t),w(t,u("account-link")).forEach(n=>{n.setAttribute("href",`https://${c.domain}/account`)}),A.render(),D(`mounted ${e} scope(s)`,t),e}function Ae(t){if(Et.has(t))return!1;let{key:e,fromUrl:n,raw:r}=nt(t);if(!e)return n?(Et.add(t),Y(t,"not-found"),S("product-not-found",{key:null,source:r},t)):t.closest(ot())||M(`[${y("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t),!1;Et.add(t),xt.add(t);let o={};Pe.set(t,o);let i=()=>Pe.get(t)===o;return rt.get(t)?t.setAttribute(y("state"),"updating"):Y(t,"loading"),B(e).then(s=>{if(!i())return;let a=rt.get(t);a?a.update(s):new Pt(t,s),en(t,s)}).catch(s=>{if(!i())return;let a=wt(s);Y(t,a?"not-found":"error",s),a?(S("product-not-found",{key:e,source:r},t),n?D(`product not found: ${e}`):k(s,`product ${e}`)):(k(s,`product ${e}`),S("error",{error:s,context:"product",key:e},t))}),!0}function Jt(t=document){let e=St(t,`select${u("country-select")}`),n=St(t,u("country-bind"));return!e.length&&!n.length?Promise.resolve():Qt().then(r=>{var l;let o=(c.country||((l=r.country)==null?void 0:l.isoCode)||"").toUpperCase(),i=[...r.availableCountries||[]].sort((d,f)=>d.name.localeCompare(f.name,c.locale||void 0)),s=i.find(d=>d.isoCode===o)||r.country,a=(d,f)=>{var h,C;return d.replace(/\{name\}/g,f.name).replace(/\{code\}/g,f.isoCode).replace(/\{currency\}/g,((h=f.currency)==null?void 0:h.isoCode)||"").replace(/\{symbol\}/g,((C=f.currency)==null?void 0:C.symbol)||"")};e.forEach(d=>{let f=d.getAttribute(y("country-label"))||"{name} ({currency})";d.innerHTML="",i.forEach(h=>d.appendChild(new Option(a(f,h),h.isoCode))),d.value=o,d.value!==o&&(d.selectedIndex=-1),d.disabled=i.length<2&&!d.hasAttribute(y("always-enabled"))}),n.forEach(d=>{var C,$;let f=m(d,"country-bind")||"name",h={name:s==null?void 0:s.name,code:s==null?void 0:s.isoCode,currency:(C=s==null?void 0:s.currency)==null?void 0:C.isoCode,symbol:($=s==null?void 0:s.currency)==null?void 0:$.symbol}[f];d.textContent=h||""})}).catch(r=>k(r,"country select"))}async function Se(t,{language:e,remember:n=!0}={}){let r=Wt(t);if(!r)throw new L(`Not a country code: ${t}`,{code:"INVALID_COUNTRY"});let o=e===void 0?c.language:zt(e),i=r!==String(c.country||"").toUpperCase()||o!==c.language;if(c.country=r,c.language=o||void 0,n&&ye({country:r,language:o}),!i)return Jt(),A.state;Vt();let s=[];return e!==void 0&&be(),A.id()&&s.push(A.setBuyerIdentity({countryCode:r},{create:!1}).catch(a=>k(a,"cart country"))),xe(),At.forEach(a=>s.push(a.load())),xt.forEach(a=>{a.closest(ot())||(Et.delete(a),Ae(a))}),Jt(),S("country-changed",{country:r,language:c.language}),await Promise.all(s),A.state}function en(t,e){let n=m(t,"page-title");!n||typeof document=="undefined"||(document.title=n.replace(/\{title\}/g,e.title).replace(/\{vendor\}/g,e.vendor||"").replace(/\{type\}/g,e.productType||""))}function nn(){A.close()}function rn(t){var n;let e=(n=t==null?void 0:t.closest)==null?void 0:n.call(t,u("product"));return e&&rt.get(e)||null}var Ce=!1;function on(){Ce||(Ce=!0,document.addEventListener("click",t=>{var a;let e=t.target;if(!(e!=null&&e.closest))return;if(e.closest(u("cart-open"))){t.preventDefault(),A.toggle();return}if(e.closest(u("cart-close"))){t.preventDefault(),A.close();return}let n=e.closest(u("cart-clear"));if(n){t.preventDefault(),H(n,()=>A.clear().catch(l=>k(l,"cart clear")));return}let r=e.closest(u("checkout"));if(r){t.preventDefault(),H(r,()=>A.checkout());return}let o=e.closest(Ee());if(o&&o.closest(u("cart-lines"))){let l=o.getAttribute(`data-${c.prefix}-key`),d=A.lines.find(h=>h.id===l),f=h=>{t.preventDefault(),h().catch(C=>k(C,"cart line"))};if(e.closest(u("line-remove")))return f(()=>A.removeLine(l));if(d&&e.closest(u("line-plus")))return f(()=>A.updateLine(l,d.quantity+1));if(d&&e.closest(u("line-minus")))return f(()=>A.updateLine(l,d.quantity-1))}let i=e.closest(u("discount-remove"));if(i){t.preventDefault();let l=(a=i.closest(u("discount-code")))==null?void 0:a.getAttribute(y("discount-code"));l&&A.removeDiscount(l).catch(d=>k(d,"discount"));return}let s=e.closest(u("group-add"));s&&(t.preventDefault(),H(s,()=>ke(s)))}),document.addEventListener("change",t=>{let e=t.target;if(!(e!=null&&e.closest))return;let n=e.closest(Ee()),r=n==null?void 0:n.getAttribute(`data-${c.prefix}-key`);r&&e.matches(`input${u("line","quantity")}`)?A.updateLine(r,parseInt(e.value,10)||0).catch(o=>k(o,"cart line")):r&&e.matches(`select${u("line-plan")}`)?A.updateLine(r,{sellingPlanId:e.value||null}).catch(o=>k(o,"cart line plan")):e.matches(`select${u("country-select")}`)?e.value&&Se(e.value).catch(o=>k(o,"country")):e.matches(u("cart-note"))&&A.setNote(e.value).catch(o=>k(o,"cart note"))}),document.addEventListener("submit",t=>{var o,i;let e=(i=(o=t.target).closest)==null?void 0:i.call(o,u("discount-form"));if(!e)return;t.preventDefault();let n=e.querySelector(u("discount-input"))||e.querySelector("input"),r=n==null?void 0:n.value.trim();r&&H(e,async()=>{var s;try{let a=await A.applyDiscount(r),l=(s=((a==null?void 0:a.discountCodes)||[]).find(d=>d.code.toLowerCase()===r.toLowerCase()))==null?void 0:s.applicable;e.classList.toggle("is-invalid",!l),S(l?"discount-applied":"discount-invalid",{code:r},e),l&&n&&(n.value="")}catch(a){e.classList.add("is-invalid"),k(a,"discount")}})}),document.addEventListener("keydown",t=>{t.key==="Escape"&&A.isOpen()&&A.close()}))}function Ee(){return`[data-${c.prefix}-key]`}async function ke(t){let e=t.closest(u("group"));if(!e)return null;let n=m(e,"group"),r=Q($t(e,"line-attributes")),o=n?[{key:"_group",value:n},...r]:r,i=w(e,u("product")).map(s=>rt.get(s)).filter(s=>{var a;return s&&((a=s.variant)==null?void 0:a.availableForSale)&&s.quantity>0}).map(s=>{let a=s.getLine();return a.attributes=[...a.attributes||[],...o],a});if(!i.length)return M("group-add: nothing selected"),null;try{let s=await A.add(i);return S("group-added",{group:n,lines:i},e),s}catch(s){return k(s,"group add"),null}}function Ie(t={}){var n;if(Z&&!Object.keys(t).length)return Z;if(te({...window.TETHER_CONFIG||{},...t}),!it())return M("TETHER_CONFIG is missing domain or token. Tether is idle."),Z=Promise.resolve(null),Z;let e=dt(c.markets);return e.country&&(c.country=e.country),e.language&&(c.language=e.language),e.locale&&!t.locale&&!((n=window.TETHER_CONFIG)!=null&&n.locale)&&(c.locale=e.locale),e.sources&&Object.keys(e.sources).length&&D("market",e),on(),c.observe&&sn(),Z=A.init().then(async r=>{var i;let o=c.country?String(c.country).toUpperCase():null;if(r&&o&&((i=r.buyerIdentity)!=null&&i.countryCode)&&r.buyerIdentity.countryCode!==o)try{r=await A.setBuyerIdentity({countryCode:o},{create:!1})}catch(s){k(s,"cart country")}return S("ready",{cart:r}),Xt}),Z}function sn(){if(Yt||typeof MutationObserver=="undefined")return;let t=null,e=new Set;Yt=new MutationObserver(n=>{n.forEach(r=>r.addedNodes.forEach(o=>{o.nodeType===1&&e.add(o)})),clearTimeout(t),t=setTimeout(()=>{e.forEach(r=>{r.isConnected&&kt(r)}),e.clear()},50)}),Yt.observe(document.body,{childList:!0,subtree:!0})}var Xt={VERSION:$e,init:Ie,mount:kt,unmount:nn,get config(){return c},get ready(){return Z||Promise.resolve(null)},query:O,withContext:qt,cart:A,getProduct:B,getProducts:ht,getRecommendations:ft,getScope:rn,addGroup:ke,primeProduct:tt,normalizeProductKey:Ut,clearProductCache:Vt,formatMoney:I,plans:jt,TetherError:L,resolveProductKey:nt,setCountry:Se,detectMarket:t=>dt(t||c.markets),getLocalization:Qt,diagnose:t=>ve({...t,version:$e}),on(t,e){let n=r=>e(r.detail,r);return document.addEventListener(`${c.prefix}:${t}`,n),()=>document.removeEventListener(`${c.prefix}:${t}`,n)}},cr=Xt;if(typeof window!="undefined"&&typeof document!="undefined"&&(window.Tether=Xt,window.TETHER_CONFIG&&window.TETHER_CONFIG.autoMount!==!1)){let e=()=>Ie().then(()=>kt(document));document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}})();
|
|
3
|
+
image { ${z} }
|
|
4
|
+
seo { title description }`}var le={};F(le,{clearProductCache:()=>se,getProduct:()=>U,getProducts:()=>pt,getRecommendations:()=>ht,hydrateProducts:()=>oe,normalizeProductKey:()=>rt,primeProduct:()=>Y,refreshProducts:()=>ce,takeStale:()=>ae});var _=new Map,De=[],re=new Map,ne=!1,dt=0,ie=t=>typeof t=="string"&&t.startsWith("gid://");function rt(t){let e=String(t??"").trim();if(!e)return null;if(ie(e))return e;if(/^\d+$/.test(e))return`gid://shopify/Product/${e}`;let r=e.match(/\/products\/([^/?#]+)/);return r?r[1]:e}function Y(t){if(!t)return;let e=Promise.resolve(t);_.set(t.handle,e),_.set(t.id,e)}function U(t){let e=rt(t);if(!e)return Promise.reject(new I("empty product key",{code:"NOT_FOUND"}));if(_.has(e))return _.get(e);let r=new Promise((n,i)=>{re.set(e,{resolve:n,reject:i}),De.push(e),ne||(ne=!0,setTimeout(ir,0))});return _.set(e,r),r}async function ir(){ne=!1;let t=dt,e=De.splice(0);if(!e.length)return;let r=e.filter(ie),n=e.filter(f=>!ie(f)),i=[],s=[],o={};r.length&&(i.push("$ids: [ID!]!"),o.ids=r,s.push("byId: nodes(ids: $ids) { ... on Product { ...TetherProduct } }")),n.forEach((f,m)=>{i.push(`$h${m}: String!`),o[`h${m}`]=f,s.push(`h${m}: product(handle: $h${m}) { ...TetherProduct }`)});let l=`query TetherProducts(${i.join(",")}){${s.join(" ")}}${ut()}`;T("fetch products",e);let p=(f,m)=>{let h=re.get(f);re.delete(f),h&&m(h)};try{let f=await q(l,o),m=new Map;(f.byId||[]).forEach(h=>{h&&m.set(h.id,h)}),n.forEach((h,C)=>{f[`h${C}`]&&m.set(h,f[`h${C}`])}),e.forEach(h=>p(h,C=>{if(m.has(h)){let A=m.get(h);t===dt&&(Y(A),qt.set(A.handle,Date.now()),qt.set(A.id,Date.now())),C.resolve(A)}else t===dt&&_.delete(h),C.reject(new I(`Product not found: ${h}`,{code:"NOT_FOUND"}))}))}catch(f){e.forEach(m=>p(m,h=>{t===dt&&_.delete(m),h.reject(f)}))}}function se(){_.clear(),dt++,et.clear(),qt.clear()}var et=new Set,qt=new Map,sr=6e4;function oe(t){(t||[]).forEach(e=>{!e?.id||!e.handle||Date.now()-(qt.get(e.handle)||0)<sr&&_.has(e.handle)||(Y(e),et.add(e.handle),et.add(e.id))})}function ae(t){let e=rt(t);if(!et.has(e))return!1;let r=_.get(e);return et.delete(e),r?.then?.(n=>{et.delete(n.handle),et.delete(n.id)}),!0}function ce(t){return t.forEach(e=>_.delete(rt(e))),t.map(e=>U(e))}async function pt({collection:t,query:e,first:r=c.collectionFirst,after:n=null,sortKey:i,reverse:s=!1,filters:o}={}){let l=ut();if(t){let f=await q(`query TetherCollection($handle:String!,$first:Int!,$after:String,$sortKey:ProductCollectionSortKeys,$reverse:Boolean,$filters:[ProductFilter!]){collection(handle:$handle){${te()} products(first:$first,after:$after,sortKey:$sortKey,reverse:$reverse,filters:$filters){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}}${l}`,{handle:t,first:r,after:n,sortKey:i||void 0,reverse:s,filters:o||void 0});if(!f.collection)throw new I(`Collection not found: ${t}`,{code:"NOT_FOUND"});let{products:m,...h}=f.collection;return m.nodes.forEach(Y),{collection:h,products:m.nodes,pageInfo:m.pageInfo}}let p=await q(`query TetherSearch($first:Int!,$after:String,$query:String,$sortKey:ProductSortKeys,$reverse:Boolean){products(first:$first,after:$after,query:$query,sortKey:$sortKey,reverse:$reverse){nodes{...TetherProduct}pageInfo{hasNextPage endCursor}}}${l}`,{first:r,after:n,query:e||void 0,sortKey:i||void 0,reverse:s});return p.products.nodes.forEach(Y),{collection:null,products:p.products.nodes,pageInfo:p.products.pageInfo}}async function ht(t,e="RELATED"){let r=rt(typeof t=="object"?t?.id:t),n=r?.startsWith("gid://"),s=(await q(`query TetherRecs(${n?"$id: ID!":"$handle: String!"},$intent:ProductRecommendationIntent){productRecommendations(${n?"productId: $id":"productHandle: $handle"},intent:$intent){...TetherProduct}}${ut()}`,n?{id:r,intent:e}:{handle:r,intent:e})).productRecommendations||[];return s.forEach(Y),s}var gt={};F(gt,{GID:()=>M,allPlans:()=>K,allocationFor:()=>D,findPlan:()=>mt,hasPlans:()=>or,planAdjustment:()=>de,planCheckoutCharge:()=>ue,planPrice:()=>ft,planSavings:()=>Nt,plansForVariant:()=>ar,toGid:()=>Ot});var M={product:t=>Ot(t,"Product"),variant:t=>Ot(t,"ProductVariant"),sellingPlan:t=>Ot(t,"SellingPlan")};function Ot(t,e){let r=String(t??"").trim();return r?r.startsWith("gid://")?r:/^\d+$/.test(r)?`gid://shopify/${e}/${r}`:r:null}function K(t){return(t?.sellingPlanGroups?.nodes||[]).flatMap(r=>(r.sellingPlans?.nodes||[]).map(n=>({...n,group:r})))}function or(t){return K(t).length>0}function D(t,e){return!t||!e?null:(t.sellingPlanAllocations?.nodes||[]).find(r=>r.sellingPlan?.id===e)||null}function ar(t,e){return K(t).filter(r=>D(e,r.id))}function ft(t,e){let n=D(t,e)?.priceAdjustments?.[0];return n?.perDeliveryPrice||n?.price||t?.price||null}function ue(t,e){let r=D(t,e);return r?.checkoutChargeAmount||r?.priceAdjustments?.[0]?.price||t?.price||null}function Nt(t,e){let r=parseFloat(t?.price?.amount),n=parseFloat(ft(t,e)?.amount);return!Number.isFinite(r)||!Number.isFinite(n)||r<=0||n>=r?{amount:null,percentage:0}:{amount:{amount:(r-n).toFixed(2),currencyCode:t.price.currencyCode},percentage:Math.round((1-n/r)*100)}}function de(t){let e=t?.priceAdjustments?.[0]?.adjustmentValue;if(!e)return null;switch(e.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:e.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"amount",value:e.adjustmentAmount};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:e.price};default:return null}}function mt(t,e){if(!e)return null;let r=K(t),n=M.sellingPlan(e),i=String(e).trim().toLowerCase();return r.find(s=>s.id===n)||r.find(s=>s.name.toLowerCase()===i)||r.find(s=>(s.options||[]).some(o=>String(o.value).toLowerCase()===i))||null}var ye={};F(ye,{attr:()=>y,busy:()=>R,cdnUrl:()=>Me,dataKey:()=>Ue,emit:()=>$,formatDate:()=>he,formatMoney:()=>O,get:()=>d,has:()=>X,hasTemplate:()=>fe,imageUrl:()=>_t,notifyLayoutChanged:()=>B,parseJSONAttr:()=>vt,productUrl:()=>yt,qsa:()=>v,readText:()=>pe,repeat:()=>V,repeatKeyed:()=>me,sameImage:()=>Dt,scoped:()=>Z,sel:()=>a,setImage:()=>N,setSelected:()=>bt,setText:()=>E,setTextTracked:()=>tt,show:()=>j,toAttributes:()=>H,watchImages:()=>ge});var y=t=>`${c.prefix}-${t}`,a=(t,e)=>e===void 0?`[${y(t)}]`:`[${y(t)}="${e}"]`,d=(t,e)=>t.getAttribute(y(e)),X=(t,e)=>t.hasAttribute(y(e)),Ue=()=>`data-${c.prefix}-key`;function yt(t,e){let r=c.productPath||"/product";if(!/\{(handle|id)\}/.test(r))return`${r.replace(/\/$/,"")}/${t}`;let n=e?String(e).split("/").pop():"";return r.replace(/\{handle\}/g,encodeURIComponent(t||"")).replace(/\{id\}/g,encodeURIComponent(n))}var v=(t,e)=>t?[...t.querySelectorAll(e)]:[],Z=(t,e,r)=>v(t,e).filter(n=>n.closest(r)===t);function $(t,e,r=document){r.dispatchEvent(new CustomEvent(`${c.prefix}:${t}`,{detail:e,bubbles:!0}))}function O(t){if(!t)return"";if(typeof c.formatMoney=="function")return c.formatMoney(t,c.locale);let e=parseFloat(t.amount);if(Number.isNaN(e))return"";try{return new Intl.NumberFormat(c.locale||void 0,{style:"currency",currency:t.currencyCode}).format(e)}catch{return`${t.currencyCode} ${e.toFixed(2)}`}}function he(t){if(!t)return"";try{return new Date(t).toLocaleDateString(c.locale||void 0)}catch{return""}}function _t(t,{width:e,height:r,crop:n}={}){if(!t)return t;try{let i=new URL(t);return e&&i.searchParams.set("width",String(e)),r&&i.searchParams.set("height",String(r)),n&&i.searchParams.set("crop",n),i.toString()}catch{return t}}function Me(t,e){if(!t||!e)return t;let r=n=>e.getAttribute(n);return _t(t,{width:r("max-width"),height:r("max-height"),crop:r("max-width")||r("max-height")?r("crop"):null})}var Dt=(t,e)=>!!(t&&e)&&t.split("?")[0]===e.split("?")[0];function N(t,e,r){if(!e)return;let n=Me(e,t);if(t.tagName==="IMG"&&Dt(t.getAttribute("src"),n)){r!=null&&!t.getAttribute("alt")&&t.setAttribute("alt",r);return}t.tagName==="IMG"?(t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.setAttribute("src",n),r!=null&&t.setAttribute("alt",r),t.getAttribute("loading")||t.setAttribute("loading","lazy")):t.style.backgroundImage=`url("${n}")`}function E(t,e){let r=e==null?"":String(e);t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value=r:t.textContent=r}var pe=t=>t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value:t.textContent;function tt(t,e){let r=pe(t);E(t,e);let n=pe(t);if(r!==n&&t.dataset.tetherSeen&&typeof c.onValueChange=="function")try{c.onValueChange(t,r)}catch{}t.dataset.tetherSeen="1"}function j(t,e){let r="tetherPrevDisplay";if(e){if(t.dataset.tetherShown!==void 0)return;t.dataset.tetherShown="",t.removeAttribute("hidden"),t.dataset[r]!==void 0?(t.style.display=t.dataset[r],delete t.dataset[r]):t.style.display==="none"&&(t.style.display=""),typeof getComputedStyle=="function"&&getComputedStyle(t).display==="none"&&(t.style.display=t.getAttribute(`${c.prefix}-display`)||"block")}else delete t.dataset.tetherShown,t.dataset[r]===void 0&&t.style.display!=="none"&&(t.dataset[r]=t.style.display||""),t.style.display="none"}function bt(t,e){t.classList.toggle("is-selected",e),t.setAttribute("aria-pressed",e?"true":"false"),t.tagName==="INPUT"&&(t.type==="radio"||t.type==="checkbox")&&(t.checked=e);let r=t.querySelector?.('input[type="radio"],input[type="checkbox"]');r&&(r.checked=e)}var Ft=new WeakMap,fe=t=>!!Ft.get(t);function Ve(t){if(!Ft.has(t)){let e=t.firstElementChild?.cloneNode(!0)??null;Ft.set(t,e),t.innerHTML=""}return Ft.get(t)}function V(t,e,r){let n=Ve(t);if(!n){L("repeater without a template child",t);return}t.innerHTML="",e.forEach((i,s)=>{let o=n.cloneNode(!0);r(o,i,s),t.appendChild(o)})}function me(t,e,r,n,{onEnter:i,onLeave:s}={}){let o=Ve(t);if(!o){L("repeater without a template child",t);return}let l=Ue(),p=`data-${c.prefix}-leaving`,f=()=>[...t.children].filter(b=>b.hasAttribute(l)&&!b.hasAttribute(p)),m=new Map(f().map(b=>[b.getAttribute(l),b])),h=[],C=new Set;e.forEach((b,u)=>{let g=String(r(b,u)),S=m.get(g);S?m.delete(g):(S=o.cloneNode(!0),S.setAttribute(l,g),C.add(S)),n(S,b,u,C.has(S)),h.push(S)});let A=h.filter(b=>!C.has(b)),lt=f().filter(b=>A.includes(b));if(!(lt.length===A.length&<.every((b,u)=>b===A[u]))){m.forEach(b=>b.remove()),h.forEach(b=>t.appendChild(b));return}h.forEach((b,u)=>{if(!C.has(b))return;let g=h[u-1];if(g&&g.parentNode===t?g.after(b):t.prepend(b),i)try{i(b)}catch{}}),m.forEach(b=>{b.setAttribute(p,""),b.removeAttribute(l),b.style.pointerEvents="none",b.inert=!0;let u=()=>b.remove();if(s)try{s(b,u)}catch{u()}else u()})}var je=null;function B(t){clearTimeout(je),je=setTimeout(()=>{typeof c.onLayoutChange=="function"?c.onLayoutChange(t):window.ScrollTrigger?.refresh&&window.ScrollTrigger.refresh(),$("layout-changed",{reason:t})},120)}function ge(t,e){let r=v(t,"img").filter(s=>!s.complete);if(!r.length)return;let n=r.length,i=()=>{--n===0&&B(`${e}:images`)};r.forEach(s=>{s.addEventListener("load",i,{once:!0}),s.addEventListener("error",i,{once:!0})})}function R(t,e){return t.getAttribute("aria-busy")==="true"?Promise.resolve():(t.setAttribute("aria-busy","true"),Promise.resolve().then(e).finally(()=>t.removeAttribute("aria-busy")))}function vt(t,e){let r=t&&d(t,e);if(!r)return null;try{return JSON.parse(r)}catch{return L(`invalid JSON in ${y(e)}`,t),null}}function H(t){return t?Array.isArray(t)?t.map(e=>({key:String(e.key),value:String(e.value??"")})):Object.entries(t).map(([e,r])=>({key:e,value:String(r??"")})):[]}function Ke(t,e=1,r={}){let n=typeof t=="object"&&t!==null?t:{variantId:t,quantity:e,...r},i=M.variant(n.merchandiseId||n.variantId||n.id);if(!i)throw new I("add(): variantId is required");let s={merchandiseId:i,quantity:Math.max(1,parseInt(n.quantity??1,10)||1)},o=n.sellingPlanId||n.sellingPlan;o&&(s.sellingPlanId=M.sellingPlan(o));let l=H(n.attributes);return l.length&&(s.attributes=l),s}function Re(t,e,r){return`mutation Tether_${t}(${e}){${t}(${r}){cart{...TetherCart}userErrors{field message}warnings{code message}}}${Lt()}`}var cr='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',jt=null,Ut=t=>v(t,cr).filter(e=>e.offsetParent!==null||e===document.activeElement);function be(t){v(document,a("cart-open")).forEach(e=>e.setAttribute("aria-expanded",String(t))),v(document,a("cart-drawer")).forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","dialog"),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&e.setAttribute("aria-label",d(e,"cart-label")||"Cart"),e.setAttribute("aria-modal",String(t)),e.classList.contains(c.cartDrawerOpenClass)||e.setAttribute("aria-hidden","true")})}var ve=t=>/does not exist|not found|invalid id/i.test(t?.message||""),P={state:null,_chain:Promise.resolve(),id(){try{return localStorage.getItem(c.storageKey)}catch{return null}},_setId(t){try{t?localStorage.setItem(c.storageKey,t):localStorage.removeItem(c.storageKey)}catch{}},get lines(){return this.state?.lines?.nodes||[]},get count(){return this.state?.totalQuantity||0},lastError:null,warnings:[],loaded:!1,_take(t,e){let r=Xt(t,e);return this.warnings=r.warnings||[],this.warnings.length&&$("cart-warning",{warnings:this.warnings}),r.cart},_queue(t){let e=this._chain.then(t,t).then(r=>(this.lastError&&(this.lastError=null,this.render()),r),r=>{throw this.lastError=r,this.render(),$("cart-error",{error:r}),r});return this._chain=e.catch(()=>{}),e},_commit(t,e){return this.state=t,t?.id&&this._setId(t.id),this.render(),$("cart-updated",{cart:t,reason:e}),t},async init(){let t=this.id();if(!t)return this.state=null,this.loaded=!0,this.render(),$("cart-updated",{cart:null,reason:"load"}),null;try{let e=await q(`query TetherCart($id:ID!){cart(id:$id){...TetherCart}}${Lt()}`,{id:t});e.cart?this.state=e.cart:(this._setId(null),this.state=null)}catch(e){x(e,"cart load failed"),this.lastError=e,ve(e)&&this._setId(null),this.state=null}return this.loaded=!0,this.render(),$("cart-updated",{cart:this.state,reason:"load"}),this.state},async _create(t={}){let e=c.country?{countryCode:String(c.country).toUpperCase()}:void 0,r=await q(Re("cartCreate","$input: CartInput!","input: $input"),{input:{buyerIdentity:e,...t}});return this._take(r.cartCreate,"cartCreate")},async _mutate(t,e,r,n,i){let s=this.id();if(!s)return i?this._create(i):null;try{let o=await q(Re(t,`$cartId: ID!, ${e}`,`cartId: $cartId, ${r}`),{...n,cartId:s});return this._take(o[t],t)}catch(o){if(i&&ve(o))return T("cart expired, creating a new one"),this._setId(null),this._create(i);throw o}},add(t,e=1,r={}){let n=(Array.isArray(t)?t:[t]).map(i=>Ke(i,e,r));return this._queue(async()=>{let i=await this._mutate("cartLinesAdd","$lines: [CartLineInput!]!","lines: $lines",{lines:n},{lines:n});return this._commit(i,"add"),$("added",{cart:i,lines:n}),c.openCartOnAdd&&this.open(),i})},updateLine(t,e){let r=typeof e=="number"?{quantity:e}:{...e};if(r.quantity!==void 0&&r.quantity<=0)return this.removeLine(t);let n={id:t};return r.quantity!==void 0&&(n.quantity=r.quantity),"sellingPlanId"in r&&(n.sellingPlanId=r.sellingPlanId?M.sellingPlan(r.sellingPlanId):null),r.attributes&&(n.attributes=H(r.attributes)),(r.merchandiseId||r.variantId)&&(n.merchandiseId=M.variant(r.merchandiseId||r.variantId)),this._queue(async()=>this._commit(await this._mutate("cartLinesUpdate","$lines: [CartLineUpdateInput!]!","lines: $lines",{lines:[n]}),"update"))},removeLine(t){let e=Array.isArray(t)?t:[t];return this._queue(async()=>this._commit(await this._mutate("cartLinesRemove","$lineIds: [ID!]!","lineIds: $lineIds",{lineIds:e}),"remove"))},clear(){let t=this.lines.map(e=>e.id);return t.length?this.removeLine(t):Promise.resolve(this.state)},setNote(t){return this._queue(async()=>this._commit(await this._mutate("cartNoteUpdate","$note: String!","note: $note",{note:t??""},{note:t??""}),"note"))},setAttributes(t){let e=new Map((this.state?.attributes||[]).map(n=>[n.key,n.value]));H(t).forEach(n=>e.set(n.key,n.value));let r=[...e].filter(([,n])=>n!=="").map(([n,i])=>({key:n,value:i}));return this._queue(async()=>this._commit(await this._mutate("cartAttributesUpdate","$attributes: [AttributeInput!]!","attributes: $attributes",{attributes:r},{attributes:r}),"attributes"))},setDiscountCodes(t){let e=(Array.isArray(t)?t:[t]).map(r=>String(r).trim()).filter(Boolean);return this._queue(async()=>this._commit(await this._mutate("cartDiscountCodesUpdate","$discountCodes: [String!]!","discountCodes: $discountCodes",{discountCodes:e},{discountCodes:e}),"discount"))},applyDiscount(t){let e=(this.state?.discountCodes||[]).map(r=>r.code);return this.setDiscountCodes([...new Set([...e,t])])},removeDiscount(t){let e=String(t).toLowerCase();return this.setDiscountCodes((this.state?.discountCodes||[]).map(r=>r.code).filter(r=>r.toLowerCase()!==e))},setBuyerIdentity(t,{create:e=!0}={}){return this._queue(async()=>{let r=await this._mutate("cartBuyerIdentityUpdate","$buyerIdentity: CartBuyerIdentityInput!","buyerIdentity: $buyerIdentity",{buyerIdentity:t},e?{buyerIdentity:t}:null).catch(n=>{if(e||!ve(n))throw n;return this._setId(null),null});return this._commit(r,"buyer-identity")})},async checkout(t=c.checkoutTarget){let e=this.id();if(!e||this.state&&!this.count)return null;let r=t==="_blank"?window.open("","_blank"):null;if(r)try{r.opener=null}catch{}try{let i=(await q("query TetherCheckout($id: ID!) { cart(id: $id) { checkoutUrl } }",{id:e})).cart?.checkoutUrl;if(!i)throw new I("No checkoutUrl (cart empty or expired)");return $("checkout",{url:i,cart:this.state}),r&&!r.closed?r.location.href=i:window.location.href=i,i}catch(n){return r&&r.close(),x(n,"checkout failed"),null}},drawers(){return v(document,a("cart-drawer"))},isOpen(){return this.drawers().some(t=>t.classList.contains(c.cartDrawerOpenClass))},open(){if(this.isOpen())return;let t=this.drawers().filter(e=>d(e,"cart-drawer")!=="manual");t.forEach(e=>{e.classList.add(c.cartDrawerOpenClass),e.setAttribute("aria-hidden","false")}),be(!0),c.cartFocus!==!1&&t[0]&&(jt=document.activeElement,setTimeout(()=>{let e=Ut(t[0])[0]||t[0];e===t[0]&&!t[0].hasAttribute("tabindex")&&(t[0].tabIndex=-1),e.focus?.({preventScroll:!0})},60)),typeof c.onCartOpen=="function"&&c.onCartOpen(t),$("cart-toggled",{open:!0})},close(){if(!this.isOpen())return;let t=this.drawers(),e=t.some(r=>r.contains(document.activeElement));t.forEach(r=>{r.classList.remove(c.cartDrawerOpenClass),r.setAttribute("aria-hidden","true")}),be(!1),e&&jt?.isConnected&&jt.focus({preventScroll:!0}),jt=null,typeof c.onCartClose=="function"&&c.onCartClose(t),$("cart-toggled",{open:!1})},toggle(){this.isOpen()?this.close():this.open()},subscribe(t){let e=()=>t(this.state,{open:this.isOpen(),count:this.count,loaded:this.loaded,warnings:this.warnings}),r=()=>e();return["cart-updated","cart-toggled"].forEach(n=>document.addEventListener(`${c.prefix}:${n}`,r)),e(),()=>["cart-updated","cart-toggled"].forEach(n=>document.removeEventListener(`${c.prefix}:${n}`,r))},render(){let t=this.state,e=t?t.totalQuantity:0,r=s=>t?O(t.cost?.[s]):"";be(this.isOpen()),v(document,a("cart-count")).forEach(s=>tt(s,e)),v(document,a("cart-subtotal")).forEach(s=>tt(s,r("subtotalAmount"))),v(document,a("cart-total")).forEach(s=>tt(s,r("totalAmount"))),v(document,a("cart-checkout-charge")).forEach(s=>tt(s,r("checkoutChargeAmount")));let n=this.lines.some(s=>s.sellingPlanAllocation),i={"cart-empty":e===0,"cart-filled":e>0,"cart-has-subscription":n,"cart-no-subscription":!n,"cart-has-discount":(t?.discountCodes||[]).some(s=>s.applicable),"cart-error":!!this.lastError,"cart-warning":this.warnings.length>0};v(document,a("cart-warning")).forEach(s=>tt(s,[...new Set(this.warnings.map(o=>o.message))].join(" "))),v(document,a("show")).forEach(s=>{let o=d(s,"show");o in i&&!s.closest(a("product"))&&j(s,i[o])}),v(document,a("checkout")).forEach(s=>{s.classList.toggle("is-disabled",!e),s.setAttribute("aria-disabled",String(!e))}),v(document,`textarea${a("cart-note")},input${a("cart-note")}`).forEach(s=>{document.activeElement!==s&&(s.value=t?.note||"")}),v(document,a("cart-discounts")).forEach(s=>{V(s,t?.discountCodes||[],(o,l)=>{o.setAttribute(y("discount-code"),l.code);let p=o.querySelector(a("discount","code"))||(o.firstElementChild?null:o);p&&E(p,l.code),o.classList.toggle("is-inapplicable",!l.applicable)})}),v(document,a("cart-lines")).forEach(s=>{me(s,this.lines,o=>o.id,(o,l)=>ur(o,l),{onEnter:c.onLineEnter,onLeave:c.onLineLeave})}),t&&B("cart")}};function lr(t,e){let r=t.merchandise||{},n=t.sellingPlanAllocation?.sellingPlan;switch(e){case"title":return r.product?.title;case"product-title":return r.product?.title;case"variant-title":return r.title==="Default Title"?"":r.title;case"options":return(r.selectedOptions||[]).filter(i=>i.value!=="Default Title").map(i=>`${i.name}: ${i.value}`).join(", ");case"vendor":return r.product?.vendor;case"sku":return r.sku;case"price":return O(t.cost?.amountPerQuantity||r.price);case"compare-at-price":return O(t.cost?.compareAtAmountPerQuantity||r.compareAtPrice);case"line-total":return O(t.cost?.totalAmount);case"line-subtotal":return O(t.cost?.subtotalAmount);case"quantity":return t.quantity;case"plan":return n?.name||"";case"plan-description":return n?.description||"";case"components":return(t.lineComponents||[]).map(i=>`${i.quantity} \xD7 ${i.merchandise?.product?.title||""}`).join(", ");default:if(e.startsWith("attribute:")){let i=e.slice(10);return(t.attributes||[]).find(s=>s.key===i)?.value||""}return}}function ur(t,e){let r=e.merchandise||{},n=!!e.sellingPlanAllocation;t.setAttribute(y("line-id"),e.id),t.classList.toggle("is-subscription",n),v(t,a("line")).forEach(s=>{let o=d(s,"line");if(o==="image")return N(s,r.image?.url||r.product?.featuredImage?.url,r.product?.title);if(o==="url"){let p=yt(r.product?.handle,r.product?.id),f=new URLSearchParams;r.id&&f.set("variant",String(r.id).split("/").pop());let m=e.sellingPlanAllocation?.sellingPlan?.id;m&&f.set("selling_plan",m.split("/").pop());let h=f.toString();return s.setAttribute("href",h?`${p}${p.includes("?")?"&":"?"}${h}`:p)}let l=lr(e,o);l!==void 0&&tt(s,l)});let i={subscription:n,"one-time":!n,"on-sale":parseFloat(e.cost?.compareAtAmountPerQuantity?.amount)>parseFloat(e.cost?.amountPerQuantity?.amount),"has-components":(e.lineComponents||[]).length>0};v(t,a("line-show")).forEach(s=>{let o=d(s,"line-show");o in i&&j(s,i[o])}),v(t,`select${a("line-plan")}`).forEach(s=>{let o=r.product?.handle;o&&U(o).then(l=>{let p=K(l),m=[...!l.requiresSellingPlan&&d(s,"line-plan")!=="subscription-only"?[{value:"",label:s.getAttribute(y("one-time-label"))||"One-time purchase"}]:[],...p.map(C=>({value:C.id,label:C.name}))],h=m.map(C=>C.value).join("|");s.dataset.tetherSig!==h&&(s.innerHTML="",m.forEach(C=>{let A=document.createElement("option");A.value=C.value,A.textContent=C.label,s.appendChild(A)}),s.dataset.tetherSig=h),s.value=e.sellingPlanAllocation?.sellingPlan?.id||"",j(s,p.length>0)}).catch(l=>x(l,"line plan options"))})}var xe={};F(xe,{ProductScope:()=>wt,rememberOptionNames:()=>Kt,scopes:()=>Q});var Pe={};F(Pe,{STATUS_KEYS:()=>Vt,boundary:()=>Mt,isNotFound:()=>$t,ownedBy:()=>we,resolveProductKey:()=>ot,setScopeStatus:()=>G});function ot(t,e=window.location){let r=(d(t,"product")||"").trim();if(!r.toLowerCase().startsWith("url:"))return{key:r||null,fromUrl:!1,raw:r};let n=r.slice(4).trim(),i=null;if(n.toLowerCase()==="path"){let s=e.pathname.split("/").filter(Boolean);i=s.length?dr(s[s.length-1]):null}else i=new URLSearchParams(e.search).get(n||"handle");return i=i&&i.trim()?i.trim():null,{key:i,fromUrl:!0,raw:r}}function dr(t){try{return decodeURIComponent(t)}catch{return t}}var Vt=["loading","ready","error","not-found"],$t=t=>t?.code==="NOT_FOUND",Mt=()=>["product","collection","products","recommendations"].map(t=>a(t)).join(","),we=(t,e)=>t===e||t.parentElement?.closest(Mt())===e;function G(t,e,r){let n=e==="not-found";t.setAttribute(y("state"),n?"error":e),e==="error"||n?t.setAttribute(y("error"),n?"not-found":r?.code||"error"):t.removeAttribute(y("error")),Z(t,a("show"),Mt()).forEach(i=>{let s=d(i,"show");Vt.includes(s)&&j(i,s===e)}),(e==="error"||n)&&Z(t,a("add-to-cart"),Mt()).forEach(i=>{i.classList.add("is-disabled"),i.setAttribute("aria-disabled","true"),"disabled"in i&&(i.disabled=!0)})}var Q=new WeakMap,Be=()=>a("product");function pr(t,e){let r=e.indexOf("."),n=e.slice(0,r),i=e.slice(r+1);return(t.metafields||[]).find(o=>o&&o.namespace===n&&o.key===i)||null}var Rt=new Map;function Kt(t){(t||[]).forEach(e=>{e?.handle&&!Rt.has(e.handle)&&Rt.set(e.handle,(e.options||[]).map(r=>r.name))})}var wt=class{constructor(e,r){this.root=e,this.product=r,this.selected={},this.variant=null,this.quantity=Math.max(0,parseInt(d(e,"quantity")??"1",10)||(X(e,"quantity")?0:1)),this.plans=K(r),this.purchase="one-time",this.planId=null,Q.set(e,this),e.setAttribute(y("state"),"ready"),e.removeAttribute(y("error")),this.initSelection(),this.initPurchase(),this.renderProduct(),this.bind(),this.renderVariant(),ge(e,"product"),B("product"),$("product-ready",{product:r,scope:this},e)}update(e){let r=this.variant?.id;this.product=e,this.plans=K(e),this.planId&&!this.plans.some(i=>i.id===this.planId)&&(this.planId=this.plans[0]?.id||null),!this.plans.length&&this.purchase==="subscription"&&(this.purchase="one-time");let n=e.variants.nodes.find(i=>i.id===r);n&&(this.selected={},n.selectedOptions.forEach(i=>{this.selected[i.name]=i.value})),this.root.setAttribute(y("state"),"ready"),this.root.removeAttribute(y("error")),this.renderProduct(),this.renderVariant(),B("product"),$("product-updated",{product:e,scope:this},this.root)}$(e){let r=Z(this.root,e,Be());return this.root.matches(e)?[this.root,...r]:r}optName(e){let r=this.product?.options||[];if(!e||r.some(i=>i.name===e))return e;let n=(Rt.get(this.product.handle)||[]).indexOf(e);return n>=0&&r[n]?r[n].name:e}initSelection(){let e=this.product.variants.nodes,r=e.find(i=>i.availableForSale)||e[0];r&&r.selectedOptions.forEach(i=>{this.selected[i.name]=i.value});let n=new URLSearchParams(window.location.search).get("variant")||d(this.root,"variant");if(n){let i=M.variant(n),s=e.find(o=>o.id===i);s&&(this.selected={},s.selectedOptions.forEach(o=>{this.selected[o.name]=o.value}))}}initPurchase(){if(!this.plans.length)return;let e=new URLSearchParams(window.location.search),r=mt(this.product,e.get("selling_plan")),n=mt(this.product,d(this.root,"default-plan"));this.planId=(r||n||this.plans[0]).id;let i=r?"subscription":d(this.root,"default-purchase")||c.defaultPurchase;this.purchase=this.product.requiresSellingPlan||i==="subscription"?"subscription":"one-time"}findVariant(){return this.product.variants.nodes.find(e=>e.selectedOptions.every(r=>this.selected[r.name]===r.value))||null}isValueAvailable(e,r){return this.product.variants.nodes.some(n=>n.availableForSale&&n.selectedOptions.every(i=>i.name===e?i.value===r:this.selected[i.name]===i.value))}get plan(){return this.plans.find(e=>e.id===this.planId)||null}get subscriptionAvailable(){return!!(this.variant&&this.plans.some(e=>D(this.variant,e.id)))}get isSubscription(){return this.purchase==="subscription"&&!!D(this.variant,this.planId)}getLine(){if(!this.variant)return null;let e={merchandiseId:this.variant.id,quantity:this.quantity};this.isSubscription&&(e.sellingPlanId=this.planId);let r=this.collectAttributes();return r.length&&(e.attributes=r),e}collectAttributes(){let e=H(vt(this.root,"line-attributes")),r=this.$(a("line-attribute")).map(n=>{let i=d(n,"line-attribute"),s;return n.type==="checkbox"?s=n.checked?n.value&&n.value!=="on"?n.value:"Yes":"":n.type==="radio"?s=n.checked?n.value:null:s=n.value,s==null||s===""?null:{key:i,value:String(s)}}).filter(Boolean);return[...e,...r]}select(e,r){this.selected[e]!==r&&(this.selected[e]=r,this.renderVariant())}selectVariant(e){let r=this.product.variants.nodes.find(n=>n.id===M.variant(e));r&&(this.selected={},r.selectedOptions.forEach(n=>{this.selected[n.name]=n.value}),this.renderVariant())}setPurchase(e){let r=e==="subscription"?"subscription":"one-time";r==="one-time"&&this.product.requiresSellingPlan||this.purchase!==r&&(this.purchase=r,this.renderVariant())}selectPlan(e){let r=mt(this.product,e);r&&(this.planId=r.id,this.purchase="subscription",this.renderVariant())}setQuantity(e){let r=X(this.root,"quantity")?0:1;this.quantity=Math.max(r,parseInt(e,10)||0),this.$(a("qty")).forEach(n=>E(n,this.quantity)),this.renderVariant()}async addToCart(){if(!this.variant?.availableForSale)return null;let e=this.getLine();if(!e||e.quantity<1)return null;let r=await P.add(e);return $("product-added",{product:this.product,variant:this.variant,line:e},this.root),r}bind(){let e=r=>r&&r.closest(Be())===this.root;this.root.addEventListener("click",r=>{let n=r.target;if(!n?.closest)return;let i=n.closest(a("option-value"));if(e(i)&&i.closest(a("option-list"))){r.preventDefault(),this.select(this.optName(d(i.closest(a("option-list")),"option-list")),d(i,"option-value"));return}let s=n.closest(a("plan-value"));if(e(s)){r.preventDefault(),this.selectPlan(d(s,"plan-value"));return}let o=n.closest(`${a("purchase")}:not(select)`);if(e(o)){o.tagName!=="INPUT"&&r.preventDefault(),this.setPurchase(d(o,"purchase"));return}let l=n.closest(a("qty-plus"));if(e(l)){r.preventDefault(),this.setQuantity(this.quantity+1);return}let p=n.closest(a("qty-minus"));if(e(p)){r.preventDefault(),this.setQuantity(this.quantity-1);return}let f=n.closest(a("add-to-cart"));e(f)&&(r.preventDefault(),this.onAddClick(f))}),this.root.addEventListener("change",r=>{let n=r.target;e(n)&&(n.matches(`select${a("option")}`)?this.select(this.optName(d(n,"option")),n.value):n.matches(`select${a("variant-select")}`)?this.selectVariant(n.value):n.matches(`select${a("plan")}`)?n.value?this.selectPlan(n.value):this.setPurchase("one-time"):n.matches(`select${a("purchase")}`)?this.setPurchase(n.value):n.matches(a("qty"))&&this.setQuantity(n.value))})}onAddClick(e){let r=e.querySelector(a("add-label"))||e,n=d(e,"adding-text"),i=s=>E(r,s);r.dataset.tetherLabel===void 0&&(r.dataset.tetherLabel=r.tagName==="INPUT"?r.value:r.textContent),R(e,async()=>{n&&i(n);try{await this.addToCart()}catch(s){x(s,"add to cart failed"),$("error",{error:s,context:"add-to-cart"},this.root)}finally{n&&i(r.dataset.tetherLabel)}}).then(()=>{this.renderVariant()})}renderProduct(){let e=this.product;Rt.has(e.handle)||this.$(`${a("option-list")},select${a("option")}`).map(i=>d(i,"option-list")||d(i,"option")).some(i=>e.options.some(s=>s.name===i))&&Kt([e]);let r=this.product;this.$(a("bind")).forEach(n=>{let i=d(n,"bind")||"",s={title:r.title,"description-text":r.description,vendor:r.vendor,type:r.productType,handle:r.handle}[i];if(s!==void 0)return E(n,s);switch(i){case"description":n.innerHTML=r.descriptionHtml||"";return;case"published-at":return E(n,he(r.publishedAt));case"min-price":return E(n,O(r.priceRange.minVariantPrice));case"max-price":return E(n,O(r.priceRange.maxVariantPrice));case"featured-image":return N(n,r.featuredImage?.url,r.featuredImage?.altText||r.title);case"url":case"link":n.setAttribute("href",yt(r.handle,r.id)),i==="url"&&!n.firstElementChild&&!n.textContent.trim()&&E(n,r.title);return;case"images":{let o=[...n.children].map(l=>l.tagName==="IMG"?l:l.querySelector("img"));if(!fe(n)&&o.length===r.images.nodes.length&&o.every((l,p)=>Dt(l?.getAttribute("src"),r.images.nodes[p].url)))return}return V(n,r.images.nodes,(o,l)=>{let p=o.matches(`img,${a("bind","image")}`)?o:o.querySelector("img")||o;N(p,l.url,l.altText||r.title)});case"tags":{let o=(n.getAttribute("exclude")||"").split(",").map(l=>l.trim()).filter(Boolean);return V(n,r.tags.filter(l=>!o.includes(l)),(l,p)=>E(l,p))}default:if(/^image:\d+$/.test(i)){let o=r.images.nodes[i.slice(6)-1]||r.featuredImage;return N(n,o?.url,o?.altText||r.title)}if(i.startsWith("metafield:")){let o=pr(r,i.slice(10));return o?o.reference?.image?N(n,o.reference.image.url,o.reference.image.altText):(/^(rich_text|multi_line_text)_field$/.test(o.type)&&(n.style.whiteSpace="pre-line"),E(n,o.value)):E(n,"")}return}}),this.$(a("option-list")).forEach(n=>{let i=this.optName(d(n,"option-list")),s=r.options.find(o=>o.name===i);return!s||s.optionValues.length<=1&&X(n,"hide-single")?j(n,!1):V(n,s.optionValues,(o,l)=>{o.setAttribute(y("option-value"),l.name);let p=o.querySelector(a("bind","option-value"));p?E(p,l.name):o.firstElementChild||E(o,l.name);let f=o.querySelector(a("bind","swatch"));f&&l.swatch?.color&&(f.style.backgroundColor=l.swatch.color),f&&l.swatch?.image?.previewImage&&N(f,l.swatch.image.previewImage.url,l.name)})}),this.$(`select${a("option")}`).forEach(n=>{let i=r.options.find(s=>s.name===this.optName(d(n,"option")));if(!i)return j(n,!1);n.innerHTML="",i.optionValues.forEach(s=>n.appendChild(new Option(s.name,s.name)))}),this.$(`select${a("variant-select")}`).forEach(n=>{n.innerHTML="",r.variants.nodes.forEach(i=>n.appendChild(new Option(i.title,i.id)))}),this.$(a("plan-list")).forEach(n=>{let i=(d(n,"plan-list")||"").trim(),s=["","true","all","*"].includes(i.toLowerCase())?null:i,o=this.plans.filter(l=>!s||l.group.name===s);V(n,o,(l,p)=>{l.setAttribute(y("plan-value"),p.id),!l.firstElementChild&&!l.querySelector(a("plan-bind"))&&E(l,p.name)})}),this.$(`select${a("plan")}`).forEach(n=>{n.innerHTML="",!r.requiresSellingPlan&&d(n,"plan")!=="subscription-only"&&n.appendChild(new Option(n.getAttribute(y("one-time-label"))||"One-time purchase","")),this.plans.forEach(i=>n.appendChild(new Option(i.name,i.id)))})}renderVariant(){let e=this.product,r=this.findVariant();if(r||([r]=e.variants.nodes,r&&(this.selected={},r.selectedOptions.forEach(u=>{this.selected[u.name]=u.value}))),this.variant=r,!r)return;if(this.plans.length&&!D(r,this.planId)){let u=this.plans.find(g=>D(r,g.id));u&&(this.planId=u.id)}let n=this.isSubscription,i=r.price,s=this.planId?ft(r,this.planId):null,o=n?s:i,l=n&&D(r,this.planId)?.priceAdjustments?.[0]?.compareAtPrice||r.compareAtPrice,p=l&&parseFloat(l.amount)>parseFloat(o.amount),f=p?Math.round((1-parseFloat(o.amount)/parseFloat(l.amount))*100):0,m=this.planId?Nt(r,this.planId):{amount:null,percentage:0},h=this.plan,C={amount:(parseFloat(o.amount)*Math.max(1,this.quantity)).toFixed(2),currencyCode:o.currencyCode},A=O,lt=u=>u?`${u}%`:"",Wt={price:()=>A(o),"total-price":()=>A(C),"one-time-price":()=>A(i),"subscription-price":()=>A(s),"subscription-savings":()=>lt(m.percentage),"subscription-savings-amount":()=>A(m.amount),"checkout-charge":()=>A(n?ue(r,this.planId):o),"plan-name":()=>h?.name,"plan-description":()=>h?.description,"plan-group":()=>h?.group?.name,"compare-at-price":()=>p?A(l):"","unit-price":()=>A(r.unitPrice),"discount-percentage":()=>`${f}%`,"discount-amount":()=>p?A({amount:String(parseFloat(l.amount)-parseFloat(o.amount)),currencyCode:o.currencyCode}):"","variant-title":()=>r.title,"variant-id":()=>r.id,sku:()=>r.sku,barcode:()=>r.barcode,stock:()=>r.quantityAvailable,quantity:()=>this.quantity};this.$(a("bind")).forEach(u=>{let g=d(u,"bind");g==="variant-image"?N(u,r.image?.url||e.featuredImage?.url,r.image?.altText||e.title):Wt[g]&&E(u,Wt[g]())}),this.$(a("option-selected")).forEach(u=>E(u,this.selected[this.optName(d(u,"option-selected"))]||"")),this.$(a("option-list")).forEach(u=>{let g=this.optName(d(u,"option-list"));v(u,a("option-value")).forEach(S=>{let W=d(S,"option-value");bt(S,this.selected[g]===W);let k=!this.isValueAvailable(g,W);S.classList.toggle("is-unavailable",k),S.setAttribute("data-unavailable",k?"true":"false")})}),this.$(`select${a("option")}`).forEach(u=>{u.value=this.selected[this.optName(d(u,"option"))]||""}),this.$(`select${a("variant-select")}`).forEach(u=>{u.value=r.id}),this.$(a("purchase")).forEach(u=>{if(u.tagName==="SELECT"){u.value=this.purchase;return}let g=d(u,"purchase");bt(u,g===this.purchase);let S=g==="subscription"?!this.subscriptionAvailable:e.requiresSellingPlan;u.classList.toggle("is-unavailable",S)}),this.$(a("plan-value")).forEach(u=>{let g=d(u,"plan-value"),S=this.plans.find(k=>k.id===g),W=!!D(r,g);bt(u,n&&g===this.planId),u.classList.toggle("is-unavailable",!W),v(u,a("plan-bind")).forEach(k=>{let J=de(S),Le=Nt(r,g),er=d(k,"plan-bind"),qe={name:()=>S?.name,description:()=>S?.description,price:()=>A(ft(r,g)),savings:()=>lt(Le.percentage),"savings-amount":()=>A(Le.amount),adjustment:()=>J?J.type==="percentage"?`${J.value}%`:A(J.value):""}[er];qe&&E(k,qe())})}),this.$(`select${a("plan")}`).forEach(u=>{u.value=n?this.planId:""});let b={"in-stock":r.availableForSale,"out-of-stock":!r.availableForSale,backorder:r.availableForSale&&r.currentlyNotInStock,"on-sale":!!p,"not-on-sale":!p,"has-variants":e.variants.nodes.length>1,"single-variant":e.variants.nodes.length===1,"low-stock":r.quantityAvailable!=null&&r.quantityAvailable>0&&r.quantityAvailable<=5,"subscription-available":this.subscriptionAvailable,"subscription-unavailable":!this.subscriptionAvailable,"subscription-only":!!e.requiresSellingPlan,"one-time-available":!e.requiresSellingPlan,"subscription-selected":n,"one-time-selected":!n,"has-savings":n?m.percentage>0:!!p,loading:!1,ready:!0,error:!1,"not-found":!1};this.$(a("show")).forEach(u=>{let g=d(u,"show");g in b&&(Vt.includes(g)&&!we(u,this.root)||j(u,b[g]))}),this.root.classList.toggle("is-subscription",n),this.root.setAttribute(y("purchase-mode"),n?"subscription":"one-time"),this.$(a("add-to-cart")).forEach(u=>{let g=!r.availableForSale;u.classList.toggle("is-disabled",g),u.setAttribute("aria-disabled",String(g)),"disabled"in u&&(u.disabled=g);let S=d(u,"soldout-text"),W=d(u,"subscribe-text");if(S||W){let k=u.querySelector(a("add-label"))||u;k.dataset.tetherLabel===void 0&&(k.dataset.tetherLabel=k.tagName==="INPUT"?k.value:k.textContent);let J=k.dataset.tetherLabel;n&&W&&(J=W),g&&S&&(J=S),u.getAttribute("aria-busy")!=="true"&&E(k,J)}}),$("variant-changed",{product:e,variant:r,selected:{...this.selected},purchase:this.purchase,sellingPlanId:n?this.planId:null},this.root)}};var Ae={};F(Ae,{ListScope:()=>Pt,listSelector:()=>nt});var nt=()=>`${a("collection")},${a("products")},${a("recommendations")}`,Pt=class{constructor(e){this.root=e,this.products=[],this.pageInfo=null,this.collection=null,G(e,"loading"),e.addEventListener("click",r=>{let n=r.target.closest?.(a("load-more"));n&&n.closest(nt())===e&&(r.preventDefault(),R(n,()=>this.load(!0)))})}$(e){return Z(this.root,e,nt())}options(){let e=this.root,r={first:parseInt(d(e,"limit")||"",10)||void 0,sortKey:d(e,"sort")||void 0,reverse:d(e,"reverse")==="true"};return X(e,"collection")?r.collection=d(e,"collection"):r.query=d(e,"products")||"",r}async load(e=!1){let r=this.loadToken=(this.loadToken||0)+1,n=()=>r!==this.loadToken;try{if(X(this.root,"recommendations")){let i=d(this.root,"recommendations"),s=await U(i),o=await ht(s.id,d(this.root,"intent")||"RELATED");if(n())return;let l=parseInt(d(this.root,"limit")||"",10);this.products=l?o.slice(0,l):o}else{let i=await pt({...this.options(),after:e?this.pageInfo?.endCursor:null});if(n())return;this.collection=i.collection,this.pageInfo=i.pageInfo,this.products=e?[...this.products,...i.products]:i.products}this.render(),G(this.root,"ready"),$("list-ready",{products:this.products,collection:this.collection},this.root)}catch(i){if(n())return;e||G(this.root,$t(i)?"not-found":"error",i),x(i,"list load failed"),$("error",{error:i,context:"list"},this.root)}}render(){let e=this.collection;this.$(a("collection-bind")).forEach(n=>{switch(d(n,"collection-bind")){case"title":return E(n,e?.title||"");case"description":n.innerHTML=e?.descriptionHtml||"";return;case"image":return N(n,e?.image?.url,e?.image?.altText||e?.title);case"count":return E(n,this.products.length);default:return}}),this.$(a("list")).forEach(n=>{V(n,this.products,(i,s)=>{i.setAttribute(y("product"),s.handle),i.removeAttribute(y("state"))}),$("list-rendered",{container:n},this.root)});let r=this.products.length===0;this.$(a("show")).forEach(n=>{let i=d(n,"show");i==="list-empty"&&(n.style.display=r?"":"none"),i==="list-filled"&&(n.style.display=r?"none":"")}),this.$(a("load-more")).forEach(n=>{n.style.display=this.pageInfo?.hasNextPage?"":"none"}),B("list")}};var Ce={};F(Ce,{hydrateFromPage:()=>Se,liveLists:()=>ct,liveProducts:()=>at,mountProduct:()=>Qt,mountedLists:()=>Ht,mountedProducts:()=>xt,pruneLive:()=>Gt,retryFailed:()=>Ee,within:()=>At});var xt=new WeakSet,Ht=new WeakSet,at=new Set,ct=new Set,He=new WeakMap;function Gt(){at.forEach(t=>{t.isConnected||at.delete(t)}),ct.forEach(t=>{t.root.isConnected||ct.delete(t)})}function At(t,e){return[...t.matches?.(e)?[t]:[],...v(t,e)]}function Qt(t){if(xt.has(t))return!1;let{key:e,fromUrl:r,raw:n}=ot(t);if(!e)return r?(xt.add(t),G(t,"not-found"),$("product-not-found",{key:null,source:n},t)):t.closest(nt())||L(`[${y("product")}] without a value. Bind it to the Shopify handle field, or use "url:handle".`,t),!1;xt.add(t),at.add(t);let i={};He.set(t,i);let s=()=>He.get(t)===i;return Q.get(t)?t.setAttribute(y("state"),"updating"):G(t,"loading"),U(e).then(o=>{if(!s())return;let l=Q.get(t);l?l.update(o):new wt(t,o),hr(t,o),c.revalidate!==!1&&ae(e)&&fr(e)}).catch(o=>{if(!s())return;let l=$t(o);G(t,l?"not-found":"error",o),l?($("product-not-found",{key:e,source:n},t),r?T(`product not found: ${e}`):x(o,`product ${e}`)):(x(o,`product ${e}`),$("error",{error:o,context:"product",key:e},t))}),!0}function hr(t,e){let r=d(t,"page-title");!r||typeof document>"u"||(document.title=r.replace(/\{title\}/g,e.title).replace(/\{vendor\}/g,e.vendor||"").replace(/\{type\}/g,e.productType||""))}function Ee(){Gt(),at.forEach(t=>{t.getAttribute(y("state"))!=="error"||t.getAttribute(y("error"))==="not-found"||(xt.delete(t),Qt(t))})}var Bt=new Set;function fr(t){Bt.size||setTimeout(mr,0),Bt.add(t)}function mr(){let t=[...Bt];Bt=new Set,ce(t).forEach((e,r)=>e.then(n=>{at.forEach(i=>{let s=Q.get(i);if(!s||!i.isConnected)return;let o=ot(i).key;o!==t[r]&&o!==n.handle&&o!==n.id||JSON.stringify(s.product)!==JSON.stringify(n)&&s.update(n)})}).catch(n=>x(n,`refresh ${t[r]}`)))}var Ge=new WeakSet;function Se(t=document){v(t.ownerDocument||t,'script[type="application/json"][data-tether-hydrate]').forEach(e=>{if(!Ge.has(e)){Ge.add(e);try{let r=JSON.parse(e.textContent);Kt(r.products);let n=(i,s)=>String(i||"").toUpperCase()===String(s||"").toUpperCase();n(r.country,c.country)&&n(r.language,c.language)?oe(r.products):T("hydration skipped: other market")}catch(r){L("bad data-tether-hydrate",r)}}})}var{cfg:gr}=It,Qe={"config.js":It,"client.js":Zt,"dom.js":ye,"fragments.js":ee,"loader.js":le,"selling-plans.js":gt,"status.js":Pe,"cart.js":$e,"product.js":xe,"collection.js":Ae,"mounting.js":Ce},Ie=typeof document<"u"&&document.currentScript?.src||"",Et={};function it(t){if(Et[t])return Et[t];let e=gr.partsUrl||Ie.replace(/[^/]*$/,""),r=/\.min\.js(\?|$)/.test(Ie)||!Ie?".min":"",n=`${e.replace(/\/?$/,"/")}tether.${t}${r}.js`;return Et[t]=new Promise((i,s)=>{let o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>window.Tether?.__parts?.[t]?i(window.Tether.__parts[t]):s(new Error(`${n} did not register`)),o.onerror=()=>{delete Et[t],s(new Error(`Could not load ${n}. Host it next to the Tether script, or set partsUrl.`))},document.head.appendChild(o)}),Et[t]}var We="0.5.0",st=null,ke=null;function St(t=document){if(!Ct())return 0;let e=0;return Gt(),Se(t),At(t,nt()).forEach(r=>{if(Ht.has(r))return;Ht.add(r),e++;let n=new Pt(r);ct.add(n),r.addEventListener(`${c.prefix}:list-rendered`,i=>St(i.detail.container)),n.load()}),At(t,a("product")).forEach(r=>{Qt(r)&&e++}),At(t,`${a("country-select")},${a("country-bind")}`).length&&it("markets").then(r=>r.renderCountrySelects(t)).catch(r=>x(r,"markets")),v(t,a("account-link")).forEach(r=>{r.setAttribute("href",`https://${c.domain}/account`)}),P.render(),T(`mounted ${e} scope(s)`,t),e}function Ye(){P.close()}function yr(t){let e=t?.closest?.(a("product"));return e&&Q.get(e)||null}var Je=!1;function br(){Je||(Je=!0,document.addEventListener("click",t=>{let e=t.target;if(!e?.closest)return;if(e.closest(a("cart-open"))){t.preventDefault(),P.toggle();return}if(e.closest(a("cart-close"))){t.preventDefault(),P.close();return}let r=e.closest(a("cart-clear"));if(r){t.preventDefault(),R(r,()=>P.clear().catch(l=>x(l,"cart clear")));return}let n=e.closest(a("checkout"));if(n){t.preventDefault(),R(n,()=>P.checkout());return}let i=e.closest(ze());if(i&&i.closest(a("cart-lines"))){let l=i.getAttribute(`data-${c.prefix}-key`),p=P.lines.find(m=>m.id===l),f=m=>{t.preventDefault(),m().catch(h=>x(h,"cart line"))};if(e.closest(a("line-remove")))return f(()=>P.removeLine(l));if(p&&e.closest(a("line-plus")))return f(()=>P.updateLine(l,p.quantity+1));if(p&&e.closest(a("line-minus")))return f(()=>P.updateLine(l,p.quantity-1))}let s=e.closest(a("discount-remove"));if(s){t.preventDefault();let l=s.closest(a("discount-code"))?.getAttribute(y("discount-code"));l&&P.removeDiscount(l).catch(p=>x(p,"discount"));return}let o=e.closest(a("group-add"));o&&(t.preventDefault(),R(o,()=>Xe(o)))}),document.addEventListener("change",t=>{let e=t.target;if(!e?.closest)return;let n=e.closest(ze())?.getAttribute(`data-${c.prefix}-key`);n&&e.matches(`input${a("line","quantity")}`)?P.updateLine(n,parseInt(e.value,10)||0).catch(i=>x(i,"cart line")):n&&e.matches(`select${a("line-plan")}`)?P.updateLine(n,{sellingPlanId:e.value||null}).catch(i=>x(i,"cart line plan")):e.matches(`select${a("country-select")}`)?e.value&&tr(e.value).catch(i=>x(i,"country")):e.matches(a("cart-note"))&&P.setNote(e.value).catch(i=>x(i,"cart note"))}),document.addEventListener("submit",t=>{let e=t.target.closest?.(a("discount-form"));if(!e)return;t.preventDefault();let r=e.querySelector(a("discount-input"))||e.querySelector("input"),n=r?.value.trim();n&&R(e,async()=>{try{let s=((await P.applyDiscount(n))?.discountCodes||[]).find(o=>o.code.toLowerCase()===n.toLowerCase())?.applicable;s||await P.removeDiscount(n).catch(()=>{}),e.classList.toggle("is-invalid",!s),$(s?"discount-applied":"discount-invalid",{code:n},e),s&&r&&(r.value="")}catch(i){e.classList.add("is-invalid"),x(i,"discount")}})},!0),document.addEventListener("input",t=>{t.target.closest?.(a("discount-form"))?.classList.remove("is-invalid")}),c.astro!==!1&&(document.addEventListener("astro:page-load",()=>St(document)),document.addEventListener("astro:before-swap",()=>Ye())),window.addEventListener("online",()=>{Ee(),ct.forEach(t=>{t.root.getAttribute(y("state"))==="error"&&t.load()})}),document.addEventListener("keydown",t=>{if(!P.isOpen())return;if(t.key==="Escape"){P.close();return}if(t.key!=="Tab"||c.cartFocus===!1)return;let e=P.drawers().find(s=>s.classList.contains(c.cartDrawerOpenClass)),r=e?Ut(e):[];if(!r.length)return;let n=r[0],i=r[r.length-1];(!e.contains(document.activeElement)||t.shiftKey&&document.activeElement===n||!t.shiftKey&&document.activeElement===i)&&(t.preventDefault(),(t.shiftKey?i:n).focus())}))}function ze(){return`[data-${c.prefix}-key]`}async function Xe(t){let e=t.closest(a("group"));if(!e)return null;let r=d(e,"group"),n=H(vt(e,"line-attributes")),i=r?[{key:"_group",value:r},...n]:n,s=v(e,a("product")).map(o=>Q.get(o)).filter(o=>o&&o.variant?.availableForSale&&o.quantity>0).map(o=>{let l=o.getLine();return l.attributes=[...l.attributes||[],...i],l});if(!s.length)return L("group-add: nothing selected"),null;try{let o=await P.add(s);return $("group-added",{group:r,lines:s},e),o}catch(o){return x(o,"group add"),null}}function Ze(t={}){return st&&!Object.keys(t).length?st:(zt({...window.TETHER_CONFIG||{},...t}),Ct()?(br(),c.observe&&$r(),st=vr(t).then(()=>P.init()).then(async e=>{let r=c.country?String(c.country).toUpperCase():null;if(e&&r&&e.buyerIdentity?.countryCode&&e.buyerIdentity.countryCode!==r)try{e=await P.setBuyerIdentity({countryCode:r},{create:!1})}catch(n){x(n,"cart country")}return $("ready",{cart:e}),Te}),st):(L("TETHER_CONFIG is missing domain or token. Tether is idle."),st=Promise.resolve(null),st))}async function vr(t){let e=c.markets||{};if(e.detect===!1)return;let r=null;if(e.detect)try{r=(await it("markets")).detectMarket(e)}catch(n){x(n,"markets");return}else if(e.remember!==!1){try{r=JSON.parse(localStorage.getItem(`${c.prefix}:market:${c.domain}`)||"null")}catch{}r&&!/^[A-Z]{2}$/.test(r.country||"")&&(r=null)}r&&(r.country&&(c.country=r.country),r.language&&(c.language=r.language),r.locale&&!t.locale&&(c.locale=r.locale),T("market",r))}function tr(t,e){return it("markets").then(r=>r.setCountry(t,e))}function $r(){if(ke||typeof MutationObserver>"u")return;let t=null,e=new Set;ke=new MutationObserver(r=>{r.forEach(n=>n.addedNodes.forEach(i=>{i.nodeType===1&&e.add(i)})),clearTimeout(t),t=setTimeout(()=>{e.forEach(n=>{n.isConnected&&St(n)}),e.clear()},50)}),ke.observe(document.body,{childList:!0,subtree:!0})}var Te={VERSION:We,init:Ze,mount:St,unmount:Ye,get config(){return c},get ready(){return st||Promise.resolve(null)},query:q,withContext:Tt,cart:P,getProduct:U,getProducts:pt,getRecommendations:ht,getScope:yr,addGroup:Xe,primeProduct:Y,normalizeProductKey:rt,clearProductCache:se,formatMoney:O,imageUrl:_t,plans:gt,TetherError:I,resolveProductKey:ot,setCountry:tr,detectMarket:t=>it("markets").then(e=>e.detectMarket(t||c.markets)),getLocalization:()=>it("markets").then(t=>t.getLocalization()),diagnose:t=>it("diagnose").then(e=>e.diagnose({...t,version:We})),__core:Qe,__parts:{},on(t,e){let r=n=>e(n.detail,n);return document.addEventListener(`${c.prefix}:${t}`,r),()=>document.removeEventListener(`${c.prefix}:${t}`,r)}},cn=Te;if(typeof window<"u"&&typeof document<"u"&&(window.Tether=Te,window.TETHER_CONFIG&&window.TETHER_CONFIG.autoMount!==!1&&!window.TETHER_INTEGRATION)){let e=()=>Ze().then(()=>St(document));document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}})();
|
|
134
5
|
//# sourceMappingURL=tether.min.js.map
|