PageSourceSearch

https://voltaatelier.com/cdn/shopifycloud/checkout-web/assets/c1/1ea09741.JwOFoEgj.js

js voltaatelier.com collected 2026-10-05 02:48:59 UTC 16,228 bytes, 1 lines download raw bytes

1import{l as e,s as t,m as n,x as s,a8 as a,T as i,a9 as o,u as r,t as l}from"./2c1ab0fe.GMbxnz74.js";import{i as d,eP as c,bq as u,eQ as p,bj as m,eR as _,cV as g,eS as h,B as y,c as f,H as v,P as C,bz as b,eT as P}from"./164ad2e3.B4L1MRYB.js";import{S as A,db as I,bp as j,ej as R,E,aX as S,bA as k,T as M,dd as D,ek as w,au as L,bh as x,el as N,em as z,en as T,bv as $,eo as O,n as U,ep as q,eq as H,cj as B}from"./4c290a1e.DMQ9xOwP.js";import{g as V}from"./f1968089.lfvhhPdb.js";import{O as F}from"./7a8217fd.C-KSXAi3.js";import{I as Y}from"./fc21c11a.Dku7sbdq.js";import"./9f047e05.DwjCPgK0.js";import"./app.DGSHpWaV.js";import"./0a7dffce.BcNpdEJk.js";import"./5fda1420.BLaDhoyL.js";import"./60a453ce.Cg9T1Gj2.js";import"./21cc90a2.Ccyorzx_.js";import"./bb728e1c.CHt2JlPY.js";import"./0e9ee714.BUAjwk_6.js";import"./39921a74.BMGPgeDG.js";import"./e3e348f2.DAaElZ9-.js";import"./ca5e9c49.DIuWAPOX.js";import"./ccdf3592.y_I-TghG.js";import"./e477f96c.DJuIaq7S.js";import"./0c0ad074.Dl7fvU-G.js";import"./cb38e5c2.Hmwo5zs2.js";import"./53bbdad9.oGVvLPt2.js";import"./945a08d6.c61SBjtG.js";import"./ec391382.CdHY2UiR.js";import"./31cc568e.CVMsqQ1x.js";import"./4ea44c06.Cj0Sc_bl.js";import"./91319467.DpeMFOvW.js";import"./ed9f2238.BDG257lM.js";import"./1ed8f5e3.DkmKdCgD.js";import"./7ee73f43.QtnstTj2.js";import"./cb5cf153.CBk88ZOK.js";import"./87bfafec.4CtkSIvo.js";import"./55098bf1.SNyaSeYe.js";const W=["PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT","DELIVERY_DELIVERY_LINE_DETAIL_CHANGED","CARD_DECLINED","NAME_MISMATCH","INCORRECT_CVC",c.InvalidShippingAddress,j.InvalidExtensionState,j.InvalidCaptcha];var G=(e=>(e.CheckoutOne="C1",e.Pay="PAY",e))(G||{});const J=["initializePay","pingPay","updateAuthorization","updateCheckout","updateCard","setInitialUserState"];class K extends Error{constructor(e,t){super(e),this.name="RPCConnectionTimeoutError",this.diagnostics=t}}function Q({checkoutDetails:l,open:d,onClose:c,onError:P,locale:I}){const{i18n:j,observability:z,shopPay:T}=A(),{installments:$}=T,O=x("taxes").value,U=g(),[q,H]=s(null),[B,V]=s(),[Y,W]=s(),[Q,X]=s(null),[Z,ee]=s(!1),te=t(e=>{U.current&&V(e)},[U]),ne=e(),se=$.payment.value,ae=k(T.session.selectedPaymentMethod.value),ie=T.user.creditCards,oe=T.accessToken.value,re=i(()=>({onClose(e,t){W(t),Q||X(e),c()},setHeight(e){B&&(B.style.height=`${e}px`)},onComplete(e){z.log("installments_payment_created","[Installments] Installments payment created"),$.unstable_updatePayment(e)},onError:P,onPayAnotherWay(){try{T.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"}),ne.current=void 0,W(void 0),X(null)}catch{return void c()}c()},onUpdateProgress(e,t){ne.current=e;const n=t?ie.value.find(e=>Number(e.id)===t?.id):null,s=n&&t?.id!==Number(ae?.id),a=!n&&t;if(s)T.session.selectPaymentMethod(N(n));else if(a){const e=T.user.addCreditCard((i=t,{lastUsedAt:"",name:"",preferred:!1,id:String(i.id),uuid:i.uuid??"",brand:i.brand,expired:i.expired,expiring:!1,expiryMonth:i.month,expiryYear:i.year,funding:i.funding,lastDigits:i.last_digits,supportsInstallmentsInterestLoan:i.supports_installments_interest_loan,supportsInstallmentsSplitPayLoan:i.supports_installments_split_pay_loan,installmentsSplitPayLoanNotSupportedReason:i.installments_split_pay_loan_not_supported_reason,installmentsInterestLoanNotSupportedReason:i.installments_interest_loan_not_supported_reason,billingAddress:{address:{firstName:i.billing_address.first_name,lastName:i.billing_address.last_name,company:i.billing_address.company,address1:i.billing_address.address1,address2:i.billing_address.address2,city:i.billing_address.city,postalCode:i.billing_address.zip,phone:i.billing_address.phone,countryCode:i.billing_address.country_code,zoneCode:i.billing_address.zone_code}},billingAddressValid:i.address_valid,verified:!0}));T.session.selectPaymentMethod(e)}var i},onPing(e,t){if("installments_iframe_loaded"===e){const e=t?.consolidatedPlanSelectionReviewVariant,n="treatment"===e;B?.classList.toggle("IgLVV","copy_and_visual_only"===e||n),B?.classList.toggle("X587H",n),H(!0)}}}),[P,Q,c,B,z,$,ie.value,ae?.id,T.session,T.user]),le=function({open:t,lastKnownPayStepId:a,locale:o}){const{client:r,environment:{services:{shopServer:l}},shop:d,observability:c,source:g,shopPay:h}=A(),y=S({source:g}),{config:f}=h,v=h.installments.triggerSource.value,C=h.deviceFingerprint.value,{tracking:b}=f,P=b.unique,I=b.visit,{myshopifyDomain:j,merchantPolicies:R,countryCode:E}=d,{checkoutSessionIdentifier:x}=g,N=h.session.selectedPaymentMethod.value,z=k(N),T=w,[$,O]=s(z?.id),[
1U,q]=s(C),{paymentMethods:H}=M(),B=D(H.value),V=B?.availableLoanTypes.join(",")||"",F=B?.supportedCountries.join(",")||E,Y=B?.creditCardEnabledCountries.join(",")||"",W=Boolean(x),G=Boolean($),J=Boolean(B),K=V.length>0,Q=Y.length>0,X=Boolean(U),Z=(B?.supportedCountries.length??0)>0,ee=R.find(({handle:e})=>"refund-policy"===e)?.url,te=u().value,ne=p(),se=m({include:{shopId:!0,shopClientUuid:!0}}),ae=h.isExternal;n(()=>{!t&&z&&O(z.id)},[z,t]),n(()=>{t&&!$&&z&&O(z.id)},[t,$,z]),n(()=>{t||null===C||q(C)},[C,t]);const ie=i(()=>{if(!x||!$)return null;const e={checkout_version:y,checkout_token:x,locale:o,parent_page_load_id:T,selected_card_id:$,shopify_domain:j,last_known_step_id:a,available_loan_types:V,refund_policy_url:ee,isPointOfSale:te,supported_countries:F,tracking_unique:P,tracking_visit:I,device_fingerprint:U??"",credit_card_enabled_countries:Y,trigger_source:v},t=(te?Object.entries({...e,...ne}):Object.entries(e)).map(([e,t=""])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&"),n=L(),s=new URL(`/pay/transactions/${n?"installments_iframe_inapp":"installments_iframe"}?${t}`,l.url),i=new URLSearchParams(r.initialRequest.url.search);return se(s.searchParams,i),n&&ae&&(s.searchParams.set("origin",_.PaymentRequest),s.searchParams.set("flow","payment_request")),s.href},[x,$,y,o,T,j,a,V,F,Y,ee,te,P,I,U,ne,r.initialRequest.url.search,se,l.url,ae,v]),oe=e(!1);return n(()=>{t?ie||oe.current||(oe.current=!0,c.log("installments_iframe_source_missing","[Installments] Iframe source missing while modal open",{availableLoanTypesPresent:K,creditCardEnabledCountriesPresent:Q,hasCheckoutToken:W,hasDeviceFingerprint:X,hasInitialSelectedCard:G,hasInstallmentsConfig:J,supportedCountriesPresent:Z})):oe.current=!1},[K,Q,ie,W,X,G,J,c,t,Z]),ie}({open:d,lastKnownPayStepId:Y,locale:I}),de=function(r,l,d){const[c,u]=s(!1),[p,m]=s(0),{observability:_}=A(),g=i(()=>{if(!l)return;const e=function(e,{logging:t,messenger:n,observability:s,...i}){return{...a(n,i),id:i.uuid(),log(e,...t){},observabilityLog(t,n,a){s&&s.log(t,`[${e}-RPC] ${n}`,a)}}}(G.CheckoutOne,{callable:J,logging:!1,messenger:o(l,{terminate:!1}),uuid:E,observability:_});return e.log(`expose initializeC1 ${p}`),e.expose({initializeC1(){}}),e},[l,p,_]);n(()=>{if(!g)return void u(!1);const e={reset(){u(!1),m(e=>e+1)},closeModal(e,n){t("closeModal",arguments),r.onClose(e,n)},initializeC1(){return t("initializeC1",arguments),u(!0),{id:g.id,metadata:{timestamp:(new Date).toISOString()}}},installmentsError(e){t("installmentsError",arguments),r.onError(e)},payAnotherWay(){t("payAnotherWay",arguments),r.onPayAnotherWay()},payWithInstallments(e){t("payWithInstallments",arguments),r.onComplete(e)},pingC1(e="interrogative",n){return t("pingC1",arguments),g.log(`PING: ${e} @ ${(new Date).toISOString()}`),r.onPing(e,n),`PONG: ${G.CheckoutOne}`},resizeModal(e){return t("resizeModal",arguments),r.setHeight(e),window.innerHeight},updateProgress(e,n){t("updateProgress",arguments),r.onUpdateProgress(e,n)}};function t(e,t){g?.log(e,t)}g.log("expose handlers"),g.expose({...e})},[r,g]);const h=t(e=>e.initializePay(),[]),{connected:y,error:f}=function({rpcEndpoint:t,initializer:a,connectionOptions:{timeout:i=1e3,attemptDelay:o=100}={},inAppRPCSessionCount:r}){const[l,d]=s(!1),c=R(r),[u,p]=s(),m=e({attemptCount:0,initializerCalled:!1,startedAt:0}),_=t&&a&&!l&&!u;return n(()=>{c!==r&&d(!1)},[r,c]),n(()=>{let e=!1;return m.current={attemptCount:0,initializerCalled:!1,startedAt:Date.now()},t&&a&&_&&(t.log("connection initiated"),t.observabilityLog("installments_rpc_connection_initiated","RPC connection initiated",{sessionCount:r,timeoutMs:i,attemptDelayMs:o}),async function(){if(!t||!a||!_)return;const{call:n,log:s,observabilityLog:i}=t;for(;;){m.current.attemptCount++;const t=m.current.attemptCount;
1try{s(`RPC channel ${r} opening...`),i("installments_rpc_connection_attempt",`RPC channel ${r} opening (attempt ${t})`,{sessionCount:r,attemptNumber:t,elapsedMs:Date.now()-m.current.startedAt}),m.current.initializerCalled=!0;const l=await a(n);if(!l){if(s("RPC channel not ready yet"),i("installments_rpc_not_ready","RPC channel not ready yet, retrying",{sessionCount:r,attemptNumber:t,elapsedMs:Date.now()-m.current.startedAt}),await new Promise(e=>setTimeout(e,o)),e)break;continue}s("RPC channel opened",l),i("installments_rpc_connected","RPC channel opened successfully",{sessionCount:r,attemptNumber:t,elapsedMs:Date.now()-m.current.startedAt}),e||d(!0);break}catch(l){s("RPC connection failed",l),i("installments_rpc_connection_error",`RPC connection failed on attempt ${t}`,{sessionCount:r,attemptNumber:t,elapsedMs:Date.now()-m.current.startedAt,errorMessage:l instanceof Error?l.message:String(l),errorName:l instanceof Error?l.name:"unknown"}),e||p(l);break}}}()),()=>{e=!0}},[o,_,a,t,r,i]),n(()=>{if(!t||!_)return;let e=!1;const{log:n,observabilityLog:s}=t,a=setTimeout(()=>{if(_){const t=m.current,a={attemptCount:t.attemptCount,elapsedMs:Date.now()-t.startedAt,timeoutMs:i,initializerCalled:t.initializerCalled,sessionCount:r},o=new K("RPC channel open timeout",a);n("RPC connection failed",o),s("installments_rpc_connection_timeout",`RPC channel open timeout after ${a.attemptCount} attempt(s) over ${a.elapsedMs}ms`,a),e||p(o)}},i);return()=>{clearTimeout(a),e=!0}},[_,t,i,r]),n(()=>(t||d(!1),()=>{t&&t.terminate()}),[t]),{connected:l,error:u}}({rpcEndpoint:g,initializer:c?h:void 0,connectionOptions:d,inAppRPCSessionCount:p});if(f)throw f;if(g&&c&&y)return g.call}(re,B);return h({enabled:Boolean(B),onTimeout:()=>{q||(P(),H(!1))},timeout:6e3}),n(()=>{!l&&se||(z.log("installments_progress_reset","[Installments] Installments progress reset",{reason:se?"checkoutDetails":"installmentsPayment"}),ne.current=void 0)},[l,se,z]),n(()=>{de&&oe&&de.updateAuthorization({accessToken:oe})},[de,oe]),n(()=>{de&&d&&l&&!O&&void 0!==l?.installmentsProposalData?.taxAmount&&!se&&(z.log("installments_proposal_data_passed_to_iframe","[Installments] Proposal data passed to iframe"),de.updateCheckout(l,ne.current))},[l,se,d,de,O,z]),n(()=>{de&&ae?.id&&de.updateCard(ae.id)},[de,ae?.id]),n(()=>{de&&Q&&de.setInitialUserState(Q)},[de,Q]),!1===q?r(b,{open:Z,size:"large",onHide:()=>{ee(!1),c()},accessibilityLabel:j.translate("installments.pay_in_installments_error_title"),children:r(y,{blockAlignment:"center",minBlockSize:"200px",children:r(f,{alignItems:"center",gap:"base",children:[r(v,{level:2,textAlign:"center",children:j.translate("installments.pay_in_installments_error_title")}),r(C,{textAlign:"center",children:j.translate("installments.pay_in_installments_error_description")})]})})}):le?r(F,{accessibilityLabel:j.translate("installments.pay_in_installments_title"),allow:"camera; microphone; gyroscope; accelerometer",blocking:!0,iframeId:"shop-pay-affirm-iframe",iframeRef:te,open:d,source:le}):null}function X(e){if(!e)return"";const t=e.shippingAddress?{countryCode:e.shippingAddress.countryCode,postalCode:e.shippingAddress.postalCode}:void 0,n=e.merchandiseLines.map((e,t)=>({id:e.stableId??e.id??`__idx_${t}`,quantity:e.quantity,totalPrice:e.totalPrice})).sort((e,t)=>e.id<t.id?-1:e.id>t.id?1:0),s=e.storeAddress?{key:e.storeAddress.key,value:e.storeAddress.value}:void 0;return JSON.stringify({sellerId:e.sellerId,channel:e.channel,deliveryMethod:e.deliveryMethod,merchandiseLines:n,shippingAddress:t,shippingAmount:e.shippingAmount,storeAddress:s,taxAmount:e.taxAmount,total:e.total})}function Z(){const{i18n:a,shopPay:o,observability:p}=A(),{locale:m}=a,_=function(){const[e,t]=s(),[a,o]=s(!1),{value:r}=$(),d=function(){const{shopPay:e,checkout:t}=A(),n=u(),{merchandiseLines:s,taxes:a,paymentMethods:i}=M(),o=O("ONE_TIME_PURCHASE"),r=function(e){const t=M().customAttributes;return l(()=>{if(!e.value)return;const n=z(T,t.value),s=n?JSON.parse(n.value):void 0;return s?{...s,zoneCode:s.provinceCode,postalCode:s.zip}:void 0})}(n),d=$();return l(()=>{const l=s.value?.lines.filter(({quantity:e})=>e>0);if(!l)return;const c=n.value,u=U(o.value),p=e.session.selectedShippingAddress.value,m=q(c,u),_=function(e){switch(e?.status){case"available_total":return e.totalTax;case"available_total_included":return e.totalIncludedInTarget;default:return}}(a.value);return{sellerId:D(i.value)?.sellerId,merchandiseLines:l,shippingAddress:t.isShippingRequired.value?p?.address:void 0,shippingAmount:u?.costAfterDiscounts,taxAmount:_,total:d.value,channel:c?P.RetailPos:P.Online,deliveryMethod:m,storeAddress:r.value}})}().value,c=R(e),{locale:p}=A().i18n;return n(()=>
1{if(!r||!d)return void t(void 0);const n={format:"${{amount}}",decimal_mark:".",thousands_separator:","};if(!e)return void t({currencyFormat:n,installmentsProposalData:d,paymentDue:r,locale:p});const s=X(d)!==X(e.installmentsProposalData);s&&t({currencyFormat:n,installmentsProposalData:d,paymentDue:r,locale:p}),o(s)},[e,d,r,p]),i(()=>({checkoutProposal:e,previousCheckoutProposal:c,hasChanged:a}),[e,c,a])}(),g=H(_,200),{onInstallmentsError:h}=function(){const{source:s,checkout:a,shop:i,shopPay:o,observability:r,userEvents:l,embed:u}=A(),{installments:p,session:m}=o,_=o.user.installments,g=p.payment.value,h=a.latestReceipt.value,{progress:y}=d(),f=e(g),v=t(e=>{const t=function(e){if(!e)return"no_result";if("errors"in e&&e.errors.length>0){const t=e.errors.map(e=>e.code).join(", ");if(t)return t}return"failure"in e&&e.failure?`failed_receipt_${e.failure.type}`:"status"in e&&e.status?"invalid"===e.status?`error_result_invalid__${e.reasons.join("__")}`:`error_result_${e.status}`:void 0}(e);let n;!function(e){if(!e)return!1;if("reasons"in e&&e.reasons)return e.reasons.some(e=>W.includes(e));if("failure"in e&&e.failure){const t=e.failure;return"payment"===t.type&&W.includes(t.code)}return"violations"in e&&e.violations.some(({code:e})=>W.includes(e))}(e)?(n=I.InstallmentsPermanentRejection,_.unstable_setRetryable(!1)):(n=I.InstallmentsRetryError,_.unstable_setRetryable(!0),p.unstable_setModalCloseForRetry(!0)),function(e){return"agreement_invalid"===e?.status&&e.violations.some(({code:e})=>e===c.InvalidShippingAddress)}(e)&&p.unstable_setAgreementError(c.InvalidShippingAddress);const d=_.isRetryable.value,g=_.isRejected.value,h=p.agreementError.value;r.log("shop_pay_installments_error_occurred","[Installments] An error has occurred",{errors:t,eventType:n,installmentsRetryableSignal:d,installmentsRejectedSignal:g,installmentsAgreementErrorSignal:h}),l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...V(s,a,i,{embedPlatform:u?.platform,shopAppSurface:o.app.config.surface}),eventType:n,success:!1,errorMessage:t}}),_.unstable_setRejected(!0),m.unstable_setInternalProgressing(!1)},[r,l,p,_,s,a,i,m,u?.platform,o.app.config.surface]);return n(()=>{g&&f.current!==g&&(y("shop-pay-installments-error-handler",e=>{"success"!==e.status&&"alreadyCompleted"!==e.status&&(v(e),p.unstable_updatePayment(void 0))}),f.current=g)},[g,v,y,p]),n(()=>{"failed"===h?.status&&g&&(v(h),p.unstable_updatePayment(void 0))},[h]),{onInstallmentsError:v}}(),{countryCode:y,defaultLocale:f,checkoutLocaleSupported:v}=B(Y),C=o.installments,b=C.isModalOpen.value,j=C.isModalClosedForRetry.value,E=y.value?`${f.value}-${y.value}`:f.value,S=t(()=>{p.log("installments_modal_closed","[Installments] Modal closed"),C.unstable_setModalOpen(!1)},[p,C]);return n(()=>{_?.hasChanged&&b&&(p.log("installments_checkout_details_changed_while_modal_open","[Installments] Checkout details changed while modal open"),S())},[_?.hasChanged,b,S,p]),n(()=>{j&&(p.log("installments_modal_closed_for_retry","[Installments] Modal closed for retry"),C.unstable_setModalCloseForRetry(!1),S())},[j,C,S,p]),r(Q,{checkoutDetails:g?.checkoutProposal,open:b,onClose:S,onError:h,locale:v.value?m:E})}export{Z as InstallmentsModal};

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.