PageSourceSearch

https://shop.spikeartmagazine.com/cdn/shopifycloud/checkout-web/assets/c1/Trekkie.DL7VkJKs.js

js spikeartmagazine.com collected 2026-09-24 18:25:55 UTC 15,554 bytes, 1 lines download raw bytes

1import{A as Y,T as et,q as h}from"./esnext-vendor.BBoIVOQW.js";import{ef as Nt,eg as Ot,o as wt,eh as Ft,ei as Wt,cp as Vt,ej as Gt,ek as w}from"./hydrate.Tsur0pib.js";import{I as xt,e4 as Bt,e5 as Ht,e6 as Kt,e7 as zt,e8 as St,e9 as Yt,ea as Ut,T as qt,g as kt,ah as $t,W as Jt,a5 as Xt,eb as jt,bV as Qt,ec as Zt,ed as U,ee as Ct,ef as vt,eg as bt}from"./addresses-is-address-empty.ZJ1ThpFy.js";import"./app.CUBUOQtX.js";import"./shared-permissions.DW7FOCqf.js";import"./hooks-useShopPayExternalAppContext.YLtTu3k6.js";var m=(r=>(r.StartedOrder="Started Order",r.StartedOrderRemote="Started Order Remote",r.StartedOrderOncePerCheckout="Started Order Once Per Checkout",r.StartedOrderOncePerCheckoutRemote="Started Order Once Per Checkout Remote",r.CompletedOrder="Completed Order",r.AddedPayment="Added Payment",r.AddedPaymentRemote="Added Payment Remote",r.CheckoutContactPageStarted="Checkout Contact Step Started",r.CheckoutContactInfoSubmitted="Checkout Contact Info Submitted",r.CheckoutContactInfoSubmittedRemote="Checkout Contact Info Submitted Remote",r.CheckoutAddressInfoSubmitted="Checkout Address Info Submitted",r.CheckoutAddressInfoSubmittedRemote="Checkout Address Info Submitted Remote",r.CheckoutShippingPageStarted="Checkout Shipping Step Started",r.CheckoutShippingInfoSubmitted="Checkout Shipping Info Submitted",r.CheckoutShippingInfoSubmittedRemote="Checkout Shipping Info Submitted Remote",r.CheckoutPaymentPageStarted="Checkout Payment Step Started",r.CheckoutOnePageView="Checkout One Page View",r))(m||{});const gt="checkout",te=[Bt,Ht,Kt,zt,St,Yt,Ut];class At extends Error{constructor(){super(...arguments),this.name="TrekkieError"}}class ee{constructor({shop:l,checkoutToken:c="",locale:k,analyticsConfig:b,sourceUrl:d,themeId:E,themeCityHash:S,userEvents:B,s2s:q,monorailRegion:W,getCookie:I},H){if(this.libraryLoaded=!1,this.trekkieLoadedCallback=H,this.analyticsWindow=window,this.tricorder=this.analyticsWindow.ShopifyAnalytics?.lib||this.analyticsWindow.trekkie||[],this.tricorder?.integrations){this.libraryLoaded=!0,this.trekkieLoadedCallback(this.analyticsWindow?.ShopifyAnalytics?.lib?.trekkie);return}const _=parseInt(xt(l.id),10),T=te.filter(L=>l.hasFlagEnabled(L)),e=T.includes(St);this.tricorder.ready(()=>{this.libraryLoaded||(this.libraryLoaded=!0,this.shopifyAnalytics={...this.shopifyAnalytics,lib:this.tricorder},this.trekkieLoadedCallback(this.tricorder?.trekkie))}),this.tricorder.load=L=>{if(this.tricorder.config=L,!e){const{assetPath:K,sriHash:C}=l.trekkieLoadConfiguration,N=K&&C,R=document.getElementsByTagName("script")[0],g=document.createElement("script");g.type="text/javascript",g.onerror=function(){const A=document.createElement("script");A.type="text/javascript",A.onerror=function(){const O={schemaId:"trekkie_checkout_load_errors/1.1",payload:{appName:gt,shopId:_,themeId:E,contextUrl:window.location.href,sourceUrl:d}};B.monorailEvent(O)},A.async=!0,A.src=d,N&&(A.setAttribute("integrity",C),A.setAttribute("crossorigin","anonymous")),R?.parentNode?.insertBefore(A,R)},g.async=!0,g.src=d,N&&(g.setAttribute("integrity",C),g.setAttribute("crossorigin","anonymous")),R?.parentNode?.insertBefore(g,R)}};const V={appName:gt,development:!1,defaultAttributes:{shopId:_,isMerchantRequest:I("_ab")?!0:null,themeId:E,themeCityHash:S,contentLanguage:k,currency:l.currencyCode,checkoutToken:c},isServerSideCookieWritingEnabled:!0,enabledBetaFlags:T};W&&(V.monorailRegion=W),this.tricorder.load({Trekkie:V,...b,"Session Attribution":{},S2S:q})}get tricorder(){return this.analyticsWindow?.trekkie}set tricorder(l){if(!this.analyticsWindow)throw new At("AnalyticsWindow is not set.");this.analyticsWindow.trekkie=l}get shopifyAnalytics(){return this.analyticsWindow.ShopifyAnalytics}set shopifyAnalytics(l){if(!this.analyticsWindow)throw new At("AnalyticsWindow is not set.");this.analyticsWindow.ShopifyAnalytics=l}page(l="",c={},k){this.tricorder?.page(l,c,k)}track(l,c,k,b,d){this.tricorder?.track(l,c,k,b,d)}}function F({remoteTotalDetails:r,remoteMerchandiseLinesByShopId:l,emitRemoteEventForShop:c}
1){if(r)for(const[k,b]of r.perShopRemoteTotals.entries())if(l){const d=l?.get(k)??[];c({remoteTotals:b,remoteMerchandiseLines:d})}else c({remoteTotals:b})}function G(r){switch(r){case"/":case"/information":return{title:"Checkout - Contact Information",page:"/checkout/contact_information"};case"/shipping":return{title:"Checkout - Shipping",page:"/checkout/shipping"};case"/payment":return{title:"Checkout - Payment",page:"/checkout/payment"};case"/review":return{title:"Checkout - Review",page:"/checkout/review"};case"/processing":return{title:"Checkout - Processing",page:"/checkout/processing"};case"/thank-you":return{title:"Checkout - Receipt",page:"/checkout/thank_you"};case"/stock-problems":return{title:"Checkout - Stock problems",page:"/checkout/stock_problems"};case"/error":return{title:"Checkout - Error",page:"/checkout/error"};case"/no-address-location":return{title:"Checkout - No Address Location",page:"/checkout/no_address_location"};case"/shoppay_login":return{title:"ShopPay - Login",page:"/shop.app/pay/login"};case"/shoppay":return{title:"ShopPay - Payment",page:"/shop.app/pay/payment"};default:return{title:null,page:null}}}function x(r){return r?.map(c=>{const k=c.lineAllocations.reduce((d,E)=>(E.allocations.filter(S=>S.discountDetails.discount.type==="code").forEach(S=>{S.amount.amount>d.amount&&(d.amount=S.amount.amount,d.code=S.discountDetails.title)}),d),{code:void 0,amount:0});return{variantId:U(c.variantId),productId:U(c.productId),productGid:c.productId,category:c.productType,coupon:k.code,currency:c.itemPrice?.currencyCode,name:c.title,price:c.itemPrice?.amount,quantity:c.quantity,brand:c.vendor,variant:c.subtitle,sku:c.sku}})}function de(){const{client:r,observability:l,userEvents:c,environment:k,i18n:{locale:b},shop:d,source:E,checkout:{identity:S}}=qt(),B=S.current.value==="shopPay"?"trekkie-checkout-one-shop-app":"trekkie-checkout-one",{data:q}=Nt(),W=q?.session?.activeCheckoutRolloutTreatments?.flatMap(({rolloutId:t,treatmentId:o})=>{const s=kt(t),n=kt(o);return s!==void 0&&n!==void 0?[{rolloutId:Number(s),treatmentId:Number(n)}]:[]}),I=Y(W);I.current=W;const H=E.checkoutSessionIdentifier||E.sourceId;let _=d.theme?.id===void 0||d.theme?.id===null?void 0:parseInt(d.theme.id,10);_&&_>Number.MAX_SAFE_INTEGER&&(_=void 0);const T=d.theme?.cityhash,e=$t(),{email:V,phone:L,shippingAddress:K}=Jt(),C=Ot(),{value:N}=Xt().deliveryNext,R=r.unstable_getSerialization("apiClientId"),g=r.unstable_getSerialization("apiClientId"),{currentPage:A}=wt().value,O=A&&["onePage"].includes(A.id),ot=Ft(),$=Wt(),J=Y(new WeakSet).current,{value:It}=jt(),v=It,u=Vt(),st=et(()=>({}),[]),f=Qt(),nt=h(t=>{if(!t){l.error(new Zt("Trekkie is not available"));return}f.value?.defaultAttributes!==t?.defaultAttributes&&f.setValue({defaultAttributes:t?.defaultAttributes})},[l,f]),a=et(()=>{const t=T===null?void 0:T,o=e.current.fields.buyerIdentity.peek(),s={facebookCapiEnabled:d.facebookCapiEnabled,source:B,customerId:U(o?.customerProfile?.id),cartApiClientId:R,apiClientId:g},n=`${k.services.trekkie.url}/${d.trekkieLoadConfiguration?.assetPath||"s/trekkie.storefront.min.js"}`,i={shop:d,checkoutToken:H,locale:b,analyticsConfig:st,sourceUrl:n,themeId:_,themeCityHash:t,userEvents:c,monorailRegion:"shop_domain",s2s:s,getCookie:p=>r.cookies.get(p)??null};return ot?null:new ee(i,nt)},[d,H,b,st,_,T,c,r.cookies,nt,e,R,g,B,ot,k.services.trekkie.url]),rt=h(t=>{const{title:o,page:s}=G(t);!o||!s||!u.value||a?.page(o,{path:s})},[a,u]),it=h(t=>{const{title:o,page:s}=G(t);if(!o||!s||!u.value)return;const n={name:o,path:s};a?.track(m.CheckoutOnePageView,n,void 0,void 0,{shopifyEmitted:!0})},[a,u]),at=et(()=>{let t={amount:void 0,currencyCode:void 0};return C&&N?.status==="filled"&&N.lines.forEach(o=>{if(o.status==="available"){const s=o.selectedDeliveryMethodHandle;s&&(t=o.methods.filter(i=>i.handle===s&&i.costAfterDiscounts!==void 0).reduce((i,p)=>{const D=i.amount===void 0?0:i.amount;return i.amount=D+p.costAfterDiscounts.amount,i.currencyCode=p.costAfterDiscounts.currencyCode,i},t))}}),t},[N,C]),ct=h(()=>{const t=e.current.fields.merchandiseLines.value,o=e.current.fields.remoteMerchandiseDetails.value;if(u.value){const s=e.current.fields.subtotal.value,n=e.current.fields.subtotalAfterMerchandiseDiscounts.value,i=Ct(t?.lines??[],o),D={step:1,products:x(i),currency:s?.currencyCode,revenue:s?.amount,subtotalAfterMerchandiseDiscounts:n?.amount,...I.current?.length?{rolloutIds:I.current.map(y=>Number(y.rolloutId)),rolloutTreatmentIds:I.current.map(y=>Number(y.treatmentId))}:{}};a?.track(m.StartedOrder,D,void 0,void 0,{shopifyEmitted:!0})}if(v){const s=e.current.fields.remoteTotalDetails.value,n=vt(t?.lines??[],o);F({remoteTotalDetails:s,remoteMerchandiseLinesByShopId:n,emitRemoteEventForShop:({remoteTotals:i,remoteMerchandiseLines:p})=>{const y={step:1,products:p?x(p):[],currency:i?.subtotal?.currencyCode,revenue:i?.runningTotal?.amount,subtotalAfterMerchandiseDiscounts:i?.subtotal?.amount};a?.track(m.StartedOrderRemote,y,void 0,void 0,{shopifyEmitted:!0})}})}},[a,e,v,u]),ut=h(()=>{const t=e.current.fields.subtotal.value,o=e.current.fields.subtotalAfterMerchandiseDiscounts.value,s=e.current.fields.remoteTotalDetails.value,n=e.current.fields.merchandiseLines.value,i=e.current.fields.remoteMerchandiseDetails.value,p=Ct(n?.lines??[],i),D=vt(n?.lines??[],i);if(u.value){const M={step:1,products:x(p),currency:t?.currencyCode,revenue:t?.amount,subtotalAfterMerchandiseDiscounts:o?.amount,...I.current?.length?{rolloutIds:I.current.map(P=>Number(P.rolloutId)),rolloutTreatmentIds:I.current.map(P=>Number(P.treatmentId))}:{}};a?.track(m.StartedOrderOncePerCheckout,M,void 0,void 0,{shopifyEmitted:!0})}v&&F({remoteTotalDetails:s,remoteMerchandiseLinesByShopId:D,emitRemoteEventForShop:({remoteTotals:y,remoteMerchandiseLines:M})=>{const z={step:1,products:M?x(M):[],currency:y?.subtotal?.currencyCode,revenue:y?.runningTotal?.amount,subtotalAfterMerchandiseDiscounts:y?.subtotal?.amount};a?.track(m.StartedOrderOncePerCheckoutRemote,z,void 0,void 0,{shopifyEmitted:!0})}})},[a,e,v,u]),dt=h(()=>
1{if(!C||$.shouldPrevent()||!u.value)return;const t=e.current.fields.merchandiseLines.value,o=t?.lines&&x(t?.lines),s=C.purchaseOrder,n=U(C.orderIdentity.id),i=n?.toString(),p=s.billingAddress,y=e.current.fields.buyerIdentity.value?.customerProfile;let M=y?.firstName,P=y?.lastName;P||(M=p?.firstName,P=p?.lastName);const z=e.current.fields.total.value,Et=e.current.fields.subtotal.value,Rt=e.current.fields.subtotalAfterMerchandiseDiscounts.value,Dt=Gt(e),yt=e.current.fields.contactInfo.value,Mt=e.current.fields.discountLines.value?.lines.filter(tt=>tt.discount.type==="code").map(tt=>tt.discount.title)||[],Tt=C.analytics?.checkoutCompletedEventId||void 0,Lt=C.analytics?.emitConversionEvent||!1;a?.track(m.CompletedOrder,{customerEventData:{customer:{firstName:M,lastName:P,emailAddress:y?.email??yt?.email,phoneNumber:y?.phone??yt?.phone},address:{city:p?.city,province:p?.zoneCode,country:p?.countryCode,zip:p?.postalCode}},orderId:n,orderName:i,products:o,total:z?.amount??0,currency:z?.currencyCode,revenue:Et?.amount??0,subtotalAfterMerchandiseDiscounts:Rt?.amount??0,coupon:Mt[0],tax:Dt?.amount??0,shipping:at.amount??0},Tt,Lt,{shopifyEmitted:!0}),$.markAsEmitted()},[C,e,a,at.amount,$,u]),lt=h(()=>{const t=e.current.fields.runningTotal.value,o=e.current.fields.subtotalAfterMerchandiseDiscounts.value,s=e.current.fields.remoteTotalDetails.value;if(u.value){const n={currency:t?.currencyCode,total:t?.amount,subtotalAfterMerchandiseDiscounts:o?.amount};a?.track(m.AddedPayment,n,void 0,void 0,{shopifyEmitted:!0})}v&&F({remoteTotalDetails:s,emitRemoteEventForShop:({remoteTotals:n})=>{const i={currency:n?.runningTotal?.currencyCode,total:n?.runningTotal?.amount,subtotalAfterMerchandiseDiscounts:n?.subtotal?.amount};a?.track(m.AddedPaymentRemote,i,void 0,void 0,{shopifyEmitted:!0})}})},[a,e,v,u]),X=h(()=>{if(u.value){const{title:t,page:o}=G("/information"),s={name:t,path:o};a?.track(m.CheckoutContactPageStarted,s,void 0,void 0,{shopifyEmitted:!0})}},[a,u]),_t=h(()=>{const t=V.value,o=L.value,s=e.current.fields.subtotalAfterMerchandiseDiscounts.value,n=e.current.fields.remoteTotalDetails.value;if(u.value){const i={email:t,phone:o,subtotalAfterMerchandiseDiscounts:s?.amount};a?.track(m.CheckoutContactInfoSubmitted,i,void 0,void 0,{shopifyEmitted:!0})}v&&F({remoteTotalDetails:n,emitRemoteEventForShop:({remoteTotals:i})=>{const p={email:t,phone:o,subtotalAfterMerchandiseDiscounts:i?.subtotal?.amount};a?.track(m.CheckoutContactInfoSubmittedRemote,p,void 0,void 0,{shopifyEmitted:!0})}})},[a,V,L,e,v,u]),Pt=h(()=>{const t=K.value,o=e.current.fields.subtotalAfterMerchandiseDiscounts.value,s=e.current.fields.remoteTotalDetails.value;if(u.value){const n={city:t?.city,country:t?.countryCode,phone:t?.phone,province:t?.zoneCode,postalCode:t?.postalCode,firstName:t?.firstName,lastName:t?.lastName,address1:t?.address1,address2:t?.address2,subtotalAfterMerchandiseDiscounts:o?.amount};a?.track(m.CheckoutAddressInfoSubmitted,n,void 0,void 0,{shopifyEmitted:!0})}v&&F({remoteTotalDetails:s,emitRemoteEventForShop:({remoteTotals:n})=>{const i={city:t?.city,country:t?.countryCode,phone:t?.phone,province:t?.zoneCode,postalCode:t?.postalCode,firstName:t?.firstName,lastName:t?.lastName,address1:t?.address1,address2:t?.address2,subtotalAfterMerchandiseDiscounts:n?.subtotal?.amount};a?.track(m.CheckoutAddressInfoSubmittedRemote,i,void 0,void 0,{shopifyEmitted:!0})}})},[a,K,e,v,u]),pt=h(()=>{if(!u.value)return;const{title:t,page:o}=G("/shipping"),s={name:t,path:o};a?.track(m.CheckoutShippingPageStarted,s,void 0,void 0,{shopifyEmitted:!0})},[a,u]),j=h(()=>{const t=e.current.fields.runningTotal.value,o=e.current.fields.subtotalAfterMerchandiseDiscounts.value,s=e.current.fields.remoteTotalDetails.value;if(u.value){const n={total:t?.amount,currency:t?.currencyCode,subtotalAfterMerchandiseDiscounts:o?.amount};a?.track(m.CheckoutShippingInfoSubmitted,n,void 0,void 0,{shopifyEmitted:!0})}v&&F({remoteTotalDetails:s,emitRemoteEventForShop:({remoteTotals:n})=>{const i={total:n?.runningTotal?.amount,currency:n?.runningTotal?.currencyCode,subtotalAfterMerchandiseDiscounts:n?.subtotal?.amount};a?.track(m.CheckoutShippingInfoSubmittedRemote,i,void 0,void 0,{shopifyEmitted:!0})}})},[a,e,v,u]),ht=h(()=>
1{if(!u.value)return;const{title:t,page:o}=G("/payment"),s={name:t,path:o};a?.track(m.CheckoutPaymentPageStarted,s,void 0,void 0,{shopifyEmitted:!0})},[a,u]);w(h(t=>{f.value.defaultAttributes&&t.type==="page_view"&&rt(t.url)},[f,rt])),w(h(t=>{f.value.defaultAttributes&&t.type==="initiate_checkout"&&ct()},[f,ct])),w(h(t=>{f.value.defaultAttributes&&t.type==="initiate_checkout_once_per_checkout"&&ut()},[f,ut])),w(h(t=>{f.value.defaultAttributes&&t.type==="complete_checkout"&&dt()},[f,dt])),w(h(t=>{f.value.defaultAttributes&&t.type==="add_payment_info"&&lt()},[f,lt]));const Q=Y(!1),Z=Y(void 0),mt=bt(_t,500),ft=bt(Pt,500);return w(h(t=>{f.value.defaultAttributes&&(J.has(t)||(J.add(t),t.type==="one_page_checkout_page_view"&&(it(t.url),t.url==="/"&&Z.current===void 0&&(X(),Q.current=!0)),t.type==="section_interaction"&&O&&(t.section==="contact"?(Q.current&&Z.current===void 0||X(),Q.current=!1):t.section==="payment"&&(j(),ht()),Z.current=t.section),t.type==="section_complete"&&(t.section==="contact"?mt():t.section==="deliveryAddress"&&ft()),t.type==="shipping_methods_filled"&&O&&pt(),t.type==="page_submit"&&t.page==="shipping"&&!O&&j()))},[f.value.defaultAttributes,O,X,J,it,j,ht,mt,ft,pt])),null}export{de as default};

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.