PageSourceSearch

https://wellwoven.com/_next/static/immutable/chunks/3l6me-pvmop6k.js

js wellwoven.com collected 2026-09-25 19:47:02 UTC 40,855 bytes, 209 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,340461,t=>{"use strict";t.i(247167);let e=[".wellwoven.com"],r=new Set(["wellwoven.com","wellwoven-com.myshopify.com"]);t.s(["isInternalShopifyHost",0,function(t){if(!t)return!1;let n=t.toLowerCase();return!!r.has(n)||e.some(t=>n.endsWith(t))}])},998669,768834,579473,70650,139704,635316,914840,937608,138174,267903,t=>{"use strict";var e=t.i(271645);let r=t=>{let e,r=new Set,n=(t,n)=>{let a="function"==typeof t?t(e):t;if(!Object.is(a,e)){let t=e;e=(null!=n?n:"object"!=typeof a||null===a)?a:Object.assign({},e,a),r.forEach(r=>r(e,t))}},a=()=>e,i={setState:n,getState:a,getInitialState:()=>o,subscribe:t=>(r.add(t),()=>r.delete(t))},o=e=t(n,a,i);return i},n=t=>{let n=t?r(t):r,a=t=>(function(t,r=t=>t){let n=e.default.useSyncExternalStore(t.subscribe,e.default.useCallback(()=>r(t.getState()),[t,r]),e.default.useCallback(()=>r(t.getInitialState()),[t,r]));return e.default.useDebugValue(n),n})(n,t);return Object.assign(a,n),a},a=t=>t?n(t):n;function i(t,e){let r;try{r=t()}catch(t){return}return{getItem:t=>{var n;let a=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),i=null!=(n=r.getItem(t))?n:null;return i instanceof Promise?i.then(a):a(i)},setItem:(t,n)=>r.setItem(t,JSON.stringify(n,null==e?void 0:e.replacer)),removeItem:t=>r.removeItem(t)}}t.s(["create",0,a],768834);let o=t=>e=>{try{let r=t(e);if(r instanceof Promise)return r;return{then:t=>o(t)(r),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>o(e)(t)}}},c=(t,e)=>(r,n,a)=>{let c,s={storage:i(()=>window.localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},l=!1,u=0,d=new Set,m=new Set,f=s.storage;if(!f)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...t)},n,a);let p=()=>{let t=s.partialize({...n()});return f.setItem(s.name,{state:t,version:s.version})},h=a.setState;a.setState=(t,e)=>(h(t,e),p());let g=t((...t)=>(r(...t),p()),n,a);a.getInitialState=()=>g;let y=()=>{var t,e;if(!f)return;let a=++u;l=!1,d.forEach(t=>{var e;return t(null!=(e=n())?e:g)});let i=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,null!=(t=n())?t:g))||void 0;return o(f.getItem.bind(f))(s.name).then(t=>{if(t)if("number"!=typeof t.version||t.version===s.version)return[!1,t.state];else{if(s.migrate){let e=s.migrate(t.state,t.version);return e instanceof Promise?e.then(t=>[!0,t]):[!0,e]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(t=>{var e;if(a!==u)return;let[i,o]=t;if(r(c=s.merge(o,null!=(e=n())?e:g),!0),i)return p()}).then(()=>{a===u&&(null==i||i(n(),void 0),c=n(),l=!0,m.forEach(t=>t(c)))}).catch(t=>{a===u&&(null==i||i(void 0,t))})};return a.persist={setOptions:t=>{s={...s,...t},t.storage&&(f=t.storage)},clearStorage:()=>{null==f||f.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:t=>(d.add(t),()=>{d.delete(t)}),onFinishHydration:t=>(m.add(t),()=>{m.delete(t)})},s.skipHydration||y(),c||g};t.s(["createJSONStorage",0,i,"persist",0,c],579473);var s=t.i(247167),l=t.i(467034);function u(t){return t.extensions?.code==="ACCESS_DENIED"&&Array.isArray(t.path)&&t.path.length>0}function d(t){return t.match(/\b(?:query|mutation)\s+(\w+)/)?.[1]??"anonymous"}async function m(t,e={},r){let n,a=r?.cache?{cache:r.cache}:{next:{revalidate:r?.revalidate??600}};for(let i=0;i<=2;i++)try{let o;if(i>0){let t=2e3*i;await new Promise(e=>setTimeout(e,t))}let c=await fetch("https://wellwoven-com.myshopify.com/api/2026-04/graphql.json",{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":"9f37eac5c2690828d51eba34b5aec875"},body:JSON.stringify({query:t,variables:e}),...a,signal:AbortSignal.timeout(2e4)});if(!c.ok){if((c.status>=500||429===c.status)&&i<2){n=Error(`Shopify API error: ${c.status} ${c.statusText}`);continue}throw Error(`Shopify API error: ${c.status} ${c.statusText}`)}if("1"===s.default.env.SHOPIFY_FETCH_AUDIT){let r=await c.text();console.info("shopify.fetch.audit",{operation:d(t),bytes:l.Buffer.byteLength(r,"utf8"),variables:e}),o=JSON.parse(r)}else o=await c.json();if(o.errors?.length){if(!(r?.allowDegradedFieldErrors!==!1&&null!=o.data&&o.errors.every(u)))throw Error(o.errors.map(t=>t.message).join("\n"));
1console.error("shopify.fetch.access_denied_field",{operation:d(t),fields:o.errors.map(t=>t.path?.join(".")),requiredAccess:o.errors.map(t=>t.message)})}return o.data}catch(t){if(i<2&&function(t){if(!(t instanceof Error))return!1;if("TimeoutError"===t.name)return!0;let e=new Set(["ETIMEDOUT","ECONNRESET","UND_ERR_SOCKET","EAI_AGAIN"]),r=t;for(let t=0;t<5&&r;t++)if("object"==typeof r&&null!==r){let t=r;if("string"==typeof t.code&&(e.has(t.code)||t.code.startsWith("ERR_SSL_")))return!0;if(Array.isArray(t.errors)){for(let r of t.errors)if(r&&"object"==typeof r&&"code"in r){let t=r.code;if("string"==typeof t&&(e.has(t)||t.startsWith("ERR_SSL_")))return!0}}r=t.cause}else break;return!1}(t)){n=t,console.warn("shopify.fetch.retry",{attempt:i+1,maxAttempts:3,errorName:t.name,errorMessage:t.message});continue}throw t}throw n}let f=`
2  fragment CartFragment on Cart {
3    id
4    checkoutUrl
5    note
6    attributes {
7      key
8      value
9    }
10    totalQuantity
11    discountCodes {
12      code
13      applicable
14    }
15    discountAllocations {
16      discountedAmount {
17        amount
18        currencyCode
19      }
20    }
21    cost {
22      subtotalAmount {
23        amount
24        currencyCode
25      }
26      totalAmount {
27        amount
28        currencyCode
29      }
30    }
31    lines(first: 100) {
32      pageInfo {
33        hasNextPage
34      }
35      edges {
36        node {
37          id
38          quantity
39          attributes {
40            key
41            value
42          }
43          sellingPlanAllocation {
44            sellingPlan {
45              id
46              name
47            }
48          }
49          cost {
50            totalAmount {
51              amount
52              currencyCode
53            }
54          }
55          discountAllocations {
56            discountedAmount {
57              amount
58              currencyCode
59            }
60          }
61          merchandise {
62            ... on ProductVariant {
63              id
64              title
65              image {
66                url
67                altText
68                width
69                height
70              }
71              price {
72                amount
73                currencyCode
74              }
75              product {
76                id
77                title
78                handle
79                tags
80                collections(first: 100) {
81                  nodes {
82                    id
83                  }
84                  pageInfo {
85                    hasNextPage
86                  }
87                }
88                leadTimeDays: metafield(
89                  namespace: "custom"
90                  key: "lead_time_days"
91                ) {
92                  value
93                }
94                displayTitle: metafield(
95                  namespace: "wellwoven"
96                  key: "display_title"
97                ) {
98                  value
99                }
100              }
101              selectedOptions {
102                name
103                value
104              }
105            }
106          }
107        }
108      }
109    }
110  }
111`,p=`
112  ${f}
113  mutation CartCreate($input: CartInput!) {
114    cartCreate(input: $input) {
115      cart {
116        ...CartFragment
117      }
118      userErrors {
119        field
120        message
121      }
122    }
123  }
124`,h=`
125  ${f}
126  mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
127    cartLinesAdd(cartId: $cartId, lines: $lines) {
128      cart {
129        ...CartFragment
130      }
131      userErrors {
132        field
133        message
134      }
135    }
136  }
137`,g=`
138  ${f}
139  mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {
140    cartLinesUpdate(cartId: $cartId, lines: $lines) {
141      cart {
142        ...CartFragment
143      }
144      userErrors {
145        field
146        message
147      }
148    }
149  }
150`,y=`
151  ${f}
152  mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {
153    cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
154      cart {
155        ...CartFragment
156      }
157      userErrors {
158        field
159        message
160      }
161    }
162  }
163`,w=`
164  ${f}
165  mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {
166    cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
167      cart {
168        ...CartFragment
169      }
170      userErrors {
171        field
172        message
173      }
174    }
175  }
176`,v=`
177  ${f}
178  mutation CartNoteUpdate($cartId: ID!, $note: String!) {
179    cartNoteUpdate(cartId: $cartId, note: $note) {
180      cart {
181        ...CartFragment
182      }
183      userErrors {
184        field
185        message
186      }
187    }
188  }
189`,b=`
190  ${f}
191  mutation CartAttributesUpdate($cartId: ID!, $attributes: [AttributeInput!]!) {
192    cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
193      cart {
194        ...CartFragment
195      }
196      userErrors {
197        field
198        message
199      }
200    }
201  }
202`,_=`
203  ${f}
204  query Cart($cartId: ID!) {
205    cart(id: $cartId) {
206      ...CartFragment
207    }
208  }
209`;function C(t){let e=t.lines,r=t.discountCodes,n=t.discountAllocations;return{...t,attributes:Array.isArray(t.attributes)?t.attributes:[],discountCodes:r??[],discountAllocations:Array.isArray(n)?n:[],lines:e.edges.map(t=>
209({...t.node,attributes:Array.isArray(t.node.attributes)?t.node.attributes:[],sellingPlanAllocation:t.node.sellingPlanAllocation??null,discountAllocations:Array.isArray(t.node.discountAllocations)?t.node.discountAllocations:[]}))}}var S=t.i(681307);let I=S.z.object({amount:S.z.string(),currencyCode:S.z.string()}),A=S.z.object({url:S.z.string(),altText:S.z.string().nullable(),width:S.z.number(),height:S.z.number()}),k=S.z.object({name:S.z.string(),value:S.z.string()}),E=S.z.object({id:S.z.string(),quantity:S.z.number(),attributes:S.z.array(S.z.object({key:S.z.string(),value:S.z.string()})),sellingPlanAllocation:S.z.object({sellingPlan:S.z.object({id:S.z.string(),name:S.z.string()})}).nullable().optional(),cost:S.z.object({totalAmount:I}),merchandise:S.z.object({id:S.z.string(),title:S.z.string(),image:A.nullable().optional(),price:I,product:S.z.object({title:S.z.string(),handle:S.z.string()}),selectedOptions:S.z.array(k)})}),P=S.z.object({id:S.z.string(),checkoutUrl:S.z.string(),attributes:S.z.array(S.z.object({key:S.z.string(),value:S.z.string()})),totalQuantity:S.z.number(),discountCodes:S.z.array(S.z.object({code:S.z.string(),applicable:S.z.boolean()})),cost:S.z.object({subtotalAmount:I,totalAmount:I}),lines:S.z.object({edges:S.z.array(S.z.object({node:E}))})});var $=t.i(125722);let x="wellwoven-cart-id";function D(t){if("u"<typeof document)return;let e="https:"===window.location.protocol?"; Secure":"";document.cookie=`${x}=${encodeURIComponent(t)}; path=/; max-age=1209600; SameSite=Lax${e}`}function L(){if("u"<typeof document)return null;let t=document.cookie.match(RegExp(`(?:^|; )${x}=([^;]*)`));if(!t)return null;try{return decodeURIComponent(t[1])}catch{return null}}function N(){try{localStorage.removeItem(x)}catch{}!function(){if("u"<typeof document)return;let t="https:"===window.location.protocol?"; Secure":"";document.cookie=`${x}=; path=/; max-age=0; SameSite=Lax${t}`}()}function U(){let t=null;try{t=localStorage.getItem(x)}catch{}let e=L();if(t)return e!==t&&D(t),t;if(e){try{localStorage.setItem(x,e)}catch{}return e}return null}let z="wellwoven-checkout-pending";function T(t){let e=null;try{e=sessionStorage.getItem(z)}catch{return!1}if(!e)return!1;try{sessionStorage.removeItem(z)}catch{}try{let r=JSON.parse(e);if(!r.cartId)return!1;return r.cartId===t}catch{return!1}}t.s(["consumeCheckoutPending",0,T,"markCheckoutPending",0,function(t){try{let e={cartId:t,at:Date.now()};sessionStorage.setItem(z,JSON.stringify(e))}catch{}}],70650);var O=t.i(762606);
209let j="America/New_York",F=["january","february","march","april","may","june","july","august","september","october","november","december"];function R(t,e,r){if(!Number.isFinite(t)||!Number.isFinite(e)||!Number.isFinite(r)||e<1||e>12||r<1||r>31)return null;let n=new Date(Date.UTC(t,e-1,r,12));return n.getUTCFullYear()!==t||n.getUTCMonth()!==e-1||n.getUTCDate()!==r?null:`${String(t).padStart(4,"0")}-${String(e).padStart(2,"0")}-${String(r).padStart(2,"0")}`}function q(t){let e=t?.match(/^(\d{4})-(\d{2})-(\d{2})$/);return e?R(Number(e[1]),Number(e[2]),Number(e[3])):null}function M(t=new Date){let e=Object.fromEntries(new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:j}).formatToParts(t).map(t=>[t.type,t.value])),r=R(Number(e.year),Number(e.month),Number(e.day));if(!r)throw Error("Could not resolve the Well Woven store date");return r}function J(t){let e=q(t);if(!e)return null;let[r,n,a]=e.split("-").map(Number),i=new Date(Date.UTC(r,n-1,a,12));return new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",timeZone:j}).format(i)}function G(t,e){let r=q(e),n=function(t){if(!t)return null;let e=t.match(/^(\d{4})-(\d{2})-(\d{2})(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2}))?$/);if(e&&!Number.isNaN(Date.parse(t)))return R(Number(e[1]),Number(e[2]),Number(e[3]));let r=t.match(/^(?:Ships\s+(?:(?:on|by)\s+)?)?(\d{1,2})\/(\d{1,2})\/(\d{4}|\d{2})$/i);if(r){var n;return R((n=Number(r[3]))<100?2e3+n:n,Number(r[1]),Number(r[2]))}let a=t.match(/^(?:Ships\s+(?:(?:on|by)\s+)?)?([A-Za-z]{3,9})\.?\s+(\d{1,2}),?\s+(\d{4})$/i);if(!a)return null;let i=a[1].toLowerCase(),o=F.findIndex(t=>i===t||i===t.slice(0,3)||"september"===t&&"sept"===i);return o>=0?R(Number(a[3]),o+1,Number(a[2])):null}(t);if(!r||!n||n<r)return null;let a=J(n);return a?{dateOnly:n,display:a}:null}t.s(["formatDateOnly",0,J,"getStoreDateOnly",0,M,"parseDateOnly",0,q,"resolveCurrentPreorderShipDate",0,G],139704);let W="_preorder",K="_preorder_ship_date_iso",V="_preorder_ship_date",H="_preorder_selling_plan_id",B="Pre-order",Z=[W,K,V,H,B];function Q(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return`gid://shopify/SellingPlan/${t}`;if("string"!=typeof t)return null;let e=t.trim(),r="gid://shopify/SellingPlan/",n=e.startsWith(r)?e.slice(r.length):e;return/^[1-9]\d*$/.test(n)?`${r}${n}`:null}function Y(t,e){return t.attributes?.find(t=>t.key===e)?.value??null}function X(t){let e=t.attributes.filter(t=>t.key===W);return 1===e.length&&e[0]?.value==="true"}function tt(t,e=M(),r={}){let n=r.linesArePreorderCandidates?t:t.filter(X);if(0===n.length)return null;let a=[],i=new Set,o=0;for(let t of n){let r=new Set;Z.some(e=>t.attributes.filter(t=>t.key===e).length>1)&&r.add("duplicate-canonical-attribute"),"true"!==Y(t,W)&&r.add("missing-preorder-flag");let n=Y(t,K),c=Y(t,V);null===n&&null===c&&r.add("missing-date"),null===n&&r.add("missing-canonical-date");let s=function(t,e){let r=Y(t,K);if(null!==r){let t=G(r,e);return t&&t.dateOnly===r?t:null}return G(Y(t,V),e)}(t,e);s?null!==n&&(c!==s.display&&r.add("display-date-mismatch"),Y(t,B)!==`Expected to ship ${s.display}`&&r.add("display-copy-mismatch")):r.add("invalid-or-expired-date");let l=Y(t,H),u=Q(l);l&&u&&u===l||r.add("missing-selling-plan-id");let d=Q(t.sellingPlanAllocation?.sellingPlan.id);if(d?u&&d!==u&&r.add("selling-plan-mismatch"):r.add("missing-selling-plan-allocation"),r.size>0)for(let e of(o+=t.quantity,r))i.add(e);else s&&a.push(s.dateOnly)}let c=a.sort().at(-1)??null;return{lineCount:n.reduce((t,e)=>t+e.quantity,0),invalidLineCount:o,isValid:0===i.size,shipDate:c?J(c):null,shipDateIso:c,invalidReasons:[...i]}}function te(t){if(!t)return"";let e=1===t.lineCount?"item":"items";return t.isValid&&t.shipDate?`Pre-order: ${t.lineCount} ${e}. Latest expected ship date: ${t.shipDate}.`:`Pre-order: ${t.lineCount} ${e}. Shipping date requires verification.`}t.s(["PREORDER_CART_BLOCK_MESSAGE",0,"Your pre-order needs an updated ship date. Please remove it and add it again from the product page.","buildPreorderCartAttributes",0,function(t,e,r=M()){let n=G(t,r);if(!n||n.dateOnly!==t)throw Error("A current canonical preorder ship date is required");let a=Q(e);if(!a||a!==e)throw Error("An exact Shopify preorder selling-plan GID is required");return[{key:W,value:"true"},{key:K,value:n.dateOnly},{key:V,value:n.display},{key:H,value:a},{key:B,value:`Expected to ship ${n.display}`}]},"buildPreorderCartNote",0,te,"getCartPreorderSummary",0,tt,"isPreorderCartLine",0,X,"normalizePreorderSellingPlanId",0,Q],635316);var tr=t.i(113222),tn=t.i(345367),ta=t.i(340461);let ti="ww_pmax_attribution",to="ww_pmax_session",tc=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$/,ts=/^[a-z0-9]{24,64}$/,tl=Object.freeze({enabled:!1,treatmentPercent:0,key:"pmax-v1"}
209),tu=new Set(["ww_pmax_acq","ww_pmax_campaign","ww_pmax_asset_group","ww_pmax_product","ww_pmax_anchor_product","ww_pmax_anchor_variant","ww_pmax_device","ww_pmax_landing_path","ww_pmax_captured_at","ww_pmax_session_id","ww_pmax_treatment"]);function td(t){if("string"!=typeof t)return null;let e=t.trim();return e.length<=100&&tc.test(e)?e:null}function tm(t){if("string"!=typeof t)return null;let e=t.trim();return/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,199}$/.test(e)?e:null}function tf(t){let e=tm(t?.anchorProductId),r=tm(t?.anchorVariantId);return{...e?{anchorProductId:e}:{},...r?{anchorVariantId:r}:{}}}function tp(t){if("string"!=typeof t)return"/";let e=t.trim();return 0===e.length||e.length>512||!e.startsWith("/")||e.startsWith("//")||e.includes("\\")||/[\u0000-\u001f\u007f]/.test(e)?"/":e}function th(t){if("string"==typeof t)switch(t.trim().toLowerCase()){case"mobile":case"desktop":case"tablet":case"other":return t.trim().toLowerCase();default:return}}function tg(t){return"pmax"===new URLSearchParams(t||"").get("ww_acq")}function ty(t){let e,r,n,a,i,o;return tg(t)?{acquisition:"pmax",context:(e=new URLSearchParams(t||""),r={},n=td(e.get("ww_campaign")),a=td(e.get("ww_asset_group")),i=td(e.get("ww_product")),o=th(e.get("ww_device")),n&&(r.campaign=n),a&&(r.assetGroup=a),i&&(r.product=i),o&&(r.device=o),r)}:null}function tw(t,e=tl){if(!ts.test(t)||!0!==e.enabled)return"off";let r=Math.max(0,Math.min(100,Math.floor(e.treatmentPercent??0)));return 0===r?"control":100===r||function(t){let e=0x811c9dc5;for(let r=0;r<t.length;r+=1)e^=t.charCodeAt(r),e=Math.imul(e,0x1000193);return(e>>>0)%100}(`${e.key??"pmax-v1"}:${t}`)<r?"treatment":"control"}function tv(){let t=globalThis.crypto;if(t?.getRandomValues){let e=new Uint8Array(16);return t.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}return`${Date.now().toString(36)}${Math.random().toString(36).slice(2)}`.replace(/[^a-z0-9]/g,"").padEnd(24,"0").slice(0,32)}function tb(t=Date.now()){if(!(0,tn.resolveEffectiveConsent)().marketing)return t_(),null;try{let e=window.localStorage.getItem(ti),r=function(t,e){if(!t)return null;try{let r=JSON.parse(t);if(!r||"pmax"!==r.acquisition||"number"!=typeof r.capturedAt||!Number.isFinite(r.capturedAt)||r.capturedAt>e||e-r.capturedAt>7776e6||"string"!=typeof r.sessionId||!ts.test(r.sessionId)||"off"!==r.treatment&&"control"!==r.treatment&&"treatment"!==r.treatment)return null;let n=r.context&&"object"==typeof r.context?r.context:{},a=r.anchor&&"object"==typeof r.anchor?r.anchor:{};return{acquisition:"pmax",context:{...td(n.campaign)?{campaign:td(n.campaign)}:{},...td(n.assetGroup)?{assetGroup:td(n.assetGroup)}:{},...td(n.product)?{product:td(n.product)}:{},...th(n.device)?{device:th(n.device)}:{}},anchor:tf({anchorProductId:"string"==typeof a.anchorProductId?a.anchorProductId:void 0,anchorVariantId:"string"==typeof a.anchorVariantId?a.anchorVariantId:void 0}),landingPath:tp(r.landingPath),capturedAt:r.capturedAt,sessionId:r.sessionId,treatment:r.treatment}}catch{return null}}(e,t);return!r&&e&&window.localStorage.removeItem(ti),r}catch{return null}}function t_(){try{window.localStorage.removeItem(ti),window.sessionStorage.removeItem(to)}catch{}}function tC(t=Date.now(),e=tl,r){if(!(0,tn.resolveEffectiveConsent)().marketing)return t_(),null;if(!tg(window.location.search))return null;let n=function(){if(!(0,tn.resolveEffectiveConsent)().marketing)return null;try{let t=window.sessionStorage.getItem(to);if(t&&ts.test(t))return t;let e=tv();return window.sessionStorage.setItem(to,e),e}catch{return tv()}}();if(!n)return null;let a=function(t,e,r,n,a=tl,i){let o=ty(t);return o&&ts.test(r)?{...o,anchor:tf(i),landingPath:tp(e),capturedAt:n,sessionId:r,treatment:tw(r,a)}:null}(window.location.search,window.location.pathname,n,t,e,r);if(!a)return null;try{window.localStorage.setItem(ti,JSON.stringify(a))}catch{}return a}function tS(t){return tu.has(t)}function tI(){if(!(0,tn.resolveEffectiveConsent)().marketing)return[];var t=tb();if(!t)return[];let e=[{key:"ww_pmax_acq",value:"pmax"},{key:"ww_pmax_landing_path",value:t.landingPath},{key:"ww_pmax_captured_at",value:new Date(t.capturedAt).toISOString()},{key:"ww_pmax_session_id",value:t.sessionId},{key:"ww_pmax_treatment",value:t.treatment}];return t.context.campaign&&e.push({key:"ww_pmax_campaign",value:t.context.campaign}),t.context.assetGroup&&e.push({key:"ww_pmax_asset_group",value:t.context.assetGroup}),t.context.product&&e.push({key:"ww_pmax_product",value:t.context.product}),t.anchor?.anchorProductId&&e.push({key:"ww_pmax_anchor_product",value:t.anchor.anchorProductId}),t.anchor?.anchorVariantId&&e.push({key:"ww_pmax_anchor_variant",value:t.anchor.anchorVariantId}),t.context.device&&e.push({key:"ww_pmax_device",value:t.context.device}),e}t.s(["PMAX_CONTEXT_QUERY_KEYS",0,["ww_campaign","ww_asset_group","ww_product","ww_device"],"capturePmaxAttributionFromLocation",0,tC,"clearStoredPmaxAttribution",0,t_,"getConsentedPmaxAttributionAttributes",0,tI,"getOrAssignPmaxTreatment",0,function(t,e,r=tl){let n=ty(t);if(!n||!(0,tn.resolveEffectiveConsent)().marketing)return null;try{let t=e.getItem(to);return t&&ts.test(t)||(t=tv(),e.setItem(to,t)),{...n,sessionId:t,treatment:tw(t,r)}}catch{let t=tv();return{...n,sessionId:t,treatment:tw(t,r)}}},"isPmaxAttributionAttributeKey",0,tS,"readPmaxExperienceFromUrl",0,ty,"readStoredPmaxAttribution",0,tb],914840);let tA=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],tk="ww_paid_attribution",tE=/[\u0000-\u001f\u007f]/,tP=
209/^(?:cpc|ppc|paid|paid[-_ ]?social|paid[-_ ]?search|display|retargeting|remarketing)$/i,t$=new Set(["ww_first","ww_latest_paid"].flatMap(t=>[...tA.map(e=>`${t}_${e}`),`${t}_landing_path`,`${t}_captured_at`]));function tx(t,e){if("string"!=typeof t)return null;let r=t.trim();return 0===r.length||r.length>e||tE.test(r)?null:r}function tD(t){if(!t||"object"!=typeof t)return{};let e={};for(let r of tA){let n=tx(t[r],200);n&&(e[r]=n)}return e}function tL(t){return tA.some(e=>!!t[e])}function tN(t){let e=new URLSearchParams(t||""),r={};for(let t of tA){let n=tx(e.get(t),200);n&&(r[t]=n)}return r}function tU(t){let e=t.utm_medium;return"string"==typeof e&&tP.test(e.trim())}function tz(t){let e=tx(t,512);return e?.startsWith("/")?e:"/"}function tT(t,e){if(!t||"object"!=typeof t)return null;let r=t.capturedAt;if("number"!=typeof r||!Number.isFinite(r)||r>e||e-r>7776e6)return null;let n=tD(t.utms);return tL(n)?{utms:n,landingPath:tz(t.landingPath),capturedAt:r}:null}function tO(t=Date.now()){try{let e=window.localStorage.getItem(tk),r=function(t,e){let r;if(!t)return null;try{r=JSON.parse(t)}catch{return null}if(!r||"object"!=typeof r)return null;let n=r,a=n.updatedAt;if("number"!=typeof a||!Number.isFinite(a)||a>e||e-a>7776e6)return null;let i=tT(n.firstTouch,e),o=tT(n.latestPaidTouch,e),c=o&&tU(o.utms)?o:null,s=i??c;return s?{firstTouch:s,...c?{latestPaidTouch:c}:{},updatedAt:a}:null}(e,t);return!r&&e&&window.localStorage.removeItem(tk),r}catch{return null}}function tj(t,e){let r=[];for(let n of tA){let a=e.utms[n];a&&r.push({key:`${t}_${n}`,value:a})}return r.push({key:`${t}_landing_path`,value:e.landingPath},{key:`${t}_captured_at`,value:new Date(e.capturedAt).toISOString()}),r}function tF(t){return t$.has(t)||tS(t)}function tR(){var t;return(0,tn.resolveEffectiveConsent)().marketing?[...(t=tO())?[...tj("ww_first",t.firstTouch),...t.latestPaidTouch?tj("ww_latest_paid",t.latestPaidTouch):[]]:[],...tI()]:[]}t.s(["capturePaidAttributionFromLocation",0,function(t=Date.now()){var e;if(!(0,tn.resolveEffectiveConsent)().marketing){try{window.localStorage.removeItem(tk)}catch{}t_();return}let r=tN(window.location.search);if(!tL(r))return void tC(t);let n=(e=function(t,e,r,n){let a=tD(e);if(!tL(a))return t;let i={utms:a,landingPath:tz(r),capturedAt:n};return{firstTouch:t?.firstTouch??i,latestPaidTouch:tU(a)?i:t?.latestPaidTouch,updatedAt:n}}(tO(t),r,window.location.pathname,t))?JSON.stringify(e):null;if(n){try{window.localStorage.setItem(tk,n)}catch{}tC(t)}},"decoratePaidAttributionCheckoutUrl",0,function(t){let e;if(!(0,tn.resolveEffectiveConsent)().marketing)return t;try{e=new URL(t)}catch{return t}return"https:"===e.protocol&&(0,ta.isInternalShopifyHost)(e.hostname)?function(t,e){let r;if(!e)return t;try{r=new URL(t)}catch{return t}for(let t of tA){let n=(e.latestPaidTouch??e.firstTouch).utms[t];n&&!r.searchParams.has(t)&&r.searchParams.set(t,n)}return r.toString()}(t,tO()):t},"getConsentedPaidAttributionAttributes",0,tR,"isPaidAttributionAttributeKey",0,tF,"isPaidUtmTouch",0,tU,"parseUtms",0,tN],937608);let tq=["gclid","gbraid","wbraid","fbclid","ttclid","msclkid","oppref"],tM="ww_order_click_attribution",tJ=/^[\w.-]{1,512}$/;function tG(t,e){if("oppref"!==t)return"string"==typeof e&&tJ.test(e);return"string"==typeof e&&e.length>0&&e.length<=512&&!/[\u0000-\u001F\u007F]/.test(e)}function tW(t){return tq.some(e=>tG(e,t[e]))}function tK(t=Date.now()){try{let e=window.localStorage.getItem(tM),r=function(t,e){let r;if(!t)return null;try{r=JSON.parse(t)}catch{return null}if(!r||"object"!=typeof r||Array.isArray(r))return null;let n=r,a=n.capturedAt;if("number"!=typeof a||!Number.isFinite(a)||a>e||e-a>7776e6)return null;let i=function(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};let e={};for(let r of tq)tG(r,t[r])&&(e[r]=t[r]);return e}(n.ids);return tW(i)?{ids:i,capturedAt:a}:null}(e,t);return!r&&e&&window.localStorage.removeItem(tM),r}catch{return null}}function tV(){try{window.localStorage.removeItem(tM)}catch{}}t.s(["ORDER_CLICK_ID_KEYS",0,tq,"captureOrderClickIdsFromLocation",0,function(t=Date.now()){var e;if(!(0,tn.resolveEffectiveConsent)().marketing)return void tV();let r=function(t){let e=new URLSearchParams(t||""),r={};for(let t of tq){let n=e.get(t);tG(t,n)&&(r[t]=n)}return r}(window.location.search);if(!tW(r)){tU(tN(window.location.search))&&tV();return}let n=tW((e={ids:r,capturedAt:t}).ids)?JSON.stringify(e):null;if(n)try{window.localStorage.setItem(tM,n)}catch{}},"readStoredOrderClickAttribution",0,tK],138174);var tH=t.i(325427),tB=t.i(103118),tZ=t.i(553768);let tQ="ww_attribution_version",tY="ww_click_captured_at";function tX(t){return`ww_click_${t}`}let t0=new Set([...tq.map(tX),tY]);function t1(){return(0,tn.resolveEffectiveConsent)().marketing?function(t,e,r=[]){return 0===t.length&&0===e.length&&0===r.length?[]:[{key:tQ,value:"1"},...t,...e,...r]}([...tR(),...(0,tH.getRecommendationAttributionAttributes)()],function(){let t=tK();if(!t)return[];let e=[];for(let r of tq){let n=t.ids[r];n&&e.push({key:tX(r),value:n})}return e.push({key:tY,value:new Date(t.capturedAt).toISOString()}),e}(),[...(0,tB.getPdpGorgiasChatAttributionAttributes)(),...(0,tZ.getGorgiasTrackingAttributes)()]):[]}var t2=t.i(575948);let t7="_internal_production",t6="_internal_production_buy_now",t3="_internal_production_ship_date",t4="Expected ship date",t9="Production lead time";function t5(t){let e=(0,t2.parseProductLeadTimeDays)(t)??t2.LEAD_TIME_CONFIG.internal_production.handlingDaysMax;return 0===e?"Ships the same business day when ordered before the applicable cutoff":`Ships within ${e} business ${1===e?"day":"days"}`}function t8(t,e){return t.attributes?.find(t=>t.key===e)?.value??null}function et(t){return"true"===t8(t,t7)||"true"===t8(t,t6)}function ee(t,e){let r,n,a;if(!et(t)||(n=(r=t.attributes??[]).filter(({key:t})=>t===t7),a=r.filter(({key:t})=>t===t9),1===n.length&&n[0]?.value==="true"&&1===a.length&&a[0]?.value===t5(e)&&!r.some(({ke
209y:t})=>[t6,t3,t4].includes(t))))return null;let i=t.attributes??[],o=i.filter(({key:t})=>t!==t7&&t!==t6&&t!==t3&&t!==t4&&t!==t9);return o.unshift({key:t7,value:"true"}),o.push({key:t9,value:t5(e)}),JSON.stringify(o)===JSON.stringify(i)?null:o}t2.LEAD_TIME_CONFIG.internal_production.handlingDaysMax,t.s(["buildInternalProductionCartAttributes",0,function(t){return[{key:t7,value:"true"},{key:t9,value:t5(t)}]},"isInternalProductionCartLine",0,et,"migrateInternalProductionCartLineAttributes",0,ee],267903);var er=t.i(129518);let en=null,ea=Promise.resolve();class ei extends Error{constructor(t){super(t),this.name="CartUserError"}}function eo(t){let e=(0,tr.getLineUnitPrice)(t).amount,r=Number(e);if(""!==e.trim()&&Number.isFinite(r)&&r>=0)return r;let n=Number(t.cost.totalAmount.amount);return t.quantity>0?n/t.quantity:n}function ec(t){return[...t??[]].map(({key:t,value:e})=>`${t}\u0000${e}`).sort().join("\x01")}function es(t,e){let r=ec(e.attributes),n=t.lines.filter(t=>t.merchandise.id===e.variantId);return n.find(t=>ec(t.attributes)===r)??n.at(-1)}function el(t,e){let r=t.attributes?.find(t=>"_custom_price"===t.key)?.value,n=Number(r);return r&&Number.isFinite(n)&&n>=0?n:eo(e)}async function eu(t,e){let r=tt(t.lines),n=e?tt(e.lines):null;if(!r&&!n)return t;let a=te(r);if(t.note===a)return t;try{let e=await m(v,{cartId:t.id,note:a},{cache:"no-store"});if(e.cartNoteUpdate.userErrors.length>0||!e.cartNoteUpdate.cart)return console.warn("[cart] failed to sync preorder cart note:",e.cartNoteUpdate.userErrors[0]?.message??"missing cart"),t;return C(e.cartNoteUpdate.cart)}catch(e){return console.warn("[cart] failed to sync preorder cart note:",e),t}}async function ed(t){let e=t.lines.flatMap(t=>{let e=ee(t,t.merchandise.product.leadTimeDays?.value);return e?[{id:t.id,attributes:e}]:[]});if(0===e.length)return t;try{let r=await m(g,{cartId:t.id,lines:e},{cache:"no-store"});if(r.cartLinesUpdate.userErrors.length>0||!r.cartLinesUpdate.cart)return console.warn("[cart] failed to migrate legacy production timing:",r.cartLinesUpdate.userErrors[0]?.message??"missing cart"),t;return C(r.cartLinesUpdate.cart)}catch(e){return console.warn("[cart] failed to migrate legacy production timing:",e),t}}function em(t){let e={merchandiseId:t.variantId,quantity:t.quantity??1};return t.sellingPlanId&&(e.sellingPlanId=t.sellingPlanId),t.attributes&&t.attributes.length>0&&(e.attributes=t.attributes),e}function ef(t){return(0,O.normalizePendingDiscountCode)(t)}function ep(t){return(t?.discountCodes??[]).map(t=>ef(t.code)).filter(Boolean).sort()}class eh extends Error{userMessage;constructor(t){super(t),this.userMessage=t,this.name="DiscountNotApplicableError"}}async function eg(t,e){try{let r=await fetch("/api/discount/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cartId:t,code:e})});if(!r.ok)return null;let n=await r.json();if("boolean"!=typeof n?.ok)return null;return n}catch{return null}}function ey(t){return Math.round(100*Math.max(0,t))/100}function ew(t,e){return{code:ef(t),title:e.title,kind:e.kind,predictedDiscountAmount:ey(e.predictedDiscountAmount),predictedFreeShipping:e.predictedFreeShipping,overridesStorefront:e.overridesStorefront}}function ev(t){let e=t.map(t=>({...t,code:ef(t.code),predictedDiscountAmount:ey(t.predictedDiscountAmount)})).filter(t=>t.code);if(0===e.length)return null;let r=e.reduce((t,e)=>t+e.predictedDiscountAmount,0),n=e.find(t=>"free-shipping"!==t.kind)?.kind??e[0].kind;return{code:e.map(t=>t.code).join(" + "),title:e.map(t=>t.title).join(" + "),kind:n,predictedDiscountAmount:ey(r),predictedFreeShipping:e.some(t=>t.predictedFreeShipping),overridesStorefront:e.some(t=>t.overridesStorefront),codes:e}}function eb(t){return t?t.codes?.length?t.codes.map(t=>({...t,code:ef(t.code)})):[{code:ef(t.code),title:t.title,kind:t.kind,predictedDiscountAmount:t.predictedDiscountAmount,predictedFreeShipping:t.predictedFreeShipping,overridesStorefront:t.overridesStorefront}]:[]}function e_(t){return new Set((t?.discountCodes??[]).map(t=>ef(t.code)).filter(Boolean))}let eC={length:0,clear:()=>{},getItem:()=>null,key:()=>null,removeItem:()=>{},setItem:()=>{}},eS=a()(c((t,e)=>{async function r(t){let e=t1(),r=await m(p,{input:{lines:t,...e.length>0?{attributes:e}:{}}},{cache:"no-store"});if(r.cartCreate.userErrors.length>0)throw new ei(r.cartCreate.userErrors[0].message);let n=C(r.cartCreate.cart);var a=n.id;try{localStorage.setItem(x,a)}catch{}return D(a),n=await eu(n)}async function n(n,a,i){var o;let c=await m(h,{cartId:n,lines:a},{cache:"no-store"}),s=c.cartLinesAdd.userErrors;if(o=c.cartLinesAdd.cart,null===o||s.some(t=>"INVALID"===t.code||/not\s*found|invalid\s*cart|does\s*not\s*exist/i.test(t.message)))return(0,$.trackCartError)(i,"not_found",s[0]?.message??"cart was null"),N(),t({cart:null}),r(a);if(s.length>0)throw new ei(s[0].message);return eu(C(c.cartLinesAdd.cart),e().cart)}async function a(r){let n=e().cart;if(!n)return;let a=n.lines.find(t=>
209t.id===r);t({isLoading:!0});try{let e=await m(y,{cartId:n.id,lineIds:[r]},{cache:"no-store"});if(e.cartLinesRemove.userErrors.length>0)throw new ei(e.cartLinesRemove.userErrors[0].message);let i=await eu(C(e.cartLinesRemove.cart),n);t({cart:i,isLoading:!1}),a&&(0,$.trackRemoveFromCart)({item_id:a.merchandise.id,item_name:a.merchandise.product.title,item_brand:"Well Woven",item_variant:a.merchandise.title,price:eo(a),quantity:a.quantity,currency:i.cost.totalAmount.currencyCode}),0===i.totalQuantity&&N()}catch(e){throw console.error("Failed to remove from cart:",e),(0,$.trackCartError)("remove",e instanceof ei?"user_error":"network",e instanceof Error?e.message:String(e)),t({isLoading:!1}),e}}async function i(r){let n=ef(r),a=e().cart;if(!a)throw Error("No cart to apply discount to");if(n){t({isLoading:!0});try{var i;let r,o,c=await m(w,{cartId:a.id,discountCodes:Array.from(new Set([...a.discountCodes.map(t=>ef(t.code)),n])).filter(Boolean)},{cache:"no-store"});if(c.cartDiscountCodesUpdate.userErrors.length>0)throw new ei(c.cartDiscountCodesUpdate.userErrors[0].message);let s=C(c.cartDiscountCodesUpdate.cart);t({cart:s});let l=e().discountPreview,u=await eg(s.id,n);if(!u)return void t({isLoading:!1});if(!u.ok){let e,r,a=s;try{let e=await m(w,{cartId:s.id,discountCodes:s.discountCodes.map(t=>ef(t.code)).filter(t=>t!==n)},{cache:"no-store"});0===e.cartDiscountCodesUpdate.userErrors.length&&(a=C(e.cartDiscountCodesUpdate.cart),t({cart:a}))}catch(t){console.warn("[cart] failed to detach rejected code:",t)}throw t({discountPreview:(i=a,e=ef(n),r=e_(i),ev(eb(l).filter(t=>t.code!==e&&r.has(t.code)))),isLoading:!1}),new eh(u.message)}t({discountPreview:(r=ef(n),o=e_(s),ev([...eb(l).filter(t=>t.code!==r&&o.has(t.code)),ew(r,u)])),isLoading:!1})}catch(e){if(e instanceof eh)throw(0,$.trackCartError)("discount_apply","user_error",e.userMessage),e;throw console.error("Failed to apply discount:",e),(0,$.trackCartError)("discount_apply",e instanceof ei?"user_error":"network",e instanceof Error?e.message:String(e)),t({isLoading:!1}),e}}}async function o(){let t=(0,O.getPendingDiscountCode)();if(t)try{await i(t),(0,O.clearPendingDiscountCode)()}catch(t){t instanceof eh&&(0,O.clearPendingDiscountCode)(),console.warn("[cart] pending discount did not apply:",t)}}return{cart:null,isOpen:!1,isLoading:!1,discountPreview:null,openCart:()=>t({isOpen:!0}),closeCart:()=>t({isOpen:!1}),toggleCart:()=>t(t=>({isOpen:!t.isOpen})),syncPaidAttribution:async()=>{let r=async()=>{var r,n;let a=e().cart;if(!a)return null;let i=(r=a.attributes??[],n=t1(),[...r.filter(t=>{var e;return!((e=t.key)===tQ||tF(e)||(0,tH.isRecommendationAttributionAttributeKey)(e)||(0,tB.isPdpGorgiasChatAttributionAttributeKey)(e)||(0,tZ.isGorgiasTrackingAttributeKey)(e)||t0.has(e))}),...n]),o=a.attributes??[];if(o.length===i.length&&o.every((t,e)=>t.key===i[e]?.key&&t.value===i[e]?.value))return a;try{let e=await m(b,{cartId:a.id,attributes:i},{cache:"no-store"});if(e.cartAttributesUpdate.userErrors.length>0||!e.cartAttributesUpdate.cart)return console.warn("[cart] failed to sync order attribution:",e.cartAttributesUpdate.userErrors[0]?.message??"missing cart"),a;let r=C(e.cartAttributesUpdate.cart);return t({cart:r}),r}catch(t){return console.warn("[cart] failed to sync order attribution:",t),a}},n=ea.then(r,r);return ea=n.then(()=>void 0,()=>void 0),n},initCart:async()=>en||(en=(async()=>{let r=U();if(r){if(T(r)){N(),t({cart:null});return}try{let a=await m(_,{cartId:r},{cache:"no-store"});if(a.cart){var n;let r;n=a.cart,(r=P.safeParse(n)).success||console.warn("[Shopify] Schema validation warning for cart.init:",r.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`).join(", "));let i=await ed(C(a.cart));if(t({cart:i}),i.discountCodes.length>0){let r=ep(i);Promise.all(i.discountCodes.map(async t=>{let e=ef(t.code),r=await eg(i.id,e);return r?.ok?ew(e,r):null})).then(n=>{var a;let i=ev(n.filter(t=>null!==t));a=ep(e().cart),r.length===a.length&&r.every((t,e)=>t===a[e])&&i&&t({discountPreview:i})}).catch(()=>{})}}else N(),t({cart:null})}catch(t){throw console.error("Failed to restore cart:",t),(0,$.trackCartError)("init","network",t instanceof Error?t.message:String(t)),t}}})().catch(t=>{throw en=null,t})),addToCart:async(a,i=1,c)=>{try{await e().initCart()}catch{if(!e().cart&&U())throw Error("Cart restore failed")}let s=async()=>{t({isLoading:!0});try{let s=em({variantId:a,quantity:i,attributes:c}),l=e().cart;l=l?await n(l.id,[s],"add"):await r([s]),t({cart:l,isOpen:!0,isLoading:!1});let u={variantId:a,quantity:i,attributes:c},d=es(l,u);d&&((0,$.trackAddToCart)({item_id:a,item_name:d.merchandise.product.title,item_brand:"Well Woven",item_variant:d.merchandise.title,price:el(u,d),quantity:i,currency:l.cost.totalAmount.currencyCode}),(0,er.trackKlaviyoAddedToCart)({cart:l,addedLine:d,addedQuantity:i})),await o()}catch(e){throw console.error("Failed to add to cart:",e),(0,$.trackCartError)("add",e instanceof ei?"user_error":"network",e instanceof Error?e.message:String(e)),t({isLoading:!1}),e}},l=ea.then(s,s);return ea=l.catch(()=>{}),l},addToCartBatch:async a=>{if(0===a.length)return;try{await e().initCart()}catch{if(!e().cart&&U())throw Error("Cart restore failed")}let i=async()=>{t({isLoading:!0});try{let i=a.map(em),c=e().cart;for(let e of(c=c?await n(c.id,i,"add_batch"):await r(i),t({cart:c,isOpen:!0,isLoading:!1}),a)){let t=es(c,e);t&&(0,$.trackAddToCart)({item_id:e.variantId,item_name:t.merchandise.product.title,item_brand:"Well Woven",item_variant:t.merchandise.title,price:el(e,t),quantity:e.quantity??1,currency:c.cost.totalAmount.currencyCode})}let s=a[0],l=es(c,s);l&&(0,er.trackKlaviyoAddedToCart)({cart:c,addedLine:l,addedQuantity:s.quantity??1}),await o()}catch(e){throw console.error("Failed to add items to cart:",e),(0,$.trackCartError)("add_batch",e instanceof ei?"user_error":"network",e instanceof Error?e.message:String(e)),t({isLoading:!1}),e}},c=ea.then(i,i);
209return ea=c.catch(()=>{}),c},updateLineQuantity:async(r,n)=>{let i=async()=>{let i=e().cart;if(i){t({isLoading:!0});try{if(n<=0)return void await a(r);let e=await m(g,{cartId:i.id,lines:[{id:r,quantity:n}]},{cache:"no-store"});if(e.cartLinesUpdate.userErrors.length>0)throw new ei(e.cartLinesUpdate.userErrors[0].message);let o=await eu(C(e.cartLinesUpdate.cart),i);t({cart:o,isLoading:!1})}catch(e){throw console.error("Failed to update cart:",e),(0,$.trackCartError)("update",e instanceof ei?"user_error":"network",e instanceof Error?e.message:String(e)),t({isLoading:!1}),e}}},o=ea.then(i,i);return ea=o.catch(()=>{}),o},removeLine:async t=>{let e=()=>a(t),r=ea.then(e,e);return ea=r.catch(()=>{}),r},applyDiscountCode:async t=>{let e=async()=>{await i(t)},r=ea.then(e,e);return ea=r.catch(()=>{}),r},removeDiscountCode:async()=>{let r=async()=>{let r=e().cart;if(r){t({isLoading:!0});try{let e=await m(w,{cartId:r.id,discountCodes:[]},{cache:"no-store"});if(e.cartDiscountCodesUpdate.userErrors.length>0)throw new ei(e.cartDiscountCodesUpdate.userErrors[0].message);t({cart:C(e.cartDiscountCodesUpdate.cart),discountPreview:null,isLoading:!1})}catch(e){throw console.error("Failed to remove discount:",e),(0,$.trackCartError)("discount_remove",e instanceof ei?"user_error":"network",e instanceof Error?e.message:String(e)),t({isLoading:!1}),e}}},n=ea.then(r,r);return ea=n.catch(()=>{}),n}}},{name:"wellwoven-cart-state",version:1,storage:i(()=>{try{return localStorage.getItem("__ww_probe__"),localStorage}catch{return eC}}),partialize:t=>({cart:t.cart}),skipHydration:!0,merge:(t,e)=>{let r=function(t,e){if(t&&t.cart)return t.cart.id!==e?{cart:null}:{cart:t.cart}}(t,L());return void 0===r?e:{...e,...r}}}));t.s(["DiscountNotApplicableError",0,eh,"useCartStore",0,eS],998669)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.