import{Component}from"@theme/component";import{debounce,fetchConfig}from"@theme/utilities";import{cartPerformance}from"@theme/performance";class CartNote extends Component{#activeFetch=null;updateCartNote=debounce(async event=>{if(!(event.target instanceof HTMLTextAreaElement))return;const note=event.target.value;this.#activeFetch&&this.#activeFetch.abort();const abortController=new AbortController;this.#activeFetch=abortController;try{const config=fetchConfig("json",{body:JSON.stringify({note})});await fetch(Theme.routes.cart_update_url,{...config,signal:abortController.signal})}catch{}finally{this.#activeFetch=null,cartPerformance.measureFromEvent("note-update:user-action",event)}},200)}customElements.get("cart-note")||customElements.define("cart-note",CartNote);
//# sourceMappingURL=/s/files/1/0677/1399/0759/t/1/assets/cart-note.js.map?v=1783128461
