PageSourceSearch

https://supplyvictoria.ca/cdn/shopifycloud/checkout-web/assets/c1/PaymentOptionSelector.D-08K5CC.js

js supplyvictoria.ca collected 2026-09-26 06:48:07 UTC 11,817 bytes, 1 lines download raw bytes

1import{l as K,e as Q,f as B,u as e,S as H,i as ee,k,h as w,q as v,T,A as C,p as me,G as pe,g as he,D as ge}from"./esnext-vendor.B9Da21W6.js";import{cZ as te,c_ as ve,cV as ne,d as se,c$ as ye,k as I,m as ae,P as x,aC as fe,aE as be,aF as _e,l as V,d0 as Se,U as Pe,I as Ae,B as ie,bh as Ce,f as Ie,bN as Me,b as Oe}from"./hydrate.DZ4YTm7p.js";import{f as Be,d as we,e as Le,B as G}from"./components-PaymentMethodProgressionHost.DtGKVVH3.js";import{S as f,a4 as q,T as Ne,cU as Te,V as Ee,cV as ke,cW as De,an as Re,cX as Fe,aB as xe,cY as Ve}from"./addresses-is-address-empty.Bn2lNY_L.js";import{f as He,D as qe}from"./useAddressMutationsWithNegotiation.qYbyFTyH.js";import{b as We}from"./hooks-useGeneralPaymentErrorMessage.EV5zhNz-.js";import{u as Ye}from"./hooks-useShopPayProgressIntercepts.C0rljcs-.js";import{B as ze}from"./BillingAddressSelector.DB4kH3hG.js";import{a as Ue,C as E,b as je}from"./Choice.DSKmQsTS.js";import{u as Ge,P as $e}from"./components-VatNumberValidationField.DDyS8GP9.js";import{S as $}from"./ChangeCompanyLocationLink.r3PUjspg.js";import{u as Je}from"./hooks-useUpdateCheckoutAddress.DUYbpduS.js";import{C as Ze}from"./localization-index.1YNaS8kx.js";import{C as Xe}from"./IncentiveBadge.DborNHa8.js";import{u as Ke,a as Qe}from"./OnePage.B6rwcJvn.js";import{g as et}from"./app.DbSrjjlA.js";import{g as tt}from"./shop-pay-installments-monorail.BAOukcZ1.js";import{I as nt}from"./hooks-useStableHostMethodsReferences.DObnt9s8.js";function qt({selectorShowsTiles:s,afterPaymentSelector:t,renderVaultingAgreementInline:a}){const l=We(),o=te(),{checkout:n,i18n:r,shopPay:i,source:d}=f(),u=ve(),m=ne(),c=se(),{paymentMethods:g}=q(),p=i.user.creditCards,y=K(Ye().creditCardDisabled),h=Q(null),b=B(()=>!(u.value||ye({checkout:n,source:d})?.pickupAddress)&&!m.value&&n.isShippingRequired.value),_=B(()=>at({identity:n.identity},{billingPosition:o,vaultedSections:c,showBillingAddressInContext:b})),M=B(()=>He({paymentMethods:g.value})),O=B(()=>st({identity:n.identity,i18n:r},{paymentMethodMustSupportInterestBearingLoans:n.installments.paymentMethodMustSupportInterestBearingLoans.value,supportedCountryOptions:n.installments.supportedCountryOptions.value,creditCards:p.value,creditCardDisabled:y.value})),L=e(qe,{blurValidationFieldDenylist:M.value,onSetFieldErrors:l,children:[e(Be,{vaultHandle:h}),e(I,{gap:"base",children:[e(it,{}),e(we,{billingAddressInContext:_.value,vaultHandle:h,selectorShowsTiles:s,afterPaymentSelector:t,renderVaultingAgreementInline:a})]})]});return e(ee,{when:O,fallback:L,children:N=>e(H,{children:[e(I,{gap:"small-400",children:[e(ae,{level:2,children:r.translate("credit_card_form.add_debit_card")}),e(x,{color:"subdued",children:N})]}),L]})})}function st({identity:s,i18n:t},{paymentMethodMustSupportInterestBearingLoans:a,supportedCountryOptions:l,creditCards:o,creditCardDisabled:n}){if(s.current.value!=="shopPay"||!a||!o.every(i=>n(i)))return null;const r=l.map(i=>i.label).join(", ");return r?t.translate("installments.installments_debit_cards_supported_countries",{countries:r}):t.translate("installments.installments_valid_debit_cards_fallback")}function at({identity:s},{billingPosition:t,vaultedSections:a,showBillingAddressInContext:l}){switch(s.current.value){case"shopPay":return t.value==="inContext"&&!a.value.payment;case"businessCustomer":return!0;default:return l.value}}function it(){return Le(),null}const ot="billing_address_selector",R="shipping_address",J="custom_billing_address";function lt({renderFormOnly:s=!1}={}){const{i18n:t}=f(),a=fe(),{billingAddressOption:l}=Ne(),o=be(),n=l.value==="shipping"?R:J,[r,i]=k([n]),{isBilling:d}=Ge().value,u=d?e($e,{}):null;w(()=>{i([n])},[n]);const m=v(p=>{const y=p[0]===R?"shipping":"custom";l.value=y,i(p),y==="shipping"&&o()},[l,o]);_e();const c=v(({billing:p})=>{p.value=!0},[]),g=v(({billing:p})=>{p.value=!1},[]);return e(ee,{when:()=>!s&&a.value!=="form",fallback:e($,{onValid:c,onInvalid:g,children:e(G,{children:u})}),children:e(Ue,{name:ot,values:r,onChange:m,variant:"block",children:[e(E,{value:R,accessibilityLabel:t.translate("payment.same_billing_address_label"),children:e(V,{type:"strong",children:t.translate("payment.same_billing_address_label")})}),e(E,{value:J,selectedContent:e($,{onValid:c,onInvalid:g,children:e(G,{children:u})}),accessibilityLabel:t.translate("payment.different_billing_address_label"),children:e(V,{type:"strong",children:t.translate("payment.different_billing_address_label")})})]})})}const Z=()=>{const{i18n:s,checkout:{identity:t}}=f(),a=rt({identity:t});return e(I,{accessibilityRole:"group",accessibilityLabelledBy:"billingAddress",gap:"base",children:[e(ae,{id:"billingAddress",level:2,children:s.translate("payment.billing_address_title")}),e(a,{})]})};function Wt({dynamicPaymentExtensions:s=[],children:t}){Se();const a=te(),l=ne(),{checkout:o}=f(),n=se(),r=Te({checkout:o}),i=n.value.payment&&n.value.billing&&!r,[d]=Je(),u=T(()=>Object.values(Ee).some(c=>d===c),[d]),m=!i&&!l.value&&!u;return e(I,{gap:"base",children:[a.value==="beforePayment"&&m&&e(Z,{}),t,a.value==="afterPayment"&&!u&&e(H,{children:[m&&e(Z,{}),e(Pe,{customizations:s})]})]})}function rt({identity:s}){return s.current.value==="businessCustomer"?ze:lt}function ct(){const{checkout:{identity:s},shopPay:t}=f(),a=ke(),l=q().paymentMethods;return B(()=>{const o=a.value,n=t.user.installments.prequalifiedAmount.value,r=t.user.installments.credential.value,i=l.value?.find(m=>m.type==="wallet"&&m.name==="SHOPIFY_INSTALLMENTS"),d=s.current.value==="shopPay"&&o!=null&&i!=null&&o.amount>=Math.max(i.minPrice.amount,50)&&o.currencyCode===i.minPrice.currencyCode,u=n!=null&&o!=null&&(!i?.cbtEnabled||n.currencyCode===o.currencyCode)&&(r?.requiresAdditionalInformation&&o.amount<=n.amount||!r?.requiresAdditionalInformation);return d&&u})}function dt({selectable:s}){const{userEvents:t,source:a,checkout:l,shop:o,shopPay:n,embed:r}=f(),{ineligibilityReasons:i}=l.installments,{isServiceAvailable:d}=n.installments,{isRejected:u}=n.user.installments,{isLoading:m}=n.session,c=Q(null),g=C(!1),p=K(s);function y(){const h=p.value,b=h?void 0:JSON.stringify(ut({ineligibilityReasons:i.value,serviceAvailable:d.value,userRejected:u.value}));t.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...tt(a,l,o,{embedPlatform:r?.platform,shopAppSurface:n.app.c
1onfig.surface}),eventType:De.OptionImpression,success:h,errorMessage:b}})}return me(()=>{const h=c.value;if(!h||m.value||g.current)return;const b=()=>{g.current=!0,pe(y)};if(!window.IntersectionObserver){b();return}const _=new IntersectionObserver(M=>{M.some(({isIntersecting:O})=>O)&&(_.disconnect(),b())},{threshold:1});return _.observe(h),()=>_.disconnect()}),v(h=>{c.value=h},[c])}function ut({ineligibilityReasons:s,serviceAvailable:t,userRejected:a}){return s.length>0?s:t?a?["user_rejected"]:["unknown"]:["installments_unavailable"]}const mt=1e4,F={error:"iovation_sandbox_error",init:"iovation_sandbox_initialize",fingerprint:"iovation_sandbox_fingerprint"};function pt({onComplete:s}){const t=C(null),a=C(),[l,o]=k(!1),{environment:{services:{shopServer:n}},observability:r}=f(),i=C(performance.now()),d=v(c=>{s(c),o(!0),a.current=c},[s]),u=v(({data:c,origin:g,source:p})=>{if(g==="null"&&p===t.current?.contentWindow&&typeof c.payload=="string"&&c.payload!=="")switch(c.action){case F.error:r.leaveErrorBreadcrumb("[Iovation] Fingerprint error",{error:c.payload}),d("");break;case F.fingerprint:r.histogram({name:"iovation_fingerprint_load_time",value:performance.now()-i.current}),d(c.payload);break}},[d,r]),m=v(()=>{t.current?.contentWindow&&t.current.contentWindow.postMessage({action:F.init},"*")},[]);return w(()=>(window.addEventListener("message",u),()=>{window.removeEventListener("message",u)}),[u]),w(()=>{const c=setTimeout(()=>{a.current===void 0&&(r.histogram({name:"iovation_fingerprint_load_time",value:performance.now()-i.current}),d(""))},mt);return()=>clearTimeout(c)},[d,r]),l?null:e(nt,{ref:t,id:"iovation_sandbox_iframe",sandbox:"allow-scripts",src:new URL("/pay/iovation",n.url).href,style:{display:"none"},onLoad:m})}function ht(s){const t=C(null),a=C(!1);return w(()=>{if(a.current)return;if(!window.IntersectionObserver){a.current=!0,s();return}const l=new IntersectionObserver(n=>{const r=n.some(({isIntersecting:i})=>i);o&&r&&(a.current=!0,l.unobserve(o),s())},{threshold:1}),o=t.current;return o&&l.observe(o),()=>{o&&l.unobserve(o)}},[s]),t}const gt="Pdl91",vt="n7rut",yt="_4PVkL",ft="a3kZU",bt="F1g68",_t="Wkh24",A={Wrapper:gt,Active:vt,NoAnimation:yt,Badge:ft,Icon:bt,Label:_t};function St(){const{prequalifiedAnimatedBadgeShowCounter:s}=Re(),[t,a]=k(!1),{i18n:l}=f(),o=l.translate("installments.installments_prequalified_status_badge"),n=ht(v(()=>{a(!0),s.value+=1},[s]));return e("div",{className:he(A.Wrapper,{[A.Active]:t},{[A.NoAnimation]:s.value>1}),ref:n,children:e("span",{className:A.Badge,children:[e("span",{className:A.Icon,children:e(Ae,{type:"check-circle",size:"fill"})}),e("span",{className:A.Label,children:o})]})})}const X=ge(function({title:t,subtitle:a,disabled:l,badge:o},n){const r=e(x,{color:l?"subdued":void 0,children:e(V,{type:"strong",children:t})}),i=e(x,{children:a});return o?e(I,{ref:n,gap:"small-100",children:[e(I,{direction:"inline",gap:"base",children:[r,e(St,{})]}),i]}):e(ie,{ref:n,children:[r,i]})});function Yt({ineligibilityReason:s}){const{observability:t,userEvents:a,i18n:l,source:o,checkout:n,shop:r,shopPay:i}=f(),[d,u]=k(!1),m=Ce(),{recordRetailEvent:c}=Ke(),{negotiate:g}=Ie(),{paymentMethods:p}=q(),y=et(i),h=ct(),b=Qe(),{payNowLabel:_,payNowSubtitle:M,installmentsLabel:O,installmentsSubtitle:L}=b.value,N=i.user.installments.prequalifiedAmount.value,W=i.installments.isServiceAvailable.value,D=i.session.paymentMethodOption.value,oe=T(()=>D?[D.name]:[],[D]),Y=i.user.installments.isRetryable.value,z=n.installments.isUnavailable.value,S=T(()=>!W||z&&!Y,[W,z,Y]),le=dt({selectable:!S}),re=T(()=>{if(h.value&&N&&!S)return"prequalified"},[h.value,S,N]),U=v(async()=>{d||(u(!0),await g({force:!1,fieldsToResolve:["taxes","paymentMethods"],include:["paymentLines"],customizeNegotiation:P=>(P.payment?.paymentLines.push({amount:{any:!0},paymentMethod:{walletPaymentMethodConfig:{name:"SHOPIFY_INSTALLMENTS"}}}),P)}))},[g,d]);w(()=>{y==="SHOPIFY_INSTALLMENTS"&&U()},[U,y]);const ce=v(([P="SHOPIFY_INSTALLMENTS"])=>{const de=Fe(p.value)?.availableLoanTypes,{action:j,method:ue}=Pt({paymentMethodName:P,availableLoanTypes:de});i.session.unstable_updatePaymentMethodOption(ue),m.value&&c(j),P==="SHOPIFY_INSTALLMENTS"&&t.log("payment_method_selected","[Installments] Payment method selected",{paymentMethodName:P}),a.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...xe(o,n,r),action:j}})},[p,i.session,m,t,a,o,n,r,c]);return e(H,{children:[S&&e(ie,{children:[e(Me,{heading:l.translate("payment_ux.payment.payment_option.installments_unavailable"),tone:"info",children:s||l.translate("payment.payment_option.installments_temporarily_unavailable")}),e(Oe,{blockSize:"base"})]}),e(Ze.Provider,{value:!0,children:e(je,{presentation:"base",children:e(Xe,{name:"payment_method_options",title:l.translate("payment.payment_option.accessibility_label"),titleHidden:!0,onChange:ce,values:oe,children:[e(E,{value:"SHOP_PAY",children:e(X,{title:_,subt
1itle:M})}),e(E,{value:"SHOPIFY_INSTALLMENTS",disabled:S,children:[!S&&e(pt,{onComplete:i.setDeviceFingerprint}),e(X,{ref:le,title:O,subtitle:L,disabled:S,badge:re})]})]})})})]})}function Pt({paymentMethodName:s,availableLoanTypes:t}){if(s==="SHOP_PAY")return{action:"payment_method_pay_now",method:{type:"wallet",name:"SHOP_PAY"}};const a={type:"wallet",name:"SHOPIFY_INSTALLMENTS"};return Ve(t)?{action:"payment_method_interest_bearing_installments",method:a}:{action:"payment_method_installments",method:a}}export{qt as P,Wt as W,Yt as a,rt as g};

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.