(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[30],{445:function(e,t,i){"use strict";i.r(t);var l=i(0),s=i(5),n=i.n(s),o=i(120),d=i(295),r=i(35),c=i(337),a=i(58),b=i(29),u=i(398),h=i(338),p=i(339),m=e=>{let{showCompanyField:t=!1,showApartmentField:i=!1,showPhoneField:s=!1,requireCompanyField:n=!1,requirePhoneField:o=!1}=e;const{defaultAddressFields:d,billingAddress:r,setBillingAddress:m,setBillingPhone:w}=Object(c.a)(),{dispatchCheckoutEvent:g}=Object(a.a)(),{isEditor:j}=Object(b.a)();Object(l.useEffect)(()=>{s||w("")},[s,w]);const F=Object(l.useMemo)(()=>({company:{hidden:!t,required:n},address_2:{hidden:!i}}),[t,n,i]),O=j?h.a:l.Fragment;return Object(l.createElement)(O,null,Object(l.createElement)(u.a,{id:"billing",type:"billing",onChange:e=>{m(e),g("set-billing-address")},values:r,fields:Object.keys(d),fieldConfig:F}),s&&Object(l.createElement)(p.a,{isRequired:o,value:r.phone,onChange:e=>{w(e),g("set-phone-number",{step:"billing"})}}))},w=i(1),g=i(275),j={...Object(g.a)({defaultTitle:Object(w.__)("Billing address","woocommerce"),defaultDescription:Object(w.__)("Enter the address that matches your card or payment method.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},F=i(141);t.default=Object(o.withFilteredAttributes)(j)(e=>{let{title:t,description:i,showStepNumber:s,children:o,className:a}=e;const{isProcessing:b}=Object(r.b)(),{requireCompanyField:u,requirePhoneField:h,showApartmentField:p,showCompanyField:w,showPhoneField:g}=Object(F.b)(),{showBillingFields:j}=Object(c.a)();return j?Object(l.createElement)(d.a,{id:"billing-fields",disabled:b,className:n()("wc-block-checkout__billing-fields",a),title:t,description:i,showStepNumber:s},Object(l.createElement)(m,{requireCompanyField:u,showApartmentField:p,showCompanyField:w,showPhoneField:g,requirePhoneField:h}),o):null})}}]);