5 lines
4.0 KiB
JavaScript
5 lines
4.0 KiB
JavaScript
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[42],{187:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return s}));var c=n(53),o=n(173),a=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(o.b)(),n=t.paymentMethods,a=t.expressPaymentMethods,r=t.paymentMethodsInitialized,s=t.expressPaymentMethodsInitialized,i=Object(c.a)(n),u=Object(c.a)(a);return{paymentMethods:e?u:i,isInitialized:e?s:r}},r=function(){return a(!1)},s=function(){return a(!0)}},347:function(e,t,n){"use strict";var c=n(14),o=n.n(c),a=n(23),r=n.n(a),s=n(24),i=n(6),u=n.n(i),l=(n(348),["className","label","id","instanceId","onChange","children","hasError"]);t.a=Object(s.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,a=e.instanceId,s=e.onChange,i=e.children,d=e.hasError,b=void 0!==d&&d,m=r()(e,l),h=c||"checkbox-control-".concat(a);return React.createElement("label",{className:u()("wc-block-components-checkbox",{"has-error":b},t),htmlFor:h},React.createElement("input",o()({id:h,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return s(e.target.checked)},"aria-invalid":!0===b},m)),React.createElement("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},React.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&React.createElement("span",{className:"wc-block-components-checkbox__label"},n),i)}))},348:function(e,t){},378:function(e,t){},379:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var c=n(1),o=n(48),a=n(173),r=n(187),s=function(){var e=Object(o.b)(),t=e.onSubmit,n=e.isCalculating,s=e.isBeforeProcessing,i=e.isProcessing,u=e.isAfterProcessing,l=e.isComplete,d=e.hasError,b=Object(r.b)().paymentMethods,m=void 0===b?{}:b,h=Object(a.b)(),g=h.activePaymentMethod,p=h.currentStatus,f=m[g]||{},w=i||u||s,k=l&&!d;return{submitButtonText:(null==f?void 0:f.placeOrderButtonLabel)||Object(c.__)("Place Order",'woocommerce'),onSubmit:t,isCalculating:n,isDisabled:i||p.isDoingExpressPayment,waitingForProcessing:w,waitingForRedirect:k}}},418:function(e,t,n){"use strict";n.r(t);var c=n(4),o=n.n(c),a=n(5),r=n.n(a),s=n(1),i=n(6),u=n.n(i),l=n(0),d=n(347),b=n(379),m=n(24),h=n(83),g=h.j?'<a href="'.concat(h.j,'">').concat(Object(s.__)("Terms and Conditions","woo-gutenberg-product-blocks"),"</a>"):Object(s.__)("Terms and Conditions","woo-gutenberg-product-blocks"),p=h.f?'<a href="'.concat(h.f,'">').concat(Object(s.__)("Privacy Policy","woo-gutenberg-product-blocks"),"</a>"):Object(s.__)("Privacy Policy","woo-gutenberg-product-blocks"),f=Object(s.sprintf)(
|
|
/* translators: %1$s terms page link, %2$s privacy page link. */
|
|
Object(s.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woo-gutenberg-product-blocks"),g,p),w=Object(s.sprintf)(
|
|
/* translators: %1$s terms page link, %2$s privacy page link. */
|
|
Object(s.__)("You must accept our %1$s and %2$s to continue with your purchase.","woo-gutenberg-product-blocks"),g,p);n(378),t.default=Object(m.withInstanceId)((function(e){var t=e.text,n=e.checkbox,c=e.instanceId,a=e.validation,i=Object(l.useState)(!1),m=r()(i,2),h=m[0],g=m[1],p=Object(b.a)().isDisabled,k="terms-and-conditions-"+c,_=a.getValidationError,j=a.setValidationErrors,O=a.clearValidationError,v=_(k)||{},y=v.message&&!v.hidden;return Object(l.useEffect)((function(){if(n)return h?O(k):j(o()({},k,{message:Object(s.__)("Please read and accept the terms and conditions.",'woocommerce'),hidden:!0})),function(){O(k)}}),[n,h,k,O,j]),React.createElement("div",{className:u()("wc-block-checkout__terms",{"wc-block-checkout__terms--disabled":p})},n?React.createElement(React.Fragment,null,React.createElement(d.a,{id:"terms-and-conditions",checked:h,onChange:function(){return g((function(e){return!e}))},hasError:y,disabled:p},React.createElement("span",{dangerouslySetInnerHTML:{__html:t||w}}))):React.createElement("span",{dangerouslySetInnerHTML:{__html:t||f}}))}))}}]); |