"use strict";(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[1758],{8464:(e,o,r)=>{r.r(o),r.d(o,{default:()=>b});var s=r(9196),t=r(3849),c=r.n(t),a=r(5736),n=r(711),l=r(3251),d=r(9818),u=r(4801),i=r(9307);const h=({disabled:e,onChange:o,placeholder:r,value:t})=>{const[c,l]=(0,i.useState)(!1),[d,u]=(0,i.useState)("");return(0,s.createElement)("div",{className:"wc-block-checkout__add-note"},(0,s.createElement)(n.CheckboxControl,{disabled:e,label:(0,a.__)("Add a note to your order","woocommerce"),checked:c,onChange:e=>{l(e),e?t!==d&&o(d):(o(""),u(t))}}),c&&(0,s.createElement)(n.Textarea,{disabled:e,onTextChange:o,placeholder:r,value:t}))},b=({className:e})=>{const{needsShipping:o}=(0,l.V)(),{isProcessing:r,orderNotes:t}=(0,d.useSelect)((e=>{const o=e(u.CHECKOUT_STORE_KEY);return{isProcessing:o.isProcessing(),orderNotes:o.getOrderNotes()}})),{__internalSetOrderNotes:i}=(0,d.useDispatch)(u.CHECKOUT_STORE_KEY);return(0,s.createElement)(n.FormStep,{id:"order-notes",showStepNumber:!1,className:c()("wc-block-checkout__order-notes",e),disabled:r},(0,s.createElement)(h,{disabled:r,onChange:i,placeholder:o?(0,a.__)("Notes about your order, e.g. special notes for delivery.","woocommerce"):(0,a.__)("Notes about your order.","woocommerce"),value:t}))}}}]);