PageSourceSearch

https://www.reddragonnutritionals.com/cdn/shopifycloud/checkout-we…/c1/component-ApplePayButton.BvXcSeY7.js

js reddragonnutritionals.com collected 2026-09-29 00:25:51 UTC 8,456 bytes, 1 lines download raw bytes

1import{u as e,i as A,A as z,q as y,h as j,e as F,g as O,f as N,o as V,G as $,l as Q,S as Z}from"./esnext-vendor.DDpcaSqU.js";import{T as D,a$ as ee,bI as te,ae as ne,cr as ae,b8 as oe,cs as se,aI as ie}from"./utilities-previous.Cnwy8G2v.js";import{k as J,c7 as _,a7 as le,c8 as re,c9 as ce,h as ue,b7 as pe,B as q,P as de,L as me,l as ye,i as ve,aE as he,I as be,n as Pe,bC as Se,a6 as fe,ca as _e,cb as ge,F as Ae,M as Ce}from"./hydrate.BcfGVx0L.js";import{A as we}from"./app.DdDscdWN.js";import{T as ke}from"./TransitionHeight.Bhh9D1te.js";import{S as G,b as Le}from"./hooks-useWalletsTimeout.ByRalZ9t.js";import{c as Me}from"./localization-index.C3Jg94aR.js";import{s as U}from"./components-VatNumberValidationField.DqFc8B_9.js";import"./graphql-PaymentSessionMutation.C-nDEOnn.js";import"./shared-permissions.B59tuyWB.js";import"./hooks-useShopPayExternalAppContext.R6pnDxYu.js";import"./CalloutHeader.DC7jgv42.js";import"./FormLayout.UkTBTXMZ.js";import"./amazon-pay-useAmazonPayPaymentLine.X7jqQiq6.js";import"./useShopPayButtonClassName.C6ri8rG_.js";import"./shared-shop-theme.BKb8cP_L.js";import"./utilities-stable-ref.dCtJn23l.js";import"./hooks-useShouldRevealCustomization.djt7DCHB.js";import"./hooks-useForceShopPayUrl.JfumpHY0.js";import"./ChangeCompanyLocationLink.DXURX0D_.js";import"./BillingAddressForm.B1Xpg2b3.js";import"./PhoneField.rAEISard.js";import"./hooks-useSuppressShopPayModalOnLoad.Cvo-K0z2.js";import"./Popover.ZkMcWGfE.js";import"./Choice.D9vYH2mX.js";import"./Checkbox.CdJzVizb.js";import"./shop-pay-installments-monorail.B1-OWrOB.js";import"./ShopPayLogo.D2iKuiAK.js";import"./Monorail-monorailMetric-wallets.D__Peh7l.js";import"./PayButton-helpers.DGMbMyz3.js";import"./hooks-useShopPayNewSignupLoginExperiment.DrmS3FLj.js";import"./crypto-constants.Ca3tBkwm.js";import"./cross-border-hooks.BVR78hJy.js";import"./Section-SectionStyleOverride.CdNufRZ0.js";import"./AutocompleteField-hooks.By5FDG3b.js";import"./PendingShipping.D432iDGV.js";function Ee({body:v}){return e(re,{children:e(le,{dangerouslySetInnerHTML:{__html:v.value??""},scrollableContent:"all"})})}function Ie({body:v,loading:C,error:w}){const{i18n:S}=D();return e(A,{when:w,fallback:e(A,{when:C,fallback:e(Ee,{body:v}),children:e(J,{gap:"base",children:[e(_,{lines:2,lastLineSize:"large"}),e(_,{lines:3,lastLineSize:"small"}),e(_,{lines:2,lastLineSize:"base"}),e(_,{size:"extraLarge",lastLineSize:"large",lines:1}),e(_,{lines:7,lastLineSize:"small"}),e(_,{lines:3,lastLineSize:"base"})]})}),children:S.translate("bad_request.title")})}const xe="VqsW7",He="c1X76",Be="JtAjb",g={SubscriptionConsentModal:xe,Views:He,Pane:Be,"Pane-outgoing":"otCH1"};function Re({id:v,canConfirm:C,onConfirm:w,onHide:S,onShow:r}){const{i18n:h,shop:i}=D(),{checkoutProtocolModalEventSignal:c}=ee(),k=h.translate("payment.purchase_options_cancellation_policy_label"),L=i.merchantPolicies.find(({handle:m})=>m===G),a={handle:G,shopId:i.id,shopName:i.name,squareLogo:i.brandSettings?.squareLogo,name:k,url:L?.url??""},o=te(ce,{defaultPolicy:a,policies:[a]}),f=z(!1),s=y(()=>{f.current&&c.value==="applePaySubscriptionConsent"&&(c.value="none"),f.current=!1},[c]);j(()=>s,[s]);const n=F(!1),u=F(!1),H=z(null),b=ue(),p=pe(n.value,"slow"),l=n.value||u.value,T=!n.value||u.value,M=y(m=>{H.current=m,m&&(m.dataset.inertSupported=String("inert"in m))},[]),E=h.translate("wallets.continue_with",{walletName:h.translate("brand.apple_pay")}),I=n.value?Me(k):h.translate("payment.purchase_options_subscription_confirmation_title"),B=y(()=>{o.show(),n.value=!0},[o,n]),P=y(()=>{o.hide(),n.value=!1},[o,n]),R=y(()=>{u.value=!0,o.hide(),s(),S()},[u,o,s,S]),W=y(()=>{n.value=!1,u.value=!1,f.current=!0,c.value="applePaySubscriptionConsent",r()},[n,u,c,r]);return e(Se,{id:v,heading:e(J,{direction:"inline",alignItems:"center",gap:"base",children:[e(A,{when:n,children:e(he,{type:"button",padding:"small-400",borderRadius:"base",accessibilityLabel:h.translate("account_management.back"),onClick:P,children:e(be,{type:"arrow-left",size:"base"})})}),e(Pe,{level:1,autoFocus:!0,children:I},n.value?"policy":"consent")]}),accessibilityLabel:I,onShow:W,onHide:R,actionLayout:"stacked",primaryAction:e(ve,{variant:"primary",type:"button",inlineSize:"fill",disabled:!C.value,onClick:w,children:E}),children:e(q,{className:g.SubscriptionConsentModal,children:e(ke,{c
1ontentRef:H,children:e(q,{ref:M,className:g.Views,padding:"small-200",overflow:"hidden",children:[e(A,{when:()=>b?!n.value:p!=="entered",children:e(q,{className:O(g.Pane,n.value&&g["Pane-outgoing"]),"data-side":"backward","data-visible":!n.value&&(b||p!=="exit"),position:n.value?"absolute":"relative",inert:l,children:e(de,{children:e(Le,{buttonLabel:E,cancellationPolicyLink:L?e(me,{tone:"monochrome",onClick:B,children:e(ye,{children:k})}):void 0})})})}),e(A,{when:()=>b?n.value:p!=="exited",children:e(q,{className:O(g.Pane,!n.value&&g["Pane-outgoing"]),"data-side":"forward","data-visible":n.value&&(b||p!=="enter"),position:n.value?"relative":"absolute",inert:T,children:e(Ie,{body:o.policyBody,loading:o.loading,error:o.error})})})]})})})})}const Ne=Ce("ApplePaySubscriptionConsentModal");function Pt({supportedNetworks:v,color:C}){const{acceleratedWalletPaymentMethods:w,applePaySessionHandler:S,inMemoryApplePayParts:{buttonStatus:r,paymentSheetError:h}}=ne(),i=N(()=>{const t=S.value;return t?.createSession==null||t.showApplePayPaymentSheet==null?null:{createSession:t.createSession,openApplePayPaymentSheet:t.showApplePayPaymentSheet}}),c=z({status:"rendered"});V(()=>{const t=i.value!=null,x=r.value;t&&x.status==="not_rendered"?$(()=>{r.value=c.current}):!t&&x===c.current&&$(()=>{r.value={status:"not_rendered"}})}),j(()=>()=>{r.value===c.current&&(r.value={status:"not_rendered"})},[r]);const k=fe(),L=z(null),{observability:a,i18n:o,checkout:f}=D(),{wallets:s}=f,n=Q(_e()),u=N(()=>ae({hasSubscription:oe({checkout:f}),isApplePayAvailable:w.value.some(({name:t})=>t==="APPLE_PAY"),variant:n.value})),{showOverlay:H,hideOverlay:b}=ge(),p=Ae(void 0,Ne),l=F(!1),T=y(()=>{l.value=!0,a.log("apple_pay_subscription_consent_modal_opened","Apple Pay subscription consent modal opened")},[l,a]),M=y((t="dismissed")=>{l.value&&(l.value=!1,a.log("apple_pay_subscription_consent_modal_closed","Apple Pay subscription consent modal closed",{reason:t}))},[l,a]),E=()=>{a.log("apple_pay_button_clicked_while_loading","Apple Pay button clicked while already loading the payment sheet. Ignoring click.")},I=()=>{a.error(new we("Apple Pay button clicked without a ready session handler."))},B=t=>{if(s.activeSession.value?.wallet==="APPLE_PAY"){E();return}const Y=i.value;if(!Y){I();return}try{Y.openApplePayPaymentSheet(Y.createSession({supportedNetworks:v,...t&&{subscriptionConsent:t}}).session),t==="explicit_modal"&&s.activeSession.value?.wallet==="APPLE_PAY"&&a.log("apple_pay_subscription_consent_session_started","Apple Pay session started after subscription consent")}catch(d){const K={error:d,errorName:d instanceof Error?d.name:"Unknown",errorMessage:d instanceof Error?d.message:String(d),...d instanceof Error&&d.stack&&{errorStack:d.stack}};a.leaveErrorBreadcrumb("Failed to create Apple Pay session",K),h.value={type:"failed_to_create_session"},s.activeSession.value?.wallet==="APPLE_PAY"&&s.clearActiveSession({invokingWallet:"APPLE_PAY"})}},P=N(()=>u.value==="explicit_modal"),R=N(()=>l.value&&P.value&&i.value!=null&&s.activeSession.value==null);V(()=>{if(!l.value)return;(!P.value||i.value==null||s.activeSession.value!=null)&&(M("invalidated"),b(p))});const W=()=>{const t=s.activeSession.value;if(t?.wallet==="APPLE_PAY"){E();return}const x=u.value;if(P.value){if(t){a.log("apple_pay_subscription_consent_blocked_by_active_wallet","Apple Pay subscription consent blocked by another active wallet.",{activeWallet:t.wallet,requestedWallet:"APPLE_PAY"});return}if(!i.value){I();return}L.current?.focus({preventScroll:!0}),H(p);return}B(x)},m=()=>{R.value&&(a.log("apple_pay_subscription_consent_confirmed","Apple Pay subscription consent confirmed"),M("confirmed"),b(p),B("explicit_modal"))},X=i.value!=null;return e(Z,{children:[e("button",{ref:t=>{L.current=t,k("apple_pay")(t)},className:O(U.ApplePayButton,U[C],ie.borderRadius,se({focusRing:"base"})),lang:o.locale,disabled:!X,onClick:W,type:"button","aria-label":o.translate("brand.apple_pay"),"aria-haspopup":P.value?"dialog":void 0}),e(A,{when:()=>P.value||l.value,children:e(Re,{id:p,canConfirm:R,onShow:T,onHide:M,onConfirm:m})})]})}export{Pt as ApplePayButton};

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.