(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[51],{508:function(e,t,i){"use strict";i.r(t);var s=i(0),n=i(6),o=i.n(n),c=i(137),l=i(308),r=i(401),d=i(7),a=i(3),p=i(1),h=i(407),u=i(73),b=i(46),g=i(38),m=i(11),w=i(405),O=i(406),j=e=>{let{showCompanyField:t=!1,showApartmentField:i=!1,showPhoneField:n=!1,requireCompanyField:o=!1,requirePhoneField:c=!1}=e;const{defaultAddressFields:l,setShippingAddress:d,setBillingAddress:a,shippingAddress:j,setShippingPhone:F,useShippingAsBilling:f,setUseShippingAsBilling:E}=Object(r.a)(),{dispatchCheckoutEvent:k}=Object(u.a)(),{isEditor:C}=Object(b.a)(),[S,_]=Object(s.useState)(!1);Object(s.useEffect)(()=>{n||F("")},[n,F]),Object(s.useEffect)(()=>{S||(f&&a(j),_(!0))},[S,a,j,f]);const y=Object(s.useMemo)(()=>({company:{hidden:!t,required:o},address_2:{hidden:!i}}),[t,o,i]),A=C?w.a:s.Fragment;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(A,null,Object(s.createElement)(m.StoreNoticesContainer,{context:g.d.SHIPPING_ADDRESS}),Object(s.createElement)(h.a,{id:"shipping",type:"shipping",onChange:e=>{d(e),f&&a(e),k("set-shipping-address")},values:j,fields:Object.keys(l),fieldConfig:y}),n&&Object(s.createElement)(O.a,{id:"shipping-phone",isRequired:c,value:j.phone,onChange:e=>{F(e),k("set-phone-number",{step:"shipping"})}})),Object(s.createElement)(m.CheckboxControl,{className:"wc-block-checkout__use-address-for-billing",label:Object(p.__)("Use same address for billing","woocommerce"),checked:f,onChange:e=>{E(e),e&&a(j)}}))},F=i(287),f={...Object(F.a)({defaultTitle:Object(p.__)("Shipping address","woocommerce"),defaultDescription:Object(p.__)("Enter the address where you want your order delivered.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},E=i(153);t.default=Object(c.withFilteredAttributes)(f)(e=>{let{title:t,description:i,showStepNumber:n,children:c,className:p}=e;const h=Object(d.useSelect)(e=>e(a.CHECKOUT_STORE_KEY).isProcessing()),{showShippingFields:u}=Object(r.a)(),{requireCompanyField:b,requirePhoneField:g,showApartmentField:m,showCompanyField:w,showPhoneField:O}=Object(E.b)();return u?Object(s.createElement)(l.a,{id:"shipping-fields",disabled:h,className:o()("wc-block-checkout__shipping-fields",p),title:t,description:i,showStepNumber:n},Object(s.createElement)(j,{requireCompanyField:b,requirePhoneField:g,showApartmentField:m,showCompanyField:w,showPhoneField:O}),c):null})}}]);