1 line
8.0 KiB
JavaScript
1 line
8.0 KiB
JavaScript
"use strict";(globalThis.webpackChunkwoocommerce_payments=globalThis.webpackChunkwoocommerce_payments||[]).push([[796],{8908:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var a=o(1609),l=o(7723),n=o(5410),c=o(8121),i=o(4848);const r=()=>(0,i.jsxs)("svg",{width:"102",height:"32",viewBox:"4 8 56 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":(0,l.__)("Amazon Pay logo","woocommerce-payments"),children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.519 24.803c-1.922 1.419-4.708 2.173-7.107 2.173-3.362 0-6.39-1.243-8.681-3.312-.18-.163-.02-.384.197-.259 2.472 1.439 5.529 2.305 8.686 2.305 2.13 0 4.471-.442 6.626-1.356.325-.137 .597.214.279.45Z",fill:"#F79C34"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M27.319 23.89c-.246-.314-1.625-.149-2.244-.075-.188.023-.217 -.141-.048-.26 1.1-.772 2.902-.55 3.112-.29.21.26-.056 2.068 -1.086 2.93-.159.132-.31.062-.24-.113.233-.58.752-1.877.506 -2.192Z",fill:"#F79C34"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.118 18.097v-.75c0-.115.087-.19.19-.19h3.365c.108 0 .195.077.195.189v.643c-.002.108-.093.25-.254.473l-1.743 2.489c.647-.015 1.331.081 1.92.412.132.074.168.185.178.293v.8c0 .111-.121.239-.248.172-1.036-.542-2.41-.601-3.555.007-.117.062 -.24-.064-.24-.174v-.762c0-.121.003-.33.126-.516l2.019-2.896h -1.758a.187.187 0 0 1-.195-.19ZM12.844 22.786h-1.023a.193.193 0 0 1-.184-.173l.001-5.254c0-.105.089-.189.198-.189h.953c.1.005 .18.08.186.176v.686h.02c.248-.663.716-.973 1.347-.973.64 0 1.041.31 1.328.973.248-.663.812-.973 1.414-.973.43 0 .898.177 1.185.575.325.443.258 1.084.258 1.648v3.315a.193.193 0 0 1-.198 .19h-1.023a.192.192 0 0 1-.183-.19v-2.785c0-.22.018-.773-.03 -.983-.076-.355-.305-.454-.601-.454a.68.68 0 0 0-.612.43c-.105 .267-.095.709-.095 1.007v2.785a.193.193 0 0 1-.198.19h-1.022a .192.192 0 0 1-.184-.19l-.001-2.785c0-.586.095-1.448-.63-1.448 -.737 0-.708.84-.708 1.448v2.785a.193.193 0 0 1-.198.19ZM31.773 18.132c-.754 0-.802 1.028-.802 1.669s-.01 2.012.793 2.012c.793 0 .832-1.105.832-1.78 0-.442-.02-.973-.154-1.393-.114-.365-.344 -.508-.669-.508Zm-.009-1.073c1.52 0 2.341 1.305 2.341 2.963 0 1.603-.908 2.875-2.34 2.875-1.492 0-2.304-1.305-2.304-2.93 0 -1.636.822-2.908 2.303-2.908ZM36.076 22.786h-1.02a.192.192 0 0 1-.184-.188l-.002-5.256a.194.194 0 0 1 .197-.172h.95c.089.005 .163.065.181.147v.804h.02c.286-.72.687-1.062 1.394-1.062.46 0 .908.166 1.195.62.267.42.267 1.127.267 1.636v3.306a.194.194 0 0 1-.196.165h-1.026a.193.193 0 0 1-.182-.165v-2.853c0-.575.067 -1.415-.64-1.415-.249 0-.478.166-.593.42-.143.32-.162.641-.162 .995v2.83a.196.196 0 0 1-.2.188ZM23.468 22.773a.212.212 0 0 1 -.242.024c-.34-.282-.4-.413-.587-.682-.562.572-.96.744-1.688.744 -.861 0-1.532-.532-1.532-1.596 0-.83.45-1.396 1.092-1.673.555 -.244 1.331-.288 1.925-.354v-.133c0-.244.02-.532-.125-.743-.124 -.188-.363-.266-.574-.266-.39 0-.737.2-.823.615-.018.092-.085 .184-.178.189l-.992-.108c-.084-.02-.177-.086-.153-.214.225-1.187 1.285-1.557 2.249-1.567h.076c.493.006 1.123.141 1.506.51.498.465 .45 1.085.45 1.761v1.595c0 .48.2.69.387.948.065.094.08.204-.004 .273-.209.175-.58.497-.784.68l-.003-.003Zm-1.032-2.496c0 .4.01 .732-.192 1.086-.163.288-.421.465-.708.465-.393 0-.623-.299-.623 -.742 0-.872.782-1.03 1.523-1.03v.221ZM10.049 22.773a.212.212 0 0 1-.242.024c-.34-.282-.402-.413-.587-.682-.562.572-.96.744 -1.688.744-.862 0-1.532-.532-1.532-1.596 0-.83.45-1.396 1.092 -1.673.555-.244 1.33-.288 1.924-.354v-.133c0-.244.02-.532-.124 -.743-.125-.188-.364-.266-.574-.266-.391 0-.738.2-.823.615-.018 .092-.085.184-.178.189l-.992-.108c-.084-.02-.177-.086-.153-.214 .225-1.187 1.285-1.557 2.248-1.567h.076c.494.006 1.123.141 1.507 .51.498.465.45 1.085.45 1.761v1.595c0 .48.2.69.386.948.065.094 .08.204-.003.273-.21.175-.58.497-.785.68l-.002-.003Zm-1.033 -2.496c0 .4.01.732-.191 1.086-.163.288-.421.465-.709.465-.392 0-.622-.299-.622-.742 0-.872.782-1.03 1.522-1.03v.221ZM53.068 24.67v-.385c0-.11.054-.186.169-.179.213.03.516.06.73.017.281 -.059.482-.258.601-.53.168-.384.279-.693.35-.896l-2.13-5.275c -.036-.09-.047-.256.132-.256h.744c.142 0 .2.09.232.178l1.544 4.285 1.474-4.285c.03-.087.09-.178.23-.178h.703c.178 0 .167.166 .132.256l-2.112 5.44c-.274.724-.638 1.877-1.458 2.078-.411.107 -.93.068-1.235-.06-.077-.038-.106-.141-.106-.21ZM52.075 22.465a .18.18 0 0 1-.18.178h-.524a.205.205 0 0 1-.206-.178l-.052-.358a 3.067 3.067 0 0 1-.859.509c-.617.24-1.329.28-1.932-.091-.437 -.268-.668-.791-.668-1.331 0-.418.129-.832.414-1.133.381-.411.933 -.613 1.6-.613.403 0 .979.047 1.398.184v-.719c0-.73-.308-1.047 -1.12-1.047-.62 0-1.095.093-1.755.299-.106.003-.168-.077-.168 -.175v-.41c0-.099.084-.194.175-.223.472-.205 1.14-.333 1.85-.357 .926 0 2.027.209 2.027 1.633v3.832Zm-1.01-1.05V20.33c-.351-.097 -.934-.137-1.16-.137-.357 0-.747.085-.95.304a.897.897 0 0 0-.222 .615c0 .289.1.579.333.722.271.184.692.161 1.087.05.38-.109.736 -.3.913-.47ZM44.334 17.882c1.165 0 1.482.916 1.482 1.965.007.707 -.123 1.337-.49 1.698-.273.27-.58.344-1.04.344-.41 0-.95-.214 -1.352-.512v-2.999c.42-.322.954-.496 1.4-.496Zm-1.579 6.977h-.703a .18.18 0 0 1-.179-.178v-7.327a.18.18 0 0 1 .179-.179h.538c.113 0 .19.082.205.179l.057.384c.504-.448 1.153-.735 1.771-.735 1.732 0 2.302 1.427 2.302 2.911 0 1.588-.872 2.863-2.345 2.863-.62 0-1.2 -.229-1.646-.626v2.53a.18.18 0 0 1-.179.178Z",fill:"#232F3E"})]}),s=({buttonAttributes:e})=>{var t;const o=(0,a.useMemo)((()=>(0,n.f)()),[]),s=(0,a.useMemo)((()=>(0,c.Z)(e).variables.borderRadius),[e]),u=Math.min(Math.max(null!==(t=e?.height)&&void 0!==t?t:o.buttonHeight,40),55),h=(0,a.useMemo)((()=>({height:`${u}px`,borderRadius:s,width:"100%",backgroundColor:"#FFD814",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"})),[u,s]);return(0,i.jsx)("div",{children:(0,i.jsx)("button",{type:"button",id:"express-checkout-button-preview-amazonPay",className:"express-checkout-button-preview",style:h,"aria-label":(0,l.__)("Amazon Pay","woocommerce-payments"),children:(0,i.jsx)(r,{})})})}},3918:(e,t,o)=>{o.r(t),o.d(t,{default:()=>r});var a=o(1609),l=o(7723),n=o(5410),c=o(8121),i=o(4848);const r=({buttonAttributes:e})=>{var t,o,r;const s=(0,a.useMemo)((()=>(0,n.f)()),[]),u=(0,a.useMemo)((()=>(0,c.Z)(e).variables.borderRadius),[e]),h=Math.min(Math.max(null!==(t=e?.height)&&void 0!==t?t:s.buttonHeight,40),55),p=null!==(o=s.buttonTheme?.applePay)&&void 0!==o?o:"black",d=null!==(r=s.buttonType?.applePay)&&void 0!==r?r:"plain",v=(0,a.useMemo)((()=>{const e={height:`${h}px`,borderRadius:u,ApplePayButtonType:d,WebkitAppearance:"-apple-pay-button",width:"100%"};return["black","white","white-outline"].includes(p)?e.ApplePayButtonStyle=p:e.ApplePayButtonStyle="white",e}),[h,u,d,p]);return(0,i.jsx)("div",{children:(0,i.jsx)("button",{type:"button",id:"express-checkout-button-preview-applePay",className:"express-checkout-button-preview",style:v,"aria-label":(0,l.__)("Apple Pay","woocommerce-payments")})})}},7375:(e,t,o)=>{o.r(t),o.d(t,{default:()=>i});var a=o(1609),l=o(5410),n=o(8121),c=o(4848);const i=({buttonAttributes:e})=>{var t,o,i;const r=(0,a.useRef)(null),s=(0,a.useRef)(!1),u=(0,a.useMemo)((()=>(0,l.f)()),[]),h=(0,a.useMemo)((()=>(0,n.Z)(e).variables.borderRadius),[e]),p=Math.min(Math.max(null!==(t=e?.height)&&void 0!==t?t:u.buttonHeight,40),55),d=null!==(o=u.buttonTheme?.googlePay)&&void 0!==o?o:"black",v=null!==(i=u.buttonType?.googlePay)&&void 0!==i?i:"plain",m=(0,a.useMemo)((()=>({height:`${p}px`,width:"100%",overflow:"hidden"})),[p]);return(0,a.useEffect)((()=>{if(!r.current)return;const e=r.current;(async()=>{const t=e.ownerDocument,o=t.defaultView;s.current||o.google?.payments?.api?.PaymentsClient||(await new Promise(((e,o)=>{const a=t.createElement("script");a.src="https://pay.google.com/gp/p/js/pay.js",a.onload=e,a.onerror=()=>o(new Error("Failed to load Google Pay script.")),t.head.appendChild(a)})),s.current=!0);const a=new o.google.payments.api.PaymentsClient({environment:"TEST"}),l="black"===d?"black":"white";e.innerHTML="";const n=a.createButton({buttonType:v,buttonColor:l,buttonRadius:parseFloat(h)||0,buttonSizeMode:"fill",onClick:()=>{}});e.appendChild(n)})().catch((()=>{}))}),[d,h,v]),(0,c.jsx)("div",{ref:r,id:"express-checkout-button-preview-googlePay",style:m})}}}]); |