PageSourceSearch

https://pencils.com/cdn/shopifycloud/checkout-web/assets/c1/c10167e6.DJgpnUit.js

js pencils.com collected 2026-10-02 06:08:17 UTC 11,912 bytes, 1 lines download raw bytes

1import{m as K,e as X,g as B,u as e,S as q,k as ee,l as k,h as w,q as y,T,A as I,p as ge,f as ye,i as fe,D as ve}from"./2c1ab0fe.BqEHHmaW.js";import{dx as te,dy as be,c$ as ne,dz as se,dA as _e,c as C,H as ae,P as x,aC as Se,aE as Pe,aF as Ae,n as V,dB as Ie,U as Ce,I as Me,B as ie,bm as Oe,h as Be,bB as we,b as Le}from"./164ad2e3.BA-GikTU.js";import{j as Ne,h as Te,i as Ee,k as G}from"./86720dbb.B98R4NBr.js";import{O as f,P as H,Q as ke,d4 as De,V as Re,d5 as oe,d6 as Fe,aT as le,d7 as xe,ar as Ve,d8 as qe}from"./4c290a1e.FJVsH4yi.js";import{j as He,D as ze}from"./f3fe2775.BuWC6GWF.js";import{b as We}from"./58314944.CBBsxtpI.js";import{a as Ye,C as Ue}from"./31cc568e.Dti0cJak.js";import{B as je}from"./b9c0319a.D5yZDWHr.js";import{a as Ge,b as E,C as $e}from"./efa0389a.CmzfQUTJ.js";import{c as Je,d as Qe}from"./dffdfb34.BGb6nQvv.js";import{S as $}from"./0e67bd3b.IdsrMiz7.js";import{u as Ze}from"./cc6ff67d.CQwyXWHD.js";import{C as Ke}from"./a422df8c.ggO-AlYl.js";import{d as Xe,e as et}from"./f8706cb6.Bnci6QEq.js";import{g as tt}from"./65f3d4da.BdKZt11Z.js";import{g as re}from"./f1968089.DErP3-mp.js";import{I as nt}from"./3a819064.Xmk2TvaB.js";function Ht({selectorShowsTiles:s,afterPaymentSelector:t,renderVaultingAgreementInline:a}){const l=We(),i=te(),{checkout:n,i18n:r,shopPay:o,source:d}=f(),u=be(),m=ne(),c=se(),{paymentMethods:g}=H(),p=o.user.creditCards,v=K(Ye().creditCardDisabled),h=X(null),b=B(()=>!(u.value||_e({checkout:n,source:d})?.pickupAddress)&&!m.value&&n.isShippingRequired.value),_=B(()=>at({identity:n.identity},{billingPosition:i,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:v.value})),L=e(ze,{blurValidationFieldDenylist:M.value,onSetFieldErrors:l,children:[e(Ne,{vaultHandle:h}),e(C,{gap:"base",children:[e(it,{}),e(Te,{billingAddressInContext:_.value,vaultHandle:h,selectorShowsTiles:s,afterPaymentSelector:t,renderVaultingAgreementInline:a})]})]});return e(ee,{when:O,fallback:L,children:N=>e(q,{children:[e(C,{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:i,creditCardDisabled:n}){if(s.current.value!=="shopPay"||!a||!i.every(o=>n(o)))return null;const r=l.map(o=>o.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 Ee(),null}const ot="billing_address_selector",R="shipping_address",J="custom_billing_address";function lt({renderFormOnly:s=!1}={}){const{i18n:t}=f(),a=Se(),{billingAddressOption:l}=ke(),i=Pe(),n=l.value==="shipping"?R:J,[r,o]=k([n]),{isBilling:d}=Je().value,u=d?e(Qe,{}):null;w(()=>{o([n])},[n]);const m=y(p=>{const v=p[0]===R?"shipping":"custom";l.value=v,o(p),v==="shipping"&&i()},[l,i]);Ae();const c=y(({billing:p})=>{p.value=!0},[]),g=y(({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(Ge,{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 Q=()=>{const{i18n:s,checkout:{identity:t}}=f(),a=rt({identity:t});return e(C,{accessibilityRole:"group",accessibilityLabelledBy:"billingAddress",gap:"base",children:[e(ae,{id:"billingAddress",level:2,children:s.translate("payment.billing_address_title")}),e(a,{})]})};function zt({dynamicPaymentExtensions:s=[],children:t}){Ie();const a=te(),l=ne(),{checkout:i}=f(),n=se(),r=De({checkout:i}),o=n.value.payment&&n.value.billing&&!r,[d]=Ze(),u=T(()=>Object.values(Re).some(c=>d===c),[d]),m=!o&&!l.value&&!u;return e(C,{gap:"base",children:[a.value==="beforePayment"&&m&&e(Q,{}),t,a.value==="afterPayment"&&!u&&e(q,{children:[m&&e(Q,{}),e(Ce,{customizations:s})]})]})}function rt({identity:s}){return s.current.value==="businessCustomer"?je:lt}function ct({selectable:s}){const{userEvents:t,source:a,checkout:l,shop:i,shopPay:n,embed:r}=f(),{ineligibilityReasons:o}=l.installments,{isServiceAvailable:d}=n.installments,{isRejected:u}=n.user.installments,{isLoading:m}=n.session,c=X(null),g=I(!1),p=K(s);function v(){const h=p.value,b=h?void 0:JSON.stringify(dt({ineligibilityReasons:o.value,serviceAvailable:d.value,userRejected:u.value}));t.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...re(a,l,i,{embedPlatform:r?.platform,shopAppSurface:n.app.c
1onfig.surface}),eventType:oe.OptionImpression,success:h,errorMessage:b}})}return ge(()=>{const h=c.value;if(!h||m.value||g.current)return;const b=()=>{g.current=!0,ye(v)};if(!window.IntersectionObserver){b();return}const _=new IntersectionObserver(M=>{M.some(({isIntersecting:O})=>O)&&(_.disconnect(),b())},{threshold:1});return _.observe(h),()=>_.disconnect()}),y(h=>{c.value=h},[c])}function dt({ineligibilityReasons:s,serviceAvailable:t,userRejected:a}){return s.length>0?s:t?a?["user_rejected"]:["unknown"]:["installments_unavailable"]}function ut(){const{checkout:{identity:s},shopPay:t}=f(),a=Fe(),l=H().paymentMethods;return B(()=>{const i=a.value,n=t.user.installments.prequalifiedAmount.value,r=t.user.installments.credential.value,o=l.value?.find(m=>m.type==="wallet"&&m.name==="SHOPIFY_INSTALLMENTS"),d=s.current.value==="shopPay"&&i!=null&&o!=null&&i.amount>=Math.max(o.minPrice.amount,50)&&i.currencyCode===o.minPrice.currencyCode,u=n!=null&&i!=null&&(!o?.cbtEnabled||n.currencyCode===i.currencyCode)&&(r?.requiresAdditionalInformation&&i.amount<=n.amount||!r?.requiresAdditionalInformation);return d&&u})}const mt=1e4,F={error:"iovation_sandbox_error",init:"iovation_sandbox_initialize",fingerprint:"iovation_sandbox_fingerprint"};function pt({onComplete:s}){const t=I(null),a=I(),[l,i]=k(!1),{environment:{services:{shopServer:n}},observability:r}=f(),o=I(performance.now()),d=y(c=>{s(c),i(!0),a.current=c},[s]),u=y(({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()-o.current}),d(c.payload);break}},[d,r]),m=y(()=>{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()-o.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=I(null),a=I(!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:o})=>o);i&&r&&(a.current=!0,l.unobserve(i),s())},{threshold:1}),i=t.current;return i&&l.observe(i),()=>{i&&l.unobserve(i)}},[s]),t}function gt(){const{userEvents:s,source:t,checkout:a,shop:l,shopPay:i,embed:n}=f(),{prequalifiedAnimatedBadgeShowCounter:r}=le();return y(()=>{r.value>0||s.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...re(t,a,l,{embedPlatform:n?.platform,shopAppSurface:i.app.config.surface}),eventType:oe.PrequalifiedBadgeImpression,success:!0}})},[r,s,t,a,l,i,n])}const yt="Pdl91",ft="n7rut",vt="_4PVkL",bt="a3kZU",_t="F1g68",St="Wkh24",A={Wrapper:yt,Active:ft,NoAnimation:vt,Badge:bt,Icon:_t,Label:St};function Pt(){const{prequalifiedAnimatedBadgeShowCounter:s}=le(),[t,a]=k(!1),{i18n:l}=f(),i=gt(),n=l.translate("installments.installments_prequalified_status_badge"),r=ht(y(()=>{a(!0),i(),s.value+=1},[s,i]));return e("div",{className:fe(A.Wrapper,{[A.Active]:t},{[A.NoAnimation]:s.value>1}),ref:r,children:e("span",{className:A.Badge,children:[e("span",{className:A.Icon,children:e(Me,{type:"check-circle",size:"fill"})}),e("span",{className:A.Label,children:n})]})})}const Z=ve(function({title:t,subtitle:a,disabled:l,badge:i},n){const r=e(x,{color:l?"subdued":void 0,children:e(V,{type:"strong",children:t})}),o=e(x,{children:a});return i?e(C,{ref:n,gap:"small-100",children:[e(C,{direction:"inline",gap:"base",children:[r,e(Pt,{})]}),o]}):e(ie,{ref:n,children:[r,o]})});function Wt({ineligibilityReason:s}){const{observability:t,userEvents:a,i18n:l,source:i,checkout:n,shop:r,shopPay:o}=f(),[d,u]=k(!1),m=Oe(),{recordRetailEvent:c}=Xe(),{negotiate:g}=Be(),{paymentMethods:p}=H(),v=tt(o),h=ut(),b=et(),{payNowLabel:_,payNowSubtitle:M,installmentsLabel:O,installmentsSubtitle:L}=b.value,N=o.user.installments.prequalifiedAmount.value,z=o.installments.isServiceAvailable.value,D=o.session.paymentMethodOption.value,ce=T(()=>D?[D.name]:[],[D]),W=o.user.installments.isRetryable.value,Y=n.installments.isUnavailable.value,S=T(()=>!z||Y&&!W,[z,Y,W]),de=ct({selectable:!S}),ue=T(()=>{if(h.value&&N&&!S)return"prequalified"},[h.value,S,N]),U=y(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(()=>{v==="SHOPIFY_INSTALLMENTS"&&U()},[U,v]);const me=y(([P="SHOPIFY_INSTALLMENTS"])=>{const pe=xe(p.value)?.availableLoanTypes,{action:j,method:he}=At({paymentMethodName:P,availableLoanTypes:pe});o.session.unstable_updatePaymentMethodOption(he),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:{...Ve(i,n,r),action:j}})},[p,o.session,m,t,a,i,n,r,c]);return e(q,{children:[S&&e(ie,{children:[e(we,{heading:l.translate("payment_ux.payment.payment_option.installments_unavailable"),tone:"info",children:s||l.translate("payment.payment_option.installments_temporarily_unavailable")}),e(Le,{blockSize:"base"})]}),e(Ue.Provider,{value:!0,children:e($e,{presentation:"base",children:e(Ke,{name:"payment_method_options",title:l.translate("payment.payment_option.accessibility_label"),titleHidden:!0,onChange:me,values:ce,children:[e(E,{value:"SHOP_PAY",children:e(Z,{title:_,subt
1itle:M})}),e(E,{value:"SHOPIFY_INSTALLMENTS",disabled:S,children:[!S&&e(pt,{onComplete:o.setDeviceFingerprint}),e(Z,{ref:de,title:O,subtitle:L,disabled:S,badge:ue})]})]})})})]})}function At({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 qe(t)?{action:"payment_method_interest_bearing_installments",method:a}:{action:"payment_method_installments",method:a}}export{Ht as P,zt as W,Wt 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.