"use strict";(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[552],{6094:(e,o,r)=>{r.r(o),r.d(o,{default:()=>h});var t=r(1609),s=r(851),c=r(7723),a=r(4656),n=r(4958),l=r(7143),d=r(7594),u=r(6087);const i=({disabled:e,onChange:o,placeholder:r,value:s})=>{const[n,l]=(0,u.useState)(!1),[d,i]=(0,u.useState)("");return(0,t.createElement)("div",{className:"wc-block-checkout__add-note"},(0,t.createElement)(a.CheckboxControl,{disabled:e,label:(0,c.__)("Add a note to your order","woocommerce"),checked:n,onChange:e=>{l(e),e?s!==d&&o(d):(o(""),i(s))}}),n&&(0,t.createElement)(a.Textarea,{disabled:e,onTextChange:o,placeholder:r,value:s}))},h=({className:e})=>{const{needsShipping:o}=(0,n.m)(),{isProcessing:r,orderNotes:u}=(0,l.useSelect)((e=>{const o=e(d.CHECKOUT_STORE_KEY);return{isProcessing:o.isProcessing(),orderNotes:o.getOrderNotes()}})),{__internalSetOrderNotes:h}=(0,l.useDispatch)(d.CHECKOUT_STORE_KEY);return(0,t.createElement)(a.FormStep,{id:"order-notes",showStepNumber:!1,className:(0,s.A)("wc-block-checkout__order-notes",e),disabled:r},(0,t.createElement)(i,{disabled:r,onChange:h,placeholder:o?(0,c.__)("Notes about your order, e.g. special notes for delivery.","woocommerce"):(0,c.__)("Notes about your order.","woocommerce"),value:u}))}}}]);