(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[27],{225:function(e,t){},227:function(e,t,o){"use strict";var c=o(0),n=o(10);const s=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=s},237:function(e,t,o){"use strict";var c=o(0),n=o(4),s=o.n(n),a=o(1),r=o(76),l=o(227);o(225);var i=({text:e,screenReaderText:t="",element:o="li",className:n="",radius:a="small",children:r=null,...l})=>{const i=o,u=s()(n,"wc-block-components-chip","wc-block-components-chip--radius-"+a),p=Boolean(t&&t!==e);return Object(c.createElement)(i,{className:u,...l},Object(c.createElement)("span",{"aria-hidden":p,className:"wc-block-components-chip__text"},e),p&&Object(c.createElement)("span",{className:"screen-reader-text"},t),r)};t.a=({ariaLabel:e="",className:t="",disabled:o=!1,onRemove:n=(()=>{}),removeOnAnyClick:u=!1,text:p,screenReaderText:b="",...m})=>{const d=u?"span":"button";if(!e){const t=b&&"string"==typeof b?b:p;e="string"!=typeof t?/* translators: Remove chip. */
Object(a.__)("Remove","woocommerce"):Object(a.sprintf)(/* translators: %s text of the chip to remove. */
Object(a.__)('Remove "%s"',"woocommerce"),t)}const g={"aria-label":e,disabled:o,onClick:n,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||n()}},O=u?g:{},j=u?{"aria-hidden":!0}:g;return Object(c.createElement)(i,{...m,...O,className:s()(t,"is-removable"),element:u?"button":m.element,screenReaderText:b,text:p},Object(c.createElement)(d,{className:"wc-block-components-chip__remove",...j},Object(c.createElement)(r.a,{className:"wc-block-components-chip__remove-icon",icon:l.a,size:16})))}},313:function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var c=o(1),n=o(5),s=o(3),a=o(23),r=o(12),l=o(72);const i=(e="")=>{const{cartCoupons:t,cartIsLoading:o}=Object(l.a)(),{createErrorNotice:i}=Object(n.useDispatch)("core/notices"),{createNotice:u}=Object(n.useDispatch)("core/notices"),{setValidationErrors:p}=Object(n.useDispatch)(s.VALIDATION_STORE_KEY),{isApplyingCoupon:b,isRemovingCoupon:m}=Object(n.useSelect)((e=>{const t=e(s.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}}),[i,u]),{applyCoupon:d,removeCoupon:g}=Object(n.useDispatch)(s.CART_STORE_KEY);return{appliedCoupons:t,isLoading:o,applyCoupon:t=>d(t).then((()=>(Object(r.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&u("info",Object(c.sprintf)(/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((e=>(p({coupon:{message:Object(a.decodeEntities)(e.message),hidden:!1}}),Promise.resolve(!1)))),removeCoupon:t=>g(t).then((()=>(Object(r.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&u("info",Object(c.sprintf)(/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0)))).catch((t=>(i(t.message,{id:"coupon-form",context:e}),Promise.resolve(!1)))),isApplyingCoupon:b,isRemovingCoupon:m}}},383:function(e,t){},450:function(e,t,o){"use strict";var c=o(0),n=o(1),s=o(146),a=o(237),r=o(12),l=o(2);o(383);const i={context:"summary"};t.a=({cartCoupons:e=[],currency:t,isRemovingCoupon:o,removeCoupon:u,values:p})=>{const{total_discount:b,total_discount_tax:m}=p,d=parseInt(b,10);if(!d&&0===e.length)return null;const g=parseInt(m,10),O=Object(l.getSetting)("displayCartPricesIncludingTax",!1)?d+g:d,j=Object(r.applyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:e});return Object(c.createElement)(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:t,description:0!==j.length&&Object(c.createElement)(s.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woocommerce"),isLoading:o,showSpinner:!1},Object(c.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},j.map((e=>Object(c.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)(/* translators: %s Coupon code. */
Object(n.__)("Coupon: %s","woocommerce"),e.label),disabled:o,onRemove:()=>{u(e.code)},radius:"large",ariaLabel:Object(n.sprintf)(/* translators: %s is a coupon code. */
Object(n.__)('Remove coupon "%s"',"woocommerce"),e.label)}))))),label:O?Object(n.__)("Discount","woocommerce"):Object(n.__)("Coupons","woocommerce"),value:O?-1*O:"-"})}},525:function(e,t,o){"use strict";o.r(t);var c=o(0),n=o(450),s=o(39),a=o(72),r=o(313),l=o(12);const i=()=>{const{extensions:e,receiveCart:t,...o}=Object(a.a)(),n={extensions:e,cart:o,context:"woocommerce/cart"};return Object(c.createElement)(l.ExperimentalDiscountsMeta.Slot,{...n})};t.default=({className:e})=>{const{cartTotals:t,cartCoupons:o}=Object(a.a)(),{removeCoupon:u,isRemovingCoupon:p}=Object(r.a)("wc/cart"),b=Object(s.getCurrencyFromPriceResponse)(t);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.TotalsWrapper,{className:e},Object(c.createElement)(n.a,{cartCoupons:o,currency:b,isRemovingCoupon:p,removeCoupon:u,values:t})),Object(c.createElement)(i,null))}}}]);