PageSourceSearch

https://everythingfor420.com/cdn/shopifycloud/checkout-web/assets/c1/c610ba76.BDqqIv-6.js

js everythingfor420.com collected 2026-10-01 14:32:57 UTC 91,195 bytes, 8 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["cf517225.fNg-M79t.js","4c290a1e.CvCmFIo_.js","2c1ab0fe.DYQSH7bT.js","app.Bvc4uxd4.js","assets/app.BuSMBobh.css","assets/previous.BpuyvRSB.css","65f3d4da.CPQqj7Ry.js","66338e00.D_vtmHsB.js","164ad2e3.BcELPLd1.js","60a453ce.BJZuodLH.js","0a7dffce.BF-zuF6E.js","bb728e1c.D4AahLMP.js","assets/stopwatch.Kyhz8KoT.css","2210eadb.EwEgHOG0.js","28ac86c0.xCp67-Sr.js","3e6029dd.D-JwA4XF.js","assets/QRCode.BZ_m5G5a.css","30074413.DiBmOUNO.js","assets/Pressable.D9SfDfsb.css","efa0389a.BYXr6FgY.js","assets/Choice.B7lVAtpz.css","9f57d2aa.TT6vBd90.js","8574876b.ChO2GdxN.js","064f6ac1.D2j0Zkq2.js","assets/Popover.Bi1nHaU-.css","assets/DateField.CFFsBmUK.css","598fef4e.CNrSJxwe.js","assets/PaymentIcon.gzvCNwz_.css","33d2e4fc.C8-AHu8q.js","assets/NumberField.CRpcZnVJ.css","39921a74.BJI6Ssr2.js","assets/Switch.BS8yVgoP.css","27f09e31.DDcA2stW.js","137622f3.C3s9xvqK.js","54bf0ebb.B2q_EfzB.js","assets/Sheet.CpR5hiDV.css","1ed8f5e3.CGU5IASn.js","assets/floating-layer.DfWUBaTh.css","2fdb3dd3.SvLAczDE.js","53bbdad9.C7Msysac.js","47b970b2.DH4wP8_H.js","3ca8ef7e.CTrhvMhs.js","ac5a19ff.B7MskK0_.js","assets/FormLayout.CrYq3At_.css","29034f35.C0bk1Hps.js","assets/PhoneField.uZEuHncj.css","assets/AnnouncementRuntimeExtensions.DbBB6lBJ.css","cadec7c0.DuUayRsU.js","9c384ce8.mu6MOGR9.js","0b8657b8.IcKXrEvA.js"])))=>i.map(i=>d[i]);
2import{A as R,i as Fn,t as De,g as Hn,e as Ce}from"./60a453ce.BJZuodLH.js";import{E as D,f as zn,T as Jn,e as jn,h as qn,n as Kn,j as Qn,y as ye,R as mn,a4 as yn,aw as Wn,r as Xn}from"./2c1ab0fe.DYQSH7bT.js";import{b2 as y,iN as Zn,O as xn,fH as qe,aH as ns,dl as et,f as ts,G as Ve,dH as Ye,dL as st,be as nt,cb as tt,bg as rs,bd as rt,iO as it,ci as hn,cM as Ke,bw as vn,bi as ot,g as An,c4 as is,c5 as os,hX as at,aB as gn}from"./4c290a1e.CvCmFIo_.js";import{o as En,p as ze,q as In,r as _n,s as ge,d as ut,U as dt,S as as,t as Rn,I as ct,D as lt,u as Dn,O as pt}from"./66338e00.D_vtmHsB.js";import{e0 as ne,dc as ft,g5 as mt,g3 as Qe,hq as yt,hr as $e,hs as be,ht,hu as bn,d$ as me,bM as Fe,bN as He,hv as vt,dg as At,hw as gt,g_ as us,hx as Et}from"./164ad2e3.BcELPLd1.js";import{d as It,i as _t,e as Rt}from"./65f3d4da.CPQqj7Ry.js";import{g as Dt,b as bt,a as B}from"./28ac86c0.xCp67-Sr.js";import{_ as St}from"./app.Bvc4uxd4.js";import{p as Tt,a as Se,g as Ot,q as Nt}from"./cadec7c0.DuUayRsU.js";import{e as ds}from"./9c384ce8.mu6MOGR9.js";import{m as _e}from"./ac5a19ff.B7MskK0_.js";import{a as Lt,g as Pt}from"./0b8657b8.IcKXrEvA.js";import{v as kt}from"./2210eadb.EwEgHOG0.js";const Sn=e=>e??[];function bi(e){const s=e.merchantVisitorConsent();return{allowedProcessing:e.merchantAllowedProcessing(),visitorConsent:{analytics:Se(s.analytics),marketing:Se(s.marketing),preferences:Se(s.preferences),saleOfData:Se(s.sale_of_data)},shouldShowBanner:e.shouldShowBanner.value,saleOfDataRegion:e.saleOfDataRegion.value,region:Tt(e.getRegion.value),metafields:Sn(e.merchantMetafields())}}const Si={allowedProcessing:{analytics:!1,marketing:!1,preferences:!1,saleOfData:!1},visitorConsent:{analytics:void 0,marketing:void 0,preferences:void 0,saleOfData:void 0},shouldShowBanner:!1,saleOfDataRegion:!1,region:void 0,metafields:[]},wt="Capability not specified: Please declare this in your config: collect_buyer_consent.customer_privacy = true.",Mt="Personal data approval scope missing",Ct="The Customer Privacy API is not supported in Shop Pay.";function Vt(){return typeof navigator<"u"&&Zn(navigator.userAgent)}function Ut(e,s){const n=s!=null&&s>=400?`Failed to set tracking consent: ${e} (HTTP ${s})`:`Failed to set tracking consent: ${e}`;return s===401?new In(n):s!=null&&s>=400?new _n(n):Vt()&&e.includes("The string did not match the expected pattern")?new En(n):new ze(n)}function ie({customerPrivacySignal:e,createSubscribableFromSignal:s,extension:n,storefrontTokens:t,applyChange:r,extensionInstance:i,checkout:o,consentManager:u}){const l=n.capabilities.collectBuyerConsent?.customerPrivacy===!0,d=ne(n.approvalScopes,R.CustomerPersonalData);async function a(f){return r({unknownChange:f,extension:n,extensionInstanceId:i.id,allowChangeAfterJourneyCompletion:!0,allowChangeDuringAcceleratedWallet:!0,handlers:{async changeVisitorConsent({change:c}){if(!l)throw new y(wt);if(!d)throw new y(Mt);if(o.identity.current.value==="shopPay")throw new y(Ct);const p=(c.metafields||[]).filter(S=>S.value!==void 0);if(!!!p.length&&c.analytics===void 0&&c.marketing===void 0&&c.preferences===void 0&&c.saleOfData===void 0)return{type:"success"};const h=await t.get(n.appId,n.type,"customerPrivacy"),E=e.peek();return new Promise((S,g)=>{u.setTrackingConsent({analytics:c.analytics,marketing:c.marketing,preferences:c.preferences,saleOfData:c.saleOfData,isExtensionToken:!0,storefrontAccessToken:h??void 0,...p.length&&{metafields:p}},(...[A,N])=>{if(N)e.value={...E,allowedProcessing:u.merchantAllowedProcessing(),metafields:Sn(u.merchantMetafields()),visitorConsent:{analytics:c.analytics,marketing:c.marketing,preferences:c.preferences,saleOfData:c.saleOfData}},S({type:"success"});else if(A instanceof Error)g(new y(`Failed to set tracking consent: ${A.message}`));else if(A&&"error"in A){const I=String(A.error),L=A.statusCode,P=Ut(I,L);g(P)}
2else g(new ze("Received unexpected callback from setTrackingConsent()"))})})}},errorResult:c=>c instanceof y||c instanceof En||c instanceof ze||c instanceof In||c instanceof _n?{type:"error",message:c.message}:{type:"error",message:`Failed to set tracking consent: ${c.message}`}})}return{applyTrackingConsentChange:a,customerPrivacy:s(D(()=>{const{region:f,...c}=e.value,{countryCode:p,provinceCode:m}=f||{};return{...c,region:p||m?{countryCode:d?p:void 0,provinceCode:d?m:void 0}:void 0}}))}}function Ti(){const{source:e,checkout:s}=xn(),n=ft();return zn(()=>{const t=s.addressManager.shipping.value.applyAddressChangeBlockReason("ui-extension");return Gt({sourceType:e.type,canUpdateDiscountCodes:n.value,canSelectCustomAddress:!t.value})})}function Gt({sourceType:e="checkout",canUpdateDiscountCodes:s,canSelectCustomAddress:n}){const t=e==="draftOrder";return{attributes:{canUpdateAttributes:!0},delivery:{canSelectCustomAddress:n},discounts:{canUpdateDiscountCodes:s},lines:{canAddCartLine:!t,canRemoveCartLine:!t,canUpdateCartLine:!t},metafields:{canSetCartMetafields:!0,canDeleteCartMetafield:!0},notes:{canUpdateNote:!t}}}function he(e,s){return`${e} is not supported on this checkout. Consider checking "instructions.${s}" first.`}function Oi(e){const s=Jn(()=>new Map,[]),n=jn(s);return qn(()=>{Bt(s,e)},[e,s]),n}function Bt(e,s){for(const n of s)Yt(e,n.id)}function Yt(e,s){const n=e.get(s);if(n)return n;let t=()=>{};const i={promise:new Promise(o=>{t=o}),resolve:t};return e.set(s,i),i}function Ni(e,s,n){e.get(s)===n&&e.delete(s)}function $t(e,s,n){return!n||e.get(s)!==n?!1:(n.resolve(),!0)}function cs(e){const s=e.type==="local"?void 0:e.registrationId;return{appId:e.appId,appName:e.appName,extensionId:Qe(e),extensionRegistrationId:s,extensionName:e.name,extensionVersion:e.version,extensionApiVersion:e.apiVersion,extensionTarget:e.extensionPoint.target,extensionPlacement:e.placementReference,extensionType:e.type,isHighValueExtension:s!=null&&mt.has(s),isRemoteDom:e.apiVersion?Fn(e.apiVersion):!1}}function Oe(e,s=Tn){let n,t=!1;return D(()=>{const r=e();return t?s(n,r)?n:(n=r,r):(t=!0,n=r,r)})}function Ft(e){return Oe(e,qe)}function Ht(e){return Oe(e,zt)}function zt(e,s){if(e===s)return!0;if(!Array.isArray(e)||!Array.isArray(s)||e.length!==s.length)return!1;for(let n=0;n<e.length;n++)if(!Tn(e[n],s[n]))return!1;return!0}function Tn(e,s){if(e===s)return!0;if(e==null||s==null||typeof e!="object"||typeof s!="object")return!1;const n=Object.keys(e),t=Object.keys(s);return n.length!==t.length?!1:n.every(r=>Object.prototype.hasOwnProperty.call(s,r)&&e[r]===s[r])}const Jt={name:R.CustomerName,firstName:R.CustomerName,lastName:R.CustomerName,company:void 0,address1:R.CustomerAddress,address2:R.CustomerAddress,city:void 0,zip:R.CustomerAddress,countryCode:R.CustomerPersonalData,provinceCode:void 0,phone:R.CustomerPhone,oneTimeUse:void 0},jt=["DELIVERY_FIRST_NAME_REQUIRED","DELIVERY_FIRST_NAME_TOO_LONG","DELIVERY_FIRST_NAME_CONTAINS_EMOJIS","DELIVERY_FIRST_NAME_CONTAINS_HTML_TAGS","DELIVERY_FIRST_NAME_CONTAINS_URL","DELIVERY_FIRST_NAME_CONTAINS_MATHEMATICAL_SYMBOLS"],qt=["DELIVERY_LAST_NAME_REQUIRED","DELIVERY_LAST_NAME_TOO_LONG","DELIVERY_LAST_NAME_CONTAINS_EMOJIS","DELIVERY_LAST_NAME_CONTAINS_HTML_TAGS","DELIVERY_LAST_NAME_CONTAINS_URL","DELIVERY_LAST_NAME_CONTAINS_MATHEMATICAL_SYMBOLS"],Kt=["DELIVERY_COMPANY_REQUIRED","DELIVERY_COMPANY_TOO_LONG","DELIVERY_COMPANY_CONTAINS_EMOJIS","DELIVERY_COMPANY_CONTAINS_HTML_TAGS","DELIVERY_COMPANY_CONTAINS_MATHEMATICAL_SYMBOLS"],Qt=["DELIVERY_ADDRESS1_REQUIRED","DELIVERY_ADDRESS1_TOO_LONG","DELIVERY_ADDRESS1_CONTAINS_EMOJIS","DELIVERY_ADDRESS1_CONTAINS_HTML_TAGS","DELIVERY_ADDRESS1_CONTAINS_MATHEMATICAL_SYMBOLS"],Wt=["DELIVERY_ADDRESS2_REQUIRED","DELIVERY_ADDRESS2_TOO_LONG","DELIVERY_ADDRESS2_CONTAINS_EMOJIS","DELIVERY_ADDRESS2_CONTAINS_HTML_TAGS","DELIVERY_ADDRESS2_CONTAINS_MATHEMATICAL_SYMBOLS"],Xt=["DELIVERY_CITY_REQUIRED","DELIVERY_CITY_TOO_LONG","DELIVERY_CITY_CONTAINS_EMOJIS","DELIVERY_CITY_CONTAINS_HTML_TAGS","DELIVERY_CITY_CONTAINS_MATHEMATICAL_SYMBOLS"],Zt=["DELIVERY_PHONE_NUMBER_REQUIRED","DELIVERY_PHONE_NUMBER_CONTAINS_EMOJIS","DELIVERY_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"],xt=["DELIVERY_ZONE_REQUIRED_FOR_COUNTRY","DELIVERY_ZONE_NOT_FOUND"],er=["DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY","DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE","DELIVERY_POSTAL_CODE_CONTAINS_EMOJIS","DELIVERY_POSTAL_CODE_REQUIRED","DELIVERY_POSTAL_CODE_NOT_SUPPORTED","DELIVERY_POSTAL_CODE_CONTAINS_MATHEMATICAL_SYMBOLS"],sr=["DELIVERY_COUNTRY_REQUIRED"],Je={firstName:jt,lastName:qt,company:Kt,address1:Qt,address2:Wt,city:Xt,provinceCode:xt,zip:er,phone:Zt,countryCode:sr,oneTimeUse:[]},nr=new Map(Object.entries(Je).flatMap(([e,s])=>s.map(n=>[n,e])));function tr(e){return Object.keys(e).length===0}function w({createSubscribableFromSignal:e,extension:s,negotiated:n,proposed:t,journeyCompletedSignal:r,cartInstructionsSignal:i,applyChange:o,extensionInstance:u,captureEvent:l,observability:d,checkout:a,deliveryMethodsAddressErrors:f}){if(!ne(s.approvalScopes,R.CustomerPersonalData))return{billingAddress:void 0,shippingAddress:void 0};const c=(g,A)=>ne(s.approvalScopes,A)?g:void 0;let p;const m=Oe(()=>{const g=O=>{if(O===void 0||tr(O))return;const{address1:Z,address2:le,city:Ae,company:Ee,countryCode:pe,firstName:k,lastName:v,name:b,phone:ue,oneTimeUse:te,zoneCode:Be,postalCode:$n}=O;return{address1:c(Z,R.CustomerAddress),address2:c(le,R.CustomerAddress),city:Ae,company:Ee,countryCode:c(pe,R.CustomerPersonalData),firstName:c(k,R.CustomerName),lastName:c(v,R.CustomerName),name:c(b,R.CustomerName),phone:c(ue,R.CustomerPhone),provinceCode:Be,zip:c($n,R.CustomerAddress),oneTimeUse:te}};
2if(n.fields.isShippingRequired.value===!1)return;if(r.value)return g(n.fields.shippingAddress.peek());const N=g(t.shippingAddress.value),I=t.shippingAddress.value?.countryCode,L=p?.countryCode;return t.shippingAddress.dirtyFields.value.has("countryCode")&&L&&I!==L?p:(p=N,N)}),h=Oe(()=>{const g=N=>{if(N===void 0)return;const{address1:I,address2:L,city:P,company:O,countryCode:Z,firstName:le,lastName:Ae,name:Ee,phone:pe,zoneCode:k,postalCode:v}=N;return{address1:c(I,R.CustomerAddress),address2:c(L,R.CustomerAddress),city:P,company:O,countryCode:c(Z,R.CustomerPersonalData),firstName:c(le,R.CustomerName),lastName:c(Ae,R.CustomerName),name:c(Ee,R.CustomerName),phone:c(pe,R.CustomerPhone),provinceCode:k,zip:c(v,R.CustomerAddress)}};if(r.value)return g(n.fields.billingAddress.peek());const A=t.billingAddress.value;switch(t.billingAddressOption.value){case"shipping":{const N=n.fields.buyerIdentity.value?.purchasingCompany;if(N)return g(N?.location?.shippingAddress??A);if(m.value){const{oneTimeUse:I,...L}=m.value;return L}return g(A)}case"billing":{const N=n.fields.buyerIdentity.value?.purchasingCompany?.location.billingAddress;return g(N??A)}default:return g(A)}});async function E(g){return o({unknownChange:g,extension:s,extensionInstanceId:u.id,handlers:{async updateShippingAddress({change:A,negotiate:N}){if(!i.peek().delivery.canSelectCustomAddress){const v=a.addressManager.shipping.value.a
2pplyAddressChangeBlockReason("ui-extension").value,b=v?ps[v]:he("applyShippingAddressChange","delivery");throw new ge(b,{cause:{errors:[{message:b}]}})}const I=S(A);if(I)throw new ge(I,{cause:{errors:[{message:I}]}});const L=new Set,O={...t.shippingAddress.peek()};let Z=!1,le=!1;for(const v of Object.keys(A.address)){const b=A.address[v];if(v!=="oneTimeUse"){if(b!==void 0&&typeof b!="string"){const te=`Invalid shipping address value for property "${v}". Expected type string or undefined.`;throw new ge(te,{cause:{errors:[{message:te}]}})}}else if(b!==void 0&&typeof b!="boolean"){const te=`Invalid shipping address value for property "${v}". Expected type boolean or undefined.`;throw new ge(te,{cause:{errors:[{message:te}]}})}Je[v]&&Je[v].forEach(te=>L.add(te));const ue=Jt[v];ue&&!ne(s.approvalScopes,ue)||(v==="zip"?O.postalCode=b:v==="provinceCode"?O.zoneCode=b:v==="countryCode"?O.countryCode=b:v==="oneTimeUse"?O.oneTimeUse=b:(O[v]=b,v==="address1"?Z=!0:v==="address2"&&(le=!0)))}Z&&(delete O.streetName,delete O.streetNumber),le&&(delete O.line2,delete O.neighborhood),t.shippingAddress.value?.countryCode!==O?.countryCode&&l("extensionInteraction",{interaction:"marketDriverChangeShippingAddressCountryCode",extension:s,section:"extension",extensionInstanceId:u.id,timestamp:new Date}),d.log("wallets_shipping_address_update","Extensions: update to proposed shipping address",{extensionInstanceId:u.id,isPostalCodePadded:ns(O.postalCode,O.countryCode),isPreviousPostalCodePadded:ns(t.shippingAddress.value?.postalCode,t.shippingAddress.value?.countryCode),countryCode:O.countryCode});const Ae=a.addressManager.shipping.value,pe=await Kn(()=>{const v={...t.shippingAddress.peek()},b=Ae.applyAddressChange({source:"ui-extension",address:O});return ir(v,t.shippingAddress.peek(),f),b});if(pe.type==="failure"){const v=ps[pe.reason];throw new ge(v,{cause:{errors:[{message:v}]}})}const k=await N({silenceViolations:["non-delivery-address"],runListenersOnError:!1});if(k.status==="error"||k.status==="success"){const v=k.errors.reduce((b,ue)=>{if(!L.has(ue.code))return b;const te=nr.get(ue.code);return b.concat({message:ar(ue),field:te})},[]);if(v.length>0)throw new ge(v.map(({message:b})=>b).join(", "),{cause:{errors:v}})}return{type:"success",errors:null}}},errorResult:A=>({type:"error",errors:A instanceof ge?A.cause?.errors??[{message:A.message}]:[{message:A.message}]})})}return{billingAddress:e(h),shippingAddress:e(m),applyShippingAddressChange:E};function S(g){return typeof g.address!="object"||g.address===null?'Missing "address" property value.':g.address.countryCode&&!et(g.address.countryCode)?"Invalid country code.":null}}const rr=["coordinates","handle","oneTimeUse"];function ir(e,s,n){Object.keys(n).filter(t=>!rr.includes(t)).filter(t=>ls(e[t])!==ls(s?.[t])).flatMap(t=>{switch(t){case"countryCode":return[t,"zoneCode","postalCode"];case"zoneCode":return[t,"postalCode"];default:return[t]}}).forEach(t=>{n[t].value=void 0})}function ls(e){return typeof e=="string"&&e.trim()===""?void 0:e}const ps={MUST_SELECT_PROVIDED_ADDRESS:"Could not apply shipping address changes: the buyer must use the provided shipping address",ADDRESS_CHANGES_UNAVAILABLE:"Could not apply shipping address changes: current checkout state does not allow address changes",DELIVERY_ADDRESS_NOT_EDITABLE:he("applyShippingAddressChange","delivery"),ADDRESS_COUNTRY_NOT_SUPPORTED:"Could not apply shipping address changes: this checkout cannot ship to the address country"},or=new Map([["DELIVERY_ZONE_NOT_FOUND","The specified province was not found within the country"],["DELIVERY_ZONE_REQUIRED_FOR_COUNTRY","The specified country requires a province"]]);function ar(e){return or.get(e.code)??e.localizedMessage??e.nonLocalizedMessage}async function Ne(e){try{return await e()}catch(s){if(ur(s))return;throw s}}function ur(e){return e instanceof ut&&typeof e.cause=="object"&&e.cause!==null&&"code"in e.cause&&e.cause.code==="INVALID_NEGOTIATION"}function M({proposed:e,negotiated:s,createSubscribableFromSignal:n,cartInstructionsSignal:t,extension:r,extensionInstance:i,applyChange:o}){async function u(l){return o({unknownChange:l,extension:r,extensionInstanceId:i.id,handlers:{async updateAttribute({negotiate:d,change:a,markChangeAsNoOp:f}){if(fs(a),!t.peek().attributes.canUpdateAttributes)throw new y(
2he("applyAttributeChange","attributes"));const c=e.attributes.peek();return dr(a,c,s.fields.customAttributes.peek())?(f(),{type:"success"}):(e.attributes.value=ms(c,a),await Ne(()=>d({silenceViolations:["all"]})),{type:"success"})},async removeAttribute({negotiate:d,change:a}){if(fs(a),!t.peek().attributes.canUpdateAttributes)throw new y(he("applyAttributeChange","attributes"));const f=e.attributes.peek();if(!f?.find(c=>c.key===a.key))throw new y(`Invalid AttributeChange: no attribute with specified key found: "${a.key}"`);return e.attributes.value=ms(f,a),await Ne(()=>d({silenceViolations:["all"]})),{type:"success"}}},errorResult:d=>({type:"error",message:`Could not apply attribute changes. Error: ${d.message}`})})}return{applyAttributeChange:u,attributes:n(Ht(()=>(e.attributes.value||s.fields.customAttributes.value?.map(({key:l,value:d})=>({key:l,value:d})))??[]))}}function fs(e){if(typeof e.key!="string"||e.key.length<3||e.key.length>30)throw new y('Invalid AttributeChange: attribute key must be of type "string" and between 3 and 30 characters in length (inclusive)');if(e.type==="updateAttribute"&&typeof e.value!="string")throw new y('Invalid AttributeChange: attribute value must be of type "string"')}function dr(e,s,n){const t=o=>{const u=o?.find(l=>l.key===e.key);return u!==void 0&&u.value===e.value},r=t(n),i=s===void 0?r:t(s);return r&&i}function ms(e,s){const n=e?[...e]:[],t=n.findIndex(({key:r})=>r===s.key);return s.type==="updateAttribute"&&(t>-1?n[t]={key:s.key,value:s.value}:n.push({key:s.key,value:s.value})),s.type==="removeAttribute"&&n.splice(t,1),n}const cr=/^\$app|^app--\d+--/,lr=/^app--\d+--/,pr=/^app--\d+$/,Le="$app",On=":";function fr(e){return pr.test(e)?Le:e.replace(lr,Le+On)}function mr(e,s){if(e.trim()===Le)return`app--${s}`;const n=Le+On;return e.trim().startsWith(n)?`app--${s}--${e.slice(n.length)}`:e}const Nn="2026-01";function re({proposed:e,createSubscribableFromSignal:s,extension:n,cartInstructionsSignal:t,applyChange:r,extensionInstance:i,checkout:o}){const{extensibility:u}=o,l=n.type==="local"&&De(n.apiVersion).equalTo(Nn);return{metafields:s(D(()=>{const d=o.latestReceipt.value?.status==="processed"?o.latestReceipt.value?.purchaseOrder.metafields:[];return(d&&d.length>0?d:u.ui.metafields.value).map(({key:a,namespace:f,value:c,valueType:p})=>({key:a,namespace:f,value:c,valueType:p}))})),async applyMetafieldChange(d){return r({unknownChange:d,extension:n,extensionInstanceId:i.id,handlers:{async updateMetafield({change:a}){if(!vs(n.apiVersion))throw new y("Change type `updateMetafield` is no longer supported. Use `updateCartMetafield` instead.");l&&console.warn("Change type `updateMetafield` is deprecated and will be removed in a future API version. Use `updateCartMetafield` instead. See https://shopify.dev/docs/api/checkout-ui-extensions/2026-01/apis/metafields#methods-propertydetail-applymetafieldchange for more details."),yr(a);const{key:f,namespace:c,value:p,valueType:m}=a,h=u.ui.metafields.value,E=h.findIndex(A=>A.key===f&&A.namespace===c),S=[...h],g=S[E];return g?S[E]={...g,value:p,valueType:m,appId:n.appId}:S.push({key:f,namespace:c,value:p,valueType:m,appId:n.appId}),u.ui.updateMetafields(S),{type:"success"}},async removeMetafield({change:a}){if(!vs(n.apiVersion))throw new y("Change type `removeMetafield` is no longer supported. Use `removeCartMetafield` instead.");l&&console.warn("Change type `removeMetafield` is deprecated and will be removed in a future API version. Use `removeCartMetafield` instead. See https://shopify.dev/docs/api/checkout-ui-extensions/2026-01/apis/metafields#methods-propertydetail-applymetafieldchange for more details.");const{key:f,namespace:c}=a,p=u.ui.metafields.value.filter(m=>m.key!==f||m.namespace!==c);return u.ui.updateMetafields(p),{type:"success"}},async updateCartMetafield({change:a,negotiate:f}){ys(a.type,t.peek().metafields),hr(a);const c=typeof a.metafield.value=="string"?a.metafield.value:String(a.metafield.value);e.cartMetafields.value=[...e.cartMetafields.peek(),{update:{key:a.metafield.key,namespace:a.metafield.namespace,value:c,type:a.metafield.type,appId:n.appId}}];const p=await f({fieldsToResolve:["cartMetafields"],silenceViolations:["all"]});return hs(p,e,a),{type:"success"}},async removeCartMetafield({change:a,negotiate:f}){ys(a.type,t.peek().metafields),vr(a),e.cartMetafields.value=[...e.cartMetafields.peek(),{delete:{appId:n.appId,key:a.key,namespace:a.namespace}}];const c=await f({fieldsToResolve:["cartMetafields"],silenceViolations:["all"]});return hs(c,e,a),{type:"success"}}},errorResult:a=>({type:"error",message:a.message})})}}}function ys(e,{canSetCartMetafields:s,canDeleteCartMetafield:n}){const t=`applyMetafieldChange with type ${e}`;
2if(e==="updateCartMetafield"&&!s)throw new y(he(t,"metafields"));if(e==="removeCartMetafield"&&!n)throw new y(he(t,"metafields"))}function yr(e){const{key:s,namespace:n,value:t,valueType:r}=e;if(typeof s!="string"||s.length<3||s.length>30)throw new y(`Invalid property key: "${s}". It must be between 3 and 30 characters in length (inclusive).`);if(typeof n!="string")throw new y(`Invalid property namespace: "${n}". It must be a string between 2 and 20 characters (inclusive).`);if(n.length<2||n.length>20)throw new y(`Invalid property namespace: "${n}". It must be between 2 and 20 characters in length (inclusive).`);if(cr.test(n))throw new y(`Invalid property namespace: "${n}". App reserved namespaces not supported.`);switch(r){case"integer":if(typeof t!="number")throw new y(`Invalid property value: "${t}". It must be a number.`);break;case"string":if(typeof t!="string")throw new y(`Invalid property value: "${t}". It must be a string.`);if(t.length<=0)throw new y(`Invalid property value: "${t}". It must not be empty.`);break;case"json_string":if(!Ar(t))throw new y(`Invalid property value: "${t}". It must be a json_string.`);break;default:throw new y(`Invalid property valueType: "${r}". It must be in one of these values: integer, string, json_string.`)}return!0}function hr(e){const{metafield:s}=e;if(s==null)throw new y(`Invalid property metafield: "${s}". It must be an object.`);const{key:n,namespace:t,value:r,type:i}=s;if(typeof n!="string"||n.length<2||n.length>64)throw new y(`Invalid property key: "${n}". It must be between 2 and 64 characters in length (inclusive).`);if(t!==null&&typeof t!="string"&&typeof t<"u")throw new y(`Invalid property namespace: "${t}". namespace must be null, undefined, or a string between 3 and 255 characters (inclusive).`);if(typeof t=="string"&&(t.length<3||t.length>255))throw new y(`Invalid property namespace: "${t}". It must be between 3 and 255 characters in length (inclusive).`);if(typeof i!="string")throw new y(`Invalid property type: "${i}". It must be a string. Received type: ${typeof i}.`);if(i==="integer"){if(typeof r!="number"&&typeof r!="string")throw new y(`Invalid property value: "${r}". It must be a number or a string when type is "integer". Received type: ${typeof r}.`)}else if(typeof r!="string")throw new y(`Invalid property value: "${r}". It must be a string when type ("${i}") is not "integer". Received type: ${typeof r}.`)}function vr(e){const{key:s,namespace:n}=e;if(typeof s!="string")throw new y(`Invalid property key: "${s}". It must be a string.`);if(n!=null&&typeof n!="string")throw new y(`Invalid property namespace: "${n}". The namespace must be either null, undefined, or a string.`)}function Ar(e){if(typeof e!="string")return!1;try{return JSON.parse(e),!0}catch{}return!1}function gr(e){const n=e.match(/\[(\d+)\]$/)?.[1];return n!==void 0?parseInt(n,10):-1}function hs(e,s,n){const t=[...s.cartMetafields.peek()],r=e.errors.filter(l=>yt.has(l.code));if(r.length===0)return;const i=r.reduce((l,d)=>{if("target"in d){const a=gr(d.target);a>=0&&!l[a]&&(l[a]=d)}return l},{}),o=t.findIndex((l,d)=>i[d]?n.type==="updateCartMetafield"&&l.update?.key===n.metafield.key&&l.update?.namespace===n.metafield.namespace&&l.update?.value===n.metafield.value||n.type==="removeCartMetafield"&&l.delete?.key===n.key&&l.delete?.namespace===n.namespace:!1),u=i[o];if(o>-1&&u)throw s.cartMetafields.value=t.slice(0,o),new y(u.nonLocalizedMessage,{cause:{code:u.code}})}function vs(e){return!De(e).laterThan(Nn)}function Y({webPixels:e,extension:s}){const n=ts(s.appId)||"unknown-app",t=ts(Qe(s))||"unknown-extension";return{analytics:{publish:(r,i={})=>e.publishCustomEvent(r,i,{extension:{extensionId:t,appId:n,type:s.type||"unknown-type"}}),visitor:r=>e.visitor(r,{apiClientId:n})}}}const Er={id:"be4fa5a8e92c26d115e34073b486a58fc317388a2eedddb82d02eeccb9573278",type:"query",name:"ExtensionMetafields",source:""},As=async({withCache:e=!0,coreGraphql:s,extension:n,observability:t,negotiated:r,checkoutProfileId:i,appMetafieldsSignal:o})=>{let u=[];const l=Ot(r),d=await Nt({withCache:e,coreGraphql:s,resourceIds:l,checkoutProfileId:i}),a=d.data?.globalCheckoutUiExtensions??[],p=[...d.data?.checkoutProfile?.activatedExtensions??[],...a].map(({extension:h})=>h)?.find(h=>h.uuid===n.extensionId);let m=p?.metafields??[];if(!p){const h={resourceIds:l};
2n.type==="local"?h.extensionHandles=[{handle:n.handle,apiKey:n.appApiKey}]:h.extensionIds=[`gid://shopify/UiExtension/${n.extensionId}`];const{data:E}=await s.staticQuery(Er,{variables:h,cache:e});E?.extensionMetafields&&(m=E?.extensionMetafields)}u=Ir({extension:n,queryResult:d,metafields:m,observability:t}),o.value={...o.peek(),[n.id]:u}};function $({coreGraphql:e,extension:s,extensionInstance:n,negotiated:t,observability:r,createSubscribableFromSignal:i,sourceId:o,checkout:u,appMetafieldsSignal:l}){const d=Qn(()=>{As({withCache:!0,coreGraphql:e,extension:s,observability:r,negotiated:t,appMetafieldsSignal:l,checkoutProfileId:u.configuration.profileId.value})});n.on("destroy",()=>{d()});const a={type:"extension",extension:s,instanceId:n.id};return(async()=>{ds.markStarted("app-metafields-load",a);try{await As({withCache:!0,coreGraphql:e,extension:s,observability:r,negotiated:t,appMetafieldsSignal:l,checkoutProfileId:u.configuration.profileId.value})}finally{ds.markFinished("app-metafields-load",a)}})(),{appMetafields:i(D(()=>{const p=l.value[s.id]??[],m=s.extensionPoint.metafields??[],h=t.fields.buyerIdentity.value,E=h?.shopUser?.metafields??[],S=h?.shopUser?.publicId??"",g=E.flatMap(I=>!I||!S?[]:m.some(P=>P.key===I.key&&P.namespace===I.namespace)?[{target:{type:"shopUser",id:S},metafield:{key:I.key,namespace:je(s.apiVersion,I.namespace??""),value:
2I.value,type:I.type,valueType:I.valueType.toLowerCase()}}]:[]),A=t.fields.cartMetafields.value,N=Ve(s.appId);return[...p,...A?A?.flatMap(I=>I?m.some(P=>P.key===I.key&&mr(P.namespace,N)===I.namespace&&(!I.namespaceAppId||s.appId===I.namespaceAppId))?[{target:{type:"cart",id:o},metafield:{key:I.key,namespace:je(s.apiVersion,I.namespace??""),value:I.value,type:I.type,valueType:I.valueType.toLowerCase()}}]:[]:[]):[],...g]}))}}function je(e,s){return De(e).laterThan("2025-01")?fr(s):s}function Ir({queryResult:e,metafields:s,observability:n,extension:t}){if(e.error)return n.leaveErrorBreadcrumb("Extensions::GraphQL",{reason:"Failed to fetch extension metafields.",message:String(e.error),extensionId:t.id,extensionVersion:t.type==="persisted"?t.version:void 0}),[];const r=[];for(const i of s){if(!_r(t,i.ownerType))continue;const o=je(t.apiVersion,i.namespace);r.push({target:Rr(i.ownerId,i.ownerType),metafield:{key:i.key,namespace:o,value:i.value,type:i.type.toLowerCase(),valueType:i.valueType.toLowerCase()}})}return r}function _r(e,s){switch(s){case"CART":case"PRODUCT":case"PRODUCTVARIANT":case"SHOP":case"SHOPUSER":return!0;case"CUSTOMER":case"COMPANY":case"COMPANYLOCATION":return ne(e.approvalScopes,R.CustomerPersonalData);default:return(t=>!1)()}}function Rr(e,s){const n=Ve(e);switch(s){case"CUSTOMER":return{type:"customer",id:n};case"PRODUCT":return{type:"product",id:n};case"PRODUCTVARIANT":return{type:"variant",id:n};case"SHOP":return{type:"shop",id:n};case"COMPANY":return{type:"company",id:n};case"COMPANYLOCATION":return{type:"companyLocation",id:n};case"CART":return{type:"cart",id:n};case"SHOPUSER":return{type:"shopUser",id:n};default:return(r=>{throw new dt(`Metafield ownerType "${s}" with id "${e}" cannot be resolved`)})()}}function ee({publicCheckoutSessionId:e,createSubscribableFromSignal:s}){return{checkoutToken:s(ye(e))}}function Dr(e){return{initial:e.current,subscribe(n){mn(n);const t=e.subscribe((i=e.current)=>n(i));return[()=>{t(),yn(n)},e.current]}}}function F({extension:e,extensionInstance:s,createSubscribableFromSignal:n,isCheckoutEditor:t,observability:r}){const i=D(()=>{const u=e.behaviors.value,l=new Set;return u.blockProgress||l.add("blockProgress"),br(e.capabilities,l)}),o=Dr({get current(){return s.rendered},subscribe:u=>{const l=s.on("render",()=>{u(s.rendered)}),d=s.on("remove",()=>{try{u(s.rendered)}catch(p){throw r.leaveErrorBreadcrumb("Error removing rendered subscription on remove event",{isDestroyed:s.isDestroyed,rendered:s.rendered,extensionId:s.id}),p}}),a=s.on("restart",()=>{c()}),f=s.on("destroy",()=>{c()}),c=()=>{l(),d(),a(),f()};return c}});return{scriptUrl:e.scriptUrl,version:e.type==="persisted"?e.version:void 0,apiVersion:e.apiVersion,rendered:o,capabilities:n(i),editor:t?{type:"checkout"}:void 0,target:s.target}}function br(e,s){const n=[];return Object.keys(e).forEach(t=>{const r=t;r in e&&(typeof e[r]!="object"&&!s.has(r)&&e[r]&&n.push($e(r)),typeof e[r]=="object"&&Object.entries(e[r]).forEach(([i,o])=>{if(Array.isArray(o)&&o.length>0||!Array.isArray(o)&&o){const u=`${$e(t)}.${$e(i)}`;n.push(u)}}))}),n}function H({locale:e,currencySignal:s,timezone:n,extension:t,createSubscribableFromSignal:r,negotiated:i}){return{localization:{language:r(ye({isoCode:e})),extensionLanguage:r(ye({isoCode:t.extensionLocale})),currency:r(s),timezone:r(ye(n??new Intl.DateTimeFormat().resolvedOptions().timeZone)),country:r(D(()=>{const o=i.fields.buyerIdentity.value?.countryCode;if(o)return{isoCode:o}})),market:r(D(()=>{const o=i.fields.buyerIdentity.value?.market;if(!o)return;const{id:u,handle:l}=o;return{id:u,handle:l}}))}}}function z({captureEvent:e,extension:s,locale:n,shop:t,storefrontTokens:r,extensionInstance:i}){const o=s.capabilities.apiAccess;async function u(l,d=!1,a){if(!o)throw new y(`permission to access the storefront API must be specified under [capabilities] with flag "api_access = true"; this can be done within your extension's configuration. View the docs for more information:
3
4https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access`);const f=await r.get(s.appId,s.type,"fetchWithToken");if(!f)throw new st(`Could not get a storefront token for app ${s.appId} to query ${l}`);try{const c=await fetch(`https://${t.myshopifyDomain}/api/${a?.version??Hn(s.apiVersion)}/graphql.json`,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":n,"Shopify-Storefront-Extension-Token":f},body:JSON.stringify({query:l,variables:a?.variables})});return c?.status===401&&d?(r.cache.delete(r.cacheKey(s.appId,s.type)),u(l,!1,a)):c}catch(c){if(c.name==="BreadcrumbsPluginFetchError"&&d)return u(l,!1,a);throw new Ye(`An error occurred when attempting to fetch the extension api: ${c}`,{cause:c})}}return{query:async(l,d)=>{if(!s.capabilities.apiAccess)throw new y(`Extension is not allowed to use the Storefront API; permission to use the Storefront API must be specified under [capabilities] with:"api_access = true; see:
5
6https://shopify.dev/docs/api/checkout-ui-extensions/configuration#api-access`);const a=performance.now();e("extensionInteraction",{interaction:"storefrontApiQueryStart",extension:s,section:"extension",timestamp:new Date,extensionInstanceId:i.id});try{const f=await u(l,!0,d);if(f&&f.ok){e("extensionInteraction",{interaction:"storefrontApiQuerySuccess",extension:s,section:"extension",timestamp:new Date,duration:performance.now()-a,extensionInstanceId:i.id});try{return await f.json()}catch(p){throw new as("Failed to parse Storefront API response",{cause:p})}}throw new Ye(`Failed to query storefront API: status=${f?.status} ${f?.statusText}`.trim())}catch(f){let c="storefrontApiQueryError";throw f instanceof Ye&&f?.cause instanceof Error&&f.cause?.name==="BreadcrumbsPluginFetchError"?c="storefrontApiQuerySuccess":f instanceof as&&(c="storefrontResponseParseError"),e("extensionInteraction",{interaction:c,extension:s,section:"extension",timestamp:new Date,duration:performance.now()-a,error:f instanceof Error?f:void 0,extensionInstanceId:i.id}),f}}}}function J({extension:{configuration:e},createSubscribableFromSignal:s}){return s(e)}function oe(e){return{id:e.id,name:e.name,storefrontUrl:e.storefrontUrl??void 0,myshopifyDomain:e.myshopifyDomain}}function Te(e){return{id:e.id,name:e.name,storefrontUrl:e.storefrontUrl?Sr(e.storefrontUrl):void 0,myshopifyDomain:e.myshopifyDomain}}function Sr(e){return e.endsWith("/")?e:`${e}/`}const Ln="v1";function gs({extension:e}){const s=Qe(e);return Pn(`${Ln}-${s}-${e.extensionPoint.target}`)}function se({extension:e}){return Pn(`${Ln}-${e.appId}-${e.extensionId}`)}function Pn(e){const s=nt.ExtensionStorage,n=r=>`${e}-${r}`,t=()=>rt(s)??{};return{async read(r){be(typeof r=="string",'Missing "key" argument. Please pass a key to read from to storage.');const i=n(r),o=t();return Object.keys(o).length&&o[i]||null},async write(r,i){be(typeof r=="string",'Missing "key" argument. Please pass a key to write to to storage.'),be(arguments.length>1,`Missing "data" argument. Please pass a value to write to "${r}" `);const o=n(r),u=t();u[o]=i,rs(s,u)},async delete(r){be(typeof r=="string",'Missing "key" argument. Please pass a key to delete from storage.');const i=n(r),o=t();
6delete o[i],Object.keys(o).length===0?tt(s):rs(s,o)}}}function Li(e){return e}function Tr(e,s){return e.filter(n=>_t(n)&&n.discount.presentationLevel===s).map(n=>{const{discount:t,amount:r,title:i}=n;return t.type==="code"?{type:"code",code:i,discountedAmount:r}:t.type==="automatic"?{type:"automatic",title:i,discountedAmount:r}:{type:"custom",title:i,discountedAmount:r}})}function Or(e,s){return e.filter(n=>It(n.discountDetails.discount)&&n.discountDetails.discount.presentationLevel===s).map(n=>{const{discount:t,title:r}=n.discountDetails;return t.type==="code"?{type:"code",code:r,discountedAmount:n.amount}:t.type==="automatic"?{type:"automatic",title:r,discountedAmount:n.amount}:{type:"custom",title:r,discountedAmount:n.amount}})}const Nr=new Set(["DISCOUNTS_ONLY_EMPTY_TERMS_ACCEPTED","DISCOUNTS_DISCOUNTS_NOT_ALLOWED_FOR_B2B","DISCOUNTS_DISCOUNT_CODE_NOT_HONOURED","DISCOUNTS_CUSTOM_DISCOUNT_NOT_HONOURED","DISCOUNTS_UNSUPPORTED_EXPECTATION","DISCOUNTS_ALLOCATIONS_MISMATCH","DISCOUNTS_ADDITIONAL_REQUESTED_DISCOUNT_CODE_DISCARDED","DISCOUNTS_NOT_FOUND","DISCOUNTS_CURRENTLY_INACTIVE","DISCOUNTS_USAGE_LIMIT_REACHED","DISCOUNTS_CUSTOMER_USAGE_LIMIT_REACHED","DISCOUNTS_CUSTOMER_NOT_ELIGIBLE","DISCOUNTS_QUANTITY_NOT_IN_RANGE","DISCOUNTS_PURCHASE_NOT_IN_RANGE","DISCOUNTS_NO_ENTITLED_LINE_ITEMS","DISCOUNTS_NO_ENTITLED_SHIPPING_LINES","DISCOUNTS_INCOMPATIBLE_PURCHASE_TYPE","DISCOUNTS_DISCOUNT_ALREADY_APPLIED","DISCOUNTS_HIGHER_VALUE_DISCOUNT_APPLIED","DISCOUNTS_MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED","DISCOUNTS_INVALID_SIGNATURE","REDUCTION_INVALID_CODE","REDUCTION_INVALID_DISCOUNT_CODE"]);function C({negotiated:e,proposed:s,extension:n,createSubscribableFromSignal:t,cartInstructionsSignal:r,applyChange:i,extensionInstance:o,currentDiscountCodeAttemptSignal:u}){const l=t(D(()=>{const f=e.fields.discountLines.value?.lines;return f?f.filter(c=>c.discount.type==="code").map(c=>({code:c.title})):[]})),d=t(D(()=>{const f=e.fields.discountLines.value?.lines;return f?Tr(f,"CART"):[]})),a=["non-merchandise"];return{discountCodes:l,discountAllocations:d,async applyDiscountCodeChange(f){return i({unknownChange:f,extension:n,extensionInstanceId:o.id,handlers:{async addDiscountCode({negotiate:p,change:m}){c(),Es(m);const h=await p({customizeNegotiation:E=>(u.value=m.code,{...E,reduction:{code:m.code}}),silenceViolations:a});return Is(h,m.code),u.value=null,{type:"success"}},async removeDiscountCode({negotiate:p,change:m}){c(),Es(m);const h=s.discountLines.peek(),E=m.code.toUpperCase(),S=h.find(({discount:A})=>A.type==="code"&&A.title.toUpperCase()===E);if(!S)throw new y(`The discount code "${m.code}" is not allocated to this checkout and cannot be removed.`,{cause:{code:"DISCOUNT_NOT_FOUND"}});s.discountLines.value=h.filter(({discount:A})=>A.title.toUpperCase()!==S.title.toUpperCase());const g=await p({fieldsToResolve:[...ht],silenceViolations:a});return Is(g,m.code),{type:"success"}}},errorResult:p=>({type:"error",message:`Could not apply discount code changes. Error: ${p.message}`})});function c(){if(!r.peek().discounts.canUpdateDiscountCodes)throw new y(
6he("applyDiscountCodeChange","discounts"))}}}}function Es(e){if(typeof e.code!="string")throw new y('Discount code must be of type "string"')}function Is(e,s){const n=e.errors.find(t=>{if(!(t.type==="RemoveTermViolation"&&Rt(t.targetEntity)?.title!==s))return Nr.has(t.code)});if(n)throw new y(n.nonLocalizedMessage,{cause:{code:n.code}})}function Lr({extension:e,checkout:s}){return{experimentalIsShopAppStyle:Dt({allowLocal:!0,extension:e})?s.identity.current.value==="shopPay":void 0}}const Pr=new Set(["REDUCTION_INVALID_CODE","PAYMENT_GIFT_CARDS_NOT_ALLOWED_FOR_B2B","PAYMENT_GIFT_CARDS_NOT_ALLOWED_FOR_FIXED_SELLING_PLANS","PAYMENTS_GIFT_CARD_ALREADY_APPLIED","PAYMENTS_GIFT_CARD_BUYING_GIFT_CARD","PAYMENTS_GIFT_CARD_CURRENCY_MISMATCH","PAYMENTS_GIFT_CARD_DISABLED","PAYMENTS_GIFT_CARD_NON_SUFFICIENT_FUNDS","PAYMENTS_GIFT_CARD_NOT_FOUND","REDUCTION_GIFT_CARD_ALREADY_APPLIED","PAYMENTS_SHOP_CASH_GIFT_CARD_NOT_ALLOWED","REDUCTION_INVALID_GIFT_CARD_CODE","PAYMENTS_INSTALLMENTS_GIFT_CARD_NOT_ALLOWED","PAYMENTS_GIFT_CARDS_UNAVAILABLE"]);function V({negotiated:e,proposed:s,extension:n,createSubscribableFromSignal:t,shop:r,applyChange:i,extensionInstance:o}){return{appliedGiftCards:t(D(()=>{const l=e.fields.paymentLines.value;return l?l.lines.filter(d=>d.method.type==="giftCard").map(d=>({lastCharacters:hn(d.method),amountUsed:d.cost,balance:d.method.balance})):[]})),async applyGiftCardChange(l){return i({unknownChange:l,extension:n,extensionInstanceId:o.id,handlers:{async addGiftCard({negotiate:d,change:a}){if(_s(a),!e.fields.paymentMethods.peek()?.some(p=>p.type==="giftCard"))throw new y("the `applyGiftCardChange` API is disabled");const c=await d({customizeNegotiation:p=>({...p,reduction:{code:a.code}})});return Ds(c),{type:"success"}},async removeGiftCard({negotiate:d,change:a}){_s(a);const f=s.paymentLines.peek(),c=r.hasFlagEnabled(it);let p=f;c?a.code.split(",").forEach(E=>{p=Rs(p,E)}):p=Rs(p,a.code),s.paymentLines.value=p;const m=await d({});return Ds(m),{type:"success"}}},errorResult:d=>({type:"error",message:`Could not apply gift card changes. Error: ${d.message}`})})}}}function _s(e){if(typeof e?.code!="string")throw new y("Gift card code must be a string")}function Rs(e,s){const n=kr(s),t=e.findIndex(({method:i})=>i.type!=="giftCard"?!1:s.length===4?hn(i).toLowerCase()===n.slice(-4):"code"in i&&i.code.toLowerCase()===n);if(t===-1)return e;const r=[...e];return r.splice(t,1),r}function kr(e){return e.replace(/[\s-]/g,"").toLowerCase()}function Ds(e){const s=e.errors.find(n=>Pr.has(n.code));if(s)throw new y(s.nonLocalizedMessage,{cause:{code:s.code}})}function wr(e){let s,n=!1;function t(){return s??=Xn(e).catch(r=>{throw s=void 0,r}),s}return{load:t,preload(){n||(n=!0,Wn(()=>{t().catch(()=>{})}))}}}function We(e){const{lineAllocation:s}=e,n="parentRelationship"in e?e.parentRelationship?.parent?.lineAllocations?.[0]:void 0;return{id:Mr(s.stableId),quantity:s.quantity,cost:{totalAmount:s.checkoutPriceAfterDiscounts},merchandise:bs(e),attributes:e.properties.map(t=>({key:t.name,value:String(t.value)})),discountAllocations:Or(s.allocations,"LINE"),lineComponents:e.lineComponents.map(t=>({type:"bundle",id:Ss(t.lineAllocation.stableId),merchandise:bs(t),quantity:t.lineAllocation.quantity,cost:{totalAmount:t.lineAllocation.checkoutPriceAfterDiscounts},attributes:t.properties.map(r=>({key:r.name,value:String(r.value)}))})),parentRelationship:n?{parent:{id:Ss(n.stableId)}}:null}}function bs(e){if(!e.variantId)throw new Ke("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.");return{type:"variant",id:e.variantId.replace("ProductVariantMerchandise","ProductVariant"),title:e.title,subtitle:e.subtitle,image:e.image?{url:e.image.four,altText:e.image.altText}:void 0,selectedOptions:e.options.map(s=>({name:s.name,value:s.value})),product:{id:e.productId,vendor:e.vendor,productType:e.productType},requiresShipping:e.requiresShipping,sellingPlan:e.sellingPlan?{id:e.sellingPlan.id,recurringDeliveries:!!e.sellingPlan.subscriptionDetails}:void 0,sku:e.sku??void 0}}function kn(e){const{lineAllocation:s,image:n}=e;return{id:Cr(s.stableId),title:e.title,subtitle:e.subtitle,lines:[We(e)],quantity:s.quantity,cost:{totalAmount:s.checkoutPriceAfterDiscounts},image:n?{url:n.four,altText:n.altText}:void 0}}function Mr(e){return`gid://shopify/CartLine/${e}`}function Ss(e){return`gid://shopify/CartLineComponent/${e}`}function Cr(e){return`gid://shopify/PresentmentCartLine/${e}`}const Vr="merchandiseError:",Ts=wr(()=>St(()=>import("./cf517225.fNg-M79t.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function U({negotiated:e,proposed:s,createSubscribableFromSignal:n,extension:t,stableDetourSignal:r,cartInstructionsSignal:i,cartLineChangeLoadingSignal:o,observability:u,applyChange:l,extensionInstance:d,isCheckoutEditor:a}){Ts.preload();async function f(c,p){return o.value=!0,(await Ts.load()).applyCartLineChange({change:c,negotiated:e,proposed:s,stableDetourSignal:r,cartInstructionsSignal:i,negotiate:p,isCheckoutEditor:a,observability:u})}return{lines:n(Ft(()=>
6{const c=e.fields.merchandiseLines.value,p=e.fields.remoteMerchandiseDetails?.value;return c?c.lines.filter(m=>!vn(m.stableId,p)).flatMap(m=>m.productId==null?[]:m.variantId?bn(m).map(We):(u.error(new Ke("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.")),[])):[]})),async applyCartLinesChange(c){return l({unknownChange:c,extension:t,extensionInstanceId:d.id,handlers:{async addCartLine({negotiate:p,change:m}){return f(m,p)},async removeCartLine({negotiate:p,change:m}){return f(m,p)},async updateCartLine({negotiate:p,change:m}){return f(m,p)}},errorResult:p=>p.message.startsWith(Vr)?{type:"error",message:p.message}:{type:"error",message:`Could not apply line item changes. Error: ${p.message}`}}).finally(()=>{o.value=!1})}}}const Os=5e3;function G({proposed:e,negotiated:s,createSubscribableFromSignal:n,extension:t,cartInstructionsSignal:r,applyChange:i,extensionInstance:o}){return{note:n(e.note),async applyNoteChange(l){return i({unknownChange:l,extension:t,extensionInstanceId:o.id,handlers:{async updateNote({negotiate:d,change:a,markChangeAsNoOp:f}){if(u(),typeof a.note!="string")throw new y('Invalid NoteChange: note must be of type "string"');if(a.note&&a.note.length>Os)throw new y(`Invalid NoteChange: note must be less than or equal to ${Os} characters`);return Ur(a.note,e.note.peek(),s.fields.note.peek())?(f(),{type:"success"}):(e.note.value=a.note||void 0,await Ne(()=>d({silenceViolations:["all"]})),{type:"success"})},async removeNote({negotiate:d,markChangeAsNoOp:a}){return u(),Gr(e.note.peek(),s.fields.note.peek())?(a(),{type:"success"}):(e.note.value=void 0,await Ne(()=>d({silenceViolations:["all"]})),{type:"success"})}},errorResult:d=>({type:"error",message:d.message})})}};
6function u(){if(!r.peek().notes.canUpdateNote)throw new y(he("applyNoteChange","notes"))}}function Ur(e,s,n){const t=e||void 0;return s===t&&(n||void 0)===t}function Gr(e,s){return e===void 0&&(s||void 0)===void 0}function T(e){const{extension:s}=e,{applyAttributeChange:n}=M(e),{applyCartLinesChange:t}=U(e),{applyNoteChange:r}=G(e),{applyMetafieldChange:i}=re(e),{applyDiscountCodeChange:o}=C(e),{applyGiftCardChange:u}=V(e),{applyShippingAddressChange:l}=w(e),{experimentalIsShopAppStyle:d}=Lr(e);switch(s.apiVersion){case"2023-04":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u};case"2023-07":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2023-10":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2024-01":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2024-04":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2024-07":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2024-10":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2025-01":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2025-04":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2025-07":case"unstable":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2025-10":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2026-01":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2026-04":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2026-07":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2026-10":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};case"2027-01":return{applyAttributeChange:n,applyCartLinesChange:t,applyNoteChange:r,applyMetafieldChange:i,applyDiscountCodeChange:o,applyGiftCardChange:u,applyShippingAddressChange:l,experimentalIsShopAppStyle:d};default:Ce(s.apiVersion)}}function Ue(e){const{createSubscribableFromSignal:s}=e,{apiVersion:n}=e.extension;return De(n).equalTo("unstable")?{order:s(ye(void 0))}:De(n).laterThan("2025-07")?{}:{order:s(ye(void 0))}}
6function Br({negotiated:e,createSubscribableFromSignal:s,observability:n}){return{presentmentLines:s(D(()=>{const t=e.fields.merchandiseLines.value;return t?t.lines.flatMap(r=>r.variantId?bn(r).map(i=>kn(i)):(n.error(new Ke("Cannot create cart line API without a variantId. Custom merchandise lines are not yet supported.")),[])):[]}))}}function j({negotiated:e,createSubscribableFromSignal:s,proposed:n,extension:t}){return ne(t.approvalScopes,R.CustomerPersonalData)?{buyerIdentity:{customer:s(D(()=>{const r=e.fields.buyerIdentity.value?.customerProfile;if(r?.__typename==="CustomerProfile"||r?.__typename==="BusinessCustomerProfile"){const i=ne(t.approvalScopes,R.CustomerEmail),o=ne(t.approvalScopes,R.CustomerPhone),u=ne(t.approvalScopes,R.CustomerName),l=r?.__typename==="CustomerProfile"?r.storeCreditAccounts.map(d=>({...d,balance:d.balance})):[];return{id:r.id,email:i?r.email??void 0:void 0,phone:o?r.phone??void 0:void 0,fullName:u?r.fullName??void 0:void 0,firstName:u?r.firstName??void 0:void 0,lastName:u?r.lastName??void 0:void 0,image:{url:r.imageUrl},acceptsMarketing:r.acceptsEmailMarketing,acceptsEmailMarketing:r.acceptsEmailMarketing,acceptsSmsMarketing:r.acceptsSmsMarketing,storeCreditAccounts:l,ordersCount:r.ordersCount??0}}})),email:s(D(()=>{if(!ne(t.approvalScopes,R.CustomerEmail))return;const i=n.email.value,o=e.fields.buyerIdentity.value?.customerProfile?.email,u=e.fields.contactInfo.value?.email;return i||o||u})),phone:s(D(()=>{if(!ne(t.approvalScopes,R.CustomerPhone))return;const i=n.phone.value,o=e.fields.buyerIdentity.value?.customerProfile?.phone,u=e.fields.contactInfo.value?.phone;return i||o||u})),purchasingCompany:s(D(()=>{const r=e.fields.buyerIdentity.value?.purchasingCompany;if(r)return{company:{id:r.company.id,name:r.company.name,externalId:r.company?.externalId},location:{id:r.location.id,name:r.location.name,externalId:r.location?.externalId}}}))}}:{buyerIdentity:void 0}}const Yr=3e4,Re={behavior:"allow"};function q({extension:e,extensionInstance:s,proposal:n,captureEvent:t,journeyCompletedSignal:r,sourceType:i,createSubscribableFromSignal:o,journeyStateSignal:u,pageBeforeDetourSignal:l,negotiated:d,cartPageSignal:a,checkout:f,interceptorRegistrationResolversSignal:c,observability:p,negotiationRateLimiter:m}){let h=0;const E=c.peek(),S=E.get(e.id);return{intercept(g){const A=String(h++);mn(g);let N=!1;const I=[],L={interceptorKey:A,extension:e,captureEvent:t,sourceType:i,observability:p,activeRaces:I,extensionInstance:s,suppressMalformedInterceptionErrors:e.type==="persisted"||e.type==="global"},P=$r(g,L),O=async k=>{switch(k){case"registration":return await P({requiresRenderToBlock:!1}),Re;case"negotiation":{const v=await P({requiresRenderToBlock:!0});if(!v)return Re;const{perform:b}=v.interceptorRunResponse;return v.isBlocking?{behavior:"allow",errors:v.interceptorRunResponse.errors,perform:b&&Ie(()=>b({behavior:"allow"}),L)}:{behavior:"allow",perform:b&&Ie(()=>b({behavior:"allow"}),L)}}case"progression":case"completion":{const v=await P({requiresRenderToBlock:!0});if(!v)return Re;const{perform:b}=v.interceptorRunResponse;if(v.isBlocking){if(m.isThrottled(e.id)){if(!N){N=!0;const ue=cs(e),{isRemoteDom:te,isHighValueExtension:Be}=ue;p.log("extension_throttled_buyer_journey_block_attempt","[Extensions::BuyerJourneyIntercept] Throttled extension attempted to block checkout progress",{...ue,enforced:!0}),p.counter({name:"extension_throttled_buyer_journey_block_attempt",value:1,attributes:{isRemoteDom:te,isHighValueExtension:Be,enforced:!0}})}return s.markNotBlocking(A),{behavior:"allow",errors:v.interceptorRunResponse.errors,perform:b&&Ie(()=>b({behavior:"block"}),L)}}return t("extensionBuyerJourneyBlock",{behavior:"block",reason:v.interceptorRunResponse.reason,extension:e,section:"extension",timestamp:new Date,validationErrors:v.interceptorRunResponse.errors??[]}),p.debug("extensions_buyer_journey_intercepted","[Extensions::BuyerJourneyIntercept] Blocked checkout progress",{...cs(e),errors:v.interceptorRunResponse.errors,reason:v.interceptorRunResponse.reason}),{behavior:"block",reason:ot.InvalidExtensionState,errors:v.interceptorRunResponse.errors,perform:b&&Ie(()=>b({behavior:"block"}
6),L),context:{extension:me(e)}}}return{behavior:"allow",perform:b&&Ie(()=>b({behavior:"allow"}),L)}}default:return k}},Z=n.intercept(({reason:k})=>O(k));Hr({interceptorRegistrationResolvers:E,interceptorRegistration:S,extension:e,sourceType:i,observability:p});const le=async()=>{if(!f.isCheckoutLayoutForcedToOnePage.value||!f.wallets.isAcceleratedWalletEscalation.value||!s.rendered)return;const k=await P({requiresRenderToBlock:!0});if(!k?.isBlocking)return;const{perform:v}=k.interceptorRunResponse;v&&await Ie(()=>v({behavior:"block"}),L)()};O("registration").then(le).catch(k=>{p.error(k,{metadata:{extension:me(e),source:{type:i}}})});const Ae=s.on("restart",()=>{pe()}),Ee=s.on("destroy",()=>{pe()}),pe=()=>{s.markNotBlocking(A);for(const k of I)k.abort();Z(),Ae(),Ee(),yn(g)};return pe},completed:o(r),steps:o(D(()=>{if(r.value)return[{handle:"thank-you",to:"shopify:checkout/thank-you",label:"thank-you",disabled:!1}];const{plan:{greenPath:g}}=u.value,A=l.value,N=d.value,I=a.value,L=g.filter(({skipOverPage:Z})=>!Z||!Z(N)),P=L.findIndex(Z=>Z.id===A?.id),O=L.map((Z,le)=>Ns({page:Z,disabled:P>=0&&le>P}));return I&&O.unshift(Ns({page:I,disabled:!1})),O})),activeStep:o(D(()=>{if(r.value)return{handle:"thank-you"};const{plan:{greenPath:g}}=u.value,A=l.value;if(!A||!g.some(({id:I})=>I===A.id))return;const N=d.value;if(!A.skipOverPage?.(N))return{handle:Mn(A).handle}}))}}function wn(e,s,n){const t={finished:Promise.resolve(),abort:()=>{}},{captureEvent:r,extension:i}=s,o=s.duration??Yr,u=performance.now();let l,d;return t.abort=()=>{clearTimeout(d),l(void 0)},t.finished=Promise.race([new Promise(a=>{l=a,d=setTimeout(()=>{l(s.onTimeout())},o)}),e.finally(()=>{r("extensionInteraction",{interaction:"buyerJourneyInterceptor",extension:i,section:"extension",timestamp:new Date,duration:performance.now()-u,extensionInstanceId:n}),clearTimeout(d)})]),t}function $r(e,s){return async({requiresRenderToBlock:n})=>{const{interceptorKey:t,extension:r,captureEvent:i,sourceType:o,observability:u,activeRaces:l,extensionInstance:d,suppressMalformedInterceptionErrors:a}=s;if(n&&!d.rendered)return d.markNotBlocking(t),{isBlocking:!1,interceptorRunResponse:Re};const f=r.capabilities.blockProgress&&r.behaviors.value.blockProgress,c=(async()=>{try{return await e({canBlockProgress:f})}catch(h){return u.error(new Rn(`Error in buyer journey interceptor callback: ${h}`,{cause:h}),{metadata:{extension:me(r),source:{type:o}}}),{behavior:"allow",perform:()=>{}}}})(),p=wn(c,{captureEvent:i,extension:r,onTimeout:()=>(u.error(new y("buyer journey interceptor callback timed out"),{metadata:{extension:me(r),source:{type:o}}}),Re)},d.id);l.push(p);let m;try{m=await p.finished,Fr(r,m)}catch(h){if(a){const E=h;return console.warn(`${E.name}: ${E.message}`),d.markNotBlocking(t),null}throw h instanceof TypeError&&u.leaveErrorBreadcrumb("BuyerJourneryIntercept: Cannot block progress",{extension:r,interceptorRequest:m}),h}return f&&m.behavior==="block"?(d.markBlocking(t),{isBlocking:!0,interceptorRunResponse:m}):(d.markNotBlocking(t),{isBlocking:!1,interceptorRunResponse:m})}}function Ie(e,s){const{observability:n,captureEvent:t,extension:r,sourceType:i,activeRaces:o,extensionInstance:u}=s,d=(async()=>{try{return await e()}catch(a){n.error(new y(`${a} (in buyer journey interceptor)`,{cause:a}),{metadata:{extension:me(r),source:{type:i}}})}})();return async()=>{const a=wn(d,{captureEvent:t,extension:r,onTimeout:()=>{n.error(new y("perform() in buyer journey interceptor timed out"),{metadata:{extension:me(r),source:{type:i}}})}},u.id);o.push(a),await a.finished}}function Fr(e,s){const n=[];if(Object.entries(s||{}).length||n.push("interceptor result cannot be empty or undefined"),(!s?.behavior||!["block","allow"].includes(s.behavior))&&n.push(`behavior must be either "block" or "allow", received "${s?.behavior}"`),s?.hasOwnProperty("perform")&&typeof s?.perform!="function"&&n.push(`perform must be a function: received type ${typeof s?.perform}`),s?.behavior==="block"&&typeof s.reason!="string"&&n.push(`reason must be a string: received type ${typeof s?.reason}`),n.length)throw new ct(n.join("; "));e.type==="local"&&!e.capabilities.blockProgress&&s?.behavior==="block"&&console.warn(`CannotBlockProgressWarning: extension is not allowed to block checkout progress; permission to block checkout progress must be specified under [capabilities] with flag "block_progress = true; see:
7
8https://shopify.dev/docs/api/checkout-ui-extensions/configuration#block-progress`)}function Ns({page:e,disabled:s}){const{handle:n,route:t}=Mn(e),{label:r}=e;return{handle:n,to:t,label:r,disabled:s}}function Mn({id:e,route:s}){switch(e){case"information":case"shipping":case"payment":case"review":return{handle:e,route:`shopify:checkout${s}`};case"onePage":case"shopPay":return{handle:"checkout",route:`shopify:checkout${s}`};case"cart":return{handle:"cart",route:"shopify:cart"};default:return{handle:"unknown",route:"#"}}}function Hr({interceptorRegistrationResolvers:e,interceptorRegistration:s,extension:n,sourceType:t,observability:r}){if(s){$t(e,n.id,s);return}r.error(new Rn("Error registering interceptor resolver. No corresponding extension found in interceptorRegistrationResolversSignal."),{metadata:{extension:me(n),source:{type:t}}})}function de({cartInstructionsSignal:e,createSubscribableFromSignal:s}){return{instructions:s(e)}}function K({negotiated:e,createSubscribableFromSignal:s}){return{checkoutSettings:s(D(()=>{const n=e.fields.buyerIdentity.value?.customerProfile,t=e.fields.paymentFlexibilityPaymentTermsTemplate.value,r=t?{id:t.id,name:t.translatedName,dueDate:t.dueDate||void 0,dueInDays:t.dueInDays||void 0}:void 0,i=e.fields.checkoutCompletionTarget.value,o=i||"ORDER",u=n?.__typename==="BusinessCustomerProfile"&&n.checkoutExperienceConfiguration?n.checkoutExperienceConfiguration.editableShippingAddress:!0;return{orderSubmission:o,shippingAddress:{isEditable:u},paymentTermsTemplate:r}}
8))}}function Ge(e,s){return!e||e.length===0||!s?e:e.filter(n=>{const{targetMerchandiseLines:t}=n;return!t||t.length===0?!0:!t.some(i=>vn(i.stableId,s))})}function Q({negotiated:e,isOnePageCheckout:s,createSubscribableFromSignal:n}){return{cost:{subtotalAmount:n(e.fields.subtotal),totalShippingAmount:n(D(()=>{const t=e.fields.deliveryNext.value,r=e.fields.remoteMerchandiseDetails.value;if(t?.status!=="filled")return;const i=Ge(t.lines,r),o=zr(i,!s);return o.length===0?void 0:{amount:o.reduce((d,{costAfterDiscounts:a})=>d+a.amount,0),currencyCode:o[0]?.costAfterDiscounts.currencyCode}})),totalTaxAmount:n(D(()=>{const t=e.fields.taxes.value;if(t?.status==="available_total")return t.totalTax;if(t?.status==="available_total_included")return t.totalIncludedInTarget;t?.status==="unavailable"&&console.error(`Taxes are unavailable: ${t.reason}`)})),totalAmount:n(e.fields.runningTotal)}}}function zr(e,s){return e.reduce((n,t)=>{if(t.status==="not_required")return n;const{methods:r,selectedDeliveryMethodHandle:i}=t,o=r.find(({handle:d})=>i===d);if(!o)return n;const u=o?.priceBreakdown?.length&&o.priceBreakdown.every(d=>d.excludeFromDeliveryOptionPrice),l=o?.priceBreakdown?.every(d=>!!!d.targetMerchandiseLines[0]?.sellingPlan?.prepaid);return u&&l&&s||n.push({costAfterDiscounts:o.costAfterDiscounts}),n},[])}function Cn(e,s){const n=s?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,type:jr(e.methodType),carrier:{name:e.carrierName||void 0},cost:{amount:e.cost.amount,currencyCode:e.cost.currencyCode},costAfterDiscounts:{amount:e.costAfterDiscounts.amount,currencyCode:e.costAfterDiscounts.currencyCode},deliveryEstimate:qr(e),code:e.code||"",metafields:n||[]}}function Jr(e,s){const n=s?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickup",location:{address:{address1:e.pickupLocation?.address.address1,address2:e.pickupLocation?.address.address2,city:e.pickupLocation?.address.city,countryCode:e.pickupLocation?.address.countryCode,phone:e.pickupLocation?.address.phone,zip:e.pickupLocation?.address.postalCode,provinceCode:e.pickupLocation?.address.zoneCode,...Xe(e.pickupLocation?.address)}},metafields:n||[]}}function jr(e){return e==="LOCAL"?"local":"shipping"}function qr(e){return{timeInTransit:Kr(e.estimatedTimeInTransit)}}function Kr(e){if(e)return typeof e=="number"?{lower:e,upper:e}:{lower:e.lower,upper:e.upper}}function Qr({line:e,extensionContext:s,observability:n,proposedSelectedDeliveryMethodHandles:t,lines:r}){if(e.status==="available"){const i=Xr(e.methods,n,s);return{targetedCartLines:Ls(e.targetMerchandiseLines??[],r),deliveryOptions:i,selectedDeliveryOption:Wr(e,i,t),groupType:_e(e.type),isDeliveryRequired:!0,id:Ps(e.id)}}else return{targetedCartLines:Ls(e.targetMerchandiseLines,r),deliveryOptions:[],selectedDeliveryOption:void 0,groupType:_e(e.type),isDeliveryRequired:!1,id:Ps(e.id)}}function Ls(e,s){return s?s.filter(t=>e.some(r=>r.stableId===t.stableId)).flatMap(({lineAllocations:t})=>t.map(r=>({id:`gid://shopify/CartLine/${r.stableId}`}))):[]}function Wr(e,s,n){if(s.length===0)return;const t=e.methods.map(o=>o.handle),i=n.find(o=>o&&t.includes(o))||e.selectedDeliveryMethodHandle;return i?{handle:i}:void 0}function Xr(e,s,n){return e.map(t=>{switch(t.methodType){case"SHIPPING":case"LOCAL":return Cn(t,n);case"PICK_UP":return Zr(t,s,n);case"PICKUP_POINT":return ei(t,s,n);case"RETAIL":case"NONE":return;default:{const r=`Unknown delivery method type: ${t.methodType}`;s?.error(new Ze(r),{metadata:{deliveryMethod:{type:t.methodType,handle:t.handle}}});return}}}).filter(t=>t!=null)}function Zr(e,s,n){const t=xr(e,s);if(t==null)return;const r=n?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickup",location:t,metafields:r||[]}}function xr({pickupLocation:e,methodType:s},n){if(e?.type==="PickupInStoreLocation"){const{address:r}=e;return{name:e?.name,address:{name:r.name,firstName:r.firstName,lastName:r.lastName,company:r.company,address1:r.address1,address2:r.address2,city:r.city,zip:r.postalCode,countryCode:r.countryCode,provinceCode:r.zoneCode,phone:r.phone,...Xe(r)}}}const t=`Invalid pickupLocation type ${e?.type} for ${s} delivery method`;n?.error(new Ze(t))}function ei(e,s,n){const t=ti(e,s);if(t==null)return;const r=n?.filterMetafieldsByExtensionId(e.metafields);return{handle:e.handle,title:e.title||void 0,description:e.description||void 0,code:e.code||"",type:"pickupPoint",cost:{amount:e.cost.amount,currencyCode:e.cost.currencyCode},costAfterDiscounts:{amount:e.costAfterDiscounts.amount,currencyCode:e.costAfterDiscounts.currencyCode},carrier:{name:si(e),code:ni(e)},location:t,metafields:r||[]}}function si({pickupLocation:e}){if(e?.type==="PickupPointLocation")return e.carrierName}function ni({pickupLocation:e}){if(e?.type==="PickupPointLocation")return e.carrierCode}function ti({pickupLocation:e,methodType:s},n){if(e?.type==="PickupPointLocation"){const{name:r,address:i,handle:o}=e;return{name:r,handle:o,address:{name:i.name,firstName:i.firstName,lastName:i.lastName,company:i.company,address1:i.address1,address2:i.address2,city:i.city,zip:i.postalCode,countryCode:i.countryCode,provinceCode:i.zoneCode,phone:i.phone,...Xe(i)}}}const t=`Invalid pickupLocation type ${e?.type} for ${s} delivery method`;n?.error(new Ze(t))}function Xe(e){const s=e?.coordinates;return s?.latitude==null||s.longitude==null?{}:{latitude:s.latitude,longitude:s.longitude}}function Ps(e){if(e)return An("DeliveryGroup",Ve(e))}
8class Ze extends Error{constructor(s){super(s),this.name="DeliveryError"}}class Pe{constructor(s,n){this.measureAsync=(({functionToMeasure:t})=>Promise.resolve(t())),this.measureSync=(({functionToMeasure:t})=>t()),this.observability=n,this.extension=s}static wrapClient(s,n){return n instanceof Pe?n:new Pe(s,n)}counter(...s){this.observability.counter(...s)}gauge(...s){this.observability.gauge(...s)}histogram(...s){this.observability.histogram(...s)}debug(...s){this.observability.debug(...s)}log(...s){this.observability.log(...s)}addErrorMetadata(...s){this.observability.addErrorMetadata(...s)}leaveErrorBreadcrumb(...s){this.observability.leaveErrorBreadcrumb(...s)}addOnError(...s){this.observability.addOnError(...s)}removeOnError(...s){this.observability.removeOnError(...s)}async exportMetrics(){await this.observability.exportMetrics()}async exportLogs(){await this.observability.exportLogs()}addAttributesForLogs(...s){this.observability.addAttributesForLogs(...s)}enableKeepAlive(){return this.observability.enableKeepAlive()}error(s,n){const t={...n};t.metadata||(t.metadata={}),t.metadata.extension||(t.metadata.extension=me(this.extension)),this.observability.error(s,t)}leaveBreadcrumb(s,n,t){this.observability.leaveErrorBreadcrumb(s,n,t)}}class xe{constructor(s){this.extension=s}filterMetafieldsByExtensionId(s){return s.filter(n=>{const t=n.namespace.split("--");return t[0]==="app"&&t[1]===Ve(this.extension.appId)||t[0]!=="app"})}}function es({line:e,extension:s,observability:n,proposedSelectedDeliveryMethodHandles:t,lines:r}){const i=s?new xe(s):void 0;return Qr({line:e,extensionContext:i,observability:Pe.wrapClient(s,n),proposedSelectedDeliveryMethodHandles:t,lines:r})}function ri(e,s){return Jr(e,new xe(s))}function W({extension:e,negotiated:s,proposed:n,observability:t,createSubscribableFromSignal:r}){return{deliveryGroups:r(D(()=>{const o=s.fields.deliveryNext.value;if(!o)return[];const u=o.status;if(u==="unavailable")return[];const d=n.deliveryLines.value.map(c=>c.fields.deliveryMethodHandle.value),a=s.fields.remoteMerchandiseDetails.value;if(u==="filled"||u==="partial")return Ge(o.lines,a).map(p=>es({line:p,extension:e,observability:t,proposedSelectedDeliveryMethodHandles:d,lines:s.fields.merchandiseLines.value?.lines}));const f=`Unknown delivery status: ${u}`;return t.error(new lt(f),{metadata:{extension:me(e)}}),[]}))}}function fe({createSubscribableFromSignal:e,proposed:s,extension:n,negotiated:t}){return ne(n.approvalScopes,R.CustomerPersonalData)?{localizedFields:e(D(()=>{const r=s.localizationExtensions.value;return r?r.map(({fields:i})=>({key:i.key.value,title:i.title.value,value:i.value.value??""})):(t.value.localizationExtensions||[]).map(({key:i,title:o,value:u})=>({key:i,title:o,value:u??""}))}))}:{localizedFields:void 0}}function X({negotiated:e,proposed:s,createSubscribableFromSignal:n}){return{availablePaymentOptions:n(D(()=>{const t=e.fields.paymentMethods.value,r=s.paymentLines.value,i=e.fields.paymentLines.value,o=e.fields.deferredTotal.value,u="giftCard";if(!t)return[];let l=!1;const d=t?.filter(p=>p.type!==u?!0:(l=!0,!1)).map(p=>({method:p}));if(!d&&!l)return[];const a=is(d),f=os(a,r,t,{negotiatedPaymentLines:i?.lines,deferredTotal:o}),c=f.some(p=>p.method.type===u);return f.map(p=>{const m="name"in p.method?p.method.name:void 0,h="paymentMethodIdentifier"in p.method&&p.method.paymentMethodIdentifier||void 0;return{handle:He(p.method.type,m,h),type:Fe(p.method.type)}}).concat(l&&!c?[{handle:He(u),type:Fe(u)}]:[])})),selectedPaymentOptions:n(D(()=>{const t=s.paymentLines.value,r=e.fields.paymentMethods.value,i=e.fields.paymentLines.value,o=e.fields.deferredTotal.value;if(!r)return[];const u=is(t);return os(u,t,r,{negotiatedPaymentLines:i?.lines,deferredTotal:o}).map(d=>{const a="name"in d.method?d.method.name:void 0,f="paymentMethodIdentifier"in d.method&&d.method.paymentMethodIdentifier||void 0;return{handle:He(d.method.type,a,f),type:Fe(d.method.type)}})}))}}function ae({extension:e,ui:s}){return{ui:{overlay:{close(n){bt(e,n)&&s.overlay.close(n)}}}}}function _(e){const{shop:s,extension:n,extensionInstance:t}=e;switch(n.apiVersion){case"2023-04":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{presentmentLines:u}=Br(e),{note:l}=G(e),{metafields:d}=re(e),{discountAllocations:a,discountCodes:f}=C(e),{appliedGiftCards:c}=V(e),{shippingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:t.target,extension:{...r,apiVersion:r.apiVersion,target:r.target,capabilities:r.capabilities},settings:J(e),shop:Te(s),appliedGiftCards:c,attributes:i,discountAllocations:a,discountCodes:f,lines:o,metafields:d,note:l,presentmentLines:u,shippingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:gs(e),...Y(e),...B(e),...z(e),...ae(e)}}case"2023-07":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target,capabilities:r.capabilities},settings:J(e),shop:Te(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:gs(e),...Y(e),...B(e),...z(e),...ae(e)}}case"2023-10":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target,capabilities:r.capabilities},settings:J(e),shop:Te(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e)}}case"2024-01":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target,capabilities:r.capabilities},settings:J(e),shop:Te(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e)}}case"2024-04":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target,capabilities:r.capabilities},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e)}}case"2024-07":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target,capabilities:r.capabilities},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e)}}case"2024-10":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e)}}case"2025-01":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2025-04":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2025-07":case"unstable":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2025-10":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2026-01":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{metafields:l}=re(e),{discountAllocations:d,discountCodes:a}=C(e),{appliedGiftCards:f}=V(e),{shippingAddress:c,billingAddress:p}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:f,attributes:i,discountAllocations:d,discountCodes:a,lines:o,metafields:l,note:u,shippingAddress:c,billingAddress:p,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ae(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2026-04":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{discountAllocations:l,discountCodes:d}=C(e),{appliedGiftCards:a}=V(e),{shippingAddress:f,billingAddress:c}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:a,attributes:i,discountAllocations:l,discountCodes:d,lines:o,note:u,shippingAddress:f,billingAddress:c,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2026-07":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{discountAllocations:l,discountCodes:d}=C(e),{appliedGiftCards:a}=V(e),{shippingAddress:f,billingAddress:c}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:a,attributes:i,discountAllocations:l,discountCodes:d,lines:o,note:u,shippingAddress:f,billingAddress:c,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2026-10":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{discountAllocations:l,discountCodes:d}=C(e),{appliedGiftCards:a}=V(e),{shippingAddress:f,billingAddress:c}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:a,attributes:i,discountAllocations:l,discountCodes:d,lines:o,note:u,shippingAddress:f,billingAddress:c,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ee(e),...ie(e),...de(e),...fe(e)}}case"2027-01":{const r=F(e),{attributes:i}=M(e),{lines:o}=U(e),{note:u}=G(e),{discountAllocations:l,discountCodes:d}=C(e),{appliedGiftCards:a}=V(e),{shippingAddress:f,billingAddress:c}=w(e);return{version:n.apiVersion,extensionPoint:n.extensionPoint.target,extension:{...r,apiVersion:r.apiVersion,target:r.target},settings:J(e),shop:oe(s),appliedGiftCards:a,attributes:i,discountAllocations:l,discountCodes:d,lines:o,note:u,shippingAddress:f,billingAddress:c,buyerJourney:q(e),...K(e),...H(e),...j(e),...Q(e),...X(e),...W(e),...$(e),storage:se(e),...Y(e),...B(e),...z(e),...ee(e),...ie(e),...de(e),...fe(e)}}default:Ce(n.apiVersion)}}function ss(e,{stableId:s}
8){const{extension:n}=e;switch(n.apiVersion){case"2023-04":return{...ii(e,s)};case"2023-07":return{...x(e,s)};case"2023-10":return{...x(e,s)};case"2024-01":return{...x(e,s)};case"2024-04":return{...x(e,s)};case"2024-07":return{...x(e,s)};case"2024-10":return{...x(e,s)};case"2025-01":return{...x(e,s)};case"2025-04":return{...x(e,s)};case"2025-07":case"unstable":return{...x(e,s)};case"2025-10":return{...x(e,s)};case"2026-01":return{...x(e,s)};case"2026-04":return{...x(e,s)};case"2026-07":return{...x(e,s)};case"2026-10":return{...x(e,s)};case"2027-01":return{...x(e,s)};default:Ce(n.apiVersion)}}function x({createSubscribableFromSignal:e,negotiated:s},n){let t;return{target:e(D(()=>{const i=s.fields.merchandiseLines.value,o=vt({stableId:n,merchandiseLines:i?.lines??[]});if(o===null&&!t)throw new Dn("No merchandise item found");return o!==null&&(t=We(o)),t}))}}function ii({createSubscribableFromSignal:e,negotiated:s},n){let t;return{target:e(D(()=>{const i=s.fields.merchandiseLines.value,o=At(n,i?.lines??[]);if(o===null&&!t)throw new Dn("No merchandise item found");if(o!==null){const{parent:u,index:l}=o;t=kn(gt(u,l))}return t}))}}const ks=64;function Vn({applyChange:e,extension:s,proposed:n,createSubscribableFromSignal:t,extensionInstance:r,bankIdNumberSignal:i},{paymentMethodIdentifier:o}){const u=ne(s.approvalScopes,R.CheckoutExtensionPayments);async function l(d){return e({unknownChange:d,extension:s,extensionInstanceId:r.id,handlers:{async updatePaymentMethodAttributes({change:a}){if(!u)throw new y(oi);a.attributes.forEach(c=>{if(typeof c.value=="string"&&c.value.length>ks)throw new y(`Value length exceeded threshold ${ks} for key ${c.key}`)});const f=n.paymentLines.peek();return n.paymentLines.value=f.map(c=>(c.method.type==="customOnsite"||c.method.type==="direct")&&c.method.paymentMethodIdentifier===o?{...c,method:{...c.method,paymentAttributes:JSON.stringify(a.attributes)}}:c),{type:"success"}}},errorResult:a=>({type:"error",message:a.message})})}return{applyPaymentMethodAttributesChange:l,paymentMethodAttributes:u?t(D(()=>{const d=n.paymentLines.value.find(({method:a})=>{if(a.type==="direct"||a.type==="customOnsite")return a.paymentMethodIdentifier===o&&a.paymentAttributes});if(d){const{paymentAttributes:a}=d.method;if(a)return JSON.parse(a)}})):void 0,bankIdNumber:u?t(i):void 0}}const oi="Access denied: the extension does not have the required approval scopes";function ai({createSubscribableFromSignal:e,extension:s,negotiated:n,proposal:t},r){let i;const o=r?.handle,u=e(D(()=>{const d=n.fields.deliveryNext.value;if(!d||d.status!=="filled")return i;const c=d.lines.filter(p=>p.status==="available").flatMap(p=>p.methods).find(p=>p.handle===o);if(c){const p=ri(c,s);i=qe(i,p)?i:p}return i})),l=e(D(()=>t.parts.deliveryLines.value.some(({fields:{deliveryMethodHandle:a}})=>o===a.value)));return{target:u,isTargetSelected:l}}function Un({createSubscribableFromSignal:e},{isLocationFormVisible:s}){return{isLocationFormVisible:e(ye(s))}}function Gn({createSubscribableFromSignal:e},{isLocationFormVisible:s}){return{isLocationFormVisible:e(ye(s))}}function ui({extension:e,negotiated:s,applyChange:n,extensionInstance:t},{paymentMethodIdentifier:r,submitRedeemablePaymentLine:i}){return{async applyRedeemableChange(o){return n({unknownChange:o,extension:e,extensionInstanceId:t.id,handlers:{async redeemableAddChange({negotiate:u,change:l}){if(!(e.type==="local")&&!ne(e.approvalScopes,R.CheckoutExtensionRedeemables))throw new y("Access denied: the extension does not have the required approval scopes");const a=s.fields.availableRedeemables.peek()?.map(E=>({paymentMethod:Lt(E.paymentMethod)}))??[],f={paymentMethod:{type:"redeemable",redemptionSource:"CUSTOM",redemptionContent:{paymentMethodIdentifier:r,maskedIdentifier:di(l.identifier),redemptionAttributes:l.attributes}}},c=Pt(f),p=await u({customizeNegotiation:E=>({...E,availableRedeemables:{availableRedeemables:a.concat(c)}}),fieldsToResolve:["availableRedeemables"]}),m=p.status==="error"&&p.violations.some(us),h=p.violations.find(us);if(m)throw new y("Could not apply redeemable",{cause:{code:h?.code}});if(i){const E=p.negotiated.availableRedeemables?.find(N=>Et(f.paymentMethod,N.paymentMethod)),S=p.negotiated.paymentDue;if(!E||!S)throw new y("Could not apply redeemable",{cause:{code:h?.code}});const g=await i(E,S),A=g&&(g.status==="error"&&g.violations.some(at)||g.status!=="error"&&g.status!=="success");if(!g||A)throw new y("Could not submit redeemable as a payment line")}return{type:"success"}}},errorResult:u=>({type:"error",message:u.message})})}}}function di(e){return e.slice(0,-4).replace(/./g,"•")+e.slice(-4)}function Bn({createSubscribableFromSignal:e,extension:s,negotiated:n,proposal:t},{handle:r,isInModal:i}
8){let o;const u=e(D(()=>{const a=s?new xe(s):void 0,f=n.fields.deliveryNext.value;if(!f||f.status!=="filled")return o;const m=f.lines.filter(h=>h.status==="available").flatMap(h=>h.methods).find(h=>h.handle===r);if(m){const h=Cn(m,a);o=qe(o,h)?o:h}return o})),l=e(D(()=>t.parts.deliveryLines.value.some(f=>r===f.fields.deliveryMethodHandle.value)));return{target:u,isTargetSelected:l,renderMode:{overlay:i??!1}}}function Yn(e,s){const{extension:{apiVersion:n}}=e;switch(n){case"2023-04":case"2023-07":case"2023-10":return{};case"2024-01":case"2024-04":return ci(e,s??{});case"2024-07":return ce(e,s??{});case"2024-10":return ce(e,s??{});case"2025-01":return ce(e,s??{});case"2025-04":return ce(e,s??{});case"2025-07":case"unstable":return ce(e,s??{});case"2025-10":return ce(e,s??{});case"2026-01":return ce(e,s??{});case"2026-04":return ce(e,s??{});case"2026-07":return ce(e,s??{});case"2026-10":return ce(e,s??{});case"2027-01":return ce(e,s??{});default:Ce(n)}}function ce({createSubscribableFromSignal:e,observability:s,extension:n,proposed:t,negotiated:r},{includeDeliverySelectionGroups:i,groupType:o}){return{target:e(D(()=>{const u=r.fields.deliveryNext.value;if(!o||u?.status!=="filled")return;const l=r.fields.remoteMerchandiseDetails.value,d=u.lines.filter(gn),f=Ge(d,l).filter(({type:S})=>_e(S)===o),p=t.deliveryLines.value.filter(S=>_e(S.fields.type.value)===o).map(S=>S.fields.deliveryMethodHandle.value),m=r.fields.merchandiseLines.value?.lines,h=S=>es({line:S,extension:n,observability:s,proposedSelectedDeliveryMethodHandles:p,lines:m}),E=f.map(h);return E.length>0?{groupType:o,deliveryGroups:E}:void 0})),deliverySelectionGroups:e(D(()=>{const u=t.deliveryMacros.value,l=t.deliveryLines.value.map(a=>a.value).filter(({type:a,deliveryMethodTypes:f})=>a==="ONE_TIME_PURCHASE"&&f.some(c=>c==="SHIPPING"||c==="LOCAL"));if(!i||!u.length||!l.length)return;const d=new Set(l.map(({deliveryMethodHandle:a})=>a).filter(a=>!!a));return u.map(a=>{const f=Object.values(a.deliveryMethodHandles).filter(c=>!!c);return{handle:a.id,selected:f.length===d.size&&f.every(c=>d.has(c)),title:a.title,associatedDeliveryOptions:f.map(c=>({handle:c})),cost:{amount:a.cost.amount,currencyCode:a.cost.currencyCode},costAfterDiscounts:{amount:a.costAfterDiscounts.amount,currencyCode:a.costAfterDiscounts.currencyCode}}})}))}}function ci({createSubscribableFromSignal:e,observability:s,extension:n,proposed:t,negotiated:r},{groupType:i}){return{target:e(D(()=>{const o=r.fields.deliveryNext.value;if(!i||o?.status!=="filled")return;const u=r.fields.remoteMerchandiseDetails.value,l=o.lines.filter(gn),a=Ge(l,u).filter(({type:E})=>_e(E)===i),c=t.deliveryLines.value.filter(E=>_e(E.fields.type.value)===i).map(E=>E.fields.deliveryMethodHandle.value),p=r.fields.merchandiseLines.value?.lines,m=E=>es({line:E,extension:n,observability:s,proposedSelectedDeliveryMethodHandles:c,lines:p}),[h]=a;return h?m(h):void 0}))}}const ws={name:"Checkout::Dynamic::Render",api(e){return{..._(e),...T(e),...Ue(e)}}},Ms={name:"Checkout::Actions::RenderBefore",api(e){return{..._(e),...T(e)}}},Cs={name:"Checkout::CartLineDetails::RenderAfter",api(e,s){return{..._(e),...T(e),...ss(e,s),...Ue(e)}}},Vs={name:"Checkout::CartLineDetails::RenderLineComponents",api(e,s){return{..._(e),...ss(e,s)}}},Us={name:"Checkout::CartLines::RenderAfter",api(e){return{..._(e),...T(e),...Ue(e)}}},Gs={name:"Checkout::Contact::RenderAfter",api(e){return{..._(e),...T(e)}}},Bs={name:"Checkout::CustomerInformation::RenderAfter",api(e){return{..._(e),...T(e),...Ue(e)}}},Ys={name:"Checkout::DeliveryAddress::RenderBefore",api(e){return{..._(e),...T(e)}}},$s={name:"purchase.checkout.delivery-address.render-after",api(e){return{..._(e),...T(e)}}},Fs={name:"Checkout::GiftCard::Render",api(e,s){return{..._(e),...T(e),...ui(e,s)}}},Hs={name:"Checkout::PaymentMethod::Render",api(e,s){return{..._(e),...T(e),...Vn(e,s)}}},zs={name:"Checkout::PaymentMethod::HostedFields::RenderAfter",api(e,s){return{..._(e),...T(e),...Vn(e,s)}}},Js={name:"Checkout::PaymentMethod::RenderRequiredAction",api(e){return{..._(e),...T(e)}}},js={name:"purchase.checkout.payment-method-list.render-before",api(e){return{..._(e),...T(e)}}},qs={name:"purchase.checkout.payment-method-list.render-after",api(e){return{..._(e),...T(e)}}},Ks={name:"Checkout::PickupLocations::RenderBefore",api(e,s){return{..._(e),...T(e),...Un(e,s)}}},Qs={name:"Checkout::PickupLocations::RenderAfter",api(e,s){return{..._(e),...T(e),...Un(e,s)}}},Ws={name:"Checkout::PickupPoints::RenderBefore",api(e,s){return{..._(e),...T(e),...Gn(e,s)}}},Xs={name:"Checkout::PickupPoints::RenderAfter",api(e,s){return{..._(e),...T(e),...Gn(e,s)}}},Zs={name:"purchase.checkout.pickup-location-option-item.render-after",api(e,s){return{..._(e),...T(e),...ai(e,s)}}},xs={name:"Checkout::Reductions::RenderBefore",api(e){return{..._(e),...T(e)}}},en={name:"Checkout::Reductions::RenderAfter",api(e){return{..._(e),...T(e)}}},sn={name:"Checkout::ShippingMethodDetails::RenderAfter",api(e,s){return{..._(e),...T(e),...Bn(e,s)}}},nn={name:"Checkout::ShippingMethodDetails::RenderExpanded",api(e,s){return{..._(e),...T(e),...Bn(e,s)}}},tn={name:"Checkout::ShippingMethods::RenderBefore",api(e,s){return{..._(e),...T(e),...Yn(e,s)}}},rn={name:"Checkout::ShippingMethods::RenderAfter",api(e,s){return{..._(e),...T(e),...Yn(e,s)}}},on={name:"purchase.checkout.header.render-after",api(e){return{..._(e),...T(e)}}},an={name:"purchase.checkout.footer.render-after",api(e){return{..._(e),...T(e)}}},ke={name:"purchase.checkout.chat.render",api(e){return{..._(e),...T(e)}}};function li({extensionInstance:e,announcementEmitter:s}){return e.target!=="purchase.thank-you.announcement.render"?{}:(e.on("destroy",()=>{s.removeAllListeners()}),e.on("restart",()=>{s.removeAllListeners()}),{})}function ve({createSubscribableFromSignal:e,checkout:s,isCheckoutEditor:n,journeyCompletedSignal:t,observability:r}){return{orderConfirmation:e(D(()=>{const i=s.latestReceipt.value,o=!i||i.status!=="processed";if(o&&n)return{order:{id:An("Order","0")},number:kt().substring(0,10),isFirstOrder:!0};if(o){const u=t.peek()?"No receipt available on thankYou page":"No receipt available";throw i&&r.leaveErrorBreadcrumb("Receipt (OrderConfirmationApi):",{status:i.status,keys:Object.keys(i)}),new pt(u)}return{order:{id:i.orderIdentity.id},number:i.orderIdentity.buyerIdentifier??void 0,isFirstOrder:i.isFirstOrder??!0}}))}}const un={name:"Checkout::ThankYou::Dynamic::Render",api(e){return{..._(e),...ve(e)}}},dn={name:"Checkout::ThankYou::CartLineDetails::RenderAfter",api(e,s){return{..._(e),...ss(e,s),...ve(e)}}},cn={name:"Checkout::ThankYou::CartLines::RenderAfter",api(e){return{..._(e),...ve(e)}}},ln={name:"Checkout::ThankYou::CustomerInformation::RenderAfter",api(e){return{..._(e),...ve(e)}}},pn={name:"purchase.thank-you.header.render-after",api(e){return{..._(e),...ve(e)}}},fn={name:"purchase.thank-you.footer.render-after",api(e){return{..._(e),...ve(e)}}},we={name:"purchase.thank-you.chat.render",api(e){return{..._(e),...ve(e)}}},Me={name:"purchase.thank-you.announcement.render",api(e){return{..._(e),...ve(e),...li(e)}}},Pi={[ws.name]:ws,[Ms.name]:Ms,[Cs.name]:Cs,[Vs.name]:Vs,[Us.name]:Us,[Gs.name]:Gs,[Bs.name]:Bs,[Ys.name]:Ys,[$s.name]:$s,[Fs.name]:Fs,[Hs.name]:Hs,[zs.name]:zs,[js.name]:js,[qs.name]:qs,[Ks.name]:Ks,[Qs.name]:Qs,[Zs.name]:Zs,[Ws.name]:Ws,[Xs.name]:Xs,[Js.name]:Js,[xs.name]:xs,[en.name]:en,[sn.name]:sn,[tn.name]:tn,[rn.name]:rn,[nn.name]:nn,[on.name]:on,[an.name]:an,[ke.name]:ke,[un.name]:un,[dn.name]:dn,[cn.name]:cn,[ln.name]:ln,[pn.name]:pn,[fn.name]:fn,[we.name]:we,[Me.name]:Me},ki=[ke.name,we.name,Me.name],wi=[ke.name,we.name,Me.name];
8export{ki as D,Vr as M,Pi as R,wi as a,w as b,M as c,re as d,cs as e,$ as f,se as g,oe as h,he as i,J as j,F as k,z as l,H as m,ee as n,Y as o,Li as p,Dr as q,Yt as r,vs as s,Ni as t,Oi as u,Ti as v,bi as w,Bt as x,Si as y};

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.