"use strict";(self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp=self.webpackChunkwebpackWcBlocksCartCheckoutFrontendJsonp||[]).push([[6945],{746:(e,t,c)=>{c.r(t),c.d(t,{default:()=>g});var l=c(1609),a=c(7723),o=c(6087),n=c(5738),s=c(329),r=c(2663),i=c(8509),p=c(1e3),m=c(8531),u=c(5703),h=c(8460);const d=()=>{const{shippingRates:e,isLoadingRates:t}=(0,i.V)();return(0,l.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},(0,l.createElement)("legend",{className:"screen-reader-text"},(0,a.__)("Shipping options","woocommerce")),(0,l.createElement)(h.A,{className:"wc-block-components-totals-shipping__options",shippingRates:e,isLoadingRates:t,context:"woocommerce/cart"}))},g=({className:e})=>{const{isEditor:t}=(0,r.m)(),{cartNeedsShipping:c,shippingRates:h}=(0,i.V)(),[g,w]=(0,o.useState)(!1);if(!c)return null;if(t&&0===(0,m.T4)(h))return null;const _=(0,u.getSetting)("isShippingCalculatorEnabled",!0),k=(0,m.PU)(h);return(0,l.createElement)(p.TotalsWrapper,{className:e},(0,l.createElement)(s.S.Provider,{value:{showCalculator:_,shippingCalculatorID:"shipping-calculator-form-wrapper",isShippingCalculatorOpen:g,setIsShippingCalculatorOpen:w}},(0,l.createElement)(n.w7,{label:k?(0,a.__)("Collection","woocommerce"):(0,a.__)("Delivery","woocommerce"),placeholder:_?null:(0,l.createElement)("span",{className:"wc-block-components-shipping-placeholder__value"},(0,a.__)("Calculated at checkout","woocommerce")),collaterals:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(d,null),!_&&(0,m.$u)(h)&&(0,l.createElement)("div",{className:"wc-block-components-totals-shipping__delivery-options-notice"},(0,a.__)("Delivery options will be calculated during checkout","woocommerce")))})))}}}]);