PageSourceSearch

https://elasticsteel.com/cdn/shopifycloud/checkout-web/assets/c1/7fd9930c.BvMRYJIc.js

js elasticsteel.com collected 2026-10-06 12:32:27 UTC 6,713 bytes, 1 lines download raw bytes

1import{z as e,g as a,h as n,u as t,J as o,q as i,T as l,S as s}from"./2c1ab0fe.Bywc2Brn.js";import{t as r,f as c,v as d,b as m,ab as p,S as h,B as u,a1 as g,d as _,M as b,bR as f}from"./164ad2e3.CZ86Jn5i.js";import{Q as y,C as w}from"./3e6029dd.MbJj4w9O.js";import"./app.DWJ9FfA1.js";import{bl as x,c as S,v as k,bm as M}from"./9dba8418.ogFVeXB5.js";import"./d0bb51ec.DFDQ8Mc_.js";import"./f67abd2c.LtwWKIr5.js";import"./60a453ce.CcyvSWbx.js";import"./e12db40c.B9ahJFAB.js";var v="var(--_1cm3fw00)";const z=d("Countdown");function C({duration:i=0,defaultValue:l=i,label:s,onEnd:d}){const m=r(void 0,z),[p]=e(()=>Date.now()+l),[h,u]=e(()=>Math.max(l,0)),g=a(d),_=a(!1);g.current=d,n(()=>{let e;const a=()=>{const n=Math.max(p-Date.now(),0);u(n),0!==n?e=setTimeout(a,n%1e3||1e3):_.current||(_.current=!0,g.current?.())};return a(),()=>clearTimeout(e)},[p]);const b=i>0?Math.min(Math.max((i-h)/i*100,0),100):0;return t("div",{role:s?"timer":void 0,"aria-labelledby":s?m:void 0,className:"_1cm3fw02 _1cm3fw01 _1fragem6t _1fragemzf _1fragem82",children:[t("div",{"aria-hidden":!0,className:"_1cm3fw04 _1cm3fw03 _1fragemup _1fragemv4 _1fragemzf _1fragem32",style:o({[v]:`${b}%`}),children:t("div",{className:"_1cm3fw06 _1cm3fw05 _1fragem4q"})}),s&&t(c,{id:m,accessibilityVisibility:"hidden",type:"small",textAlign:"center",color:"subdued",children:s(h)})]})}function I(e=navigator.userAgent,a){return x(e)||/Shop App\/[^/]+\/iOS\//.test(e)||null!=a&&"WEB"!==a}const R=new Set(["alipay","bancontact","blik","eps","ideal","klarna","mobilepay","multibanco","paypal","przelewy24","satispay","sofort","swish","twint","usdc","wechatpay"]);function E(e){return e.toLowerCase().replace(/[\s_-]+/gu,"")}const D=e=>{const a=Math.floor(e/36e5),n=String(Math.floor(e%36e5/6e4)).padStart(2,"0"),t=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return a>0?`${a}:${n}:${t}`:`${n}:${t}`},A={bogus_app_coin:"/cdn/shopifycloud/checkout-web/assets/c1/assets/bogus.Dgqxw51f.svg",pix:"/cdn/shopifycloud/checkout-web/assets/c1/assets/pix.D3fYfWH5.svg",blik:"/cdn/shopifycloud/checkout-web/assets/c1/assets/blik.DVGmDGpj.svg",swish:"/cdn/shopifycloud/checkout-web/assets/c1/assets/swish.Bmk5gRpD.svg"},T=["wechat_pay","paynow"];function q({challengeType:a,challengeData:o,receipt:r,paymentMethod:d,onModalRender:x,challengeExpiresAt:v}){const z=((e,a)=>null!=a?Math.max(a-Date.now(),0):e&&f(e)&&e.timeout?.millisecondsRemaining||0)(r,v),[q,j]=e(!1),[N,O]=e(),[$]=e(z),{i18n:L,client:Q,embed:B}=S(),V=function(e){const{paymentMethod:a}=e,{userEvents:n,shop:{id:t},source:o}=S(),s=i(e=>n.monorailEvent({schemaId:"checkout_buyer_action_required_events/1.0",payload:{eventTriggerReason:e,paymentMethodDisplayName:a.name,checkoutSessionIdentifier:o.checkoutSessionIdentifier||"",shopId:parseInt(k(t),10)}}),[a.name,t,o.checkoutSessionIdentifier,n]);return l(()=>({onModalRendered:()=>s("modal_rendered"),onModalTimeout:()=>s("buyer_action_timeout"),onModalExit:()=>s("buyer_closes_modal"),onCopiedToClipboard:()=>s("buyer_copies_to_clipboard"),onChallengeRendered:e=>{switch(e){case"QR_CODE":s("qr_code_rendered");break;case"EXTERNAL":s("external_action_rendered")}}}),[s])}({paymentMethod:d});l(()=>{q&&x&&setTimeout(()=>{x()},1e3)},[q,x]);const J=i(()=>r?(V.onModalTimeout(),j(!1),null):null,[r,V]);let W,F;n(()=>{a&&o&&$&&(O(JSON.parse(o)),j(!0))},[a,o,$]);let G,X=!1;switch(a){case"QR_CODE":if(W=L.translate("payment_challenge_modal.qr_code.instructions",{paymentMethod:d.name}),N){const e=JSON.parse(N.data);F=e?.mobile_app_universal_url,G=e?.instruction,X=T.includes(e?.instruction),"wechat_pay"===e?.instruction?W=I(Q.userAgent,B?.platform)?L.translate("payment_challenge_modal.qr_code.wechat_instructions_mobile"):L.translate("payment_challenge_modal.qr_code.wechat_instructions"):"paynow"===e?.instruction&&(W=I(Q.userAgent,B?.platform)?L.translate("payment_challenge_modal.qr_code.paynow_instructions_mobile"):L.translate("payment_challenge_modal.qr_code.paynow_instructions"))}break;case"EXTERNAL":W=L.translate("payment_challenge_modal.external.instructions",{paymentMethod:d.name});break;default:W=L.translate("payment_challenge_modal.instructions",{paymentMethod:d.name})}n(()=>{q&&N&&V.onModalRendered()},[q,N,V]),n(()=>{N&&V.onChallengeRendered(a)},[V,N,a]);const H=L.translate("payment_challenge_modal.copy_text",{paymentMethod:d.name}),Y=L.translate("payment_challenge_modal.open_app_text",{paymentMethod:d.name}),K=F?Y:H,P=L.translate("payment_challenge_modal.header",{paymentMethod:d.name}),U=L.translate("payment_challenge_modal.close"),Z=(e=>{const a=M(e);return a?A[a]:null})(d),ee="QR_CODE"===a?function(e){for(const a of e){if("string"!=typeof a||""===a)continue;const e=E(a);if(R.has(e))return`https://cdn.shopify.com/static/retail/lpm-icons/png/square-icons/${e}.png`}}([G,...d.paymentBrands??[]]):void 0;return r&&t(b,{open:q,blocking:!0,accessibilityLabel:P,size:"base",children:t(m,{children:[t(p,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-300",alignItems:"center",alignContent:"center",children:[t(c,{size:"large",textAlign:"start",children:P}),t(h,{gap:"small-400",alignItems:"end",children:t(u,{onClick:()=>(V.onModalExit(),void window.location.reload()),variant:"plain",tone:"monochrome",inlineAlignment:"end",accessibilityLabel:U,children:t(g,{type:"x"})})})]}),t(m,{children:[t(_,{blockSize:"base"}),Z&&!ee&&t(s,{children:[t(h,{gap:"large-300",alignItems:"center",children:t("img",{src:Z,alt:d.name})}),t(_,{blockSize:"small-400"})]}),t(h,{gap:"large-300",alignItems:"center",children:t(c,{size:"base",textAlign:"center",textWrap:"pretty",children:W})}),"QR_CODE"===a&&N&&t(s,{children:[t(_,{blockSize:"base"}),t(h,{gap:"base",alignItems:"center",children:[t(h,{gap:"base",maxInlineSize:"150px",minInlineSize:"150px",alignItems:"center",children:t(y,{content:N?.code,size:"fill",logo:ee},ee)}),!X&&t(s,{children:[t(_,{blockSize:"large-200"}),t(h,{gap:"base",alignItems:"center",maxInlineSize:"400px",minInlineSize:"@media (inline-size >= extraSmall) 400px, 100%",children:t(u,{commandFor:"qr-code-challenge-data-code",command:F?void 0:"--copy",inlineSize:"fill",inlineAlignment:"center",onClick:()=>{F&&(window.open(F,"_blank"),V.onChallengeRendered("QR_CODE"))},children:K})}),!F&&t(w,{text:N?.code,id:"qr-code-challenge-data-code",onCopy:()=>V.onCopiedToClipboard()})]})]})]}),t(_,{blockSize:"large-200"}),t(h,{alignItems:"center",children:t(m,{maxInlineSize:"150px",minInlineSize:"150px",children:t(C,{duration:$,defaultValue:z,label:e=>L.translate("payment_challenge_modal.timer_message",{timeLeft:D(e)}),onEnd:J})})}),t(_,{blockSize:"large-200"})]})]})})}export{A as SUPPORTED_PAYMENT_METHOD_BRAND_ICONS,q 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.